algosdk 3.7.0-beta.1 → 3.8.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.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/appAccess.js +4 -0
- package/dist/cjs/appAccess.js.map +1 -1
- package/dist/cjs/client/v2/algod/getPeers.js +20 -0
- package/dist/cjs/client/v2/algod/getPeers.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +153 -5
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +163 -12
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/composer.js +4 -6
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/ed25519-signer.js +18 -0
- package/dist/cjs/ed25519-signer.js.map +1 -1
- package/dist/cjs/encoding/address.js +9 -0
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/falcon-signer.js +16 -0
- package/dist/cjs/falcon-signer.js.map +1 -1
- package/dist/cjs/heartbeat.js +7 -0
- package/dist/cjs/heartbeat.js.map +1 -1
- package/dist/cjs/logicsig.js +86 -6
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/makeTxn.js +11 -2
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +2 -0
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/pq-signer.js +51 -0
- package/dist/cjs/pq-signer.js.map +1 -1
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +22 -0
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +8 -0
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/block.js +28 -0
- package/dist/cjs/types/block.js.map +1 -1
- package/dist/cjs/types/statedelta.js +17 -0
- package/dist/cjs/types/statedelta.js.map +1 -1
- package/dist/cjs/utils/utils.js +14 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/appAccess.js +4 -0
- package/dist/esm/appAccess.js.map +1 -1
- package/dist/esm/client/v2/algod/getPeers.js +14 -0
- package/dist/esm/client/v2/algod/getPeers.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +149 -3
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +161 -11
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/composer.js +4 -6
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/ed25519-signer.js +18 -0
- package/dist/esm/ed25519-signer.js.map +1 -1
- package/dist/esm/encoding/address.js +9 -0
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/falcon-signer.js +16 -0
- package/dist/esm/falcon-signer.js.map +1 -1
- package/dist/esm/heartbeat.js +8 -1
- package/dist/esm/heartbeat.js.map +1 -1
- package/dist/esm/logicsig.js +86 -6
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/makeTxn.js +11 -2
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +2 -0
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/pq-signer.js +51 -0
- package/dist/esm/pq-signer.js.map +1 -1
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +22 -0
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +8 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/block.js +28 -0
- package/dist/esm/types/block.js.map +1 -1
- package/dist/esm/types/statedelta.js +17 -0
- package/dist/esm/types/statedelta.js.map +1 -1
- package/dist/esm/utils/utils.js +12 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/types/client/v2/algod/getPeers.d.ts +7 -0
- package/dist/types/client/v2/algod/models/types.d.ts +90 -3
- package/dist/types/client/v2/indexer/models/types.d.ts +114 -7
- package/dist/types/composer.d.ts +3 -3
- package/dist/types/ed25519-signer.d.ts +29 -0
- package/dist/types/encoding/address.d.ts +9 -0
- package/dist/types/falcon-signer.d.ts +29 -2
- package/dist/types/heartbeat.d.ts +2 -0
- package/dist/types/logicsig.d.ts +91 -6
- package/dist/types/makeTxn.d.ts +8 -2
- package/dist/types/mnemonic/mnemonic.d.ts +2 -0
- package/dist/types/pq-signer.d.ts +39 -2
- package/dist/types/signer.d.ts +76 -5
- package/dist/types/signing.d.ts +22 -0
- package/dist/types/transaction.d.ts +1 -0
- package/dist/types/types/block.d.ts +22 -0
- package/dist/types/types/statedelta.d.ts +18 -0
- package/dist/types/types/transactions/base.d.ts +10 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -2
- package/src/appAccess.ts +5 -0
- package/src/client/v2/algod/models/types.ts +234 -0
- package/src/client/v2/indexer/models/types.ts +280 -8
- package/src/composer.ts +7 -11
- package/src/ed25519-signer.ts +29 -0
- package/src/encoding/address.ts +9 -0
- package/src/falcon-signer.ts +31 -1
- package/src/heartbeat.ts +11 -0
- package/src/logicsig.ts +93 -6
- package/src/makeTxn.ts +13 -4
- package/src/mnemonic/mnemonic.ts +2 -0
- package/src/pq-signer.ts +71 -1
- package/src/signer.ts +77 -5
- package/src/signing.ts +22 -0
- package/src/transaction.ts +10 -0
- package/src/types/block.ts +54 -0
- package/src/types/statedelta.ts +34 -0
- package/src/types/transactions/base.ts +11 -0
- package/src/utils/utils.ts +13 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see algosdk.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.algosdk=t():e.algosdk=t()}(self,()=>(()=>{var e={180(e,t,n){var a;!function(){"use strict";var i,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,s=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",d=1e14,u=14,l=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function f(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,a=1,i=e.length,r=e[0]+"";a<i;){for(t=e[a++]+"",n=u-t.length;n--;t="0"+t);r+=t}for(i=r.length;48===r.charCodeAt(--i););return r.slice(0,i+1||1)}function w(e,t){var n,a,i=e.c,r=t.c,o=e.s,s=t.s,c=e.e,h=t.e;if(!o||!s)return null;if(n=i&&!i[0],a=r&&!r[0],n||a)return n?a?0:-s:o;if(o!=s)return o;if(n=o<0,a=c==h,!i||!r)return a?0:!i^n?1:-1;if(!a)return c>h^n?1:-1;for(s=(c=i.length)<(h=r.length)?c:h,o=0;o<s;o++)if(i[o]!=r[o])return i[o]>r[o]^n?1:-1;return c==h?0:c>h^n?1:-1}function v(e,t,n,a){if(e<t||e>n||e!==s(e))throw Error(c+(a||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function S(e){var t=e.c.length-1;return f(e.e/u)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,n){var a,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(a=e.length)){for(i=n,t-=a;--t;i+=n);e+=i}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var n,a,i,b,x,A,D,I,T,P,M=z.prototype={constructor:z,toString:null,valueOf:null},V=new z(1),R=20,B=4,C=-7,U=21,$=-1e7,O=1e7,N=!1,L=1,_=0,F={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var n,o,c,d,g,m,p,f,y=this;if(!(y instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>O?y.c=y.e=null:e.e<$?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((m="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,g=e;g>=10;g/=10,d++);return void(d>O?y.c=y.e=null:(y.e=d,y.c=[e]))}f=String(e)}else{if(!r.test(f=String(e)))return i(y,f,m);y.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(d=f.indexOf("."))>-1&&(f=f.replace(".","")),(g=f.search(/e/i))>0?(d<0&&(d=g),d+=+f.slice(g+1),f=f.substring(0,g)):d<0&&(d=f.length)}else{if(v(t,2,q.length,"Base"),10==t)return G(y=new z(e),R+y.e+1,B);if(f=String(e),m="number"==typeof e){if(0*e!=0)return i(y,f,m,t);if(y.s=1/e<0?(f=f.slice(1),-1):1,z.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(h+e)}else y.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=q.slice(0,t),d=g=0,p=f.length;g<p;g++)if(n.indexOf(o=f.charAt(g))<0){if("."==o){if(g>d){d=p;continue}}else if(!c&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){c=!0,g=-1,d=0;continue}return i(y,String(e),m,t)}m=!1,(d=(f=a(f,t,10,y.s)).indexOf("."))>-1?f=f.replace(".",""):d=f.length}for(g=0;48===f.charCodeAt(g);g++);for(p=f.length;48===f.charCodeAt(--p););if(f=f.slice(g,++p)){if(p-=g,m&&z.DEBUG&&p>15&&(e>l||e!==s(e)))throw Error(h+y.s*e);if((d=d-g-1)>O)y.c=y.e=null;else if(d<$)y.c=[y.e=0];else{if(y.e=d,y.c=[],g=(d+1)%u,d<0&&(g+=u),g<p){for(g&&y.c.push(+f.slice(0,g)),p-=u;g<p;)y.c.push(+f.slice(g,g+=u));g=u-(f=f.slice(g)).length}else g-=p;for(;g--;f+="0");y.c.push(+f)}}else y.c=[y.e=0]}function K(e,t,n,a){var i,r,o,s,c;if(null==n?n=B:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)c=y(e.c),c=1==a||2==a&&(o<=C||o>=U)?E(c,o):k(c,o,"0");else if(r=(e=G(new z(e),t,n)).e,s=(c=y(e.c)).length,1==a||2==a&&(t<=r||r<=C)){for(;s<t;c+="0",s++);c=E(c,r)}else if(t-=o,c=k(c,r,"0"),r+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=r-s)>0)for(r+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function H(e,t){for(var n,a=1,i=new z(e[0]);a<e.length;a++){if(!(n=new z(e[a])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function j(e,t,n){for(var a=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,a++);return(n=a+n*u-1)>O?e.c=e.e=null:n<$?e.c=[e.e=0]:(e.e=n,e.c=t),e}function G(e,t,n,a){var i,r,c,h,l,m,p,f=e.c,y=g;if(f){e:{for(i=1,h=f[0];h>=10;h/=10,i++);if((r=t-i)<0)r+=u,c=t,p=(l=f[m=0])/y[i-c-1]%10|0;else if((m=o((r+1)/u))>=f.length){if(!a)break e;for(;f.length<=m;f.push(0));l=p=0,i=1,c=(r%=u)-u+1}else{for(l=h=f[m],i=1;h>=10;h/=10,i++);p=(c=(r%=u)-u+i)<0?0:l/y[i-c-1]%10|0}if(a=a||t<0||null!=f[m+1]||(c<0?l:l%y[i-c-1]),a=n<4?(p||a)&&(0==n||n==(e.s<0?3:2)):p>5||5==p&&(4==n||a||6==n&&(r>0?c>0?l/y[i-c]:0:f[m-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=y[(u-t%u)%u],e.e=-t||0):f[0]=e.e=0,e;if(0==r?(f.length=m,h=1,m--):(f.length=m+1,h=y[u-r],f[m]=c>0?s(l/y[i-c]%y[c])*h:0),a)for(;;){if(0==m){for(r=1,c=f[0];c>=10;c/=10,r++);for(c=f[0]+=h,h=1;c>=10;c/=10,h++);r!=h&&(e.e++,f[0]==d&&(f[0]=1));break}if(f[m]+=h,f[m]!=d)break;f[m--]=0,h=1}for(r=f.length;0===f[--r];f.pop());}e.e>O?e.c=e.e=null:e.e<$&&(e.c=[e.e=0])}return e}function J(e){var t,n=e.e;return null===n?e.toString():(t=y(e.c),t=n<=C||n>=U?E(t,n):k(t,n,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(n=e[t],0,p,t),R=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(n=e[t],0,8,t),B=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),C=n[0],U=n[1]):(v(n,-p,p,t),C=-(U=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),$=n[0],O=n[1];else{if(v(n,-p,p,t),!n)throw Error(c+t+" cannot be zero: "+n);$=-(O=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(c+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(c+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(n=e[t],0,9,t),L=n),e.hasOwnProperty(t="POW_PRECISION")&&(v(n=e[t],0,p,t),_=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(c+t+" not an object: "+n);F=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);q=n}}return{DECIMAL_PLACES:R,ROUNDING_MODE:B,EXPONENTIAL_AT:[C,U],RANGE:[$,O],CRYPTO:N,MODULO_MODE:L,POW_PRECISION:_,FORMAT:F,ALPHABET:q}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,n,a=e.c,i=e.e,r=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===r||-1===r)&&i>=-p&&i<=p&&i===s(i)){if(0===a[0]){if(0===i&&1===a.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(a[0]).length==t){for(t=0;t<a.length;t++)if((n=a[t])<0||n>=d||n!==s(n))break e;if(0!==n)return!0}}}else if(null===a&&null===i&&(null===r||1===r||-1===r))return!0;throw Error(c+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return H(arguments,M.lt)},z.minimum=z.min=function(){return H(arguments,M.gt)},z.random=(b=9007199254740992,x=Math.random()*b&2097151?function(){return s(Math.random()*b)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,a,i,r,h=0,d=[],l=new z(V);if(null==e?e=R:v(e,0,p),i=o(e/u),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));h<i;)(r=131072*t[h]+(t[h+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[h]=n[0],t[h+1]=n[1]):(d.push(r%1e14),h+=2);h=i/2}else{if(!crypto.randomBytes)throw N=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);h<i;)(r=281474976710656*(31&t[h])+1099511627776*t[h+1]+4294967296*t[h+2]+16777216*t[h+3]+(t[h+4]<<16)+(t[h+5]<<8)+t[h+6])>=9e15?crypto.randomBytes(7).copy(t,h):(d.push(r%1e14),h+=7);h=i/7}if(!N)for(;h<i;)(r=x())<9e15&&(d[h++]=r%1e14);for(i=d[--h],e%=u,i&&e&&(r=g[u-e],d[h]=s(i/r)*r);0===d[h];d.pop(),h--);if(h<0)d=[a=0];else{for(a=-1;0===d[0];d.splice(0,1),a-=u);for(h=1,r=d[0];r>=10;r/=10,h++);h<u&&(a-=u-h)}return l.e=a,l.c=d,l}),z.sum=function(){for(var e=1,t=arguments,n=new z(t[0]);e<t.length;)n=n.plus(t[e++]);return n},a=function(){var e="0123456789";function t(e,t,n,a){for(var i,r,o=[0],s=0,c=e.length;s<c;){for(r=o.length;r--;o[r]*=t);for(o[0]+=a.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>n-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(a,i,r,o,s){var c,h,d,u,l,g,m,p,f=a.indexOf("."),w=R,v=B;for(f>=0&&(u=_,_=0,a=a.replace(".",""),g=(p=new z(i)).pow(a.length-f),_=u,p.c=t(k(y(g.c),g.e,"0"),10,r,e),p.e=p.c.length),d=u=(m=t(a,i,r,s?(c=q,e):(c=e,q))).length;0==m[--u];m.pop());if(!m[0])return c.charAt(0);if(f<0?--d:(g.c=m,g.e=d,g.s=o,m=(g=n(g,p,w,v,r)).c,l=g.r,d=g.e),f=m[h=d+w+1],u=r/2,l=l||h<0||null!=m[h+1],l=v<4?(null!=f||l)&&(0==v||v==(g.s<0?3:2)):f>u||f==u&&(4==v||l||6==v&&1&m[h-1]||v==(g.s<0?8:7)),h<1||!m[0])a=l?k(c.charAt(1),-w,c.charAt(0)):c.charAt(0);else{if(m.length=h,l)for(--r;++m[--h]>r;)m[h]=0,h||(++d,m=[1].concat(m));for(u=m.length;!m[--u];);for(f=0,a="";f<=u;a+=c.charAt(m[f++]));a=k(a,d,c.charAt(0))}return a}}(),n=function(){function e(e,t,n){var a,i,r,o,s=0,c=e.length,h=t%m,d=t/m|0;for(e=e.slice();c--;)s=((i=h*(r=e[c]%m)+(a=d*r+(o=e[c]/m|0)*h)%m*m+s)/n|0)+(a/m|0)+d*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,a){var i,r;if(n!=a)r=n>a?1:-1;else for(i=r=0;i<n;i++)if(e[i]!=t[i]){r=e[i]>t[i]?1:-1;break}return r}function n(e,t,n,a){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*a+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,i,r,o,c){var h,l,g,m,p,y,w,v,S,E,k,b,x,A,D,I,T,P=a.s==i.s?1:-1,M=a.c,V=i.c;if(!(M&&M[0]&&V&&V[0]))return new z(a.s&&i.s&&(M?!V||M[0]!=V[0]:V)?M&&0==M[0]||!V?0*P:P/0:NaN);for(S=(v=new z(P)).c=[],P=r+(l=a.e-i.e)+1,c||(c=d,l=f(a.e/u)-f(i.e/u),P=P/u|0),g=0;V[g]==(M[g]||0);g++);if(V[g]>(M[g]||0)&&l--,P<0)S.push(1),m=!0;else{for(A=M.length,I=V.length,g=0,P+=2,(p=s(c/(V[0]+1)))>1&&(V=e(V,p,c),M=e(M,p,c),I=V.length,A=M.length),x=I,k=(E=M.slice(0,I)).length;k<I;E[k++]=0);T=V.slice(),T=[0].concat(T),D=V[0],V[1]>=c/2&&D++;do{if(p=0,(h=t(V,E,I,k))<0){if(b=E[0],I!=k&&(b=b*c+(E[1]||0)),(p=s(b/D))>1)for(p>=c&&(p=c-1),w=(y=e(V,p,c)).length,k=E.length;1==t(y,E,w,k);)p--,n(y,I<w?T:V,w,c),w=y.length,h=1;else 0==p&&(h=p=1),w=(y=V.slice()).length;if(w<k&&(y=[0].concat(y)),n(E,y,k,c),k=E.length,-1==h)for(;t(V,E,I,k)<1;)p++,n(E,I<k?T:V,k,c),k=E.length}else 0===h&&(p++,E=[0]);S[g++]=p,E[0]?E[k++]=M[x]||0:(E=[M[x]],k=1)}while((x++<A||null!=E[0])&&P--);m=null!=E[0],S[0]||S.splice(0,1)}if(c==d){for(g=1,P=S[0];P>=10;P/=10,g++);G(v,r+(v.e=g+l*u-1)+1,o,m)}else v.e=l,v.r=+m;return v}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,I=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,a){var i,r=n?t:t.replace(P,"");if(T.test(r))e.s=isNaN(r)?null:r<0?-1:1;else{if(!n&&(r=r.replace(A,function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,a&&a!=i?e:t}),a&&(i=a,r=r.replace(D,"$1").replace(I,"0.$1")),t!=r))return new z(r,i);if(z.DEBUG)throw Error(c+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},M.absoluteValue=M.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},M.comparedTo=function(e,t){return w(this,new z(e,t))},M.decimalPlaces=M.dp=function(e,t){var n,a,i,r=this;if(null!=e)return v(e,0,p),null==t?t=B:v(t,0,8),G(new z(r),e+r.e+1,t);if(!(n=r.c))return null;if(a=((i=n.length-1)-f(this.e/u))*u,i=n[i])for(;i%10==0;i/=10,a--);return a<0&&(a=0),a},M.dividedBy=M.div=function(e,t){return n(this,new z(e,t),R,B)},M.dividedToIntegerBy=M.idiv=function(e,t){return n(this,new z(e,t),0,1)},M.exponentiatedBy=M.pow=function(e,t){var n,a,i,r,h,d,l,g,m=this;if((e=new z(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+J(e));if(null!=t&&(t=new z(t)),h=e.e>14,!m.c||!m.c[0]||1==m.c[0]&&!m.e&&1==m.c.length||!e.c||!e.c[0])return g=new z(Math.pow(+J(m),h?2-S(e):+J(e))),t?g.mod(t):g;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(a=!d&&m.isInteger()&&t.isInteger())&&(m=m.mod(t))}else{if(e.e>9&&(m.e>0||m.e<-1||(0==m.e?m.c[0]>1||h&&m.c[1]>=24e7:m.c[0]<8e13||h&&m.c[0]<=9999975e7)))return r=m.s<0&&S(e)?-0:0,m.e>-1&&(r=1/r),new z(d?1/r:r);_&&(r=o(_/u+2))}for(h?(n=new z(.5),d&&(e.s=1),l=S(e)):l=(i=Math.abs(+J(e)))%2,g=new z(V);;){if(l){if(!(g=g.times(m)).c)break;r?g.c.length>r&&(g.c.length=r):a&&(g=g.mod(t))}if(i){if(0===(i=s(i/2)))break;l=i%2}else if(G(e=e.times(n),e.e+1,1),e.e>14)l=S(e);else{if(0===(i=+J(e)))break;l=i%2}m=m.times(m),r?m.c&&m.c.length>r&&(m.c.length=r):a&&(m=m.mod(t))}return a?g:(d&&(g=V.div(g)),t?g.mod(t):r?G(g,_,B,void 0):g)},M.integerValue=function(e){var t=new z(this);return null==e?e=B:v(e,0,8),G(t,t.e+1,e)},M.isEqualTo=M.eq=function(e,t){return 0===w(this,new z(e,t))},M.isFinite=function(){return!!this.c},M.isGreaterThan=M.gt=function(e,t){return w(this,new z(e,t))>0},M.isGreaterThanOrEqualTo=M.gte=function(e,t){return 1===(t=w(this,new z(e,t)))||0===t},M.isInteger=function(){return!!this.c&&f(this.e/u)>this.c.length-2},M.isLessThan=M.lt=function(e,t){return w(this,new z(e,t))<0},M.isLessThanOrEqualTo=M.lte=function(e,t){return-1===(t=w(this,new z(e,t)))||0===t},M.isNaN=function(){return!this.s},M.isNegative=function(){return this.s<0},M.isPositive=function(){return this.s>0},M.isZero=function(){return!!this.c&&0==this.c[0]},M.minus=function(e,t){var n,a,i,r,o=this,s=o.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,h=e.e/u,l=o.c,g=e.c;if(!c||!h){if(!l||!g)return l?(e.s=-t,e):new z(g?o:NaN);if(!l[0]||!g[0])return g[0]?(e.s=-t,e):new z(l[0]?o:3==B?-0:0)}if(c=f(c),h=f(h),l=l.slice(),s=c-h){for((r=s<0)?(s=-s,i=l):(h=c,i=g),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(a=(r=(s=l.length)<(t=g.length))?s:t,s=t=0;t<a;t++)if(l[t]!=g[t]){r=l[t]<g[t];break}if(r&&(i=l,l=g,g=i,e.s=-e.s),(t=(a=g.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=d-1;a>s;){if(l[--a]<g[a]){for(n=a;n&&!l[--n];l[n]=t);--l[n],l[a]+=d}l[a]-=g[a]}for(;0==l[0];l.splice(0,1),--h);return l[0]?j(e,l,h):(e.s=3==B?-1:1,e.c=[e.e=0],e)},M.modulo=M.mod=function(e,t){var a,i,r=this;return e=new z(e,t),!r.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||r.c&&!r.c[0]?new z(r):(9==L?(i=e.s,e.s=1,a=n(r,e,0,3),e.s=i,a.s*=i):a=n(r,e,0,L),(e=r.minus(a.times(e))).c[0]||1!=L||(e.s=r.s),e)},M.multipliedBy=M.times=function(e,t){var n,a,i,r,o,s,c,h,l,g,p,y,w,v,S,E=this,k=E.c,b=(e=new z(e,t)).c;if(!(k&&b&&k[0]&&b[0]))return!E.s||!e.s||k&&!k[0]&&!b||b&&!b[0]&&!k?e.c=e.e=e.s=null:(e.s*=E.s,k&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=f(E.e/u)+f(e.e/u),e.s*=E.s,(c=k.length)<(g=b.length)&&(w=k,k=b,b=w,i=c,c=g,g=i),i=c+g,w=[];i--;w.push(0));for(v=d,S=m,i=g;--i>=0;){for(n=0,p=b[i]%S,y=b[i]/S|0,r=i+(o=c);r>i;)n=((h=p*(h=k[--o]%S)+(s=y*h+(l=k[o]/S|0)*p)%S*S+w[r]+n)/v|0)+(s/S|0)+y*l,w[r--]=h%v;w[r]=n}return n?++a:w.splice(0,1),j(e,w,a)},M.negated=function(){var e=new z(this);return e.s=-e.s||null,e},M.plus=function(e,t){var n,a=this,i=a.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,a.minus(e);var r=a.e/u,o=e.e/u,s=a.c,c=e.c;if(!r||!o){if(!s||!c)return new z(i/0);if(!s[0]||!c[0])return c[0]?e:new z(s[0]?a:0*i)}if(r=f(r),o=f(o),s=s.slice(),i=r-o){for(i>0?(o=r,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/d|0,s[t]=d===s[t]?0:s[t]%d;return i&&(s=[i].concat(s),++o),j(e,s,o)},M.precision=M.sd=function(e,t){var n,a,i,r=this;if(null!=e&&e!==!!e)return v(e,1,p),null==t?t=B:v(t,0,8),G(new z(r),e,t);if(!(n=r.c))return null;if(a=(i=n.length-1)*u+1,i=n[i]){for(;i%10==0;i/=10,a--);for(i=n[0];i>=10;i/=10,a++);}return e&&r.e+1>a&&(a=r.e+1),a},M.shiftedBy=function(e){return v(e,-9007199254740991,l),this.times("1e"+e)},M.squareRoot=M.sqrt=function(){var e,t,a,i,r,o=this,s=o.c,c=o.s,h=o.e,d=R+4,u=new z("0.5");if(1!==c||!s||!s[0])return new z(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+J(o)))||c==1/0?(((t=y(s)).length+h)%2==0&&(t+="0"),c=Math.sqrt(+t),h=f((h+1)/2)-(h<0||h%2),a=new z(t=c==1/0?"5e"+h:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+h)):a=new z(c+""),a.c[0])for((c=(h=a.e)+d)<3&&(c=0);;)if(r=a,a=u.times(r.plus(n(o,r,d,1))),y(r.c).slice(0,c)===(t=y(a.c)).slice(0,c)){if(a.e<h&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(a,a.e+R+2,1),e=!a.times(a).eq(o));break}if(!i&&(G(r,r.e+R+2,0),r.times(r).eq(o))){a=r;break}d+=4,c+=4,i=1}return G(a,a.e+R+1,B,e)},M.toExponential=function(e,t){return null!=e&&(v(e,0,p),e++),K(this,e,t,1)},M.toFixed=function(e,t){return null!=e&&(v(e,0,p),e=e+this.e+1),K(this,e,t)},M.toFormat=function(e,t,n){var a,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=F;else if("object"!=typeof n)throw Error(c+"Argument not an object: "+n);if(a=i.toFixed(e,t),i.c){var r,o=a.split("."),s=+n.groupSize,h=+n.secondaryGroupSize,d=n.groupSeparator||"",u=o[0],l=o[1],g=i.s<0,m=g?u.slice(1):u,p=m.length;if(h&&(r=s,s=h,h=r,p-=r),s>0&&p>0){for(r=p%s||s,u=m.substr(0,r);r<p;r+=s)u+=d+m.substr(r,s);h>0&&(u+=d+m.slice(r)),g&&(u="-"+u)}a=l?u+(n.decimalSeparator||"")+((h=+n.fractionGroupSize)?l.replace(new RegExp("\\d{"+h+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):l):u}return(n.prefix||"")+a+(n.suffix||"")},M.toFraction=function(e){var t,a,i,r,o,s,h,d,l,m,p,f,w=this,v=w.c;if(null!=e&&(!(h=new z(e)).isInteger()&&(h.c||1!==h.s)||h.lt(V)))throw Error(c+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+J(h));if(!v)return new z(w);for(t=new z(V),l=a=new z(V),i=d=new z(V),f=y(v),o=t.e=f.length-w.e-1,t.c[0]=g[(s=o%u)<0?u+s:s],e=!e||h.comparedTo(t)>0?o>0?t:l:h,s=O,O=1/0,h=new z(f),d.c[0]=0;m=n(h,t,0,1),1!=(r=a.plus(m.times(i))).comparedTo(e);)a=i,i=r,l=d.plus(m.times(r=l)),d=r,t=h.minus(m.times(r=t)),h=r;return r=n(e.minus(a),i,0,1),d=d.plus(r.times(l)),a=a.plus(r.times(i)),d.s=l.s=w.s,p=n(l,i,o*=2,B).minus(w).abs().comparedTo(n(d,a,o,B).minus(w).abs())<1?[l,i]:[d,a],O=s,p},M.toNumber=function(){return+J(this)},M.toPrecision=function(e,t){return null!=e&&v(e,1,p),K(this,e,t,2)},M.toString=function(e){var t,n=this,i=n.s,r=n.e;return null===r?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=r<=C||r>=U?E(y(n.c),r):k(y(n.c),r,"0"):10===e?t=k(y((n=G(new z(n),R+r+1,B)).c),n.e,"0"):(v(e,2,q.length,"Base"),t=a(k(y(n.c),r,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},M.valueOf=M.toJSON=function(){return J(this)},M._isBigNumber=!0,null!=t&&z.set(t),z}(),i.default=i.BigNumber=i,void 0===(a=function(){return i}.call(t,n,t,e))||(e.exports=a)}()},584(e,t,n){var a;!function(){"use strict";var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=n.g);var i=!t.HI_BASE32_NO_COMMON_JS&&e.exports,r=n.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),s={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],h=function(e,t){t.length>10&&(t="..."+t.substr(-10));var n=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw n.position=e,n},d=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,n,a,i,r,o,c,h,d=[],u=0,l=(e=e.replace(/=/g,"")).length,g=0,m=l>>3<<3;g<m;)t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],h=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3),d[u++]=255&(c<<5|h);var p=l-m;return 2===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2)):4===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4)):5===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1)):7===p&&(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3)),d},u=function(e,t){if(!t)return function(e){for(var t,n,a="",i=e.length,r=0,o=0;r<i;)if((t=e[r++])<=127)a+=String.fromCharCode(t);else{t>191&&t<=223?(n=31&t,o=1):t<=239?(n=15&t,o=2):t<=247?(n=7&t,o=3):h(r,a);for(var s=0;s<o;++s)((t=e[r++])<128||t>191)&&h(r,a),n<<=6,n+=63&t;n>=55296&&n<=57343&&h(r,a),n>1114111&&h(r,a),n<=65535?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296+(n>>10)),a+=String.fromCharCode(56320+(1023&n)))}return a}(d(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var n,a,i,r,o,c,u,l,g="",m=e.indexOf("=");-1===m&&(m=e.length);for(var p=0,f=m>>3<<3;p<f;)n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],l=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))+String.fromCharCode(255&(u<<5|l));var y=m-f;return 2===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))):4===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))):5===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))):7===y&&(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))),g},l={encode:function(e,t){var n="string"!=typeof e;return n&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),n?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e[h++],n=e[h++],a=e[h++],i=e[h++],r=e[h++],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e[h],s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e[h++],n=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e[h++],n=e[h++],a=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e[h++],n=e[h++],a=e[h++],i=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):t?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e.charCodeAt(h),s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):function(e){var t,n,a,i,r,s,h,d=!1,u="",l=0,g=0,m=e.length;if(""===e)return u;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],h=g;l<m&&h<5;++l)(s=e.charCodeAt(l))<128?c[h++]=s:s<2048?(c[h++]=192|s>>6,c[h++]=128|63&s):s<55296||s>=57344?(c[h++]=224|s>>12,c[h++]=128|s>>6&63,c[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++l)),c[h++]=240|s>>18,c[h++]=128|s>>12&63,c[h++]=128|s>>6&63,c[h++]=128|63&s);g=h-5,l===m&&++l,l>m&&h<6&&(d=!0),t=c[0],h>4?(n=c[1],a=c[2],i=c[3],r=c[4],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r]):1===h?u+=o[t>>>3]+o[t<<2&31]+"======":2===h?(n=c[1],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===h?(n=c[1],a=c[2],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):(n=c[1],a=c[2],i=c[3],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"=")}while(!d);return u}(e)},decode:u};u.asBytes=d,i?e.exports=l:(t.base32=l,r&&(void 0===(a=function(){return l}.call(l,n,l,e))||(e.exports=a)))}()},404(e,t,n){var a;!function(){"use strict";var t="input is invalid type",i="object"==typeof window,r=i?window:{};r.JS_SHA512_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=n.g:o&&(r=self);var s=!r.JS_SHA512_NO_COMMON_JS&&e.exports,c=n.amdO,h=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=["hex","array","digest","arrayBuffer"],p=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var f=function(e,t){return function(n){return new S(t,!0).update(n)[e]()}},y=function(e){var t=f("hex",e);t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=f(a,e)}return t},w=function(e,t){return function(n,a){return new E(n,t,!0).update(a)[e]()}},v=function(e){var t=w("hex",e);t.create=function(t){return new E(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=w(a,e)}return t};function S(e,t){t?(p[0]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=p[16]=p[17]=p[18]=p[19]=p[20]=p[21]=p[22]=p[23]=p[24]=p[25]=p[26]=p[27]=p[28]=p[29]=p[30]=p[31]=p[32]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==e?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==e?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function E(e,n,a){var i,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);i=!0}var o=e.length;if(!i){for(var s,c=[],d=(o=e.length,0),u=0;u<o;++u)(s=e.charCodeAt(u))<128?c[d++]=s:s<2048?(c[d++]=192|s>>6,c[d++]=128|63&s):s<55296||s>=57344?(c[d++]=224|s>>12,c[d++]=128|s>>6&63,c[d++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++u)),c[d++]=240|s>>18,c[d++]=128|s>>12&63,c[d++]=128|s>>6&63,c[d++]=128|63&s);e=c}e.length>128&&(e=new S(n,!0).update(e).array());var l=[],g=[];for(u=0;u<128;++u){var m=e[u]||0;l[u]=92^m,g[u]=54^m}S.call(this,n,a),this.update(g),this.oKeyPad=l,this.inner=!0,this.sharedMemory=a}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,r,o=0,s=e.length,c=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=c[16]=c[17]=c[18]=c[19]=c[20]=c[21]=c[22]=c[23]=c[24]=c[25]=c[26]=c[27]=c[28]=c[29]=c[30]=c[31]=c[32]=0),n)for(r=this.start;o<s&&r<128;++o)c[r>>2]|=e[o]<<l[3&r++];else for(r=this.start;o<s&&r<128;++o)(i=e.charCodeAt(o))<128?c[r>>2]|=i<<l[3&r++]:i<2048?(c[r>>2]|=(192|i>>6)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):i<55296||i>=57344?(c[r>>2]|=(224|i>>12)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[r>>2]|=(240|i>>18)<<l[3&r++],c[r>>2]|=(128|i>>12&63)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=128?(this.block=c[32],this.start=r-128,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=u[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,n,a,i,r,o,s,c,h,d,u,l,m,p,f,y,w,v,S,E,k,b,x,A,D=this.h0h,I=this.h0l,T=this.h1h,P=this.h1l,M=this.h2h,V=this.h2l,R=this.h3h,B=this.h3l,C=this.h4h,U=this.h4l,$=this.h5h,O=this.h5l,N=this.h6h,L=this.h6l,_=this.h7h,F=this.h7l,q=this.blocks;for(e=32;e<160;e+=2)t=((S=q[e-30])>>>1|(E=q[e-29])<<31)^(S>>>8|E<<24)^S>>>7,n=(E>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25),a=((S=q[e-4])>>>19|(E=q[e-3])<<13)^(E>>>29|S<<3)^S>>>6,i=(E>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26),S=q[e-32],E=q[e-31],c=((k=q[e-14])>>>16)+(S>>>16)+(t>>>16)+(a>>>16)+((s=(65535&k)+(65535&S)+(65535&t)+(65535&a)+((o=((b=q[e-13])>>>16)+(E>>>16)+(n>>>16)+(i>>>16)+((r=(65535&b)+(65535&E)+(65535&n)+(65535&i))>>>16))>>>16))>>>16),q[e]=c<<16|65535&s,q[e+1]=o<<16|65535&r;var z=D,K=I,H=T,j=P,G=M,J=V,W=R,Y=B,X=C,Q=U,Z=$,ee=O,te=N,ne=L,ae=_,ie=F;for(f=H&G,y=j&J,e=0;e<160;e+=8)t=(z>>>28|K<<4)^(K>>>2|z<<30)^(K>>>7|z<<25),n=(K>>>28|z<<4)^(z>>>2|K<<30)^(z>>>7|K<<25),a=(X>>>14|Q<<18)^(X>>>18|Q<<14)^(Q>>>9|X<<23),i=(Q>>>14|X<<18)^(Q>>>18|X<<14)^(X>>>9|Q<<23),w=(h=z&H)^z&G^f,v=(d=K&j)^K&J^y,x=X&Z^~X&te,A=Q&ee^~Q&ne,S=q[e],E=q[e+1],S=(c=((k=g[e])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(ae>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&ae)+((o=((b=g[e+1])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ie>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ie))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,ae=(c=(W>>>16)+(S>>>16)+((s=(65535&W)+(65535&S)+((o=(Y>>>16)+(E>>>16)+((r=(65535&Y)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ie=o<<16|65535&r,t=((W=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Y=o<<16|65535&r)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),n=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),a=(ae>>>14|ie<<18)^(ae>>>18|ie<<14)^(ie>>>9|ae<<23),i=(ie>>>14|ae<<18)^(ie>>>18|ae<<14)^(ae>>>9|ie<<23),w=(u=W&z)^W&H^h,v=(l=Y&K)^Y&j^d,x=ae&X^~ae&Z,A=ie&Q^~ie&ee,S=q[e+2],E=q[e+3],S=(c=((k=g[e+2])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(te>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&te)+((o=((b=g[e+3])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ne>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ne))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,te=(c=(G>>>16)+(S>>>16)+((s=(65535&G)+(65535&S)+((o=(J>>>16)+(E>>>16)+((r=(65535&J)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ne=o<<16|65535&r,t=((G=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(J=o<<16|65535&r)<<4)^(J>>>2|G<<30)^(J>>>7|G<<25),n=(J>>>28|G<<4)^(G>>>2|J<<30)^(G>>>7|J<<25),a=(te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23),i=(ne>>>14|te<<18)^(ne>>>18|te<<14)^(te>>>9|ne<<23),w=(m=G&W)^G&z^u,v=(p=J&Y)^J&K^l,x=te&ae^~te&X,A=ne&ie^~ne&Q,S=q[e+4],E=q[e+5],S=(c=((k=g[e+4])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(Z>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&Z)+((o=((b=g[e+5])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ee>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ee))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,Z=(c=(H>>>16)+(S>>>16)+((s=(65535&H)+(65535&S)+((o=(j>>>16)+(E>>>16)+((r=(65535&j)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ee=o<<16|65535&r,t=((H=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(j=o<<16|65535&r)<<4)^(j>>>2|H<<30)^(j>>>7|H<<25),n=(j>>>28|H<<4)^(H>>>2|j<<30)^(H>>>7|j<<25),a=(Z>>>14|ee<<18)^(Z>>>18|ee<<14)^(ee>>>9|Z<<23),i=(ee>>>14|Z<<18)^(ee>>>18|Z<<14)^(Z>>>9|ee<<23),w=(f=H&G)^H&W^m,v=(y=j&J)^j&Y^p,x=Z&te^~Z&ae,A=ee&ne^~ee&ie,S=q[e+6],E=q[e+7],S=(c=((k=g[e+6])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(X>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&X)+((o=((b=g[e+7])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(Q>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&Q))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,X=(c=(z>>>16)+(S>>>16)+((s=(65535&z)+(65535&S)+((o=(K>>>16)+(E>>>16)+((r=(65535&K)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,Q=o<<16|65535&r,z=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,K=o<<16|65535&r;c=(D>>>16)+(z>>>16)+((s=(65535&D)+(65535&z)+((o=(I>>>16)+(K>>>16)+((r=(65535&I)+(65535&K))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&s,this.h0l=o<<16|65535&r,c=(T>>>16)+(H>>>16)+((s=(65535&T)+(65535&H)+((o=(P>>>16)+(j>>>16)+((r=(65535&P)+(65535&j))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&s,this.h1l=o<<16|65535&r,c=(M>>>16)+(G>>>16)+((s=(65535&M)+(65535&G)+((o=(V>>>16)+(J>>>16)+((r=(65535&V)+(65535&J))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&s,this.h2l=o<<16|65535&r,c=(R>>>16)+(W>>>16)+((s=(65535&R)+(65535&W)+((o=(B>>>16)+(Y>>>16)+((r=(65535&B)+(65535&Y))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&s,this.h3l=o<<16|65535&r,c=(C>>>16)+(X>>>16)+((s=(65535&C)+(65535&X)+((o=(U>>>16)+(Q>>>16)+((r=(65535&U)+(65535&Q))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&s,this.h4l=o<<16|65535&r,c=($>>>16)+(Z>>>16)+((s=(65535&$)+(65535&Z)+((o=(O>>>16)+(ee>>>16)+((r=(65535&O)+(65535&ee))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&s,this.h5l=o<<16|65535&r,c=(N>>>16)+(te>>>16)+((s=(65535&N)+(65535&te)+((o=(L>>>16)+(ne>>>16)+((r=(65535&L)+(65535&ne))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&s,this.h6l=o<<16|65535&r,c=(_>>>16)+(ae>>>16)+((s=(65535&_)+(65535&ae)+((o=(F>>>16)+(ie>>>16)+((r=(65535&F)+(65535&ie))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&s,this.h7l=o<<16|65535&r},S.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,u=this.h5h,l=this.h5l,g=this.h6h,m=this.h6l,p=this.h7h,f=this.h7l,y=this.bits,w=d[e>>28&15]+d[e>>24&15]+d[e>>20&15]+d[e>>16&15]+d[e>>12&15]+d[e>>8&15]+d[e>>4&15]+d[15&e]+d[t>>28&15]+d[t>>24&15]+d[t>>20&15]+d[t>>16&15]+d[t>>12&15]+d[t>>8&15]+d[t>>4&15]+d[15&t]+d[n>>28&15]+d[n>>24&15]+d[n>>20&15]+d[n>>16&15]+d[n>>12&15]+d[n>>8&15]+d[n>>4&15]+d[15&n]+d[a>>28&15]+d[a>>24&15]+d[a>>20&15]+d[a>>16&15]+d[a>>12&15]+d[a>>8&15]+d[a>>4&15]+d[15&a]+d[i>>28&15]+d[i>>24&15]+d[i>>20&15]+d[i>>16&15]+d[i>>12&15]+d[i>>8&15]+d[i>>4&15]+d[15&i]+d[r>>28&15]+d[r>>24&15]+d[r>>20&15]+d[r>>16&15]+d[r>>12&15]+d[r>>8&15]+d[r>>4&15]+d[15&r]+d[o>>28&15]+d[o>>24&15]+d[o>>20&15]+d[o>>16&15]+d[o>>12&15]+d[o>>8&15]+d[o>>4&15]+d[15&o];return y>=256&&(w+=d[s>>28&15]+d[s>>24&15]+d[s>>20&15]+d[s>>16&15]+d[s>>12&15]+d[s>>8&15]+d[s>>4&15]+d[15&s]),y>=384&&(w+=d[c>>28&15]+d[c>>24&15]+d[c>>20&15]+d[c>>16&15]+d[c>>12&15]+d[c>>8&15]+d[c>>4&15]+d[15&c]+d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[15&h]+d[u>>28&15]+d[u>>24&15]+d[u>>20&15]+d[u>>16&15]+d[u>>12&15]+d[u>>8&15]+d[u>>4&15]+d[15&u]+d[l>>28&15]+d[l>>24&15]+d[l>>20&15]+d[l>>16&15]+d[l>>12&15]+d[l>>8&15]+d[l>>4&15]+d[15&l]),512==y&&(w+=d[g>>28&15]+d[g>>24&15]+d[g>>20&15]+d[g>>16&15]+d[g>>12&15]+d[g>>8&15]+d[g>>4&15]+d[15&g]+d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[15&m]+d[p>>28&15]+d[p>>24&15]+d[p>>20&15]+d[p>>16&15]+d[p>>12&15]+d[p>>8&15]+d[p>>4&15]+d[15&p]+d[f>>28&15]+d[f>>24&15]+d[f>>20&15]+d[f>>16&15]+d[f>>12&15]+d[f>>8&15]+d[f>>4&15]+d[15&f]),w},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,d=this.h5h,u=this.h5l,l=this.h6h,g=this.h6l,m=this.h7h,p=this.h7l,f=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o];return f>=256&&y.push(s>>24&255,s>>16&255,s>>8&255,255&s),f>=384&&y.push(c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,u>>24&255,u>>16&255,u>>8&255,255&u),512==f&&y.push(l>>24&255,l>>16&255,l>>8&255,255&l,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,p>>24&255,p>>16&255,p>>8&255,255&p),y},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),n=new DataView(t);return n.setUint32(0,this.h0h),n.setUint32(4,this.h0l),n.setUint32(8,this.h1h),n.setUint32(12,this.h1l),n.setUint32(16,this.h2h),n.setUint32(20,this.h2l),n.setUint32(24,this.h3h),e>=256&&n.setUint32(28,this.h3l),e>=384&&(n.setUint32(32,this.h4h),n.setUint32(36,this.h4l),n.setUint32(40,this.h5h),n.setUint32(44,this.h5l)),512==e&&(n.setUint32(48,this.h6h),n.setUint32(52,this.h6l),n.setUint32(56,this.h7h),n.setUint32(60,this.h7l)),t},S.prototype.clone=function(){var e=new S(this.bits,!1);return this.copyTo(e),e},S.prototype.copyTo=function(e){var t=0,n=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<n.length;++t)e[n[t]]=this[n[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},E.prototype=new S,E.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}},E.prototype.clone=function(){var e=new E([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var k=y(512);k.sha512=k,k.sha384=y(384),k.sha512_256=y(256),k.sha512_224=y(224),k.sha512.hmac=v(512),k.sha384.hmac=v(384),k.sha512_256.hmac=v(256),k.sha512_224.hmac=v(224),s?e.exports=k:(r.sha512=k.sha512,r.sha384=k.sha384,r.sha512_256=k.sha512_256,r.sha512_224=k.sha512_224,c&&(void 0===(a=function(){return k}.call(k,n,k,e))||(e.exports=a)))}()},215(e,t,n){var a=n(902).stringify,i=n(440);e.exports=function(e){return{parse:i(e),stringify:a}},e.exports.parse=i(),e.exports.stringify=a},440(e,t,n){var a=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,r=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,s,c,h,d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},l=function(e){return e&&e!==s&&u("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(o),o+=1,s},g=function(){var e,i="";for("-"===s&&(i="-",l("-"));s>="0"&&s<="9";)i+=s,l();if("."===s)for(i+=".";l()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,l(),"-"!==s&&"+"!==s||(i+=s,l());s>="0"&&s<="9";)i+=s,l();if(e=+i,isFinite(e))return null==a&&(a=n(180)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new a(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new a(e):e;u("Bad number")},m=function(){var e,t,n,a="";if('"'===s)for(var i=o;l();){if('"'===s)return o-1>i&&(a+=c.substring(i,o-1)),l(),a;if("\\"===s){if(o-1>i&&(a+=c.substring(i,o-1)),l(),"u"===s){for(n=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)n=16*n+e;a+=String.fromCharCode(n)}else{if("string"!=typeof d[s])break;a+=d[s]}i=o}}u("Bad string")},p=function(){for(;s&&s<=" ";)l()};return h=function(){switch(p(),s){case"{":return function(){var e,n=Object.create(null);if("{"===s){if(l("{"),p(),"}"===s)return l("}"),n;for(;s;){if(e=m(),p(),l(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&u('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?u("Object contains forbidden prototype property"):"ignore"===t.protoAction?h():n[e]=h():!0===r.test(e)?"error"===t.constructorAction?u("Object contains forbidden constructor property"):"ignore"===t.constructorAction?h():n[e]=h():n[e]=h(),p(),"}"===s)return l("}"),n;l(","),p()}}u("Bad object")}();case"[":return function(){var e=[];if("["===s){if(l("["),p(),"]"===s)return l("]"),e;for(;s;){if(e.push(h()),p(),"]"===s)return l("]"),e;l(","),p()}}u("Bad array")}();case'"':return m();case"-":return g();default:return s>="0"&&s<="9"?g():function(){switch(s){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}u("Unexpected '"+s+"'")}()}},function(e,t){var n;return c=e+"",o=0,s=" ",n=h(),p(),s&&u("Syntax error"),"function"==typeof t?function e(n,a){var i,r=n[a];return r&&"object"==typeof r&&Object.keys(r).forEach(function(t){void 0!==(i=e(r,t))?r[t]=i:delete r[t]}),t.call(n,a,r)}({"":n},""):n}}},902(e,t,n){var a=n(180),i=e.exports;!function(){"use strict";var e,t,n,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return r.lastIndex=0,r.test(e)?'"'+e.replace(r,function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function c(i,r){var o,h,d,u,l,g=e,m=r[i],p=null!=m&&(m instanceof a||a.isBigNumber(m));switch(m&&"object"==typeof m&&"function"==typeof m.toJSON&&(m=m.toJSON(i)),"function"==typeof n&&(m=n.call(r,i,m)),typeof m){case"string":return p?m:s(m);case"number":return isFinite(m)?String(m):"null";case"boolean":case"null":case"bigint":return String(m);case"object":if(!m)return"null";if(e+=t,l=[],"[object Array]"===Object.prototype.toString.apply(m)){for(u=m.length,o=0;o<u;o+=1)l[o]=c(o,m)||"null";return d=0===l.length?"[]":e?"[\n"+e+l.join(",\n"+e)+"\n"+g+"]":"["+l.join(",")+"]",e=g,d}if(n&&"object"==typeof n)for(u=n.length,o=0;o<u;o+=1)"string"==typeof n[o]&&(d=c(h=n[o],m))&&l.push(s(h)+(e?": ":":")+d);else Object.keys(m).forEach(function(t){var n=c(t,m);n&&l.push(s(t)+(e?": ":":")+n)});return d=0===l.length?"{}":e?"{\n"+e+l.join(",\n"+e)+"\n"+g+"}":"{"+l.join(",")+"}",e=g,d}}"function"!=typeof i.stringify&&(i.stringify=function(a,i,r){var o;if(e="",t="","number"==typeof r)for(o=0;o<r;o+=1)t+=" ";else"string"==typeof r&&(t=r);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return c("",{"":a})})}()},601(e,t){!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var r=t(),o=t([1]),s=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t,n,a){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=a>>24&255,e[t+5]=a>>16&255,e[t+6]=a>>8&255,e[t+7]=255&a}function m(e,t,n,a,i){var r,o=0;for(r=0;r<i;r++)o|=e[t+r]^n[a+r];return(1&o-1>>>8)-1}function p(e,t,n,a){return m(e,t,n,a,16)}function f(e,t,n,a){return m(e,t,n,a,32)}function y(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=r,k=o,b=s,x=c,A=h,D=d,I=u,T=l,P=g,M=m,V=p,R=f,B=y,C=w,U=v,$=S,O=0;O<20;O+=2)E^=(i=(B^=(i=(P^=(i=(A^=(i=E+B|0)<<7|i>>>25)+E|0)<<9|i>>>23)+A|0)<<13|i>>>19)+P|0)<<18|i>>>14,D^=(i=(k^=(i=(C^=(i=(M^=(i=D+k|0)<<7|i>>>25)+D|0)<<9|i>>>23)+M|0)<<13|i>>>19)+C|0)<<18|i>>>14,V^=(i=(I^=(i=(b^=(i=(U^=(i=V+I|0)<<7|i>>>25)+V|0)<<9|i>>>23)+U|0)<<13|i>>>19)+b|0)<<18|i>>>14,$^=(i=(R^=(i=(T^=(i=(x^=(i=$+R|0)<<7|i>>>25)+$|0)<<9|i>>>23)+x|0)<<13|i>>>19)+T|0)<<18|i>>>14,E^=(i=(x^=(i=(b^=(i=(k^=(i=E+x|0)<<7|i>>>25)+E|0)<<9|i>>>23)+k|0)<<13|i>>>19)+b|0)<<18|i>>>14,D^=(i=(A^=(i=(T^=(i=(I^=(i=D+A|0)<<7|i>>>25)+D|0)<<9|i>>>23)+I|0)<<13|i>>>19)+T|0)<<18|i>>>14,V^=(i=(M^=(i=(P^=(i=(R^=(i=V+M|0)<<7|i>>>25)+V|0)<<9|i>>>23)+R|0)<<13|i>>>19)+P|0)<<18|i>>>14,$^=(i=(U^=(i=(C^=(i=(B^=(i=$+U|0)<<7|i>>>25)+$|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14;E=E+r|0,k=k+o|0,b=b+s|0,x=x+c|0,A=A+h|0,D=D+d|0,I=I+u|0,T=T+l|0,P=P+g|0,M=M+m|0,V=V+p|0,R=R+f|0,B=B+y|0,C=C+w|0,U=U+v|0,$=$+S|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=A>>>0&255,e[17]=A>>>8&255,e[18]=A>>>16&255,e[19]=A>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=I>>>0&255,e[25]=I>>>8&255,e[26]=I>>>16&255,e[27]=I>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=M>>>0&255,e[37]=M>>>8&255,e[38]=M>>>16&255,e[39]=M>>>24&255,e[40]=V>>>0&255,e[41]=V>>>8&255,e[42]=V>>>16&255,e[43]=V>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=B>>>0&255,e[49]=B>>>8&255,e[50]=B>>>16&255,e[51]=B>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=U>>>0&255,e[57]=U>>>8&255,e[58]=U>>>16&255,e[59]=U>>>24&255,e[60]=$>>>0&255,e[61]=$>>>8&255,e[62]=$>>>16&255,e[63]=$>>>24&255}(e,t,n,a)}function w(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=0;E<20;E+=2)r^=(i=(y^=(i=(g^=(i=(h^=(i=r+y|0)<<7|i>>>25)+r|0)<<9|i>>>23)+h|0)<<13|i>>>19)+g|0)<<18|i>>>14,d^=(i=(o^=(i=(w^=(i=(m^=(i=d+o|0)<<7|i>>>25)+d|0)<<9|i>>>23)+m|0)<<13|i>>>19)+w|0)<<18|i>>>14,p^=(i=(u^=(i=(s^=(i=(v^=(i=p+u|0)<<7|i>>>25)+p|0)<<9|i>>>23)+v|0)<<13|i>>>19)+s|0)<<18|i>>>14,S^=(i=(f^=(i=(l^=(i=(c^=(i=S+f|0)<<7|i>>>25)+S|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,r^=(i=(c^=(i=(s^=(i=(o^=(i=r+c|0)<<7|i>>>25)+r|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,d^=(i=(h^=(i=(l^=(i=(u^=(i=d+h|0)<<7|i>>>25)+d|0)<<9|i>>>23)+u|0)<<13|i>>>19)+l|0)<<18|i>>>14,p^=(i=(m^=(i=(g^=(i=(f^=(i=p+m|0)<<7|i>>>25)+p|0)<<9|i>>>23)+f|0)<<13|i>>>19)+g|0)<<18|i>>>14,S^=(i=(v^=(i=(w^=(i=(y^=(i=S+v|0)<<7|i>>>25)+S|0)<<9|i>>>23)+y|0)<<13|i>>>19)+w|0)<<18|i>>>14;e[0]=r>>>0&255,e[1]=r>>>8&255,e[2]=r>>>16&255,e[3]=r>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=g>>>0&255,e[25]=g>>>8&255,e[26]=g>>>16&255,e[27]=g>>>24&255,e[28]=m>>>0&255,e[29]=m>>>8&255,e[30]=m>>>16&255,e[31]=m>>>24&255}(e,t,n,a)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function S(e,t,n,a,i,r,o){var s,c,h=new Uint8Array(16),d=new Uint8Array(64);for(c=0;c<16;c++)h[c]=0;for(c=0;c<8;c++)h[c]=r[c];for(;i>=64;){for(y(d,h,o,v),c=0;c<64;c++)e[t+c]=n[a+c]^d[c];for(s=1,c=8;c<16;c++)s=s+(255&h[c])|0,h[c]=255&s,s>>>=8;i-=64,t+=64,a+=64}if(i>0)for(y(d,h,o,v),c=0;c<i;c++)e[t+c]=n[a+c]^d[c];return 0}function E(e,t,n,a,i){var r,o,s=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=a[o];for(;n>=64;){for(y(c,s,i,v),o=0;o<64;o++)e[t+o]=c[o];for(r=1,o=8;o<16;o++)r=r+(255&s[o])|0,s[o]=255&r,r>>>=8;n-=64,t+=64}if(n>0)for(y(c,s,i,v),o=0;o<n;o++)e[t+o]=c[o];return 0}function k(e,t,n,a,i){var r=new Uint8Array(32);w(r,a,i,v);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=a[s+16];return E(e,t,n,o,r)}function b(e,t,n,a,i,r,o){var s=new Uint8Array(32);w(s,r,o,v);for(var c=new Uint8Array(8),h=0;h<8;h++)c[h]=r[h+16];return S(e,t,n,a,i,c,s)}var x=function(e){var t,n,a,i,r,o,s,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),a=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|a<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(a>>>7|i<<9),r=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|r<<12),this.r[5]=r>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(r>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,n,a,i,r){var o=new x(r);return o.update(n,a,i),o.finish(e,t),0}function D(e,t,n,a,i,r){var o=new Uint8Array(16);return A(o,0,n,a,i,r),p(e,t,o,0)}function I(e,t,n,a,i){var r;if(n<32)return-1;for(b(e,0,t,0,n,a,i),A(e,16,e,32,n-32,e),r=0;r<16;r++)e[r]=0;return 0}function T(e,t,n,a,i){var r,o=new Uint8Array(32);if(n<32)return-1;if(k(o,0,32,a,i),0!==D(t,16,t,32,n-32,o))return-1;for(b(e,0,t,0,n,a,i),r=0;r<32;r++)e[r]=0;return 0}function P(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function M(e){var t,n,a=1;for(t=0;t<16;t++)n=e[t]+a+65535,a=Math.floor(n/65536),e[t]=n-65536*a;e[0]+=a-1+37*(a-1)}function V(e,t,n){for(var a,i=~(n-1),r=0;r<16;r++)a=i&(e[r]^t[r]),e[r]^=a,t[r]^=a}function R(e,n){var a,i,r,o=t(),s=t();for(a=0;a<16;a++)s[a]=n[a];for(M(s),M(s),M(s),i=0;i<2;i++){for(o[0]=s[0]-65517,a=1;a<15;a++)o[a]=s[a]-65535-(o[a-1]>>16&1),o[a-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),r=o[15]>>16&1,o[14]&=65535,V(s,o,1-r)}for(a=0;a<16;a++)e[2*a]=255&s[a],e[2*a+1]=s[a]>>8}function B(e,t){var n=new Uint8Array(32),a=new Uint8Array(32);return R(n,e),R(a,t),f(n,0,a,0)}function C(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function $(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]+n[a]}function O(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]-n[a]}function N(e,t,n){var a,i,r=0,o=0,s=0,c=0,h=0,d=0,u=0,l=0,g=0,m=0,p=0,f=0,y=0,w=0,v=0,S=0,E=0,k=0,b=0,x=0,A=0,D=0,I=0,T=0,P=0,M=0,V=0,R=0,B=0,C=0,U=0,$=n[0],O=n[1],N=n[2],L=n[3],_=n[4],F=n[5],q=n[6],z=n[7],K=n[8],H=n[9],j=n[10],G=n[11],J=n[12],W=n[13],Y=n[14],X=n[15];r+=(a=t[0])*$,o+=a*O,s+=a*N,c+=a*L,h+=a*_,d+=a*F,u+=a*q,l+=a*z,g+=a*K,m+=a*H,p+=a*j,f+=a*G,y+=a*J,w+=a*W,v+=a*Y,S+=a*X,o+=(a=t[1])*$,s+=a*O,c+=a*N,h+=a*L,d+=a*_,u+=a*F,l+=a*q,g+=a*z,m+=a*K,p+=a*H,f+=a*j,y+=a*G,w+=a*J,v+=a*W,S+=a*Y,E+=a*X,s+=(a=t[2])*$,c+=a*O,h+=a*N,d+=a*L,u+=a*_,l+=a*F,g+=a*q,m+=a*z,p+=a*K,f+=a*H,y+=a*j,w+=a*G,v+=a*J,S+=a*W,E+=a*Y,k+=a*X,c+=(a=t[3])*$,h+=a*O,d+=a*N,u+=a*L,l+=a*_,g+=a*F,m+=a*q,p+=a*z,f+=a*K,y+=a*H,w+=a*j,v+=a*G,S+=a*J,E+=a*W,k+=a*Y,b+=a*X,h+=(a=t[4])*$,d+=a*O,u+=a*N,l+=a*L,g+=a*_,m+=a*F,p+=a*q,f+=a*z,y+=a*K,w+=a*H,v+=a*j,S+=a*G,E+=a*J,k+=a*W,b+=a*Y,x+=a*X,d+=(a=t[5])*$,u+=a*O,l+=a*N,g+=a*L,m+=a*_,p+=a*F,f+=a*q,y+=a*z,w+=a*K,v+=a*H,S+=a*j,E+=a*G,k+=a*J,b+=a*W,x+=a*Y,A+=a*X,u+=(a=t[6])*$,l+=a*O,g+=a*N,m+=a*L,p+=a*_,f+=a*F,y+=a*q,w+=a*z,v+=a*K,S+=a*H,E+=a*j,k+=a*G,b+=a*J,x+=a*W,A+=a*Y,D+=a*X,l+=(a=t[7])*$,g+=a*O,m+=a*N,p+=a*L,f+=a*_,y+=a*F,w+=a*q,v+=a*z,S+=a*K,E+=a*H,k+=a*j,b+=a*G,x+=a*J,A+=a*W,D+=a*Y,I+=a*X,g+=(a=t[8])*$,m+=a*O,p+=a*N,f+=a*L,y+=a*_,w+=a*F,v+=a*q,S+=a*z,E+=a*K,k+=a*H,b+=a*j,x+=a*G,A+=a*J,D+=a*W,I+=a*Y,T+=a*X,m+=(a=t[9])*$,p+=a*O,f+=a*N,y+=a*L,w+=a*_,v+=a*F,S+=a*q,E+=a*z,k+=a*K,b+=a*H,x+=a*j,A+=a*G,D+=a*J,I+=a*W,T+=a*Y,P+=a*X,p+=(a=t[10])*$,f+=a*O,y+=a*N,w+=a*L,v+=a*_,S+=a*F,E+=a*q,k+=a*z,b+=a*K,x+=a*H,A+=a*j,D+=a*G,I+=a*J,T+=a*W,P+=a*Y,M+=a*X,f+=(a=t[11])*$,y+=a*O,w+=a*N,v+=a*L,S+=a*_,E+=a*F,k+=a*q,b+=a*z,x+=a*K,A+=a*H,D+=a*j,I+=a*G,T+=a*J,P+=a*W,M+=a*Y,V+=a*X,y+=(a=t[12])*$,w+=a*O,v+=a*N,S+=a*L,E+=a*_,k+=a*F,b+=a*q,x+=a*z,A+=a*K,D+=a*H,I+=a*j,T+=a*G,P+=a*J,M+=a*W,V+=a*Y,R+=a*X,w+=(a=t[13])*$,v+=a*O,S+=a*N,E+=a*L,k+=a*_,b+=a*F,x+=a*q,A+=a*z,D+=a*K,I+=a*H,T+=a*j,P+=a*G,M+=a*J,V+=a*W,R+=a*Y,B+=a*X,v+=(a=t[14])*$,S+=a*O,E+=a*N,k+=a*L,b+=a*_,x+=a*F,A+=a*q,D+=a*z,I+=a*K,T+=a*H,P+=a*j,M+=a*G,V+=a*J,R+=a*W,B+=a*Y,C+=a*X,S+=(a=t[15])*$,o+=38*(k+=a*N),s+=38*(b+=a*L),c+=38*(x+=a*_),h+=38*(A+=a*F),d+=38*(D+=a*q),u+=38*(I+=a*z),l+=38*(T+=a*K),g+=38*(P+=a*H),m+=38*(M+=a*j),p+=38*(V+=a*G),f+=38*(R+=a*J),y+=38*(B+=a*W),w+=38*(C+=a*Y),v+=38*(U+=a*X),r=(a=(r+=38*(E+=a*O))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r=(a=(r+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r+=i-1+37*(i-1),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=h,e[5]=d,e[6]=u,e[7]=l,e[8]=g,e[9]=m,e[10]=p,e[11]=f,e[12]=y,e[13]=w,e[14]=v,e[15]=S}function L(e,t){N(e,t,t)}function _(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=253;a>=0;a--)L(i,i),2!==a&&4!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function F(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=250;a>=0;a--)L(i,i),1!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function q(e,n,a){var i,r,o=new Uint8Array(32),c=new Float64Array(80),h=t(),d=t(),u=t(),l=t(),g=t(),m=t();for(r=0;r<31;r++)o[r]=n[r];for(o[31]=127&n[31]|64,o[0]&=248,U(c,a),r=0;r<16;r++)d[r]=c[r],l[r]=h[r]=u[r]=0;for(h[0]=l[0]=1,r=254;r>=0;--r)V(h,d,i=o[r>>>3]>>>(7&r)&1),V(u,l,i),$(g,h,u),O(h,h,u),$(u,d,l),O(d,d,l),L(l,g),L(m,h),N(h,u,h),N(u,d,g),$(g,h,u),O(h,h,u),L(d,h),O(u,l,m),N(h,u,s),$(h,h,l),N(u,u,h),N(h,l,m),N(l,d,c),L(d,g),V(h,d,i),V(u,l,i);for(r=0;r<16;r++)c[r+16]=h[r],c[r+32]=u[r],c[r+48]=d[r],c[r+64]=l[r];var p=c.subarray(32),f=c.subarray(16);return _(p,p),N(f,f,p),R(e,f),0}function z(e,t){return q(e,t,i)}function K(e,t){return n(t,32),z(e,t)}function H(e,t,n){var i=new Uint8Array(32);return q(i,n,t),w(e,a,i,v)}x.prototype.blocks=function(e,t,n){for(var a,i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k=this.fin?0:2048,b=this.h[0],x=this.h[1],A=this.h[2],D=this.h[3],I=this.h[4],T=this.h[5],P=this.h[6],M=this.h[7],V=this.h[8],R=this.h[9],B=this.r[0],C=this.r[1],U=this.r[2],$=this.r[3],O=this.r[4],N=this.r[5],L=this.r[6],_=this.r[7],F=this.r[8],q=this.r[9];n>=16;)l=u=0,l+=(b+=8191&(a=255&e[t+0]|(255&e[t+1])<<8))*B,l+=(x+=8191&(a>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),l+=(A+=8191&(i>>>10|(r=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*F),l+=(D+=8191&(r>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*_),u=(l+=(I+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,l&=8191,l+=(T+=s>>>1&8191)*(5*N),l+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*O),l+=(M+=8191&(c>>>11|(h=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*$),l+=(V+=8191&(h>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*U),g=u+=(l+=(R+=d>>>5|k)*(5*C))>>>13,g+=b*C,g+=x*B,g+=A*(5*q),g+=D*(5*F),u=(g+=I*(5*_))>>>13,g&=8191,g+=T*(5*L),g+=P*(5*N),g+=M*(5*O),g+=V*(5*$),u+=(g+=R*(5*U))>>>13,g&=8191,m=u,m+=b*U,m+=x*C,m+=A*B,m+=D*(5*q),u=(m+=I*(5*F))>>>13,m&=8191,m+=T*(5*_),m+=P*(5*L),m+=M*(5*N),m+=V*(5*O),p=u+=(m+=R*(5*$))>>>13,p+=b*$,p+=x*U,p+=A*C,p+=D*B,u=(p+=I*(5*q))>>>13,p&=8191,p+=T*(5*F),p+=P*(5*_),p+=M*(5*L),p+=V*(5*N),f=u+=(p+=R*(5*O))>>>13,f+=b*O,f+=x*$,f+=A*U,f+=D*C,u=(f+=I*B)>>>13,f&=8191,f+=T*(5*q),f+=P*(5*F),f+=M*(5*_),f+=V*(5*L),y=u+=(f+=R*(5*N))>>>13,y+=b*N,y+=x*O,y+=A*$,y+=D*U,u=(y+=I*C)>>>13,y&=8191,y+=T*B,y+=P*(5*q),y+=M*(5*F),y+=V*(5*_),w=u+=(y+=R*(5*L))>>>13,w+=b*L,w+=x*N,w+=A*O,w+=D*$,u=(w+=I*U)>>>13,w&=8191,w+=T*C,w+=P*B,w+=M*(5*q),w+=V*(5*F),v=u+=(w+=R*(5*_))>>>13,v+=b*_,v+=x*L,v+=A*N,v+=D*O,u=(v+=I*$)>>>13,v&=8191,v+=T*U,v+=P*C,v+=M*B,v+=V*(5*q),S=u+=(v+=R*(5*F))>>>13,S+=b*F,S+=x*_,S+=A*L,S+=D*N,u=(S+=I*O)>>>13,S&=8191,S+=T*$,S+=P*U,S+=M*C,S+=V*B,E=u+=(S+=R*(5*q))>>>13,E+=b*q,E+=x*F,E+=A*_,E+=D*L,u=(E+=I*N)>>>13,E&=8191,E+=T*O,E+=P*$,E+=M*U,E+=V*C,b=l=8191&(u=(u=((u+=(E+=R*B)>>>13)<<2)+u|0)+(l&=8191)|0),x=g+=u>>>=13,A=m&=8191,D=p&=8191,I=f&=8191,T=y&=8191,P=w&=8191,M=v&=8191,V=S&=8191,R=E&=8191,t+=16,n-=16;this.h[0]=b,this.h[1]=x,this.h[2]=A,this.h[3]=D,this.h[4]=I,this.h[5]=T,this.h[6]=P,this.h[7]=M,this.h[8]=V,this.h[9]=R},x.prototype.finish=function(e,t){var n,a,i,r,o=new Uint16Array(10);if(this.leftover){for(r=this.leftover,this.buffer[r++]=1;r<16;r++)this.buffer[r]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,r=2;r<10;r++)this.h[r]+=n,n=this.h[r]>>>13,this.h[r]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,r=1;r<10;r++)o[r]=this.h[r]+n,n=o[r]>>>13,o[r]&=8191;for(o[9]-=8192,a=(1^n)-1,r=0;r<10;r++)o[r]&=a;for(a=~a,r=0;r<10;r++)this.h[r]=this.h[r]&a|o[r];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,r=1;r<8;r++)i=(this.h[r]+this.pad[r]|0)+(i>>>16)|0,this.h[r]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},x.prototype.update=function(e,t,n){var a,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),a=0;a<i;a++)this.buffer[this.leftover+a]=e[t+a];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(a=0;a<n;a++)this.buffer[this.leftover+a]=e[t+a];this.leftover+=n}};var j=I,G=T,J=[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 W(e,t,n,a){for(var i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k,b,x,A,D,I,T,P,M=new Int32Array(16),V=new Int32Array(16),R=e[0],B=e[1],C=e[2],U=e[3],$=e[4],O=e[5],N=e[6],L=e[7],_=t[0],F=t[1],q=t[2],z=t[3],K=t[4],H=t[5],j=t[6],G=t[7],W=0;a>=128;){for(k=0;k<16;k++)b=8*k+W,M[k]=n[b+0]<<24|n[b+1]<<16|n[b+2]<<8|n[b+3],V[k]=n[b+4]<<24|n[b+5]<<16|n[b+6]<<8|n[b+7];for(k=0;k<80;k++)if(i=R,r=B,o=C,s=U,c=$,h=O,d=N,l=_,g=F,m=q,p=z,f=K,y=H,w=j,D=65535&(A=G),I=A>>>16,T=65535&(x=L),P=x>>>16,D+=65535&(A=(K>>>14|$<<18)^(K>>>18|$<<14)^($>>>9|K<<23)),I+=A>>>16,T+=65535&(x=($>>>14|K<<18)^($>>>18|K<<14)^(K>>>9|$<<23)),P+=x>>>16,D+=65535&(A=K&H^~K&j),I+=A>>>16,T+=65535&(x=$&O^~$&N),P+=x>>>16,D+=65535&(A=J[2*k+1]),I+=A>>>16,T+=65535&(x=J[2*k]),P+=x>>>16,x=M[k%16],I+=(A=V[k%16])>>>16,T+=65535&x,P+=x>>>16,T+=(I+=(D+=65535&A)>>>16)>>>16,D=65535&(A=E=65535&D|I<<16),I=A>>>16,T=65535&(x=S=65535&T|(P+=T>>>16)<<16),P=x>>>16,D+=65535&(A=(_>>>28|R<<4)^(R>>>2|_<<30)^(R>>>7|_<<25)),I+=A>>>16,T+=65535&(x=(R>>>28|_<<4)^(_>>>2|R<<30)^(_>>>7|R<<25)),P+=x>>>16,I+=(A=_&F^_&q^F&q)>>>16,T+=65535&(x=R&B^R&C^B&C),P+=x>>>16,u=65535&(T+=(I+=(D+=65535&A)>>>16)>>>16)|(P+=T>>>16)<<16,v=65535&D|I<<16,D=65535&(A=p),I=A>>>16,T=65535&(x=s),P=x>>>16,I+=(A=E)>>>16,T+=65535&(x=S),P+=x>>>16,B=i,C=r,U=o,$=s=65535&(T+=(I+=(D+=65535&A)>>>16)>>>16)|(P+=T>>>16)<<16,O=c,N=h,L=d,R=u,F=l,q=g,z=m,K=p=65535&D|I<<16,H=f,j=y,G=w,_=v,k%16==15)for(b=0;b<16;b++)x=M[b],D=65535&(A=V[b]),I=A>>>16,T=65535&x,P=x>>>16,x=M[(b+9)%16],D+=65535&(A=V[(b+9)%16]),I+=A>>>16,T+=65535&x,P+=x>>>16,S=M[(b+1)%16],D+=65535&(A=((E=V[(b+1)%16])>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25)),I+=A>>>16,T+=65535&(x=(S>>>1|E<<31)^(S>>>8|E<<24)^S>>>7),P+=x>>>16,S=M[(b+14)%16],I+=(A=((E=V[(b+14)%16])>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26))>>>16,T+=65535&(x=(S>>>19|E<<13)^(E>>>29|S<<3)^S>>>6),P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,M[b]=65535&T|P<<16,V[b]=65535&D|I<<16;D=65535&(A=_),I=A>>>16,T=65535&(x=R),P=x>>>16,x=e[0],I+=(A=t[0])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[0]=R=65535&T|P<<16,t[0]=_=65535&D|I<<16,D=65535&(A=F),I=A>>>16,T=65535&(x=B),P=x>>>16,x=e[1],I+=(A=t[1])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[1]=B=65535&T|P<<16,t[1]=F=65535&D|I<<16,D=65535&(A=q),I=A>>>16,T=65535&(x=C),P=x>>>16,x=e[2],I+=(A=t[2])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[2]=C=65535&T|P<<16,t[2]=q=65535&D|I<<16,D=65535&(A=z),I=A>>>16,T=65535&(x=U),P=x>>>16,x=e[3],I+=(A=t[3])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[3]=U=65535&T|P<<16,t[3]=z=65535&D|I<<16,D=65535&(A=K),I=A>>>16,T=65535&(x=$),P=x>>>16,x=e[4],I+=(A=t[4])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[4]=$=65535&T|P<<16,t[4]=K=65535&D|I<<16,D=65535&(A=H),I=A>>>16,T=65535&(x=O),P=x>>>16,x=e[5],I+=(A=t[5])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[5]=O=65535&T|P<<16,t[5]=H=65535&D|I<<16,D=65535&(A=j),I=A>>>16,T=65535&(x=N),P=x>>>16,x=e[6],I+=(A=t[6])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[6]=N=65535&T|P<<16,t[6]=j=65535&D|I<<16,D=65535&(A=G),I=A>>>16,T=65535&(x=L),P=x>>>16,x=e[7],I+=(A=t[7])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[7]=L=65535&T|P<<16,t[7]=G=65535&D|I<<16,W+=128,a-=128}return a}function Y(e,t,n){var a,i=new Int32Array(8),r=new Int32Array(8),o=new Uint8Array(256),s=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,r[0]=4089235720,r[1]=2227873595,r[2]=4271175723,r[3]=1595750129,r[4]=2917565137,r[5]=725511199,r[6]=4215389547,r[7]=327033209,W(i,r,t,n),n%=128,a=0;a<n;a++)o[a]=t[s-n+a];for(o[n]=128,o[(n=256-128*(n<112?1:0))-9]=0,g(o,n-8,s/536870912|0,s<<3),W(i,r,o,n),a=0;a<8;a++)g(e,8*a,i[a],r[a]);return 0}function X(e,n){var a=t(),i=t(),r=t(),o=t(),s=t(),c=t(),d=t(),u=t(),l=t();O(a,e[1],e[0]),O(l,n[1],n[0]),N(a,a,l),$(i,e[0],e[1]),$(l,n[0],n[1]),N(i,i,l),N(r,e[3],n[3]),N(r,r,h),N(o,e[2],n[2]),$(o,o,o),O(s,i,a),O(c,o,r),$(d,o,r),$(u,i,a),N(e[0],s,c),N(e[1],u,d),N(e[2],d,c),N(e[3],s,u)}function Q(e,t,n){var a;for(a=0;a<4;a++)V(e[a],t[a],n)}function Z(e,n){var a=t(),i=t(),r=t();_(r,n[2]),N(a,n[0],r),N(i,n[1],r),R(e,i),e[31]^=C(a)<<7}function ee(e,t,n){var a,i;for(P(e[0],r),P(e[1],o),P(e[2],o),P(e[3],r),i=255;i>=0;--i)Q(e,t,a=n[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,a)}function te(e,n){var a=[t(),t(),t(),t()];P(a[0],d),P(a[1],u),P(a[2],o),N(a[3],d,u),ee(e,a,n)}function ne(e,a,i){var r,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(a,32),Y(o,a,32),o[0]&=248,o[31]&=127,o[31]|=64,te(s,o),Z(e,s),r=0;r<32;r++)a[r+32]=e[r];return 0}var ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var n,a,i,r;for(a=63;a>=32;--a){for(n=0,i=a-32,r=a-12;i<r;++i)t[i]+=n-16*t[a]*ae[i-(a-32)],n=Math.floor((t[i]+128)/256),t[i]-=256*n;t[i]+=n,t[a]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*ae[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ae[i];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function re(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,n)}function oe(e,n,a,i){var r,o,s=new Uint8Array(64),c=new Uint8Array(64),h=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];Y(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var l=a+64;for(r=0;r<a;r++)e[64+r]=n[r];for(r=0;r<32;r++)e[32+r]=s[32+r];for(Y(h,e.subarray(32),a+32),re(h),te(u,h),Z(e,u),r=32;r<64;r++)e[r]=i[r];for(Y(c,e,a+64),re(c),r=0;r<64;r++)d[r]=0;for(r=0;r<32;r++)d[r]=h[r];for(r=0;r<32;r++)for(o=0;o<32;o++)d[r+o]+=c[r]*s[o];return ie(e.subarray(32),d),l}function se(e,n,a,i){var s,h=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],g=[t(),t(),t(),t()];if(a<64)return-1;if(function(e,n){var a=t(),i=t(),s=t(),h=t(),d=t(),u=t(),g=t();return P(e[2],o),U(e[1],n),L(s,e[1]),N(h,s,c),O(s,s,e[2]),$(h,e[2],h),L(d,h),L(u,d),N(g,u,d),N(a,g,s),N(a,a,h),F(a,a),N(a,a,s),N(a,a,h),N(a,a,h),N(e[0],a,h),L(i,e[0]),N(i,i,h),B(i,s)&&N(e[0],e[0],l),L(i,e[0]),N(i,i,h),B(i,s)?-1:(C(e[0])===n[31]>>7&&O(e[0],r,e[0]),N(e[3],e[0],e[1]),0)}(g,i))return-1;for(s=0;s<a;s++)e[s]=n[s];for(s=0;s<32;s++)e[s+32]=i[s];if(Y(d,e,a),re(d),ee(u,g,d),te(g,n.subarray(32)),X(u,g),Z(h,u),a-=64,f(n,0,h,0)){for(s=0;s<a;s++)e[s]=0;return-1}for(s=0;s<a;s++)e[s]=n[s+64];return a}var ce=64,he=32,de=64;function ue(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function ge(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:b,crypto_stream:k,crypto_stream_salsa20_xor:S,crypto_stream_salsa20:E,crypto_onetimeauth:A,crypto_onetimeauth_verify:D,crypto_verify_16:p,crypto_verify_32:f,crypto_secretbox:I,crypto_secretbox_open:T,crypto_scalarmult:q,crypto_scalarmult_base:z,crypto_box_beforenm:H,crypto_box_afternm:j,crypto_box:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),j(e,t,n,a,o)},crypto_box_open:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),G(e,t,n,a,o)},crypto_box_keypair:K,crypto_hash:Y,crypto_sign:oe,crypto_sign_keypair:ne,crypto_sign_open:se,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:de,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ae,pack25519:R,unpack25519:U,M:N,A:$,S:L,Z:O,pow2523:F,add:X,set25519:P,modL:ie,scalarmult:ee,scalarbase:te},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){le(e,t,n),ue(n,t);for(var a=new Uint8Array(32+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+32]=e[r];return I(i,a,a.length,t,n),i.subarray(16)},e.secretbox.open=function(e,t,n){le(e,t,n),ue(n,t);for(var a=new Uint8Array(16+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+16]=e[r];return a.length<32||0!==T(i,a,a.length,t,n)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return q(n,e,t),n},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return z(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox(t,n,r)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return H(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox.open(t,n,r)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return K(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return z(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==de)throw new Error("bad secret key size");var n=new Uint8Array(ce+e.length);return oe(n,e,e.length,t),n},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var n=new Uint8Array(e.length),a=se(n,e,e.length,t);if(a<0)return null;for(var i=new Uint8Array(a),r=0;r<i.length;r++)i[r]=n[r];return i},e.sign.detached=function(t,n){for(var a=e.sign(t,n),i=new Uint8Array(ce),r=0;r<i.length;r++)i[r]=a[r];return i},e.sign.detached.verify=function(e,t,n){if(le(e,t,n),t.length!==ce)throw new Error("bad signature size");if(n.length!==he)throw new Error("bad public key size");var a,i=new Uint8Array(ce+e.length),r=new Uint8Array(ce+e.length);for(a=0;a<ce;a++)i[a]=t[a];for(a=0;a<e.length;a++)i[a+ce]=e[a];return se(r,i,i.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(de);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(he),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),n=new Uint8Array(de),a=0;a<32;a++)n[a]=e[a];return ne(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=de,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Y(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===m(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG(function(e,n){var a,i=new Uint8Array(n);for(a=0;a<n;a+=65536)t.getRandomValues(i.subarray(a,a+Math.min(n-a,65536)));for(a=0;a<n;a++)e[a]=i[a];ge(i)}):"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&e.setPRNG(function(e,n){var a,i=t.randomBytes(n);for(a=0;a<n;a++)e[a]=i[a];ge(i)})}()}(void 0!==e&&e.exports?e.exports:self.nacl=self.nacl||{})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a].call(r.exports,r,r.exports,n),r.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{ABIAddressType:()=>Jc,ABIArrayDynamicType:()=>Zc,ABIArrayStaticType:()=>Qc,ABIBoolType:()=>Wc,ABIByteType:()=>Yc,ABIContract:()=>dh,ABIInterface:()=>uh,ABIMethod:()=>ch,ABIReferenceType:()=>ih,ABIStringType:()=>Xc,ABITransactionType:()=>ah,ABITupleType:()=>eh,ABIType:()=>Hc,ABIUfixedType:()=>Gc,ABIUintType:()=>jc,ADDR_BYTE_SIZE:()=>Lc,ALGORAND_ZERO_ADDRESS_STRING:()=>rt,AccountBaseData:()=>Sa,AccountData:()=>Ea,AccountDeltas:()=>ba,AccountTotals:()=>Ta,Address:()=>ut,AlgoCount:()=>Ia,Algodv2:()=>Vr,AppLocalState:()=>da,AppLocalStateDelta:()=>ua,AppParams:()=>ha,AppParamsDelta:()=>la,AppResourceRecord:()=>ga,ApplyData:()=>na,AssetHolding:()=>ma,AssetHoldingDelta:()=>pa,AssetParams:()=>fa,AssetParamsDelta:()=>ya,AssetResourceRecord:()=>wa,AtomicTransactionComposer:()=>ph,AtomicTransactionComposerStatus:()=>gh,BalanceRecord:()=>ka,Block:()=>ra,BlockHeader:()=>Zn,ENCODED_MULTISIG_SCHEMA:()=>Dn,ENCODED_PQSIG_SCHEMA:()=>Pn,ENCODED_SUBSIG_SCHEMA:()=>bn,ERROR_INVALID_MICROALGOS:()=>wh,ERROR_MULTISIG_BAD_SENDER:()=>yh,EvalDelta:()=>ta,FALCON_1024_SCHEME:()=>pc,FalconSignatureStruct:()=>qt,FalconVerifier:()=>Ft,HashFactory:()=>Ot,INVALID_MICROALGOS_ERROR_MSG:()=>o,IncludedTransactions:()=>Aa,Indexer:()=>fs,IntDecoding:()=>l,Kmd:()=>Rr,KvValueDelta:()=>xa,LENGTH_ENCODE_BYTE_SIZE:()=>qc,LedgerStateDelta:()=>Pa,LogicSig:()=>On,LogicSigAccount:()=>Nn,MAX_LEN:()=>Nc,MSIG_PROGRAM_TAG:()=>$n,MULTISIG_BAD_SENDER_ERROR_MSG:()=>fh,MerkleArrayProof:()=>Nt,MerkleSignatureVerifier:()=>Lt,ModifiedCreatable:()=>Da,OnApplicationComplete:()=>Ct,PQ_PROGRAM_TAG:()=>Un,PQ_SALT_MAX:()=>ht,PQ_SCHEME_SIZE:()=>ct,PROGRAM_TAG:()=>Cn,Participant:()=>_t,ParticipationUpdates:()=>Qn,ProgramSourceMap:()=>lc,Reveal:()=>Kt,RewardState:()=>Wn,SIGN_BYTES_PREFIX:()=>Ls,SIGN_PROGRAM_DATA_PREFIX:()=>_n,SINGLE_BOOL_SIZE:()=>Fc,SINGLE_BYTE_SIZE:()=>_c,SignedTransaction:()=>Kn,SignedTxnInBlock:()=>ia,SignedTxnWithAD:()=>aa,SigslotCommit:()=>zt,StateProof:()=>Ht,StateProofMessage:()=>jt,StateProofTrackingData:()=>Gn,StateSchema:()=>ca,TealValue:()=>sa,Transaction:()=>un,TransactionType:()=>Bt,TxnCommitments:()=>Jn,UntypedValue:()=>oa,UpgradeState:()=>Yn,UpgradeVote:()=>Xn,ValueDelta:()=>ea,VotingData:()=>va,abiCheckTransactionType:()=>oh,abiTypeIsReference:()=>sh,abiTypeIsTransaction:()=>rh,addressFromPQKey:()=>yt,addressFromPQSig:()=>wt,addressWithSignersFromRawEd25519Signer:()=>gc,addressWithSignersFromRawFalcon1024Signer:()=>fc,addressWithSignersFromRawPQSigner:()=>mc,algosToMicroalgos:()=>c,appendSignMultisigTransaction:()=>oc,appendSignMultisigTransactionWithSigner:()=>sc,appendSignRawMultisigSignature:()=>cc,assignGroupID:()=>Ns,base64ToBytes:()=>he,bigIntToBytes:()=>ws,bytesToBase64:()=>de,bytesToBigInt:()=>vs,bytesToHex:()=>ge,bytesToString:()=>ue,coerceToBytes:()=>le,computeGroupID:()=>Os,createMultisigTransaction:()=>Zs,decodeAddress:()=>lt,decodeJSON:()=>Pe,decodeMsgpack:()=>Ie,decodeObj:()=>Se,decodeSignedTransaction:()=>Hn,decodeUint64:()=>Ye,decodeUnsignedTransaction:()=>gn,default:()=>vh,encodeAddress:()=>mt,encodeJSON:()=>Me,encodeMsgpack:()=>Te,encodeObj:()=>ye,encodeUint64:()=>We,encodeUnsignedSimulateTransaction:()=>jn,encodeUnsignedTransaction:()=>ln,encodedMultiSigFromEncodingData:()=>In,encodedMultiSigToEncodingData:()=>Tn,encodedPQSigFromEncodingData:()=>Mn,encodedPQSigToEncodingData:()=>Vn,encodedSubsigFromEncodingData:()=>xn,encodedSubsigToEncodingData:()=>An,generateAccount:()=>Ss,getApplicationAddress:()=>ft,getMethodByName:()=>hh,hexToBytes:()=>me,indexerModels:()=>t,isOnApplicationComplete:()=>$t,isTransactionType:()=>Ut,isTransactionWithSigner:()=>Oc,isValidAddress:()=>gt,logicSigFromByte:()=>Ln,makeApplicationCallTxnFromObject:()=>Ac,makeApplicationClearStateTxnFromObject:()=>Vc,makeApplicationCloseOutTxnFromObject:()=>Mc,makeApplicationCreateTxnFromObject:()=>Dc,makeApplicationDeleteTxnFromObject:()=>Tc,makeApplicationNoOpTxnFromObject:()=>Rc,makeApplicationOptInTxnFromObject:()=>Pc,makeApplicationUpdateTxnFromObject:()=>Ic,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>Ec,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>Sc,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>kc,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>bc,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>xc,makeBaseAssetConfigTxn:()=>vc,makeBasicAccountTransactionSigner:()=>Bc,makeEmptyTransactionSigner:()=>$c,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>wc,makeLogicSigAccountTransactionSigner:()=>Cc,makeMultiSigAccountTransactionSigner:()=>Uc,makePaymentTxnWithSuggestedParamsFromObject:()=>yc,masterDerivationKeyToMnemonic:()=>Rs,mergeMultisigTransactions:()=>ac,microalgosToAlgos:()=>s,mnemonicFromSeed:()=>Is,mnemonicToMasterDerivationKey:()=>Vs,mnemonicToSecretKey:()=>Ps,modelsv2:()=>e,msgpackRawDecode:()=>ve,msgpackRawDecodeAsMap:()=>Ee,msgpackRawEncode:()=>fe,multisigAddress:()=>kn,parseJSON:()=>m,pq25WordMnemonicToSeed:()=>Cs,secretKeyToMnemonic:()=>Ms,seedFromMnemonic:()=>Ts,signBytes:()=>qs,signLogicSigTransaction:()=>Hs,signLogicSigTransactionObject:()=>Ks,signMultisigTransaction:()=>ic,signMultisigTransactionWithSigner:()=>rc,signTransaction:()=>_s,signTransactionWithSigner:()=>Fs,stringifyJSON:()=>p,tealSign:()=>Fn,tealSignFromProgram:()=>zn,verifyBytes:()=>zs,verifyMultisig:()=>En,verifyTealSign:()=>qn,waitForConfirmation:()=>ys});var e={};n.r(e),n.d(e,{Account:()=>Ma,AccountApplicationResource:()=>Va,AccountApplicationResponse:()=>Ra,AccountApplicationsInformationResponse:()=>Ba,AccountAssetHolding:()=>Ca,AccountAssetResponse:()=>Ua,AccountAssetsInformationResponse:()=>$a,AccountParticipation:()=>Oa,AccountStateDelta:()=>Na,AppCallLogs:()=>La,Application:()=>_a,ApplicationInitialStates:()=>Fa,ApplicationKVStorage:()=>qa,ApplicationLocalReference:()=>za,ApplicationLocalState:()=>Ka,ApplicationParams:()=>Ha,ApplicationStateOperation:()=>ja,ApplicationStateSchema:()=>Ga,Asset:()=>Ja,AssetHolding:()=>Wa,AssetHoldingReference:()=>Ya,AssetParams:()=>Xa,AvmKeyValue:()=>Qa,AvmValue:()=>Za,BlockHashResponse:()=>ei,BlockLogsResponse:()=>ti,BlockResponse:()=>ni,BlockTxidsResponse:()=>ai,Box:()=>ii,BoxDescriptor:()=>ri,BoxReference:()=>oi,BoxesResponse:()=>si,BuildVersion:()=>ci,CompileResponse:()=>hi,DisassembleResponse:()=>di,ErrorResponse:()=>ui,EvalDelta:()=>li,EvalDeltaKeyValue:()=>gi,Genesis:()=>mi,GenesisAllocation:()=>pi,GetBlockTimeStampOffsetResponse:()=>fi,GetSyncRoundResponse:()=>yi,LedgerStateDeltaForTransactionGroup:()=>wi,LightBlockHeaderProof:()=>vi,NodeStatusResponse:()=>Si,PendingTransactionResponse:()=>Ei,PendingTransactionsResponse:()=>ki,PostTransactionsResponse:()=>bi,ScratchChange:()=>xi,SimulateInitialStates:()=>Ai,SimulateRequest:()=>Di,SimulateRequestTransactionGroup:()=>Ii,SimulateResponse:()=>Ti,SimulateTraceConfig:()=>Pi,SimulateTransactionGroupResult:()=>Mi,SimulateTransactionResult:()=>Vi,SimulateUnnamedResourcesAccessed:()=>Ri,SimulationEvalOverrides:()=>Bi,SimulationOpcodeTraceUnit:()=>Ci,SimulationTransactionExecTrace:()=>Ui,StateProof:()=>$i,StateProofMessage:()=>Oi,SupplyResponse:()=>Ni,TealKeyValue:()=>Li,TealValue:()=>_i,TransactionGroupLedgerStateDeltasForRoundResponse:()=>Fi,TransactionParametersResponse:()=>qi,TransactionProof:()=>zi,Version:()=>Ki});var t={};n.r(t),n.d(t,{Account:()=>Br,AccountParticipation:()=>Cr,AccountResponse:()=>Ur,AccountStateDelta:()=>$r,AccountsResponse:()=>Or,Application:()=>Nr,ApplicationLocalState:()=>Lr,ApplicationLocalStatesResponse:()=>_r,ApplicationLogData:()=>Fr,ApplicationLogsResponse:()=>qr,ApplicationParams:()=>zr,ApplicationResponse:()=>Kr,ApplicationStateSchema:()=>Hr,ApplicationsResponse:()=>jr,Asset:()=>Gr,AssetBalancesResponse:()=>Jr,AssetHolding:()=>Wr,AssetHoldingsResponse:()=>Yr,AssetParams:()=>Xr,AssetResponse:()=>Qr,AssetsResponse:()=>Zr,Block:()=>eo,BlockHeadersResponse:()=>to,BlockRewards:()=>no,BlockUpgradeState:()=>ao,BlockUpgradeVote:()=>io,Box:()=>ro,BoxDescriptor:()=>oo,BoxReference:()=>so,BoxesResponse:()=>co,ErrorResponse:()=>ho,EvalDelta:()=>uo,EvalDeltaKeyValue:()=>lo,HashFactory:()=>go,HbProofFields:()=>mo,HealthCheck:()=>po,HoldingRef:()=>fo,IndexerStateProofMessage:()=>yo,LocalsRef:()=>wo,MerkleArrayProof:()=>vo,MiniAssetHolding:()=>So,ParticipationUpdates:()=>Eo,ResourceRef:()=>ko,StateProofFields:()=>bo,StateProofParticipant:()=>xo,StateProofReveal:()=>Ao,StateProofSigSlot:()=>Do,StateProofSignature:()=>Io,StateProofTracking:()=>To,StateProofVerifier:()=>Po,StateSchema:()=>Mo,TealKeyValue:()=>Vo,TealValue:()=>Ro,Transaction:()=>Bo,TransactionApplication:()=>Co,TransactionAssetConfig:()=>Uo,TransactionAssetFreeze:()=>$o,TransactionAssetTransfer:()=>Oo,TransactionHeartbeat:()=>No,TransactionKeyreg:()=>Lo,TransactionPayment:()=>_o,TransactionResponse:()=>Fo,TransactionSignature:()=>qo,TransactionSignatureLogicsig:()=>zo,TransactionSignatureMultisig:()=>Ko,TransactionSignatureMultisigSubsignature:()=>Ho,TransactionStateProof:()=>jo,TransactionsResponse:()=>Go});var i={};n.r(i),n.d(i,{ABIAddressType:()=>Jc,ABIArrayDynamicType:()=>Zc,ABIArrayStaticType:()=>Qc,ABIBoolType:()=>Wc,ABIByteType:()=>Yc,ABIContract:()=>dh,ABIInterface:()=>uh,ABIMethod:()=>ch,ABIReferenceType:()=>ih,ABIStringType:()=>Xc,ABITransactionType:()=>ah,ABITupleType:()=>eh,ABIType:()=>Hc,ABIUfixedType:()=>Gc,ABIUintType:()=>jc,ADDR_BYTE_SIZE:()=>Lc,ALGORAND_ZERO_ADDRESS_STRING:()=>rt,AccountBaseData:()=>Sa,AccountData:()=>Ea,AccountDeltas:()=>ba,AccountTotals:()=>Ta,Address:()=>ut,AlgoCount:()=>Ia,Algodv2:()=>Vr,AppLocalState:()=>da,AppLocalStateDelta:()=>ua,AppParams:()=>ha,AppParamsDelta:()=>la,AppResourceRecord:()=>ga,ApplyData:()=>na,AssetHolding:()=>ma,AssetHoldingDelta:()=>pa,AssetParams:()=>fa,AssetParamsDelta:()=>ya,AssetResourceRecord:()=>wa,AtomicTransactionComposer:()=>ph,AtomicTransactionComposerStatus:()=>gh,BalanceRecord:()=>ka,Block:()=>ra,BlockHeader:()=>Zn,ENCODED_MULTISIG_SCHEMA:()=>Dn,ENCODED_PQSIG_SCHEMA:()=>Pn,ENCODED_SUBSIG_SCHEMA:()=>bn,ERROR_INVALID_MICROALGOS:()=>wh,ERROR_MULTISIG_BAD_SENDER:()=>yh,EvalDelta:()=>ta,FALCON_1024_SCHEME:()=>pc,FalconSignatureStruct:()=>qt,FalconVerifier:()=>Ft,HashFactory:()=>Ot,INVALID_MICROALGOS_ERROR_MSG:()=>o,IncludedTransactions:()=>Aa,Indexer:()=>fs,IntDecoding:()=>l,Kmd:()=>Rr,KvValueDelta:()=>xa,LENGTH_ENCODE_BYTE_SIZE:()=>qc,LedgerStateDelta:()=>Pa,LogicSig:()=>On,LogicSigAccount:()=>Nn,MAX_LEN:()=>Nc,MSIG_PROGRAM_TAG:()=>$n,MULTISIG_BAD_SENDER_ERROR_MSG:()=>fh,MerkleArrayProof:()=>Nt,MerkleSignatureVerifier:()=>Lt,ModifiedCreatable:()=>Da,OnApplicationComplete:()=>Ct,PQ_PROGRAM_TAG:()=>Un,PQ_SALT_MAX:()=>ht,PQ_SCHEME_SIZE:()=>ct,PROGRAM_TAG:()=>Cn,Participant:()=>_t,ParticipationUpdates:()=>Qn,ProgramSourceMap:()=>lc,Reveal:()=>Kt,RewardState:()=>Wn,SIGN_BYTES_PREFIX:()=>Ls,SIGN_PROGRAM_DATA_PREFIX:()=>_n,SINGLE_BOOL_SIZE:()=>Fc,SINGLE_BYTE_SIZE:()=>_c,SignedTransaction:()=>Kn,SignedTxnInBlock:()=>ia,SignedTxnWithAD:()=>aa,SigslotCommit:()=>zt,StateProof:()=>Ht,StateProofMessage:()=>jt,StateProofTrackingData:()=>Gn,StateSchema:()=>ca,TealValue:()=>sa,Transaction:()=>un,TransactionType:()=>Bt,TxnCommitments:()=>Jn,UntypedValue:()=>oa,UpgradeState:()=>Yn,UpgradeVote:()=>Xn,ValueDelta:()=>ea,VotingData:()=>va,abiCheckTransactionType:()=>oh,abiTypeIsReference:()=>sh,abiTypeIsTransaction:()=>rh,addressFromPQKey:()=>yt,addressFromPQSig:()=>wt,addressWithSignersFromRawEd25519Signer:()=>gc,addressWithSignersFromRawFalcon1024Signer:()=>fc,addressWithSignersFromRawPQSigner:()=>mc,algosToMicroalgos:()=>c,appendSignMultisigTransaction:()=>oc,appendSignMultisigTransactionWithSigner:()=>sc,appendSignRawMultisigSignature:()=>cc,assignGroupID:()=>Ns,base64ToBytes:()=>he,bigIntToBytes:()=>ws,bytesToBase64:()=>de,bytesToBigInt:()=>vs,bytesToHex:()=>ge,bytesToString:()=>ue,coerceToBytes:()=>le,computeGroupID:()=>Os,createMultisigTransaction:()=>Zs,decodeAddress:()=>lt,decodeJSON:()=>Pe,decodeMsgpack:()=>Ie,decodeObj:()=>Se,decodeSignedTransaction:()=>Hn,decodeUint64:()=>Ye,decodeUnsignedTransaction:()=>gn,encodeAddress:()=>mt,encodeJSON:()=>Me,encodeMsgpack:()=>Te,encodeObj:()=>ye,encodeUint64:()=>We,encodeUnsignedSimulateTransaction:()=>jn,encodeUnsignedTransaction:()=>ln,encodedMultiSigFromEncodingData:()=>In,encodedMultiSigToEncodingData:()=>Tn,encodedPQSigFromEncodingData:()=>Mn,encodedPQSigToEncodingData:()=>Vn,encodedSubsigFromEncodingData:()=>xn,encodedSubsigToEncodingData:()=>An,generateAccount:()=>Ss,getApplicationAddress:()=>ft,getMethodByName:()=>hh,hexToBytes:()=>me,indexerModels:()=>t,isOnApplicationComplete:()=>$t,isTransactionType:()=>Ut,isTransactionWithSigner:()=>Oc,isValidAddress:()=>gt,logicSigFromByte:()=>Ln,makeApplicationCallTxnFromObject:()=>Ac,makeApplicationClearStateTxnFromObject:()=>Vc,makeApplicationCloseOutTxnFromObject:()=>Mc,makeApplicationCreateTxnFromObject:()=>Dc,makeApplicationDeleteTxnFromObject:()=>Tc,makeApplicationNoOpTxnFromObject:()=>Rc,makeApplicationOptInTxnFromObject:()=>Pc,makeApplicationUpdateTxnFromObject:()=>Ic,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>Ec,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>Sc,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>kc,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>bc,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>xc,makeBaseAssetConfigTxn:()=>vc,makeBasicAccountTransactionSigner:()=>Bc,makeEmptyTransactionSigner:()=>$c,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>wc,makeLogicSigAccountTransactionSigner:()=>Cc,makeMultiSigAccountTransactionSigner:()=>Uc,makePaymentTxnWithSuggestedParamsFromObject:()=>yc,masterDerivationKeyToMnemonic:()=>Rs,mergeMultisigTransactions:()=>ac,microalgosToAlgos:()=>s,mnemonicFromSeed:()=>Is,mnemonicToMasterDerivationKey:()=>Vs,mnemonicToSecretKey:()=>Ps,modelsv2:()=>e,msgpackRawDecode:()=>ve,msgpackRawDecodeAsMap:()=>Ee,msgpackRawEncode:()=>fe,multisigAddress:()=>kn,parseJSON:()=>m,pq25WordMnemonicToSeed:()=>Cs,secretKeyToMnemonic:()=>Ms,seedFromMnemonic:()=>Ts,signBytes:()=>qs,signLogicSigTransaction:()=>Hs,signLogicSigTransactionObject:()=>Ks,signMultisigTransaction:()=>ic,signMultisigTransactionWithSigner:()=>rc,signTransaction:()=>_s,signTransactionWithSigner:()=>Fs,stringifyJSON:()=>p,tealSign:()=>Fn,tealSignFromProgram:()=>zn,verifyBytes:()=>zs,verifyMultisig:()=>En,verifyTealSign:()=>qn,waitForConfirmation:()=>ys});const r=1e6,o="Microalgos should be positive and less than 2^53 - 1.";function s(e){if(e<0||!Number.isSafeInteger(e))throw new Error(o);return e/r}function c(e){const t=e*r;return Math.round(t)}var h,d=n(215),u=n.n(d);!function(e){e.UNSAFE="unsafe",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(h||(h={}));const l=h,g=u()({useNativeBigInt:!0,strict:!0});function m(e,{intDecoding:t}){if(t!==l.SAFE&&t!==l.UNSAFE&&t!==l.BIGINT&&t!==l.MIXED)throw new Error(`Invalid intDecoding option: ${t}`);return g.parse(e,(e,n)=>{if(null!=n&&"object"==typeof n&&null==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,Object.prototype),"bigint"==typeof n){if(t===l.SAFE&&n>Number.MAX_SAFE_INTEGER)throw new Error(`Integer exceeds maximum safe integer: ${n.toString()}. Try parsing with a different intDecoding option.`);return t===l.BIGINT||t===l.MIXED&&n>Number.MAX_SAFE_INTEGER?n:Number(n)}return"number"==typeof n&&t===l.BIGINT&&Number.isInteger(n)?BigInt(n):n})}function p(e,t,n){return g.stringify(e,t,n)}function f(e,t){return e.length===t.length&&Array.from(e).every((e,n)=>e===t[n])}function y(...e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let a=0;for(let t=0;t<e.length;t++)n.set(e[t],a),a+=e[t].length;return n}function w(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function v(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error(`BigInt value ${e} is not a safe integer`);return Number(e)}if("number"==typeof e){if(Number.isSafeInteger(e))return e;throw new Error(`Value ${e} is not a safe integer`)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function S(e){const t=v(e);if(t<0)throw new Error(`Value ${t} is negative`);return t}function E(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e)return e;if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error(`Value ${e} is not a safe integer`);return BigInt(e)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function k(e){const t=E(e);if(t<0||t>BigInt("0xffffffffffffffff"))throw new Error(`Value ${t} is not a uint64`);return t}class b extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class x{constructor(e,t,n,a={}){this.defaultHeaders=a;const i=t.endsWith("/")?t:`${t}/`,r=new URL(i);if(void 0!==n&&(r.port=n.toString()),0===r.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=r,this.tokenHeader=e}getURL(e,t){let n;n=e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`;const a=new URL(n,this.baseURL);if(t)for(const[e,n]of Object.entries(t))a.searchParams.set(e,n.toString());return a.toString()}static formatFetchResponseHeaders(e){const t={};return e.forEach((e,n)=>{t[e]=n}),t}static async checkHttpError(e){if(e.ok)return;let t,n;try{t=new Uint8Array(await e.arrayBuffer());const a=JSON.parse((new TextDecoder).decode(t));a.message&&(n=a.message)}catch(e){}let a=`Network request error. Received status ${e.status} (${e.statusText})`;throw n&&(a+=`: ${n}`),new b(a,{body:t??new Uint8Array,status:e.status,headers:x.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:x.formatFetchResponseHeaders(e.headers)}}async get(e,t,n,a){const i={...this.tokenHeader,...this.defaultHeaders,...n??{}},r=await fetch(this.getURL(e,t),{headers:i,...a??{}});return x.formatFetchResponse(r)}async post(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"POST",body:t,headers:r,...i??{}});return x.formatFetchResponse(o)}async delete(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"DELETE",body:t,headers:r,...i??{}});return x.formatFetchResponse(o)}}class A{constructor(e){this.body=e.body,this.text=e.text,this.format=e.format,this.headers=e.headers,this.status=e.status,this.ok=e.ok}getJSONText(){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return this.text}parseBodyAsJSON(e){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return I.parseJSON(this.text,this.status,e)}}function D(e){return Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})}class I{constructor(e,t,n,a={}){this.bc=void 0!==t?new x(e,t,n,a):e}static parseJSON(e,t,n){try{return e?m(e,n):null}catch(n){const a=n;throw a.rawResponse=e||null,a.statusCode=t,a}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return(new TextEncoder).encode(p(e));if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Uint8Array)return e;throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t){const{body:n}=e;let a;return"application/msgpack"!==t&&(a=n&&(new TextDecoder).decode(n)||""),new A({...e,format:t,text:a,ok:2===Math.trunc(e.status/100)})}static prepareResponseError(e){return e.response&&(e.response=I.prepareResponse(e.response,"application/json"),e.status=e.response.status),e}async get({relativePath:e,query:t,requestHeaders:n,customOptions:a}){const i=function(e){return void 0!==e&&Object.prototype.hasOwnProperty.call(e,"format")&&"msgpack"===e.format?"application/msgpack":"application/json"}(t),r={...n??{},accept:i};try{const n=await this.bc.get(e,t?function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(e[t]&&0!==e[t].length||delete e[t]);return e}(t):void 0,r,a);return I.prepareResponse(n,i)}catch(e){throw I.prepareResponseError(e)}}async post({relativePath:e,data:t,query:n,requestHeaders:a,customOptions:i}){const r={"content-type":"application/json",...D(a??{})};try{const a=await this.bc.post(e,I.serializeData(t,r),n,r,i);return I.prepareResponse(a,"application/json")}catch(e){throw I.prepareResponseError(e)}}async delete({relativePath:e,data:t,requestHeaders:n,customOptions:a}){const i={"content-type":"application/json",...D(n??{})};try{const n=await this.bc.delete(e,void 0!==t?I.serializeData(t,i):void 0,void 0,i,a);return I.prepareResponse(n,"application/json")}catch(e){throw I.prepareResponseError(e)}}}class T{constructor(e,t,n,a,i={}){if("function"==typeof t.get)this.c=new I(t);else{let r;r="string"==typeof t?function(e,t=""){const n={};return""===t||(n[e]=t),n}(e,t):t,this.c=new I(r,n,a,i)}}}var P=new TextEncoder;function M(e,t,n){for(var a=t,i=a+n,r=[],o="";a<i;){var s=e[a++];if(128&s)if(192==(224&s)){var c=63&e[a++];r.push((31&s)<<6|c)}else if(224==(240&s)){c=63&e[a++];var h=63&e[a++];r.push((31&s)<<12|c<<6|h)}else if(240==(248&s)){var d=(7&s)<<18|(c=63&e[a++])<<12|(h=63&e[a++])<<6|63&e[a++];d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d)}else r.push(s);else r.push(s);r.length>=4096&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return r.length>0&&(o+=String.fromCharCode.apply(String,r)),o}var V=new TextDecoder;var R,B,C=function(e,t){this.type=e,this.data=t},U=(R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$=function(e){function t(n){var a=e.call(this,n)||this,i=Object.create(t.prototype);return Object.setPrototypeOf(a,i),Object.defineProperty(a,"name",{configurable:!0,enumerable:!1,value:t.name}),a}return U(t,e),t}(Error);!function(e){e[e.UNSAFE_NUMBER=0]="UNSAFE_NUMBER",e[e.SAFE_NUMBER=1]="SAFE_NUMBER",e[e.AS_ENCODED=2]="AS_ENCODED",e[e.MIXED=3]="MIXED",e[e.BIGINT=4]="BIGINT"}(B||(B={}));var O=4294967295;function N(e,t,n){var a=Math.floor(n/4294967296),i=n;e.setUint32(t,a),e.setUint32(t+4,i)}function L(e,t,n){if(n===B.UNSAFE_NUMBER||n===B.SAFE_NUMBER){var a=e.getInt32(t),i=e.getUint32(t+4);if(n===B.SAFE_NUMBER&&(a<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||a===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===i||a>(Number.MAX_SAFE_INTEGER-i)/4294967296)){var r="".concat(a<0?"-":"","0x").concat(Math.abs(a).toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigInt64(t);return n===B.MIXED&&o>=Number.MIN_SAFE_INTEGER&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}var _={type:-1,encode:function(e){var t,n,a,i;return e instanceof Date?function(e){var t,n=e.sec,a=e.nsec;if(n>=0&&a>=0&&n<=17179869183){if(0===a&&n<=4294967295){var i=new Uint8Array(4);return(t=new DataView(i.buffer)).setUint32(0,n),i}var r=n/4294967296,o=4294967295&n;return i=new Uint8Array(8),(t=new DataView(i.buffer)).setUint32(0,a<<2|3&r),t.setUint32(4,o),i}return i=new Uint8Array(12),(t=new DataView(i.buffer)).setUint32(0,a),N(t,4,n),i}((a=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(i=Math.floor(a/1e9)),nsec:a-1e9*i})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:L(t,4,B.UNSAFE_NUMBER),nsec:t.getUint32(0)};default:throw new $("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},F=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(_)}return e.prototype.register=function(e){var t=e.type,n=e.encode,a=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=a;else{var i=1+t;this.builtInEncoders[i]=n,this.builtInDecoders[i]=a}},e.prototype.tryToEncode=function(e,t){for(var n=0;n<this.builtInEncoders.length;n++)if(null!=(a=this.builtInEncoders[n])&&null!=(i=a(e,t)))return new C(-1-n,i);for(n=0;n<this.encoders.length;n++){var a,i;if(null!=(a=this.encoders[n])&&null!=(i=a(e,t)))return new C(n,i)}return e instanceof C?e:null},e.prototype.decode=function(e,t,n){var a=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return a?a(e,t,n):new C(t,e)},e.defaultCodec=new e,e}();function q(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}function z(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++){var i=e[a]-t[a];if(0!==i)return i}return e.length-t.length}var K=function(e){if(this.rawBinaryValue=e,!ArrayBuffer.isView(e))throw new TypeError("RawBinaryString: rawBinaryValue must be an ArrayBufferView")},H=function(){function e(e){var t,n,a,i,r,o,s,c;this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:F.defaultCodec,this.context=null==e?void 0:e.context,this.forceBigIntToInt64=null!==(n=null==e?void 0:e.forceBigIntToInt64)&&void 0!==n&&n,this.maxDepth=null!==(a=null==e?void 0:e.maxDepth)&&void 0!==a?a:100,this.initialBufferSize=null!==(i=null==e?void 0:e.initialBufferSize)&&void 0!==i?i:2048,this.sortKeys=null!==(r=null==e?void 0:e.sortKeys)&&void 0!==r&&r,this.forceFloat32=null!==(o=null==e?void 0:e.forceFloat32)&&void 0!==o&&o,this.ignoreUndefined=null!==(s=null==e?void 0:e.ignoreUndefined)&&void 0!==s&&s,this.forceIntegerToFloat=null!==(c=null==e?void 0:e.forceIntegerToFloat)&&void 0!==c&&c,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),n=new Uint8Array(t),a=new DataView(t);n.set(this.bytes),this.view=a,this.bytes=n},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},e.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodeBigInt=function(e){if(this.forceBigIntToInt64)this.encodeBigIntAsInt64(e);else if(e>=0)if(e<4294967296||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e<BigInt("0x10000000000000000")))throw new Error("Bigint is too large for uint64: ".concat(e));this.encodeBigIntAsInt64(e)}else if(e>=-2147483648||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e>=BigInt(-1)*BigInt("0x8000000000000000")))throw new Error("Bigint is too small for int64: ".concat(e));this.encodeBigIntAsInt64(e)}},e.prototype.encodeBigIntAsInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){var t,n,a,i=function(e){for(var t=e.length,n=0,a=0;a<t;){var i=e.charCodeAt(a++);if(4294967168&i)if(4294965248&i){if(i>=55296&&i<=56319&&a<t){var r=e.charCodeAt(a);56320==(64512&r)&&(++a,i=((1023&i)<<10)+(1023&r)+65536)}n+=4294901760&i?4:3}else n+=2;else n++}return n}(e);this.ensureBufferSizeToWrite(5+i),this.writeStringHeader(i),t=e,n=this.bytes,a=this.pos,t.length>50?function(e,t,n){P.encodeInto(e,t.subarray(n))}(t,n,a):function(e,t,n){for(var a=e.length,i=n,r=0;r<a;){var o=e.charCodeAt(r++);if(4294967168&o){if(4294965248&o){if(o>=55296&&o<=56319&&r<a){var s=e.charCodeAt(r);56320==(64512&s)&&(++r,o=((1023&o)<<10)+(1023&s)+65536)}4294901760&o?(t[i++]=o>>18&7|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128):(t[i++]=o>>12&15|224,t[i++]=o>>6&63|128)}else t[i++]=o>>6&31|192;t[i++]=63&o|128}else t[i++]=o}}(t,n,a),this.pos+=i},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(e instanceof K)this.encodeBinaryAsString(e);else if("bigint"==typeof e)this.encodeBigInt(e);else if(e instanceof Map)this.encodeMap(e,t);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMapObject(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=q(e);this.writeU8a(n)},e.prototype.encodeBinaryAsString=function(e){var t=e.rawBinaryValue;this.writeStringHeader(t.byteLength);var n=q(t);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var a=0,i=e;a<i.length;a++){var r=i[a];this.doEncode(r,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var n=0,a=0,i=t;a<i.length;a++){var r=i[a];void 0!==e.get(r)&&n++}return n},e.prototype.sortMapKeys=function(e){for(var t=[],n=[],a=[],i=[],r=0,o=e;r<o.length;r++){var s=o[r];if("number"==typeof s){if(isNaN(s))throw new Error("Cannot sort map keys with NaN value");t.push(s)}else if("bigint"==typeof s)t.push(s);else if("string"==typeof s)n.push(s);else if(ArrayBuffer.isView(s))i.push(q(s));else{if(!(s instanceof K))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(s)));a.push(s)}}return t.sort(function(e,t){return e<t?-1:e>t?1:0}),n.sort(),a.sort(function(e,t){return z(q(e.rawBinaryValue),q(t.rawBinaryValue))}),i.sort(z),[].concat(t,n,a,i)},e.prototype.encodeMapObject=function(e,t){this.encodeMap(new Map(Object.entries(e)),t)},e.prototype.encodeMap=function(e,t){var n=Array.from(e.keys());this.sortKeys&&(n=this.sortMapKeys(n));var a=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(a<16)this.writeU8(128+a);else if(a<65536)this.writeU8(222),this.writeU16(a);else{if(!(a<4294967296))throw new Error("Too large map object: ".concat(a));this.writeU8(223),this.writeU32(a)}for(var i=0,r=n;i<r.length;i++){var o=r[i],s=e.get(o);if(!this.ignoreUndefined||void 0!==s){if("string"==typeof o)this.encodeString(o);else if("number"==typeof o)this.encodeNumber(o);else if("bigint"==typeof o)this.encodeBigInt(o);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else{if(!(o instanceof K))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(o)));this.encodeBinaryAsString(o)}this.doEncode(s,t+1)}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,n){var a=n/4294967296,i=n;e.setUint32(t,a),e.setUint32(t+4,i)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),N(this.view,this.pos,e),this.pos+=8},e.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},e.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},e}();function j(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var G=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var n=0;n<this.maxKeyLength;n++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var a=0,i=this.caches[n-1];a<i.length;a++){for(var r=i[a],o=r.bytes,s=0;s<n;s++)if(o[s]!==e[t+s])continue e;return r.str}return null},e.prototype.store=function(e,t){var n=this.caches[e.length-1],a={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=a:n.push(a)},e.prototype.decode=function(e,t,n){var a=this.find(e,t,n);if(null!=a)return this.hit++,a;this.miss++;var i=M(e,t,n),r=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(r,i),i},e}(),J=function(e,t){var n,a,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(n=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],a=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},W=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},a("next"),a("throw"),a("return"),t[Symbol.asyncIterator]=function(){return this},t);function a(n){t[n]=e[n]&&function(t){return new Promise(function(a,i){!function(e,t,n,a){Promise.resolve(a).then(function(t){e({value:t,done:n})},t)}(a,i,(t=e[n](t)).done,t.value)})}}},Y=function(e){return this instanceof Y?(this.v=e,this):new Y(e)},X="array",Q="map_key",Z="map_value";function ee(e,t,n){return t?"string"==typeof e||"number"==typeof e||"bigint"==typeof e||e instanceof Uint8Array||e instanceof K:"string"==typeof e||n&&"number"==typeof e}var te=function(){function e(e){this.useMap=e,this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(e.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),e.prototype.top=function(){return this.stack[this.stackHeadPosition]},e.prototype.pushArrayState=function(e){var t=this.getUninitializedStateFromPool();t.type=X,t.position=0,t.size=e,t.array=new Array(e)},e.prototype.pushMapState=function(e){var t=this.getUninitializedStateFromPool();t.type=Q,t.readCount=0,t.size=e,t.map=this.useMap?new Map:{}},e.prototype.getUninitializedStateFromPool=function(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null})}return this.stack[this.stackHeadPosition]},e.prototype.release=function(e){var t;if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");e.type===X&&((t=e).size=0,t.array=void 0,t.position=0,t.type=void 0),e.type!==Q&&e.type!==Z||((t=e).size=0,t.map=void 0,t.readCount=0,t.type=void 0),this.stackHeadPosition--},e.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},e}(),ne=new DataView(new ArrayBuffer(0)),ae=new Uint8Array(ne.buffer);try{ne.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ie=RangeError,re=new ie("Insufficient data"),oe=new G,se=function(){function e(e){var t,n,a,i,r,o,s,c,h,d,u,l;if(this.totalPos=0,this.pos=0,this.view=ne,this.bytes=ae,this.headByte=-1,this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:F.defaultCodec,this.context=null==e?void 0:e.context,this.intMode=null!==(n=null==e?void 0:e.intMode)&&void 0!==n?n:(null==e?void 0:e.useBigInt64)?B.AS_ENCODED:B.UNSAFE_NUMBER,this.rawBinaryStringValues=null!==(a=null==e?void 0:e.rawBinaryStringValues)&&void 0!==a&&a,this.rawBinaryStringKeys=null!==(i=null==e?void 0:e.rawBinaryStringKeys)&&void 0!==i&&i,this.useRawBinaryStringClass=null!==(r=null==e?void 0:e.useRawBinaryStringClass)&&void 0!==r&&r,this.useMap=null!==(o=null==e?void 0:e.useMap)&&void 0!==o&&o,this.supportObjectNumberKeys=null!==(s=null==e?void 0:e.supportObjectNumberKeys)&&void 0!==s&&s,this.maxStrLength=null!==(c=null==e?void 0:e.maxStrLength)&&void 0!==c?c:O,this.maxBinLength=null!==(h=null==e?void 0:e.maxBinLength)&&void 0!==h?h:O,this.maxArrayLength=null!==(d=null==e?void 0:e.maxArrayLength)&&void 0!==d?d:O,this.maxMapLength=null!==(u=null==e?void 0:e.maxMapLength)&&void 0!==u?u:O,this.maxExtLength=null!==(l=null==e?void 0:e.maxExtLength)&&void 0!==l?l:O,this.keyDecoder=void 0!==(null==e?void 0:e.keyDecoder)?e.keyDecoder:oe,this.rawBinaryStringKeys&&!this.useMap)throw new Error("rawBinaryStringKeys is only supported when useMap is true");this.stack=new te(this.useMap)}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.reset()},e.prototype.setBuffer=function(e){this.bytes=q(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=q(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=q(e),a=new Uint8Array(t.length+n.length);a.set(t),a.set(n,t.length),this.setBuffer(a)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return J(this,function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}})},e.prototype.decodeAsync=function(e){var t,n,a,i,r,o,s,c,h,d,u;return c=this,h=void 0,u=function(){var c,h,d,u,l,g,m,p;return J(this,function(f){switch(f.label){case 0:c=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),t=!0,n=W(e),f.label=2;case 2:return[4,n.next()];case 3:if(a=f.sent(),i=a.done)return[3,5];if(s=a.value,t=!1,d=s,c)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{h=this.doDecodeSync(),c=!0}catch(e){if(!(e instanceof ie))throw e}this.totalPos+=this.pos,f.label=4;case 4:return t=!0,[3,2];case 5:return[3,12];case 6:return u=f.sent(),r={error:u},[3,12];case 7:return f.trys.push([7,,10,11]),t||i||!(o=n.return)?[3,9]:[4,o.call(n)];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(c){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,h]}throw g=(l=this).headByte,m=l.pos,p=l.totalPos,new RangeError("Insufficient data in parsing ".concat(j(g)," at ").concat(p," (").concat(m," in the current buffer)"))}})},new((d=void 0)||(d=Promise))(function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function a(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d(function(e){e(i)})).then(n,a)}i((u=u.apply(c,h||[])).next())})},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a,i=n.apply(e,t||[]),r=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(e){i[e]&&(a[e]=function(t){return new Promise(function(n,a){r.push([e,t,n,a])>1||s(e,t)})})}function s(e,t){try{(n=i[e](t)).value instanceof Y?Promise.resolve(n.value.v).then(c,h):d(r[0][2],n)}catch(e){d(r[0][3],e)}var n}function c(e){s("next",e)}function h(e){s("throw",e)}function d(e,t){e(t),r.shift(),r.length&&s(r[0][0],r[0][1])}}(this,arguments,function(){var n,a,i,r,o,s,c,h,d,u,l,g;return J(this,function(m){switch(m.label){case 0:n=t,a=-1,m.label=1;case 1:m.trys.push([1,13,14,19]),i=!0,r=W(e),m.label=2;case 2:return[4,Y(r.next())];case 3:if(o=m.sent(),d=o.done)return[3,12];if(g=o.value,i=!1,s=g,t&&0===a)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(a=this.readArraySize(),n=!1,this.complete()),m.label=4;case 4:m.trys.push([4,9,,10]),m.label=5;case 5:return[4,Y(this.doDecodeSync())];case 6:return[4,m.sent()];case 7:return m.sent(),0===--a?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((c=m.sent())instanceof ie))throw c;return[3,10];case 10:this.totalPos+=this.pos,m.label=11;case 11:return i=!0,[3,2];case 12:return[3,19];case 13:return h=m.sent(),u={error:h},[3,19];case 14:return m.trys.push([14,,17,18]),i||d||!(l=r.return)?[3,16]:[4,Y(l.call(r))];case 15:m.sent(),m.label=16;case 16:return[3,18];case 17:if(u)throw u.error;return[7];case 18:return[7];case 19:return[2]}})})},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=this.convertNumber(e-256);else if(e<192)if(e<128)t=this.convertNumber(e);else if(e<144){if(0!=(a=e-128)){this.pushMapState(a),this.complete();continue e}t=this.useMap?new Map:{}}else if(e<160){if(0!=(a=e-144)){this.pushArrayState(a),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.convertNumber(this.readU8());else if(205===e)t=this.convertNumber(this.readU16());else if(206===e)t=this.convertNumber(this.readU32());else if(207===e)t=this.readU64();else if(208===e)t=this.convertNumber(this.readI8());else if(209===e)t=this.convertNumber(this.readI16());else if(210===e)t=this.convertNumber(this.readI32());else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeString(n,1);else if(218===e)n=this.lookU16(),t=this.decodeString(n,2);else if(219===e)n=this.lookU32(),t=this.decodeString(n,4);else if(220===e){if(0!==(a=this.readU16())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(221===e){if(0!==(a=this.readU32())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(222===e){if(0!==(a=this.readU16())){this.pushMapState(a),this.complete();continue e}t={}}else if(223===e){if(0!==(a=this.readU32())){this.pushMapState(a),this.complete();continue e}t={}}else if(196===e){var a=this.lookU8();t=this.decodeBinary(a,1)}else if(197===e)a=this.lookU16(),t=this.decodeBinary(a,2);else if(198===e)a=this.lookU32(),t=this.decodeBinary(a,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)a=this.lookU8(),t=this.decodeExtension(a,1);else if(200===e)a=this.lookU16(),t=this.decodeExtension(a,2);else{if(201!==e)throw new $("Unrecognized type byte: ".concat(j(e)));a=this.lookU32(),t=this.decodeExtension(a,4)}this.complete();for(var i=this.stack;i.length>0;){var r=i.top();if(r.type===X){if(r.array[r.position]=t,r.position++,r.position!==r.size)continue e;t=r.array,i.release(r)}else{if(r.type===Q){if(!ee(t,this.useMap,this.supportObjectNumberKeys)){var o=this.useMap?"string, number, bigint, or Uint8Array":this.supportObjectNumberKeys?"string or number":"string";throw new $("The type of key must be ".concat(o," but got ").concat(typeof t))}if(!this.useMap&&"__proto__"===t)throw new $("The key __proto__ is not allowed");r.key=t,r.type=Z;continue e}if(this.useMap?r.map.set(r.key,t):r.map[r.key]=t,r.readCount++,r.readCount!==r.size){r.key=null,r.type=Q;continue e}t=r.map,i.release(r)}}return t}},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new $("Unrecognized array type byte: ".concat(j(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new $("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new $("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},e.prototype.decodeString=function(e,t){if(this.stateIsMapKey()?this.rawBinaryStringKeys:this.rawBinaryStringValues){var n=this.decodeBinary(e,t);return this.useRawBinaryStringClass?new K(n):n}return this.decodeUtf8String(e,t)},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new $("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw re;var a,i=this.pos+t;return a=this.stateIsMapKey()&&(null===(n=this.keyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,i,e):function(e,t,n){return n>200?function(e,t,n){var a=e.subarray(t,t+n);return V.decode(a)}(e,t,n):M(e,t,n)}(this.bytes,i,e),this.pos+=t+e,a},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&this.stack.top().type===Q},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new $("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw re;var n=this.pos+t,a=this.bytes.subarray(n,n+e);return this.pos+=t+e,a},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new $("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),a=this.decodeBinary(e,t+1);return this.extensionCodec.decode(a,n,this.context)},e.prototype.convertNumber=function(e){return function(e,t){return t===B.BIGINT?BigInt(e):Number(e)}(e,this.intMode)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e=function(e,t,n){if(n===B.UNSAFE_NUMBER||n===B.SAFE_NUMBER){var a=e.getUint32(t),i=e.getUint32(t+4);if(n===B.SAFE_NUMBER&&a>(Number.MAX_SAFE_INTEGER-i)/4294967296){var r="0x".concat(a.toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigUint64(t);return n===B.MIXED&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readI64=function(){var e=L(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();function ce(e,t){return new se(t).decode(e)}function he(e){if(w())return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e);return Uint8Array.from(t,e=>e.codePointAt(0))}function de(e){if(w())return Buffer.from(e).toString("base64");const t=Array.from(e,e=>String.fromCodePoint(e)).join("");return btoa(t)}function ue(e){return(new TextDecoder).decode(e)}function le(e){return"string"==typeof e?(new TextEncoder).encode(e):e}function ge(e){return w()?Buffer.from(e).toString("hex"):Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}function me(e){if(w())return Buffer.from(e,"hex");let t=e;e.length%2!=0&&(t=e.padStart(1,"0"));const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}const pe="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function fe(e){return t=e,new H({sortKeys:!0}).encodeSharedRef(t);var t}function ye(e){const t=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw new Error(pe+t.firstEmptyKey);return fe(e)}function we(e){switch(e){case l.UNSAFE:return B.UNSAFE_NUMBER;case l.SAFE:return B.SAFE_NUMBER;case l.MIXED:return B.MIXED;case l.BIGINT:return B.BIGINT;default:throw new Error(`Invalid intDecoding: ${e}`)}}function ve(e,t){return ce(e,{intMode:t?.intDecoding?we(t?.intDecoding):B.BIGINT})}function Se(e){return ve(e,{intDecoding:l.MIXED})}function Ee(e,t){return ce(e,{intMode:t?.intDecoding?we(t?.intDecoding):B.BIGINT,useMap:!0})}function ke(e){if(null==e)return e;if(e instanceof Uint8Array)return de(e);if(Array.isArray(e))return e.map(ke);if(e instanceof Map){const t={};for(const[n,a]of e){if("string"!=typeof n)throw new Error(`JSON map key must be a string: ${n}`);t[n]=ke(a)}return t}return e}function be(e){if(null==e)return e;if("string"==typeof e||"number"==typeof e||"bigint"==typeof e||"boolean"==typeof e)return e;if(Array.isArray(e))return e.map(be);if("object"==typeof e){const t=new Map;for(const[n,a]of Object.entries(e))t.set(n,be(a));return t}throw new Error(`Invalid JSON encoding data: ${e}`)}var xe;!function(e){e[e.MAP_VALUE=0]="MAP_VALUE",e[e.ARRAY_ELEMENT=1]="ARRAY_ELEMENT"}(xe||(xe={}));class Ae{constructor({parent:e,segment:t,baseObjectBytes:n}){this.resolvedCache=null,this.resolvedCachePresent=!1,this.parent=e,this.segment=t,this.baseObjectBytes=n}withMapValue(e){return new Ae({parent:this,segment:{kind:xe.MAP_VALUE,key:e}})}withArrayElement(e){return new Ae({parent:this,segment:{kind:xe.ARRAY_ELEMENT,key:e}})}getRawStringAtCurrentLocation(){const e=this.resolve();if(e instanceof K)return e.rawBinaryValue;throw new Error(`Invalid type. Expected RawBinaryString, got ${e} (${typeof e})`)}getRawStringKeysAndValuesAtCurrentLocation(){const e=this.resolve();if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);const t=new Map;for(const[n,a]of e){if(!(n instanceof K))throw new Error(`Invalid type for map key. Expected RawBinaryString, got ${n} (${typeof n})`);t.set(n.rawBinaryValue,a)}return t}resolve(){if(this.resolvedCachePresent)return this.resolvedCache;let e;if(e=this.parent?this.parent.resolve():ce(this.baseObjectBytes,{intMode:B.BIGINT,useMap:!0,rawBinaryStringKeys:!0,rawBinaryStringValues:!0,useRawBinaryStringClass:!0}),!this.segment)return this.resolvedCache=e,this.resolvedCachePresent=!0,e;if(this.segment.kind===xe.MAP_VALUE){if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);if("string"==typeof this.segment.key||this.segment.key instanceof Uint8Array||this.segment.key instanceof K){const t=this.segment.key instanceof K?this.segment.key.rawBinaryValue:le(this.segment.key),n="string"==typeof this.segment.key||this.segment.key instanceof K;for(const[a,i]of e){let e;if(n?a instanceof K&&(e=a.rawBinaryValue):a instanceof Uint8Array&&(e=a),e&&f(t,e)){this.resolvedCache=i;break}}}else this.resolvedCache=e.get(this.segment.key);return this.resolvedCachePresent=!0,this.resolvedCache}if(this.segment.kind===xe.ARRAY_ELEMENT){if(!Array.isArray(e))throw new Error(`Invalid type. Expected Array, got ${e} (${typeof e})`);return this.resolvedCache=e[this.segment.key],this.resolvedCachePresent=!0,this.resolvedCache}throw new Error(`Invalid segment kind: ${this.segment.kind}`)}getPathString(){const e=this.parent?this.parent.getPathString():"root";return this.segment?this.segment.kind===xe.MAP_VALUE?`${e} -> map key "${this.segment.key}" (${typeof this.segment.key})`:this.segment.kind===xe.ARRAY_ELEMENT?`${e} -> array index ${this.segment.key} (${typeof this.segment.key})`:`${e} -> unknown segment kind ${this.segment.kind}`:e}}class De{}function Ie(e,t){const n=Ee(e),a=new Ae({baseObjectBytes:e});return t.fromEncodingData(t.encodingSchema.fromPreparedMsgpack(n,a))}function Te(e){return fe(e.getEncodingSchema().prepareMsgpack(e.toEncodingData()))}function Pe(e,t){const n=m(e,{intDecoding:l.BIGINT});return t.fromEncodingData(t.encodingSchema.fromPreparedJSON(n))}function Me(e,t){const{space:n,...a}=t??{};return p(e.getEncodingSchema().prepareJSON(e.toEncodingData(),a),void 0,n)}class Ve extends De{defaultValue(){return!1}isDefaultValue(e){return!1===e}prepareMsgpack(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedMsgpack(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}prepareJSON(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedJSON(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}}class Re extends De{defaultValue(){return""}isDefaultValue(e){return""===e}prepareMsgpack(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}prepareJSON(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}}class Be extends De{defaultValue(){return BigInt(0)}isDefaultValue(e){return"bigint"==typeof e?e===BigInt(0):"number"==typeof e&&0===e}prepareMsgpack(e){return k(e)}fromPreparedMsgpack(e,t){return k(e)}prepareJSON(e,t){return k(e)}fromPreparedJSON(e){return k(e)}}var Ce=n(584),Ue=n.n(Ce),$e=n(601),Oe=n.n($e),Ne=n(404),Le=n.n(Ne);function _e(e){return Le().sha512_256.array(e)}function Fe(e){return Oe().sign.keyPair.fromSeed(e)}function qe(e){return e===Oe().sign.signatureLength}function ze(e){return Oe().sign.keyPair.fromSecretKey(e)}function Ke(e,t){return Oe().sign.detached(e,t)}function He(e,t){return Oe().verify(e,t)}function je(e,t,n){return Oe().sign.detached.verify(e,t,n)}const Ge=Oe().sign.publicKeyLength,Je=(Oe().sign.secretKeyLength,32);function We(e){if("bigint"!=typeof e&&!Number.isInteger(e)||e<0||e>BigInt("0xffffffffffffffff"))throw new Error("Input is not a 64-bit unsigned integer");const t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}function Ye(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw new Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);const n=y(new Uint8Array(8-e.byteLength),e),a=new DataView(n.buffer).getBigUint64(0),i=a>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(i)throw new Error(`Integer exceeds maximum safe integer: ${a.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(a)}return"mixed"!==t||i?a:Number(a)}const Xe=(1n<<255n)-19n,Qe=32;function Ze(e,t){let n=1n,a=t,i=(e%Xe+Xe)%Xe;for(;a>0n;)1n&a&&(n=n*i%Xe),i=i*i%Xe,a>>=1n;return n}const et=(-121665n*Ze(121666n,Xe-2n)%Xe+Xe)%Xe,tt=Ze(2n,(Xe-1n)/4n);function nt(e){return e.length===Qe&&function(e){const t=(e%Xe+Xe)%Xe,n=t*t%Xe,a=(et*n+1n)%Xe;if(0n===a)return!1;const i=(n-1n+Xe)%Xe*Ze(a,Xe-2n)%Xe,r=Ze(i,(Xe+3n)/8n);if(r*r%Xe===i)return!0;const o=r*tt%Xe;return o*o%Xe===i}(function(e){const t=e.slice();t[31]&=127;let n=0n;for(let e=31;e>=0;e--)n=n<<8n|BigInt(t[e]);return n}(e))}const at=36,it=4,rt="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",ot="address seems to be malformed",st=(new TextEncoder).encode("PQA"),ct=2,ht=255;function dt(e){return Uint8Array.from(_e(e).slice(32-it,32))}class ut{constructor(e){if(!(e instanceof Uint8Array))throw new Error(`${ot}: ${e} is not Uint8Array, type ${typeof e}`);if(e.length!==at-it)throw new Error(`${ot}: 0x${ge(e)}, length ${e.length}`);this.publicKey=e}equals(e){return e instanceof ut&&f(this.publicKey,e.publicKey)}checksum(){return dt(this.publicKey)}toString(){return Ue().encode(y(this.publicKey,this.checksum())).slice(0,58)}static fromString(e){if("string"!=typeof e)throw new Error(`${ot}: expected string, got ${typeof e}, ${e}`);if(58!==e.length)throw new Error(`${ot}: expected length 58, got ${e.length}: ${e}`);const t=Ue().decode.asBytes(e);if(t.length!==at)throw new Error(`${ot}: expected byte length ${at}, got ${t.length}`);const n=new Uint8Array(t.slice(0,at-it)),a=new Uint8Array(t.slice(Ge,at));if(!f(dt(n),a))throw new Error("wrong checksum for address");return new ut(n)}static zeroAddress(){return new ut(new Uint8Array(at-it))}}function lt(e){return ut.fromString(e)}function gt(e){try{ut.fromString(e)}catch(e){return!1}return!0}function mt(e){return new ut(e).toString()}const pt=(new TextEncoder).encode("appID");function ft(e){const t=_e(y(pt,We(e)));return new ut(Uint8Array.from(t))}function yt(e,t){if(e.length!==ct)throw new Error(`invalid PQ scheme length: expected ${ct} bytes, got ${e.length}`);for(let n=0;n<=ht;n++){const a=y(st,e,Uint8Array.of(n),t),i=Uint8Array.from(_e(a));if(!nt(i))return{address:new ut(i),salt:n}}throw new Error("no canonical salt exists for this PQ public key and scheme")}function wt(e){const{address:t,salt:n}=yt(e.sch,e.pk);if(n!==e.slt)throw new Error(`invalid PQ signature salt: expected the canonical salt ${n}, got ${e.slt}`);return t}class vt extends De{defaultValue(){return ut.zeroAddress()}isDefaultValue(e){return ut.zeroAddress().equals(e)}prepareMsgpack(e){if(e instanceof ut)return e.publicKey;throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return new ut(e)}prepareJSON(e,t){if(e instanceof ut)return e.toString();throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedJSON(e){return ut.fromString(e)}}class St extends De{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array)return de(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if(null==e)return this.defaultValue();if("string"==typeof e)return he(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class Et extends De{constructor(e){super(),this.length=e}defaultValue(){return new Uint8Array(this.length)}isDefaultValue(e){return e instanceof Uint8Array&&e.byteLength===this.length&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}prepareJSON(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return de(e);throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedJSON(e){if("string"==typeof e){const t=he(e);if(t.byteLength===this.length)return t;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${t.byteLength}`)}throw new Error("Invalid base64 byte array")}}class kt extends De{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return new K(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return t.getRawStringAtCurrentLocation()}prepareJSON(e,t){if(e instanceof Uint8Array){const n=ue(e);if(!t.lossyBinaryStringConversion&&!f(le(n),e))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${de(e)}`);return n}throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return le(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class bt extends De{constructor(e){super(),this.itemSchema=e}defaultValue(){return[]}isDefaultValue(e){return Array.isArray(e)&&0===e.length}prepareMsgpack(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareMsgpack(e));throw new Error("ArraySchema data must be an array")}fromPreparedMsgpack(e,t){if(Array.isArray(e))return e.map((e,n)=>this.itemSchema.fromPreparedMsgpack(e,t.withArrayElement(n)));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}prepareJSON(e,t){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareJSON(e,t));throw new Error("ArraySchema data must be an array")}fromPreparedJSON(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.fromPreparedJSON(e));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}}function xt(e){return e.map(e=>({...e,omitEmpty:!0}))}class At extends De{constructor(e){super(),this.entries=e,this.checkEntries()}pushEntries(...e){this.entries.push(...e),this.checkEntries()}checkEntries(){for(const e of this.entries)if(e.embedded){if(""!==e.key)throw new Error("Embedded entries must have an empty key");if(!(e.valueSchema instanceof At))throw new Error("Embedded entry valueSchema must be a NamedMapSchema")}const e=new Set;for(const t of this.getEntries()){if(e.has(t.key))throw new Error(`Duplicate key: ${t.key}`);e.add(t.key)}}getEntries(){const e=[];for(const t of this.entries)if(t.embedded){const n=t.valueSchema;e.push(...n.getEntries())}else e.push(t);return e}defaultValue(){const e=new Map;for(const t of this.getEntries())e.set(t.key,t.valueSchema.defaultValue());return e}isDefaultValue(e){if(!(e instanceof Map))return!1;for(const t of this.getEntries())if(!t.valueSchema.isDefaultValue(e.get(t.key)))return!1;return!0}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`NamedMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const n of this.getEntries()){const a=e.get(n.key);n.omitEmpty&&n.valueSchema.isDefaultValue(a)||t.set(n.key,n.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n=new Map;for(const a of this.getEntries())if(e.has(a.key))n.set(a.key,a.valueSchema.fromPreparedMsgpack(e.get(a.key),t.withMapValue(a.key)));else{if(!a.omitEmpty)throw new Error(`Missing key: ${a.key}`);n.set(a.key,a.valueSchema.defaultValue())}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n={};for(const a of this.getEntries()){const i=e.get(a.key);a.omitEmpty&&a.valueSchema.isDefaultValue(i)||(n[a.key]=a.valueSchema.prepareJSON(i,t))}return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("NamedMapSchema data must be an object");const t=new Map;for(const n of this.getEntries())if(Object.prototype.hasOwnProperty.call(e,n.key))t.set(n.key,n.valueSchema.fromPreparedJSON(e[n.key]));else{if(!n.omitEmpty)throw new Error(`Missing key: ${n.key}`);t.set(n.key,n.valueSchema.defaultValue())}return t}}function Dt(...e){const t=new Map;for(const n of e)for(const[e,a]of n){if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,a)}return t}function It(e,t){const n=new Map;for(const[a,i]of e){const[e,r]=t(a,i);n.set(e,r)}return n}class Tt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){const e=k(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("Uint64MapSchema data must be a Map");const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e.toString()]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("Uint64MapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e)){const e=BigInt(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.fromPreparedJSON(a))}return t}}function Pt(e){if(e instanceof K)return ue(e.rawBinaryValue);if(e instanceof Map){const t=new Map;for(const[n,a]of e)t.set(Pt(n),Pt(a));return t}return Array.isArray(e)?e.map(Pt):e}class Mt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(new K(n),this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){const n=new Map,a=t.getRawStringKeysAndValuesAtCurrentLocation();for(const[e,i]of a)n.set(e,this.valueSchema.fromPreparedMsgpack(Pt(i),t.withMapValue(new K(e))));return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a}`);const e=ue(a);if(!t.lossyBinaryStringConversion&&!f(le(e),a))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${de(a)}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("SpecialCaseBinaryStringMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(le(n),this.valueSchema.fromPreparedJSON(a));return t}}class Vt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){}isDefaultValue(e){return void 0===e||this.valueSchema.isDefaultValue(e)}prepareMsgpack(e){if(void 0!==e)return this.valueSchema.prepareMsgpack(e)}fromPreparedMsgpack(e,t){if(null!=e)return this.valueSchema.fromPreparedMsgpack(e,t)}prepareJSON(e,t){return void 0===e?null:this.valueSchema.prepareJSON(e,t)}fromPreparedJSON(e){if(null!=e)return this.valueSchema.fromPreparedJSON(e)}}class Rt extends De{defaultValue(){}isDefaultValue(e){return void 0===e}prepareMsgpack(e){return e}fromPreparedMsgpack(e,t){return e}prepareJSON(e,t){return ke(e)}fromPreparedJSON(e){return be(e)}}var Bt,Ct;function Ut(e){return e===Bt.pay||e===Bt.keyreg||e===Bt.acfg||e===Bt.axfer||e===Bt.afrz||e===Bt.appl||e===Bt.stpf||e===Bt.hb}function $t(e){return e===Ct.NoOpOC||e===Ct.OptInOC||e===Ct.CloseOutOC||e===Ct.ClearStateOC||e===Ct.UpdateApplicationOC||e===Ct.DeleteApplicationOC}!function(e){e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl",e.stpf="stpf",e.hb="hb"}(Bt||(Bt={})),function(e){e[e.NoOpOC=0]="NoOpOC",e[e.OptInOC=1]="OptInOC",e[e.CloseOutOC=2]="CloseOutOC",e[e.ClearStateOC=3]="ClearStateOC",e[e.UpdateApplicationOC=4]="UpdateApplicationOC",e[e.DeleteApplicationOC=5]="DeleteApplicationOC"}(Ct||(Ct={}));class Ot{constructor(e){this.hashType=e.hashType}getEncodingSchema(){return Ot.encodingSchema}toEncodingData(){return new Map([["t",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new Ot({hashType:Number(e.get("t"))})}}Ot.encodingSchema=new At(xt([{key:"t",valueSchema:new Be}]));class Nt{constructor(e){this.path=e.path,this.hashFactory=e.hashFactory,this.treeDepth=e.treeDepth}getEncodingSchema(){return Nt.encodingSchema}toEncodingData(){return new Map([["pth",this.path],["hsh",this.hashFactory.toEncodingData()],["td",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new Nt({path:e.get("pth"),hashFactory:Ot.fromEncodingData(e.get("hsh")),treeDepth:Number(e.get("td"))})}}Nt.encodingSchema=new At(xt([{key:"pth",valueSchema:new bt(new St)},{key:"hsh",valueSchema:Ot.encodingSchema},{key:"td",valueSchema:new Be}]));class Lt{constructor(e){this.commitment=e.commitment,this.keyLifetime=e.keyLifetime}getEncodingSchema(){return Lt.encodingSchema}toEncodingData(){return new Map([["cmt",this.commitment],["lf",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleSignatureVerifier: ${e}`);return new Lt({commitment:e.get("cmt"),keyLifetime:e.get("lf")})}}Lt.encodingSchema=new At(xt([{key:"cmt",valueSchema:new Et(64)},{key:"lf",valueSchema:new Be}]));class _t{constructor(e){this.pk=e.pk,this.weight=e.weight}getEncodingSchema(){return _t.encodingSchema}toEncodingData(){return new Map([["p",this.pk.toEncodingData()],["w",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Participant: ${e}`);return new _t({pk:Lt.fromEncodingData(e.get("p")),weight:e.get("w")})}}_t.encodingSchema=new At(xt([{key:"p",valueSchema:Lt.encodingSchema},{key:"w",valueSchema:new Be}]));class Ft{constructor(e){this.publicKey=e.publicKey}getEncodingSchema(){return Ft.encodingSchema}toEncodingData(){return new Map([["k",this.publicKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconVerifier: ${e}`);return new Ft({publicKey:e.get("k")})}}Ft.encodingSchema=new At(xt([{key:"k",valueSchema:new Et(1793)}]));class qt{constructor(e){this.signature=e.signature,this.vectorCommitmentIndex=e.index,this.proof=e.proof,this.verifyingKey=e.verifyingKey}getEncodingSchema(){return qt.encodingSchema}toEncodingData(){return new Map([["sig",this.signature],["idx",this.vectorCommitmentIndex],["prf",this.proof.toEncodingData()],["vkey",this.verifyingKey.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconSignatureStruct: ${e}`);return new qt({signature:e.get("sig"),index:e.get("idx"),proof:Nt.fromEncodingData(e.get("prf")),verifyingKey:Ft.fromEncodingData(e.get("vkey"))})}}qt.encodingSchema=new At(xt([{key:"sig",valueSchema:new St},{key:"idx",valueSchema:new Be},{key:"prf",valueSchema:Nt.encodingSchema},{key:"vkey",valueSchema:Ft.encodingSchema}]));class zt{constructor(e){this.sig=e.sig,this.l=e.l}getEncodingSchema(){return zt.encodingSchema}toEncodingData(){return new Map([["s",this.sig.toEncodingData()],["l",this.l]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SigslotCommit: ${e}`);return new zt({sig:qt.fromEncodingData(e.get("s")),l:e.get("l")})}}zt.encodingSchema=new At(xt([{key:"s",valueSchema:qt.encodingSchema},{key:"l",valueSchema:new Be}]));class Kt{constructor(e){this.sigslot=e.sigslot,this.participant=e.participant}getEncodingSchema(){return Kt.encodingSchema}toEncodingData(){return new Map([["s",this.sigslot.toEncodingData()],["p",this.participant.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Reveal: ${e}`);return new Kt({sigslot:zt.fromEncodingData(e.get("s")),participant:_t.fromEncodingData(e.get("p"))})}}Kt.encodingSchema=new At(xt([{key:"s",valueSchema:zt.encodingSchema},{key:"p",valueSchema:_t.encodingSchema}]));class Ht{constructor(e){this.sigCommit=e.sigCommit,this.signedWeight=e.signedWeight,this.sigProofs=e.sigProofs,this.partProofs=e.partProofs,this.merkleSignatureSaltVersion=e.merkleSignatureSaltVersion,this.reveals=e.reveals,this.positionsToReveal=e.positionsToReveal}getEncodingSchema(){return Ht.encodingSchema}toEncodingData(){return new Map([["c",this.sigCommit],["w",this.signedWeight],["S",this.sigProofs.toEncodingData()],["P",this.partProofs.toEncodingData()],["v",this.merkleSignatureSaltVersion],["r",It(this.reveals,(e,t)=>[e,t.toEncodingData()])],["pr",this.positionsToReveal]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new Ht({sigCommit:e.get("c"),signedWeight:e.get("w"),sigProofs:Nt.fromEncodingData(e.get("S")),partProofs:Nt.fromEncodingData(e.get("P")),merkleSignatureSaltVersion:Number(e.get("v")),reveals:It(e.get("r"),(e,t)=>[e,Kt.fromEncodingData(t)]),positionsToReveal:e.get("pr")})}}Ht.encodingSchema=new At(xt([{key:"c",valueSchema:new St},{key:"w",valueSchema:new Be},{key:"S",valueSchema:Nt.encodingSchema},{key:"P",valueSchema:Nt.encodingSchema},{key:"v",valueSchema:new Be},{key:"r",valueSchema:new Tt(Kt.encodingSchema)},{key:"pr",valueSchema:new bt(new Be)}]));class jt{constructor(e){this.blockHeadersCommitment=e.blockHeadersCommitment,this.votersCommitment=e.votersCommitment,this.lnProvenWeight=e.lnProvenWeight,this.firstAttestedRound=e.firstAttestedRound,this.lastAttestedRound=e.lastAttestedRound}getEncodingSchema(){return jt.encodingSchema}toEncodingData(){return new Map([["b",this.blockHeadersCommitment],["v",this.votersCommitment],["P",this.lnProvenWeight],["f",this.firstAttestedRound],["l",this.lastAttestedRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new jt({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}static fromMap(e){return new jt({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}}jt.encodingSchema=new At(xt([{key:"b",valueSchema:new St},{key:"v",valueSchema:new St},{key:"P",valueSchema:new Be},{key:"f",valueSchema:new Be},{key:"l",valueSchema:new Be}]));class Gt{constructor(e){this.sig=e.sig,this.pk=e.pk,this.pk2=e.pk2,this.pk1Sig=e.pk1Sig,this.pk2Sig=e.pk2Sig}getEncodingSchema(){return Gt.encodingSchema}toEncodingData(){return new Map([["s",this.sig],["p",this.pk],["p2",this.pk2],["p1s",this.pk1Sig],["p2s",this.pk2Sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HeartbeatProof: ${e}`);return new Gt({sig:e.get("s"),pk:e.get("p"),pk2:e.get("p2"),pk1Sig:e.get("p1s"),pk2Sig:e.get("p2s")})}}Gt.encodingSchema=new At(xt([{key:"s",valueSchema:new Et(64)},{key:"p",valueSchema:new Et(32)},{key:"p2",valueSchema:new Et(32)},{key:"p1s",valueSchema:new Et(64)},{key:"p2s",valueSchema:new Et(64)}]));class Jt{constructor(e){this.address=e.address,this.proof=e.proof,this.seed=e.seed,this.voteID=e.voteID,this.keyDilution=e.keyDilution}getEncodingSchema(){return Jt.encodingSchema}toEncodingData(){return new Map([["a",this.address],["prf",this.proof.toEncodingData()],["sd",this.seed],["vid",this.voteID],["kd",this.keyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Heartbeat: ${e}`);return new Jt({address:e.get("a"),proof:Gt.fromEncodingData(e.get("prf")),seed:e.get("sd"),voteID:e.get("vid"),keyDilution:e.get("kd")})}}function Wt(e){return e.every(e=>0===e)}function Yt(e,t,n){if(null==e)return;let a;if(e instanceof Uint8Array&&(a=e),null==a||a.byteLength!==n)throw Error(`${t} must be a ${n} byte Uint8Array`);return a}function Xt(e){if(null==e)throw new Error("Address must not be null or undefined");if("string"==typeof e)return ut.fromString(e);if(e instanceof ut)return e;throw new Error(`Not an address: ${e}`)}function Qt(e){if(null==e)return;let t;if(e instanceof ut)t=e;else{if("string"!=typeof e)throw new Error(`Not an address: ${e}`);t=ut.fromString(e)}if(Wt(t.publicKey))throw new Error("Invalid use of the zero address. To omit this value, pass in undefined");return t}function Zt(e){if(void 0!==e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}}function en(e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}function tn(e){if(void 0!==e)return k(e)}function nn(e){if(!0===e||!1===e)return e;throw new Error(`Not a boolean: ${e}`)}function an(e){if(Array.isArray(e))return e.slice();throw new Error(`Not an array: ${e}`)}function rn(e,t,n){const a=Zt(e);if(void 0!==a){if(a.byteLength!==t)throw new Error(`${n} must be ${t} bytes long, was ${a.byteLength}`);if(!Wt(a))return a}}function on(e){if(null!=e&&"object"==typeof e){const{appIndex:t,name:n}=e;return{appIndex:k(t),name:en(n)}}throw new Error(`Not a box reference: ${e}`)}function sn(e){if(null!=e&&"object"==typeof e){const{assetIndex:t,address:n}=e;return{assetIndex:k(t),address:Xt(n)}}throw new Error(`Not a holding reference: ${e}`)}function cn(e){if(null!=e&&"object"==typeof e){const{appIndex:t,address:n}=e;return{appIndex:k(t),address:Xt(n)}}throw new Error(`Not a locals reference: ${e}`)}function hn(e){if(null!=e&&"object"==typeof e){const{address:t,appIndex:n,assetIndex:a,holding:i,locals:r,box:o}=e;if(void 0!==t)return{address:Xt(t)};if(void 0!==n)return{appIndex:k(n)};if(void 0!==a)return{assetIndex:k(a)};if(void 0!==i)return{holding:sn(i)};if(void 0!==r)return{locals:cn(r)};if(void 0!==o)return{box:on(o)}}throw new Error(`Not a resource reference: ${e}`)}Jt.encodingSchema=new At(xt([{key:"a",valueSchema:new vt},{key:"prf",valueSchema:Gt.encodingSchema},{key:"sd",valueSchema:new St},{key:"vid",valueSchema:new Et(32)},{key:"kd",valueSchema:new Be}]));const dn=(new TextEncoder).encode("TX");class un{constructor(e){if(!Ut(e.type))throw new Error(`Invalid transaction type: ${e.type}`);if(this.type=e.type,this.sender=Xt(e.sender),this.note=en(e.note??new Uint8Array),this.lease=rn(e.lease,32,"lease"),this.rekeyTo=Qt(e.rekeyTo),this.group=void 0,this.firstValid=k(e.suggestedParams.firstValid),this.lastValid=k(e.suggestedParams.lastValid),e.suggestedParams.genesisID){if("string"!=typeof e.suggestedParams.genesisID)throw new Error("Genesis ID must be a string if present");this.genesisID=e.suggestedParams.genesisID}this.genesisHash=Zt(e.suggestedParams.genesisHash);const t=[];if(e.paymentParams&&t.push(Bt.pay),e.keyregParams&&t.push(Bt.keyreg),e.assetConfigParams&&t.push(Bt.acfg),e.assetTransferParams&&t.push(Bt.axfer),e.assetFreezeParams&&t.push(Bt.afrz),e.appCallParams&&t.push(Bt.appl),e.stateProofParams&&t.push(Bt.stpf),e.heartbeatParams&&t.push(Bt.hb),1!==t.length)throw new Error(`Transaction has wrong number of type fields present (${t.length}): ${t}`);if(this.type!==t[0])throw new Error(`Transaction has type ${this.type} but fields present for ${t[0]}`);if(e.paymentParams&&(this.payment={receiver:Xt(e.paymentParams.receiver),amount:k(e.paymentParams.amount),closeRemainderTo:Qt(e.paymentParams.closeRemainderTo)}),e.keyregParams){if(this.keyreg={voteKey:Yt(e.keyregParams.voteKey,"voteKey",32),selectionKey:Yt(e.keyregParams.selectionKey,"selectionKey",32),stateProofKey:Yt(e.keyregParams.stateProofKey,"stateProofKey",64),voteFirst:tn(e.keyregParams.voteFirst),voteLast:tn(e.keyregParams.voteLast),voteKeyDilution:tn(e.keyregParams.voteKeyDilution),nonParticipation:nn(e.keyregParams.nonParticipation??!1)},this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution))throw new Error("nonParticipation is true but participation params are present.");if(!this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution)&&(!this.keyreg.voteKey||!this.keyreg.selectionKey||void 0===this.keyreg.voteFirst||void 0===this.keyreg.voteLast||void 0===this.keyreg.voteKeyDilution))throw new Error("Online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution")}if(e.assetConfigParams&&(this.assetConfig={assetIndex:k(e.assetConfigParams.assetIndex??0),total:k(e.assetConfigParams.total??0),decimals:S(e.assetConfigParams.decimals??0),defaultFrozen:nn(e.assetConfigParams.defaultFrozen??!1),manager:Qt(e.assetConfigParams.manager),reserve:Qt(e.assetConfigParams.reserve),freeze:Qt(e.assetConfigParams.freeze),clawback:Qt(e.assetConfigParams.clawback),unitName:e.assetConfigParams.unitName,assetName:e.assetConfigParams.assetName,assetURL:e.assetConfigParams.assetURL,assetMetadataHash:rn(e.assetConfigParams.assetMetadataHash,32,"assetMetadataHash")}),e.assetTransferParams&&(this.assetTransfer={assetIndex:k(e.assetTransferParams.assetIndex),amount:k(e.assetTransferParams.amount),assetSender:Qt(e.assetTransferParams.assetSender),receiver:Xt(e.assetTransferParams.receiver),closeRemainderTo:Qt(e.assetTransferParams.closeRemainderTo)}),e.assetFreezeParams&&(this.assetFreeze={assetIndex:k(e.assetFreezeParams.assetIndex),freezeAccount:Xt(e.assetFreezeParams.freezeTarget),frozen:nn(e.assetFreezeParams.frozen)}),e.appCallParams){const{onComplete:t}=e.appCallParams;if(!$t(t))throw new Error(`Invalid onCompletion value: ${t}`);this.applicationCall={appIndex:k(e.appCallParams.appIndex),onComplete:t,numLocalInts:S(e.appCallParams.numLocalInts??0),numLocalByteSlices:S(e.appCallParams.numLocalByteSlices??0),numGlobalInts:S(e.appCallParams.numGlobalInts??0),numGlobalByteSlices:S(e.appCallParams.numGlobalByteSlices??0),extraPages:S(e.appCallParams.extraPages??0),approvalProgram:en(e.appCallParams.approvalProgram??new Uint8Array),clearProgram:en(e.appCallParams.clearProgram??new Uint8Array),appArgs:an(e.appCallParams.appArgs??[]).map(en),accounts:an(e.appCallParams.accounts??[]).map(Xt),foreignApps:an(e.appCallParams.foreignApps??[]).map(k),foreignAssets:an(e.appCallParams.foreignAssets??[]).map(k),boxes:an(e.appCallParams.boxes??[]).map(on),access:an(e.appCallParams.access??[]).map(hn),rejectVersion:S(e.appCallParams.rejectVersion??0)}}if(e.stateProofParams&&(this.stateProof={stateProofType:S(e.stateProofParams.stateProofType??0),stateProof:e.stateProofParams.stateProof,message:e.stateProofParams.message}),e.heartbeatParams&&(this.heartbeat=new Jt({address:e.heartbeatParams.address,proof:e.heartbeatParams.proof,seed:e.heartbeatParams.seed,voteID:e.heartbeatParams.voteID,keyDilution:e.heartbeatParams.keyDilution})),this.fee=k(e.suggestedParams.fee),!nn(e.suggestedParams.flatFee??!1)){const t=k(e.suggestedParams.minFee);this.fee*=BigInt(this.estimateSize()),this.fee<t&&(this.fee=t)}}getEncodingSchema(){return un.encodingSchema}toEncodingData(){const e=new Map([["type",this.type],["fv",this.firstValid],["lv",this.lastValid],["snd",this.sender],["gen",this.genesisID],["gh",this.genesisHash],["fee",this.fee],["note",this.note],["lx",this.lease],["rekey",this.rekeyTo],["grp",this.group]]);if(this.payment)return e.set("amt",this.payment.amount),e.set("rcv",this.payment.receiver),e.set("close",this.payment.closeRemainderTo),e;if(this.keyreg)return e.set("votekey",this.keyreg.voteKey),e.set("selkey",this.keyreg.selectionKey),e.set("sprfkey",this.keyreg.stateProofKey),e.set("votefst",this.keyreg.voteFirst),e.set("votelst",this.keyreg.voteLast),e.set("votekd",this.keyreg.voteKeyDilution),e.set("nonpart",this.keyreg.nonParticipation),e;if(this.assetConfig){e.set("caid",this.assetConfig.assetIndex);const t=new Map([["t",this.assetConfig.total],["dc",this.assetConfig.decimals],["df",this.assetConfig.defaultFrozen],["m",this.assetConfig.manager],["r",this.assetConfig.reserve],["f",this.assetConfig.freeze],["c",this.assetConfig.clawback],["un",this.assetConfig.unitName],["an",this.assetConfig.assetName],["au",this.assetConfig.assetURL],["am",this.assetConfig.assetMetadataHash]]);return e.set("apar",t),e}if(this.assetTransfer)return e.set("xaid",this.assetTransfer.assetIndex),e.set("aamt",this.assetTransfer.amount),e.set("arcv",this.assetTransfer.receiver),e.set("aclose",this.assetTransfer.closeRemainderTo),e.set("asnd",this.assetTransfer.assetSender),e;if(this.assetFreeze)return e.set("faid",this.assetFreeze.assetIndex),e.set("afrz",this.assetFreeze.frozen),e.set("fadd",this.assetFreeze.freezeAccount),e;if(this.applicationCall)return e.set("apid",this.applicationCall.appIndex),e.set("apan",this.applicationCall.onComplete),e.set("apaa",this.applicationCall.appArgs),e.set("apat",this.applicationCall.accounts),e.set("apas",this.applicationCall.foreignAssets),e.set("apfa",this.applicationCall.foreignApps),e.set("apbx",function(e,t,n){const a=BigInt(n),i=t.map(BigInt);return e.map(e=>function(e,t,n){const a=BigInt(e.appIndex),i=e.name,r=a===BigInt(0)||a===n,o=t.indexOf(a)+1;if(0===o&&!r)throw new Error(`Box ref with appId ${a} not in foreign-apps`);return new Map([["i",o],["n",i]])}(e,i,a))}(this.applicationCall.boxes,this.applicationCall.foreignApps,this.applicationCall.appIndex)),e.set("al",function(e,t){const n=[];function a(e){for(let t=0;t<n.length;t++){const a=n[t],i=a.get("d");if((!e.address&&!i||e.address&&i&&e.address.equals(i))&&a.get("s")===e.assetIndex&&a.get("p")===e.appIndex)return t+1}return e.address&&n.push(new Map([["d",e.address]])),e.assetIndex&&n.push(new Map([["s",e.assetIndex]])),e.appIndex&&n.push(new Map([["p",e.appIndex]])),n.length}const i=ut.zeroAddress();for(const r of t)if(r.address||r.assetIndex||r.appIndex)a(r);else{if(r.holding){const e=r.holding;let t=0;e.address&&!e.address.equals(i)&&(t=a({address:e.address}));const o=a({assetIndex:e.assetIndex});n.push(new Map([["h",new Map([["d",t],["s",o]])]]));continue}if(r.locals){const t=r.locals;let o=0;t.address&&!t.address.equals(i)&&(o=a({address:t.address}));let s=0;t.appIndex&&BigInt(t.appIndex)!==e&&(s=a({appIndex:t.appIndex})),n.push(new Map([["l",new Map([["d",o],["p",s]])]]));continue}if(r.box){const t=r.box;let i=0;t.appIndex&&BigInt(t.appIndex)!==e&&(i=a({appIndex:t.appIndex})),n.push(new Map([["b",new Map([["i",i],["n",t.name]])]]))}}return n}(this.applicationCall.appIndex,this.applicationCall.access)),e.set("apap",this.applicationCall.approvalProgram),e.set("apsu",this.applicationCall.clearProgram),e.set("apls",new Map([["nui",this.applicationCall.numLocalInts],["nbs",this.applicationCall.numLocalByteSlices]])),e.set("apgs",new Map([["nui",this.applicationCall.numGlobalInts],["nbs",this.applicationCall.numGlobalByteSlices]])),e.set("apep",this.applicationCall.extraPages),e.set("aprv",this.applicationCall.rejectVersion),e;if(this.stateProof)return e.set("sptype",this.stateProof.stateProofType),e.set("sp",this.stateProof.stateProof?this.stateProof.stateProof.toEncodingData():void 0),e.set("spmsg",this.stateProof.message?this.stateProof.message.toEncodingData():void 0),e;if(this.heartbeat){const t=new Jt({address:this.heartbeat.address,proof:this.heartbeat.proof,seed:this.heartbeat.seed,voteID:this.heartbeat.voteID,keyDilution:this.heartbeat.keyDilution});return e.set("hb",t.toEncodingData()),e}throw new Error(`Unexpected transaction type: ${this.type}`)}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t={minFee:BigInt(0),flatFee:!0,fee:e.get("fee")??0,firstValid:e.get("fv")??0,lastValid:e.get("lv")??0,genesisHash:e.get("gh"),genesisID:e.get("gen")},n=e.get("type");if(!Ut(n))throw new Error(`Unrecognized transaction type: ${n}`);const a={type:n,sender:e.get("snd")??ut.zeroAddress(),note:e.get("note"),lease:e.get("lx"),suggestedParams:t};if(e.get("rekey")&&(a.rekeyTo=e.get("rekey")),a.type===Bt.pay){const t={amount:e.get("amt")??0,receiver:e.get("rcv")??ut.zeroAddress()};e.get("close")&&(t.closeRemainderTo=e.get("close")),a.paymentParams=t}else if(a.type===Bt.keyreg){const t={voteKey:e.get("votekey"),selectionKey:e.get("selkey"),stateProofKey:e.get("sprfkey"),voteFirst:e.get("votefst"),voteLast:e.get("votelst"),voteKeyDilution:e.get("votekd"),nonParticipation:e.get("nonpart")};a.keyregParams=t}else if(a.type===Bt.acfg){const t={assetIndex:e.get("caid")};if(e.get("apar")){const n=e.get("apar");t.total=n.get("t"),t.decimals=n.get("dc"),t.defaultFrozen=n.get("df"),t.unitName=n.get("un"),t.assetName=n.get("an"),t.assetURL=n.get("au"),t.assetMetadataHash=n.get("am"),n.get("m")&&(t.manager=n.get("m")),n.get("r")&&(t.reserve=n.get("r")),n.get("f")&&(t.freeze=n.get("f")),n.get("c")&&(t.clawback=n.get("c"))}a.assetConfigParams=t}else if(a.type===Bt.axfer){const t={assetIndex:e.get("xaid")??0,amount:e.get("aamt")??0,receiver:e.get("arcv")??ut.zeroAddress()};e.get("aclose")&&(t.closeRemainderTo=e.get("aclose")),e.get("asnd")&&(t.assetSender=e.get("asnd")),a.assetTransferParams=t}else if(a.type===Bt.afrz){const t={assetIndex:e.get("faid")??0,freezeTarget:e.get("fadd")??ut.zeroAddress(),frozen:e.get("afrz")??!1};a.assetFreezeParams=t}else if(a.type===Bt.appl){const t={appIndex:e.get("apid")??0,onComplete:S(e.get("apan")??0),appArgs:e.get("apaa"),accounts:e.get("apat"),foreignAssets:e.get("apas"),foreignApps:e.get("apfa"),approvalProgram:e.get("apap"),clearProgram:e.get("apsu"),extraPages:e.get("apep"),rejectVersion:e.get("aprv")??0},n=e.get("apls");n&&(t.numLocalInts=n.get("nui"),t.numLocalByteSlices=n.get("nbs"));const i=e.get("apgs");i&&(t.numGlobalInts=i.get("nui"),t.numGlobalByteSlices=i.get("nbs"));const r=e.get("apbx");r&&(t.boxes=r.map(e=>{const n=S(e.get("i")??0),a=en(e.get("n")??new Uint8Array);if(0===n)return{appIndex:0,name:a};if(!t.foreignApps||n>t.foreignApps.length)throw new Error(`Cannot find foreign app index ${n} in ${t.foreignApps}`);return{appIndex:t.foreignApps[n-1],name:a}}));const o=e.get("al");o&&(t.access=function(e){const t=[];for(const n of e){const a=n.get("d"),i=n.get("s"),r=n.get("p");if(a){t.push({address:a});continue}if(i){t.push({assetIndex:i});continue}if(r){t.push({appIndex:r});continue}const o=n.get("h");if(o){const n=S(o.get("d")??0),a=S(o.get("s"));if(!a)throw new Error(`Holding missing asset index: ${o}`);const i=0===n?ut.zeroAddress():e[n-1].get("d"),r=e[a-1].get("s");t.push({holding:{address:i,assetIndex:r}});continue}const s=n.get("l");if(s){const n=S(s.get("d")??0),a=S(s.get("p")??0),i=0===n?ut.zeroAddress():e[n-1].get("d"),r=0===a?BigInt(0):e[a-1].get("p");t.push({locals:{address:i,appIndex:r}});continue}const c=n.get("b");if(c){const n=S(c.get("i")??0),a=c.get("n");if(!a)throw new Error(`Box missing name: ${c}`);const i=0===n?BigInt(0):e[n-1].get("p");t.push({box:{appIndex:i,name:a}});continue}t.push({box:{appIndex:BigInt(0),name:new Uint8Array(0)}})}return t}(o)),a.appCallParams=t}else if(a.type===Bt.stpf){const t={stateProofType:e.get("sptype"),stateProof:e.get("sp")?Ht.fromEncodingData(e.get("sp")):void 0,message:e.get("spmsg")?jt.fromEncodingData(e.get("spmsg")):void 0};a.stateProofParams=t}else{if(a.type!==Bt.hb){const e=a.type;throw new Error(`Unexpected transaction type: ${e}`)}{const t=Jt.fromEncodingData(e.get("hb")),n={address:t.address,proof:t.proof,seed:t.seed,voteID:t.voteID,keyDilution:t.keyDilution};a.heartbeatParams=n}}const i=new un(a);if(e.get("grp")){const t=en(e.get("grp"));if(32!==t.byteLength)throw new Error(`Invalid group length: ${t.byteLength}`);i.group=t}return i}estimateSize(){return this.toByte().length+75}bytesToSign(){const e=this.toByte();return y(dn,e)}toByte(){return Te(this)}rawSignTxn(e){return Ke(this.bytesToSign(),e)}signTxn(e){const t=ze(e),n=new ut(t.publicKey),a=this.rawSignTxn(e);return this.attachSignature(n,a)}attachSignature(e,t){if(!qe(t.length))throw new Error("Invalid signature length");const n=new Map([["sig",t],["txn",this.toEncodingData()]]),a=Xt(e);return this.sender.equals(a)||n.set("sgnr",a),fe(new At(xt([{key:"txn",valueSchema:un.encodingSchema},{key:"sig",valueSchema:new Et(64)},{key:"sgnr",valueSchema:new Vt(new vt)}])).prepareMsgpack(n))}rawTxID(){const e=this.toByte(),t=y(dn,e);return Uint8Array.from(_e(t))}txID(){const e=this.rawTxID();return Ue().encode(e).slice(0,52)}}function ln(e){return Te(e)}function gn(e){return Ie(e,un)}un.encodingSchema=new At(xt([{key:"type",valueSchema:new Re},{key:"snd",valueSchema:new vt},{key:"lv",valueSchema:new Be},{key:"gen",valueSchema:new Vt(new Re)},{key:"gh",valueSchema:new Vt(new Et(32))},{key:"fee",valueSchema:new Be},{key:"fv",valueSchema:new Be},{key:"note",valueSchema:new St},{key:"lx",valueSchema:new Vt(new Et(32))},{key:"rekey",valueSchema:new Vt(new vt)},{key:"grp",valueSchema:new Vt(new Et(32))},{key:"amt",valueSchema:new Vt(new Be)},{key:"rcv",valueSchema:new Vt(new vt)},{key:"close",valueSchema:new Vt(new vt)},{key:"votekey",valueSchema:new Vt(new Et(32))},{key:"selkey",valueSchema:new Vt(new Et(32))},{key:"sprfkey",valueSchema:new Vt(new Et(64))},{key:"votefst",valueSchema:new Vt(new Be)},{key:"votelst",valueSchema:new Vt(new Be)},{key:"votekd",valueSchema:new Vt(new Be)},{key:"nonpart",valueSchema:new Vt(new Ve)},{key:"caid",valueSchema:new Vt(new Be)},{key:"apar",valueSchema:new Vt(new At(xt([{key:"t",valueSchema:new Be},{key:"dc",valueSchema:new Be},{key:"df",valueSchema:new Ve},{key:"m",valueSchema:new Vt(new vt)},{key:"r",valueSchema:new Vt(new vt)},{key:"f",valueSchema:new Vt(new vt)},{key:"c",valueSchema:new Vt(new vt)},{key:"un",valueSchema:new Vt(new Re)},{key:"an",valueSchema:new Vt(new Re)},{key:"au",valueSchema:new Vt(new Re)},{key:"am",valueSchema:new Vt(new Et(32))}])))},{key:"xaid",valueSchema:new Vt(new Be)},{key:"aamt",valueSchema:new Vt(new Be)},{key:"arcv",valueSchema:new Vt(new vt)},{key:"aclose",valueSchema:new Vt(new vt)},{key:"asnd",valueSchema:new Vt(new vt)},{key:"faid",valueSchema:new Vt(new Be)},{key:"afrz",valueSchema:new Vt(new Ve)},{key:"fadd",valueSchema:new Vt(new vt)},{key:"apid",valueSchema:new Vt(new Be)},{key:"apan",valueSchema:new Vt(new Be)},{key:"apaa",valueSchema:new Vt(new bt(new St))},{key:"apat",valueSchema:new Vt(new bt(new vt))},{key:"apas",valueSchema:new Vt(new bt(new Be))},{key:"apfa",valueSchema:new Vt(new bt(new Be))},{key:"apbx",valueSchema:new Vt(new bt(new At(xt([{key:"i",valueSchema:new Be},{key:"n",valueSchema:new St}]))))},{key:"al",valueSchema:new Vt(new bt(new At(xt([{key:"d",valueSchema:new Vt(new vt)},{key:"s",valueSchema:new Vt(new Be)},{key:"p",valueSchema:new Vt(new Be)},{key:"h",valueSchema:new Vt(new At(xt([{key:"d",valueSchema:new Be},{key:"s",valueSchema:new Be}])))},{key:"l",valueSchema:new Vt(new At(xt([{key:"d",valueSchema:new Be},{key:"p",valueSchema:new Be}])))},{key:"b",valueSchema:new Vt(new At(xt([{key:"i",valueSchema:new Be},{key:"n",valueSchema:new St}])))}]))))},{key:"apap",valueSchema:new Vt(new St)},{key:"apsu",valueSchema:new Vt(new St)},{key:"apls",valueSchema:new Vt(new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}])))},{key:"apgs",valueSchema:new Vt(new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}])))},{key:"apep",valueSchema:new Vt(new Be)},{key:"aprv",valueSchema:new Vt(new Be)},{key:"sptype",valueSchema:new Vt(new Be)},{key:"sp",valueSchema:new Vt(Ht.encodingSchema)},{key:"spmsg",valueSchema:new Vt(jt.encodingSchema)},{key:"hb",valueSchema:new Vt(Jt.encodingSchema)}]));const mn=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),pn="invalid multisig version",fn="bad multisig threshold",yn="bad multisig public key - wrong length",wn="nacl public key length is not 32 bytes";function vn(e){return e.map(e=>"string"==typeof e?ut.fromString(e).publicKey:e.publicKey)}function Sn({version:e,threshold:t,pks:n}){if(1!==e||e>255||e<0)throw new Error(pn);if(0===t||0===n.length||t>n.length||t>255)throw new Error(fn);const a=at-it;if(a!==Ge)throw new Error(wn);const i=new Uint8Array(mn.length+2+a*n.length);i.set(mn,0),i.set([e],mn.length),i.set([t],mn.length+1);for(let e=0;e<n.length;e++){if(n[e].length!==a)throw new Error(yn);i.set(n[e],mn.length+2+e*a)}return new ut(Uint8Array.from(_e(i)))}function En(e,t,n){const a=t.v,i=t.thr,r=t.subsig,o=r.map(e=>e.pk);if(t.subsig.length<i)return!1;let s;try{s=Sn({version:a,threshold:i,pks:o}).publicKey}catch(e){return!1}if(!f(s,n))return!1;let c=0;for(const e of r)void 0!==e.s&&(c+=1);if(c<i)return!1;let h=0;for(const t of r)void 0!==t.s&&je(e,t.s,t.pk)&&(h+=1);return!(h<i)}function kn({version:e,threshold:t,addrs:n}){return function({version:e,threshold:t,addrs:n}){return Sn({version:e,threshold:t,pks:vn(n)})}({version:e,threshold:t,addrs:n})}const bn=new At(xt([{key:"pk",valueSchema:new Et(32)},{key:"s",valueSchema:new Vt(new Et(64))}]));function xn(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedSubsig: ${e}`);const t={pk:e.get("pk")};return e.get("s")&&(t.s=e.get("s")),t}function An(e){const t=new Map([["pk",e.pk]]);return e.s&&t.set("s",e.s),t}const Dn=new At(xt([{key:"v",valueSchema:new Be},{key:"thr",valueSchema:new Be},{key:"subsig",valueSchema:new bt(bn)}]));function In(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedMultiSig: ${e}`);return{v:S(e.get("v")),thr:S(e.get("thr")),subsig:e.get("subsig").map(xn)}}function Tn(e){return new Map([["v",e.v],["thr",e.thr],["subsig",e.subsig.map(An)]])}const Pn=new At(xt([{key:"sch",valueSchema:new St},{key:"slt",valueSchema:new Be},{key:"pk",valueSchema:new St},{key:"sig",valueSchema:new St}]));function Mn(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedPQSig: ${e}`);const t=e.get("sch");if(t.length!==ct)throw new Error(`Invalid decoded EncodedPQSig: expected a ${ct}-byte scheme, got ${t.length} bytes`);const n=S(e.get("slt"));if(n>ht)throw new Error(`Invalid decoded EncodedPQSig: salt ${n} exceeds the maximum of ${ht}`);return{sch:t,slt:n,pk:e.get("pk"),sig:e.get("sig")}}function Vn(e){return new Map([["sch",e.sch],["slt",e.slt],["pk",e.pk],["sig",e.sig]])}const Rn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;function Bn(e){if(!e||0===e.length)throw new Error("empty program");const t="\n".charCodeAt(0),n=" ".charCodeAt(0),a="~".charCodeAt(0);if(e.every(e=>e===t||(e=>n<=e&&e<=a)(e))){const t=(new TextDecoder).decode(e);if(gt(t))throw new Error("requesting program bytes, get Algorand address");if(Rn.test(t))throw new Error("program should not be b64 encoded");throw new Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}const Cn=(new TextEncoder).encode("Program"),Un=(new TextEncoder).encode("PQProgram"),$n=(new TextEncoder).encode("MsigProgram");class On{constructor(e,t){if(t&&(!Array.isArray(t)||!t.every(e=>e.constructor===Uint8Array)))throw new TypeError("Invalid arguments");let n=[];null!=t&&(n=t.map(e=>new Uint8Array(e))),Bn(e),this.logic=e,this.args=n,this.sig=void 0,this.msig=void 0,this.lmsig=void 0,this.pqsig=void 0}getEncodingSchema(){return On.encodingSchema}toEncodingData(){const e=new Map([["l",this.logic],["arg",this.args],["sig",this.sig]]);return this.msig&&e.set("msig",Tn(this.msig)),this.lmsig&&e.set("lmsig",Tn(this.lmsig)),this.pqsig&&e.set("pqsig",Vn(this.pqsig)),e}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig: ${e}`);const t=new On(e.get("l"),e.get("arg"));return t.sig=e.get("sig"),e.get("msig")&&(t.msig=In(e.get("msig"))),e.get("lmsig")&&(t.lmsig=In(e.get("lmsig"))),e.get("pqsig")&&(t.pqsig=Mn(e.get("pqsig"))),t}verify(e){if([this.sig,this.msig,this.lmsig,this.pqsig].filter(Boolean).length>1)return!1;try{Bn(this.logic)}catch(e){return!1}const t=y(Cn,this.logic);if(!(this.sig||this.msig||this.lmsig||this.pqsig))return f(_e(t),e);if(this.pqsig)return!1;if(this.sig)return je(t,this.sig,e);if(this.lmsig){const t=Sn({version:this.lmsig.v,threshold:this.lmsig.thr,pks:this.lmsig.subsig.map(e=>e.pk)});return En(y($n,t.publicKey,this.logic),this.lmsig,e)}return!!this.msig&&En(t,this.msig,e)}address(){const e=_e(y(Cn,this.logic));return new ut(Uint8Array.from(e))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{const n=vn(t.addrs).map(e=>({pk:e}));this.lmsig={v:t.version,thr:t.threshold,subsig:n};const[a,i]=this.singleSignMultisig(e,this.lmsig);this.lmsig.subsig[i].s=a}}async signWithSigner(e,t){const n=await e(this,t);if(null==t){if("pqsig"in n&&n.pqsig)return this.clearSignatures(),this.pqsig=n.pqsig,n.address;if(!("sig"in n)||!n.sig)throw Error("Expected DelegatedLsigSigner to return sig or pqsig, but both are undefined. If signing for an msig, be sure to pass the msig argument");this.clearSignatures(),this.sig=n.sig}else{if(!("lmsig"in n)||!n.lmsig)throw Error("Expected DelegatedLsigSigner to return lmsig, but lmsig is undefined. If signing for a single account, do not pass msig argument");const{lmsig:e}=n,a=vn(t.addrs);if(e.v!==t.version||e.thr!==t.threshold||e.subsig.length!==a.length||!e.subsig.every((e,t)=>f(e.pk,a[t])))throw Error("DelegatedLsigSigner returned an lmsig whose version, threshold or public keys do not match the requested multisig");this.clearSignatures(),this.lmsig=n.lmsig}return n.address}clearSignatures(){this.sig=void 0,this.msig=void 0,this.lmsig=void 0,this.pqsig=void 0}appendToMultisig(e){if(void 0===this.lmsig)throw new Error("no multisig present");const[t,n]=this.singleSignMultisig(e,this.lmsig);this.lmsig.subsig[n].s=t}async appendToMultisigWithSigner(e){if(void 0===this.lmsig)throw new Error("no multisig present");const t=await e(this,{version:this.lmsig.v,threshold:this.lmsig.thr,addrs:this.lmsig.subsig.map(e=>new ut(e.pk))});if(!("lmsig"in t)||!t.lmsig)throw Error("Expected DelegatedLsigSigner to return lmsig, but lmsig is undefined");if(t.lmsig.v!==this.lmsig.v||t.lmsig.thr!==this.lmsig.thr)throw Error("DelegatedLsigSigner returned an lmsig whose version or threshold does not match the current msig");let n=!1;for(const e of t.lmsig.subsig)if(e.s){n=!0;const t=this.lmsig.subsig.find(t=>f(t.pk,e.pk));if(void 0===t)throw Error(`DelegatedLsigSigner returned a signature for ${new ut(e.pk)} but this pk is not in the current msig`);if(t.s&&!f(t.s,e.s))throw Error(`DelegatedLsigSigner returned a signature for ${new ut(e.pk)} that conflicts with the signature already collected for it`);t.s=e.s}if(!n)throw Error("DelegatedLsigSigner returned an lmsig with no signatures")}signProgram(e){return Ke(y(Cn,this.logic),e)}signProgramMultisig(e,t){const n=Sn({version:t.v,threshold:t.thr,pks:t.subsig.map(e=>e.pk)});return Ke(y($n,n.publicKey,this.logic),e)}singleSignMultisig(e,t){let n=-1;const a=ze(e).publicKey;for(let e=0;e<t.subsig.length;e++){const{pk:i}=t.subsig[e];if(f(i,a)){n=e;break}}if(-1===n)throw new Error("invalid secret key");return[this.signProgramMultisig(e,t),n]}toByte(){return Te(this)}static fromByte(e){return Ie(e,On)}async signDataWithSigner(e,t){return e(t,this)}}On.encodingSchema=new At(xt([{key:"l",valueSchema:new St},{key:"arg",valueSchema:new bt(new St)},{key:"sig",valueSchema:new Vt(new Et(64))},{key:"msig",valueSchema:new Vt(Dn)},{key:"lmsig",valueSchema:new Vt(Dn)},{key:"pqsig",valueSchema:new Vt(Pn)}]));class Nn{constructor(e,t){this.lsig=new On(e,t),this.sigkey=void 0}getEncodingSchema(){return Nn.encodingSchema}toEncodingData(){return new Map([["lsig",this.lsig.toEncodingData()],["sigkey",this.sigkey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t=e,n=On.fromEncodingData(t.get("lsig")),a=new Nn(n.logic,n.args);return a.lsig=n,a.sigkey=t.get("sigkey"),a}toByte(){return Te(this)}static fromByte(e){return Ie(e,Nn)}isDelegated(){return!!(this.lsig.sig||this.lsig.msig||this.lsig.lmsig||this.lsig.pqsig)}verify(){const e=this.address();return this.lsig.verify(e.publicKey)}address(){if([this.lsig.sig,this.lsig.msig,this.lsig.lmsig,this.lsig.pqsig].filter(Boolean).length>1)throw new Error("LogicSig has too many signatures. At most one of sig, msig, lmsig, or pqsig may be present");if(this.lsig.pqsig){const e=wt(this.lsig.pqsig);if(this.sigkey&&!f(this.sigkey,e.publicKey))throw new Error(`Signing key for delegated account does not match the PQ signature. The signature authorizes ${e}, but sigkey is ${new ut(this.sigkey)}`);return e}if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return new ut(this.sigkey)}const e=this.lsig.lmsig||this.lsig.msig;return e?Sn({version:e.v,threshold:e.thr,pks:e.subsig.map(e=>e.pk)}):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}async signMultisigWithSigner(e,t){await this.lsig.signWithSigner(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}async appendToMultisigWithSigner(e){await this.lsig.appendToMultisigWithSigner(e)}sign(e){this.lsig.sign(e),this.sigkey=ze(e).publicKey}async signWithSigner(e){const t=await this.lsig.signWithSigner(e);this.sigkey=t.publicKey}}function Ln(e){return Ie(e,On)}Nn.encodingSchema=new At(xt([{key:"lsig",valueSchema:On.encodingSchema},{key:"sigkey",valueSchema:new Vt(new Et(32))}]));const _n=(new TextEncoder).encode("ProgData");function Fn(e,t,n){const a=y(("string"==typeof n?ut.fromString(n):n).publicKey,t);return Ke(y(_n,a),e)}function qn(e,t,n,a){const i=y(("string"==typeof t?ut.fromString(t):t).publicKey,e);return je(y(_n,i),n,a)}function zn(e,t,n){return Fn(e,t,new On(n).address())}class Kn{constructor({txn:e,sig:t,msig:n,lsig:a,pqsig:i,sgnr:r}){this.txn=e,this.sig=t,this.msig=n,this.lsig=a,this.pqsig=i,this.sgnr=r;let o=0;if(t&&(o+=1),n&&(o+=1),a&&(o+=1),i&&(o+=1),o>1)throw new Error(`SignedTransaction must not have more than 1 signature. Got ${o}`)}getEncodingSchema(){return Kn.encodingSchema}toEncodingData(){return new Map([["txn",this.txn.toEncodingData()],["sig",this.sig],["msig",this.msig?Tn(this.msig):void 0],["lsig",this.lsig?this.lsig.toEncodingData():void 0],["pqsig",this.pqsig?Vn(this.pqsig):void 0],["sgnr",this.sgnr]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTransaction: ${e}`);return new Kn({txn:un.fromEncodingData(e.get("txn")),sig:e.get("sig"),msig:e.get("msig")?In(e.get("msig")):void 0,lsig:e.get("lsig")?On.fromEncodingData(e.get("lsig")):void 0,pqsig:e.get("pqsig")?Mn(e.get("pqsig")):void 0,sgnr:e.get("sgnr")})}}function Hn(e){return Ie(e,Kn)}function jn(e){return Te(new Kn({txn:e}))}Kn.encodingSchema=new At(xt([{key:"txn",valueSchema:un.encodingSchema},{key:"sig",valueSchema:new Vt(new Et(64))},{key:"msig",valueSchema:new Vt(Dn)},{key:"lsig",valueSchema:new Vt(On.encodingSchema)},{key:"pqsig",valueSchema:new Vt(Pn)},{key:"sgnr",valueSchema:new Vt(new vt)}]));class Gn{constructor(e){this.stateProofVotersCommitment=e.stateProofVotersCommitment,this.stateProofOnlineTotalWeight=e.stateProofOnlineTotalWeight,this.stateProofNextRound=e.stateProofNextRound}getEncodingSchema(){return Gn.encodingSchema}toEncodingData(){return new Map([["v",this.stateProofVotersCommitment],["t",this.stateProofOnlineTotalWeight],["n",this.stateProofNextRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTrackingData: ${e}`);return new Gn({stateProofVotersCommitment:e.get("v"),stateProofOnlineTotalWeight:e.get("t"),stateProofNextRound:e.get("n")})}}Gn.encodingSchema=new At(xt([{key:"v",valueSchema:new St},{key:"t",valueSchema:new Be},{key:"n",valueSchema:new Be}]));class Jn{constructor(e){this.nativeSha512_256Commitment=e.nativeSha512_256Commitment,this.sha256Commitment=e.sha256Commitment}getEncodingSchema(){return Jn.encodingSchema}toEncodingData(){return new Map([["txn",this.nativeSha512_256Commitment],["txn256",this.sha256Commitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TxnCommitments: ${e}`);return new Jn({nativeSha512_256Commitment:e.get("txn"),sha256Commitment:e.get("txn256")})}}Jn.encodingSchema=new At(xt([{key:"txn",valueSchema:new Et(32)},{key:"txn256",valueSchema:new Et(32)}]));class Wn{constructor(e){this.feeSink=e.feeSink,this.rewardsPool=e.rewardsPool,this.rewardsLevel=e.rewardsLevel,this.rewardsRate=e.rewardsRate,this.rewardsResidue=e.rewardsResidue,this.rewardsRecalculationRound=e.rewardsRecalculationRound}getEncodingSchema(){return Wn.encodingSchema}toEncodingData(){return new Map([["fees",this.feeSink],["rwd",this.rewardsPool],["earn",this.rewardsLevel],["rate",this.rewardsRate],["frac",this.rewardsResidue],["rwcalr",this.rewardsRecalculationRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded RewardState: ${e}`);return new Wn({feeSink:e.get("fees"),rewardsPool:e.get("rwd"),rewardsLevel:e.get("earn"),rewardsRate:e.get("rate"),rewardsResidue:e.get("frac"),rewardsRecalculationRound:e.get("rwcalr")})}}Wn.encodingSchema=new At(xt([{key:"fees",valueSchema:new vt},{key:"rwd",valueSchema:new vt},{key:"earn",valueSchema:new Be},{key:"rate",valueSchema:new Be},{key:"frac",valueSchema:new Be},{key:"rwcalr",valueSchema:new Be}]));class Yn{constructor(e){this.currentProtocol=e.currentProtocol,this.nextProtocol=e.nextProtocol,this.nextProtocolApprovals=e.nextProtocolApprovals,this.nextProtocolVoteBefore=e.nextProtocolVoteBefore,this.nextProtocolSwitchOn=e.nextProtocolSwitchOn}getEncodingSchema(){return Yn.encodingSchema}toEncodingData(){return new Map([["proto",this.currentProtocol],["nextproto",this.nextProtocol],["nextyes",this.nextProtocolApprovals],["nextbefore",this.nextProtocolVoteBefore],["nextswitch",this.nextProtocolSwitchOn]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeState: ${e}`);return new Yn({currentProtocol:e.get("proto"),nextProtocol:e.get("nextproto"),nextProtocolApprovals:e.get("nextyes"),nextProtocolVoteBefore:e.get("nextbefore"),nextProtocolSwitchOn:e.get("nextswitch")})}}Yn.encodingSchema=new At(xt([{key:"proto",valueSchema:new Re},{key:"nextproto",valueSchema:new Re},{key:"nextyes",valueSchema:new Be},{key:"nextbefore",valueSchema:new Be},{key:"nextswitch",valueSchema:new Be}]));class Xn{constructor(e){this.upgradePropose=e.upgradePropose,this.upgradeDelay=e.upgradeDelay,this.upgradeApprove=e.upgradeApprove}getEncodingSchema(){return Xn.encodingSchema}toEncodingData(){return new Map([["upgradeprop",this.upgradePropose],["upgradedelay",this.upgradeDelay],["upgradeyes",this.upgradeApprove]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeVote: ${e}`);return new Xn({upgradePropose:e.get("upgradeprop"),upgradeDelay:e.get("upgradedelay"),upgradeApprove:e.get("upgradeyes")})}}Xn.encodingSchema=new At(xt([{key:"upgradeprop",valueSchema:new Re},{key:"upgradedelay",valueSchema:new Be},{key:"upgradeyes",valueSchema:new Ve}]));class Qn{constructor(e){this.expiredParticipationAccounts=e.expiredParticipationAccounts,this.absentParticipationAccounts=e.absentParticipationAccounts}getEncodingSchema(){return Qn.encodingSchema}toEncodingData(){return new Map([["partupdrmv",this.expiredParticipationAccounts],["partupdabs",this.absentParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new Qn({expiredParticipationAccounts:e.get("partupdrmv"),absentParticipationAccounts:e.get("partupdabs")})}}Qn.encodingSchema=new At(xt([{key:"partupdrmv",valueSchema:new bt(new vt)},{key:"partupdabs",valueSchema:new bt(new vt)}]));class Zn{constructor(e){this.round=e.round,this.branch=e.branch,this.seed=e.seed,this.txnCommitments=e.txnCommitments,this.timestamp=e.timestamp,this.genesisID=e.genesisID,this.genesisHash=e.genesisHash,this.proposer=e.proposer,this.feesCollected=e.feesCollected,this.bonus=e.bonus,this.proposerPayout=e.proposerPayout,this.rewardState=e.rewardState,this.upgradeState=e.upgradeState,this.upgradeVote=e.upgradeVote,this.txnCounter=e.txnCounter,this.stateproofTracking=e.stateproofTracking,this.participationUpdates=e.participationUpdates}getEncodingSchema(){return Zn.encodingSchema}toEncodingData(){return Dt(new Map([["rnd",this.round],["prev",this.branch],["seed",this.seed],["ts",this.timestamp],["gen",this.genesisID],["gh",this.genesisHash],["prp",this.proposer],["fc",this.feesCollected],["bi",this.bonus],["pp",this.proposerPayout],["tc",this.txnCounter],["spt",It(this.stateproofTracking,(e,t)=>[e,t.toEncodingData()])]]),this.txnCommitments.toEncodingData(),this.rewardState.toEncodingData(),this.upgradeState.toEncodingData(),this.upgradeVote.toEncodingData(),this.participationUpdates.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new Zn({round:e.get("rnd"),branch:e.get("prev"),seed:e.get("seed"),txnCommitments:Jn.fromEncodingData(e),timestamp:e.get("ts"),genesisID:e.get("gen"),genesisHash:e.get("gh"),proposer:e.get("prp"),feesCollected:e.get("fc"),bonus:e.get("bi"),proposerPayout:e.get("pp"),rewardState:Wn.fromEncodingData(e),upgradeState:Yn.fromEncodingData(e),upgradeVote:Xn.fromEncodingData(e),txnCounter:e.get("tc"),stateproofTracking:It(e.get("spt"),(e,t)=>[Number(e),Gn.fromEncodingData(t)]),participationUpdates:Qn.fromEncodingData(e)})}}Zn.encodingSchema=new At(xt([{key:"rnd",valueSchema:new Be},{key:"prev",valueSchema:new class extends De{defaultValue(){return new Uint8Array(32)}isDefaultValue(e){return e instanceof Uint8Array&&32===e.byteLength&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return`blk-${Ue().encode(e).slice(0,52)}`;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e&&56===e.length&&e.startsWith("blk-"))return Uint8Array.from(Ue().decode.asBytes(e.slice(4)));throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}}},{key:"seed",valueSchema:new St},{key:"",valueSchema:Jn.encodingSchema,embedded:!0},{key:"ts",valueSchema:new Be},{key:"gen",valueSchema:new Re},{key:"gh",valueSchema:new Et(32)},{key:"prp",valueSchema:new vt},{key:"fc",valueSchema:new Be},{key:"bi",valueSchema:new Be},{key:"pp",valueSchema:new Be},{key:"",valueSchema:Wn.encodingSchema,embedded:!0},{key:"",valueSchema:Yn.encodingSchema,embedded:!0},{key:"",valueSchema:Xn.encodingSchema,embedded:!0},{key:"tc",valueSchema:new Be},{key:"spt",valueSchema:new Tt(Gn.encodingSchema)},{key:"",valueSchema:Qn.encodingSchema,embedded:!0}]));class ea{constructor(e){this.action=e.action,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return ea.encodingSchema}toEncodingData(){return new Map([["at",this.action],["bs",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ValueDelta: ${e}`);return new ea({action:Number(e.get("at")),bytes:e.get("bs"),uint:e.get("ui")})}}ea.encodingSchema=new At(xt([{key:"at",valueSchema:new Be},{key:"bs",valueSchema:new kt},{key:"ui",valueSchema:new Be}]));class ta{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"gd",valueSchema:new Vt(new Mt(ea.encodingSchema))},{key:"ld",valueSchema:new Vt(new Tt(new Mt(ea.encodingSchema)))},{key:"sa",valueSchema:new Vt(new bt(new vt))},{key:"lg",valueSchema:new Vt(new bt(new kt))},{key:"itx",valueSchema:new Vt(new bt(aa.encodingSchema))}]))),this.encodingSchemaValue}constructor(e){this.globalDelta=e.globalDelta??new Map,this.localDeltas=e.localDeltas??new Map,this.sharedAccts=e.sharedAccts??[],this.logs=e.logs??[],this.innerTxns=e.innerTxns??[]}getEncodingSchema(){return ta.encodingSchema}toEncodingData(){return new Map([["gd",It(this.globalDelta,(e,t)=>[e,t.toEncodingData()])],["ld",It(this.localDeltas,(e,t)=>[e,It(t,(e,t)=>[e,t.toEncodingData()])])],["sa",this.sharedAccts],["lg",this.logs],["itx",this.innerTxns.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new ta({globalDelta:e.get("gd")?It(e.get("gd"),(e,t)=>[e,ea.fromEncodingData(t)]):void 0,localDeltas:e.get("ld")?It(e.get("ld"),(e,t)=>[Number(e),It(t,(e,t)=>[e,ea.fromEncodingData(t)])]):void 0,sharedAccts:e.get("sa"),logs:e.get("lg"),innerTxns:(e.get("itx")??[]).map(aa.fromEncodingData)})}}class na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"ca",valueSchema:new Vt(new Be)},{key:"aca",valueSchema:new Vt(new Be)},{key:"rs",valueSchema:new Vt(new Be)},{key:"rr",valueSchema:new Vt(new Be)},{key:"rc",valueSchema:new Vt(new Be)},{key:"dt",valueSchema:new Vt(ta.encodingSchema)},{key:"caid",valueSchema:new Vt(new Be)},{key:"apid",valueSchema:new Vt(new Be)}]))),this.encodingSchemaValue}constructor(e){this.closingAmount=e.closingAmount,this.assetClosingAmount=e.assetClosingAmount,this.senderRewards=e.senderRewards,this.receiverRewards=e.receiverRewards,this.closeRewards=e.closeRewards,this.evalDelta=e.evalDelta,this.configAsset=e.configAsset,this.applicationID=e.applicationID}getEncodingSchema(){return na.encodingSchema}toEncodingData(){return new Map([["ca",this.closingAmount],["aca",this.assetClosingAmount],["rs",this.senderRewards],["rr",this.receiverRewards],["rc",this.closeRewards],["dt",this.evalDelta?this.evalDelta.toEncodingData():void 0],["caid",this.configAsset],["apid",this.applicationID]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplyData: ${e}`);return new na({closingAmount:e.get("ca"),assetClosingAmount:e.get("aca"),senderRewards:e.get("rs"),receiverRewards:e.get("rr"),closeRewards:e.get("rc"),evalDelta:e.get("dt")?ta.fromEncodingData(e.get("dt")):void 0,configAsset:e.get("caid"),applicationID:e.get("apid")})}}class aa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"",valueSchema:Kn.encodingSchema,embedded:!0},{key:"",valueSchema:na.encodingSchema,embedded:!0}]))),this.encodingSchemaValue}constructor(e){this.signedTxn=e.signedTxn,this.applyData=e.applyData}getEncodingSchema(){return aa.encodingSchema}toEncodingData(){return Dt(this.signedTxn.toEncodingData(),this.applyData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnWithAD: ${e}`);return new aa({signedTxn:Kn.fromEncodingData(e),applyData:na.fromEncodingData(e)})}}class ia{constructor(e){this.signedTxn=e.signedTxn,this.hasGenesisID=e.hasGenesisID,this.hasGenesisHash=e.hasGenesisHash}getEncodingSchema(){return ia.encodingSchema}toEncodingData(){return Dt(new Map([["hgi",this.hasGenesisID],["hgh",this.hasGenesisHash]]),this.signedTxn.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnInBlock: ${e}`);return new ia({signedTxn:aa.fromEncodingData(e),hasGenesisID:e.get("hgi"),hasGenesisHash:e.get("hgh")})}}ia.encodingSchema=new At(xt([{key:"",valueSchema:aa.encodingSchema,embedded:!0},{key:"hgi",valueSchema:new Ve},{key:"hgh",valueSchema:new Ve}]));class ra{constructor(e){this.header=e.header,this.payset=e.payset}getEncodingSchema(){return ra.encodingSchema}toEncodingData(){const e=new Map([["txns",this.payset.map(e=>e.toEncodingData())]]);return Dt(e,this.header.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new ra({header:Zn.fromEncodingData(e),payset:e.get("txns").map(ia.fromEncodingData)})}}ra.encodingSchema=new At(xt([{key:"",valueSchema:Zn.encodingSchema,embedded:!0},{key:"txns",valueSchema:new bt(ia.encodingSchema)}]));class oa{constructor(e){this.data=e}getEncodingSchema(){return oa.encodingSchema}toEncodingData(){return this.data}static fromEncodingData(e){return new oa(e)}}oa.encodingSchema=new Rt;class sa{constructor(e){this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return sa.encodingSchema}toEncodingData(){return new Map([["tt",this.type],["tb",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new sa({type:Number(e.get("tt")),bytes:e.get("tb"),uint:e.get("ui")})}}sa.encodingSchema=new At(xt([{key:"tt",valueSchema:new Be},{key:"tb",valueSchema:new Vt(new kt)},{key:"ui",valueSchema:new Vt(new Be)}]));class ca{constructor(e){this.numUints=e.numUints,this.numByteSlices=e.numByteSlices}getEncodingSchema(){return ca.encodingSchema}toEncodingData(){return new Map([["nui",this.numUints],["nbs",this.numByteSlices]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new ca({numUints:Number(e.get("nui")),numByteSlices:Number(e.get("nbs"))})}}ca.encodingSchema=new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}]));class ha{constructor(e){this.approvalProgram=e.approvalProgram,this.clearStateProgram=e.clearStateProgram,this.globalState=e.globalState,this.localStateSchema=e.localStateSchema,this.globalStateSchema=e.globalStateSchema,this.extraProgramPages=e.extraProgramPages}getEncodingSchema(){return ha.encodingSchema}toEncodingData(){return new Map([["approv",this.approvalProgram],["clearp",this.clearStateProgram],["gs",It(this.globalState,(e,t)=>[e,t.toEncodingData()])],["lsch",this.localStateSchema.toEncodingData()],["gsch",this.globalStateSchema.toEncodingData()],["epp",this.extraProgramPages]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParams: ${e}`);return new ha({approvalProgram:e.get("approv"),clearStateProgram:e.get("clearp"),globalState:It(e.get("gs"),(e,t)=>[e,sa.fromEncodingData(t)]),localStateSchema:ca.fromEncodingData(e.get("lsch")),globalStateSchema:ca.fromEncodingData(e.get("gsch")),extraProgramPages:Number(e.get("epp"))})}}ha.encodingSchema=new At(xt([{key:"approv",valueSchema:new St},{key:"clearp",valueSchema:new St},{key:"gs",valueSchema:new Mt(sa.encodingSchema)},{key:"lsch",valueSchema:ca.encodingSchema},{key:"gsch",valueSchema:ca.encodingSchema},{key:"epp",valueSchema:new Be}]));class da{constructor(e){this.schema=e.schema,this.keyValue=e.keyValue}getEncodingSchema(){return da.encodingSchema}toEncodingData(){return new Map([["hsch",this.schema.toEncodingData()],["tkv",It(this.keyValue,(e,t)=>[e,t.toEncodingData()])]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalState: ${e}`);return new da({schema:ca.fromEncodingData(e.get("hsch")),keyValue:It(e.get("tkv"),(e,t)=>[e,sa.fromEncodingData(t)])})}}da.encodingSchema=new At(xt([{key:"hsch",valueSchema:ca.encodingSchema},{key:"tkv",valueSchema:new Mt(sa.encodingSchema)}]));class ua{constructor(e){this.localState=e.localState,this.deleted=e.deleted}getEncodingSchema(){return ua.encodingSchema}toEncodingData(){return new Map([["LocalState",this.localState?this.localState.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalStateDelta: ${e}`);return new ua({localState:e.get("LocalState")?da.fromEncodingData(e.get("LocalState")):void 0,deleted:e.get("Deleted")})}}ua.encodingSchema=new At(xt([{key:"LocalState",valueSchema:new Vt(da.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class la{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return la.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParamsDelta: ${e}`);return new la({params:e.get("Params")?ha.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}la.encodingSchema=new At(xt([{key:"Params",valueSchema:new Vt(ha.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class ga{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.state=e.state}getEncodingSchema(){return ga.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["State",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppResourceRecord: ${e}`);return new ga({id:e.get("Aidx"),address:e.get("Addr"),params:la.fromEncodingData(e.get("Params")),state:ua.fromEncodingData(e.get("State"))})}}ga.encodingSchema=new At(xt([{key:"Aidx",valueSchema:new Be},{key:"Addr",valueSchema:new vt},{key:"Params",valueSchema:la.encodingSchema},{key:"State",valueSchema:ua.encodingSchema}]));class ma{constructor(e){this.amount=e.amount,this.frozen=e.frozen}getEncodingSchema(){return ma.encodingSchema}toEncodingData(){return new Map([["a",this.amount],["f",this.frozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new ma({amount:e.get("a"),frozen:e.get("f")})}}ma.encodingSchema=new At(xt([{key:"a",valueSchema:new Be},{key:"f",valueSchema:new Ve}]));class pa{constructor(e){this.holding=e.holding,this.deleted=e.deleted}getEncodingSchema(){return pa.encodingSchema}toEncodingData(){return new Map([["Holding",this.holding?this.holding.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingDelta: ${e}`);return new pa({holding:e.get("Holding")?ma.fromEncodingData(e.get("Holding")):void 0,deleted:e.get("Deleted")})}}pa.encodingSchema=new At(xt([{key:"Holding",valueSchema:new Vt(ma.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class fa{constructor(e){this.total=e.total,this.decimals=e.decimals,this.defaultFrozen=e.defaultFrozen,this.unitName=e.unitName,this.assetName=e.assetName,this.url=e.url,this.metadataHash=e.metadataHash,this.manager=e.manager,this.reserve=e.reserve,this.freeze=e.freeze,this.clawback=e.clawback}getEncodingSchema(){return fa.encodingSchema}toEncodingData(){return new Map([["t",this.total],["dc",this.decimals],["df",this.defaultFrozen],["un",this.unitName],["an",this.assetName],["au",this.url],["am",this.metadataHash],["m",this.manager],["r",this.reserve],["f",this.freeze],["c",this.clawback]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new fa({total:e.get("t"),decimals:e.get("dc"),defaultFrozen:e.get("df"),unitName:e.get("un"),assetName:e.get("an"),url:e.get("au"),metadataHash:e.get("am"),manager:e.get("m"),reserve:e.get("r"),freeze:e.get("f"),clawback:e.get("c")})}}fa.encodingSchema=new At(xt([{key:"t",valueSchema:new Be},{key:"dc",valueSchema:new Be},{key:"df",valueSchema:new Ve},{key:"un",valueSchema:new Vt(new kt)},{key:"an",valueSchema:new Vt(new kt)},{key:"au",valueSchema:new Vt(new kt)},{key:"am",valueSchema:new Et(32)},{key:"m",valueSchema:new Vt(new vt)},{key:"r",valueSchema:new Vt(new vt)},{key:"f",valueSchema:new Vt(new vt)},{key:"c",valueSchema:new Vt(new vt)}]));class ya{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return ya.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParamsDelta: ${e}`);return new ya({params:e.get("Params")?fa.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}ya.encodingSchema=new At(xt([{key:"Params",valueSchema:new Vt(fa.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class wa{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.holding=e.holding}getEncodingSchema(){return wa.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["Holding",this.holding.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResourceRecord: ${e}`);return new wa({id:e.get("Aidx"),address:e.get("Addr"),params:ya.fromEncodingData(e.get("Params")),holding:pa.fromEncodingData(e.get("Holding"))})}}wa.encodingSchema=new At(xt([{key:"Aidx",valueSchema:new Be},{key:"Addr",valueSchema:new vt},{key:"Params",valueSchema:ya.encodingSchema},{key:"Holding",valueSchema:pa.encodingSchema}]));class va{constructor(e){this.voteID=e.voteID,this.selectionID=e.selectionID,this.stateProofID=e.stateProofID,this.voteFirstValid=e.voteFirstValid,this.voteLastValid=e.voteLastValid,this.voteKeyDilution=e.voteKeyDilution}getEncodingSchema(){return va.encodingSchema}toEncodingData(){return new Map([["VoteID",this.voteID],["SelectionID",this.selectionID],["StateProofID",this.stateProofID],["VoteFirstValid",this.voteFirstValid],["VoteLastValid",this.voteLastValid],["VoteKeyDilution",this.voteKeyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded VotingData: ${e}`);return new va({voteID:e.get("VoteID"),selectionID:e.get("SelectionID"),stateProofID:e.get("StateProofID"),voteFirstValid:e.get("VoteFirstValid"),voteLastValid:e.get("VoteLastValid"),voteKeyDilution:e.get("VoteKeyDilution")})}}va.encodingSchema=new At(xt([{key:"VoteID",valueSchema:new Et(32)},{key:"SelectionID",valueSchema:new Et(32)},{key:"StateProofID",valueSchema:new Et(64)},{key:"VoteFirstValid",valueSchema:new Be},{key:"VoteLastValid",valueSchema:new Be},{key:"VoteKeyDilution",valueSchema:new Be}]));class Sa{constructor(e){this.status=e.status,this.microAlgos=e.microAlgos,this.rewardsBase=e.rewardsBase,this.rewardedMicroAlgos=e.rewardedMicroAlgos,this.authAddr=e.authAddr,this.incentiveEligible=e.incentiveEligible,this.totalAppSchema=e.totalAppSchema,this.totalExtraAppPages=e.totalExtraAppPages,this.totalAppParams=e.totalAppParams,this.totalAppLocalStates=e.totalAppLocalStates,this.totalAssetParams=e.totalAssetParams,this.totalAssets=e.totalAssets,this.totalBoxes=e.totalBoxes,this.totalBoxBytes=e.totalBoxBytes,this.lastProposed=e.lastProposed,this.lastHeartbeat=e.lastHeartbeat}getEncodingSchema(){return Sa.encodingSchema}toEncodingData(){return new Map([["Status",this.status],["MicroAlgos",this.microAlgos],["RewardsBase",this.rewardsBase],["RewardedMicroAlgos",this.rewardedMicroAlgos],["AuthAddr",this.authAddr],["IncentiveEligible",this.incentiveEligible],["TotalAppSchema",this.totalAppSchema.toEncodingData()],["TotalExtraAppPages",this.totalExtraAppPages],["TotalAppParams",this.totalAppParams],["TotalAppLocalStates",this.totalAppLocalStates],["TotalAssetParams",this.totalAssetParams],["TotalAssets",this.totalAssets],["TotalBoxes",this.totalBoxes],["TotalBoxBytes",this.totalBoxBytes],["LastProposed",this.lastProposed],["LastHeartbeat",this.lastHeartbeat]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountBaseData: ${e}`);return new Sa({status:Number(e.get("Status")),microAlgos:e.get("MicroAlgos"),rewardsBase:e.get("RewardsBase"),rewardedMicroAlgos:e.get("RewardedMicroAlgos"),authAddr:e.get("AuthAddr"),incentiveEligible:e.get("IncentiveEligible"),totalAppSchema:ca.fromEncodingData(e.get("TotalAppSchema")),totalExtraAppPages:Number(e.get("TotalExtraAppPages")),totalAppParams:e.get("TotalAppParams"),totalAppLocalStates:e.get("TotalAppLocalStates"),totalAssetParams:e.get("TotalAssetParams"),totalAssets:e.get("TotalAssets"),totalBoxes:e.get("TotalBoxes"),totalBoxBytes:e.get("TotalBoxBytes"),lastProposed:e.get("LastProposed"),lastHeartbeat:e.get("LastHeartbeat")})}}Sa.encodingSchema=new At(xt([{key:"Status",valueSchema:new Be},{key:"MicroAlgos",valueSchema:new Be},{key:"RewardsBase",valueSchema:new Be},{key:"RewardedMicroAlgos",valueSchema:new Be},{key:"AuthAddr",valueSchema:new vt},{key:"IncentiveEligible",valueSchema:new Ve},{key:"TotalAppSchema",valueSchema:ca.encodingSchema},{key:"TotalExtraAppPages",valueSchema:new Be},{key:"TotalAppParams",valueSchema:new Be},{key:"TotalAppLocalStates",valueSchema:new Be},{key:"TotalAssetParams",valueSchema:new Be},{key:"TotalAssets",valueSchema:new Be},{key:"TotalBoxes",valueSchema:new Be},{key:"TotalBoxBytes",valueSchema:new Be},{key:"LastProposed",valueSchema:new Be},{key:"LastHeartbeat",valueSchema:new Be}]));class Ea{constructor(e){this.accountBaseData=e.accountBaseData,this.votingData=e.votingData}getEncodingSchema(){return Ea.encodingSchema}toEncodingData(){return Dt(this.accountBaseData.toEncodingData(),this.votingData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountData: ${e}`);return new Ea({accountBaseData:Sa.fromEncodingData(e),votingData:va.fromEncodingData(e)})}}Ea.encodingSchema=new At(xt([{key:"",valueSchema:Sa.encodingSchema,embedded:!0},{key:"",valueSchema:va.encodingSchema,embedded:!0}]));class ka{constructor(e){this.addr=e.addr,this.accountData=e.accountData}getEncodingSchema(){return ka.encodingSchema}toEncodingData(){return Dt(new Map([["Addr",this.addr]]),this.accountData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BalanceRecord: ${e}`);return new ka({addr:e.get("Addr"),accountData:Ea.fromEncodingData(e)})}}ka.encodingSchema=new At(xt([{key:"Addr",valueSchema:new vt},{key:"",valueSchema:Ea.encodingSchema,embedded:!0}]));class ba{constructor(e){this.accounts=e.accounts,this.appResources=e.appResources,this.assetResources=e.assetResources}getEncodingSchema(){return ba.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.map(e=>e.toEncodingData())],["AppResources",0===this.appResources.length?void 0:this.appResources.map(e=>e.toEncodingData())],["AssetResources",0===this.assetResources.length?void 0:this.assetResources.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountDeltas: ${e}`);return new ba({accounts:(e.get("Accts")??[]).map(ka.fromEncodingData),appResources:(e.get("AppResources")??[]).map(ga.fromEncodingData),assetResources:(e.get("AssetResources")??[]).map(wa.fromEncodingData)})}}ba.encodingSchema=new At(xt([{key:"Accts",valueSchema:new bt(ka.encodingSchema)},{key:"AppResources",valueSchema:new Vt(new bt(ga.encodingSchema))},{key:"AssetResources",valueSchema:new Vt(new bt(wa.encodingSchema))}]));class xa{constructor(e){this.data=e.data,this.oldData=e.oldData}getEncodingSchema(){return xa.encodingSchema}toEncodingData(){return new Map([["Data",this.data],["OldData",this.oldData]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded KvValueDelta: ${e}`);return new xa({data:e.get("Data"),oldData:e.get("OldData")})}}xa.encodingSchema=new At(xt([{key:"Data",valueSchema:new Vt(new St)},{key:"OldData",valueSchema:new Vt(new St)}]));class Aa{constructor(e){this.lastValid=e.lastValid,this.intra=e.intra}getEncodingSchema(){return Aa.encodingSchema}toEncodingData(){return new Map([["LastValid",this.lastValid],["Intra",this.intra]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IncludedTransactions: ${e}`);return new Aa({lastValid:e.get("LastValid"),intra:Number(e.get("Intra"))})}}Aa.encodingSchema=new At(xt([{key:"LastValid",valueSchema:new Be},{key:"Intra",valueSchema:new Be}]));class Da{constructor(e){this.creatableType=e.creatableType,this.created=e.created,this.creator=e.creator,this.ndeltas=e.ndeltas}getEncodingSchema(){return Da.encodingSchema}toEncodingData(){return new Map([["Ctype",this.creatableType],["Created",this.created],["Creator",this.creator],["Ndeltas",this.ndeltas]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ModifiedCreatable: ${e}`);return new Da({creatableType:Number(e.get("Ctype")),created:e.get("Created"),creator:e.get("Creator"),ndeltas:Number(e.get("Ndeltas"))})}}Da.encodingSchema=new At(xt([{key:"Ctype",valueSchema:new Be},{key:"Created",valueSchema:new Ve},{key:"Creator",valueSchema:new vt},{key:"Ndeltas",valueSchema:new Be}]));class Ia{constructor(e){this.money=e.money,this.rewardUnits=e.rewardUnits}getEncodingSchema(){return Ia.encodingSchema}toEncodingData(){return new Map([["mon",this.money],["rwd",this.rewardUnits]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AlgoCount: ${e}`);return new Ia({money:e.get("mon"),rewardUnits:e.get("rwd")})}}Ia.encodingSchema=new At(xt([{key:"mon",valueSchema:new Be},{key:"rwd",valueSchema:new Be}]));class Ta{constructor(e){this.online=e.online,this.offline=e.offline,this.notParticipating=e.notParticipating,this.rewardsLevel=e.rewardsLevel}getEncodingSchema(){return Ta.encodingSchema}toEncodingData(){return new Map([["online",this.online.toEncodingData()],["offline",this.offline.toEncodingData()],["notpart",this.notParticipating.toEncodingData()],["rwdlvl",this.rewardsLevel]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountTotals: ${e}`);return new Ta({online:Ia.fromEncodingData(e.get("online")),offline:Ia.fromEncodingData(e.get("offline")),notParticipating:Ia.fromEncodingData(e.get("notpart")),rewardsLevel:e.get("rwdlvl")})}}Ta.encodingSchema=new At(xt([{key:"online",valueSchema:Ia.encodingSchema},{key:"offline",valueSchema:Ia.encodingSchema},{key:"notpart",valueSchema:Ia.encodingSchema},{key:"rwdlvl",valueSchema:new Be}]));class Pa{constructor(e){this.accounts=e.accounts,this.kvMods=e.kvMods,this.txids=e.txids,this.txleases=e.txleases,this.creatables=e.creatables,this.blockHeader=e.blockHeader,this.stateProofNext=e.stateProofNext,this.prevTimestamp=e.prevTimestamp,this.totals=e.totals}getEncodingSchema(){return Pa.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.toEncodingData()],["KvMods",0===this.kvMods.size?void 0:It(this.kvMods,(e,t)=>[e,t.toEncodingData()])],["Txids",It(this.txids,(e,t)=>[e,t.toEncodingData()])],["Txleases",this.txleases.toEncodingData()],["Creatables",0===this.creatables.size?void 0:It(this.creatables,(e,t)=>[e,t.toEncodingData()])],["Hdr",this.blockHeader.toEncodingData()],["StateProofNext",this.stateProofNext],["PrevTimestamp",this.prevTimestamp],["Totals",this.totals.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDelta: ${e}`);return new Pa({accounts:ba.fromEncodingData(e.get("Accts")),kvMods:It(e.get("KvMods")??new Map,(e,t)=>[e,xa.fromEncodingData(t)]),txids:It(e.get("Txids"),(e,t)=>[e,Aa.fromEncodingData(t)]),txleases:oa.fromEncodingData(e.get("Txleases")),creatables:It(e.get("Creatables")??new Map,(e,t)=>[e,Da.fromEncodingData(t)]),blockHeader:Zn.fromEncodingData(e.get("Hdr")),stateProofNext:e.get("StateProofNext"),prevTimestamp:e.get("PrevTimestamp"),totals:Ta.fromEncodingData(e.get("Totals"))})}}Pa.encodingSchema=new At(xt([{key:"Accts",valueSchema:ba.encodingSchema},{key:"KvMods",valueSchema:new Vt(new Mt(xa.encodingSchema))},{key:"Txids",valueSchema:new class extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(n,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("ByteArrayMapSchema data must be a Map");const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);n.set(a,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);const e=de(a);if(n.has(e))throw new Error(`Duplicate key (base64): ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("ByteArrayMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(he(n),this.valueSchema.fromPreparedJSON(a));return t}}(Aa.encodingSchema)},{key:"Txleases",valueSchema:new Vt(new Rt)},{key:"Creatables",valueSchema:new Vt(new Tt(Da.encodingSchema))},{key:"Hdr",valueSchema:Zn.encodingSchema},{key:"StateProofNext",valueSchema:new Be},{key:"PrevTimestamp",valueSchema:new Be},{key:"Totals",valueSchema:Ta.encodingSchema}]));class Ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"min-balance",valueSchema:new Be,omitEmpty:!0},{key:"pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"rewards",valueSchema:new Be,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"status",valueSchema:new Re,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-created-apps",valueSchema:new Be,omitEmpty:!0},{key:"total-created-assets",valueSchema:new Be,omitEmpty:!0},{key:"apps-local-state",valueSchema:new Vt(new bt(Ka.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(Wa.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"created-apps",valueSchema:new Vt(new bt(_a.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new Vt(new bt(Ja.encodingSchema)),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-proposed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation",valueSchema:new Vt(Oa.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-type",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"total-box-bytes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"total-boxes",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalCreatedApps:d,totalCreatedAssets:u,appsLocalState:l,appsTotalExtraPages:g,appsTotalSchema:m,assets:p,authAddr:f,createdApps:y,createdAssets:w,incentiveEligible:S,lastHeartbeat:k,lastProposed:b,participation:x,rewardBase:A,sigType:D,totalBoxBytes:I,totalBoxes:T}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=E(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalCreatedApps=v(d),this.totalCreatedAssets=v(u),this.appsLocalState=l,this.appsTotalExtraPages=void 0===g?void 0:v(g),this.appsTotalSchema=m,this.assets=p,this.authAddr="string"==typeof f?ut.fromString(f):f,this.createdApps=y,this.createdAssets=w,this.incentiveEligible=S,this.lastHeartbeat=void 0===k?void 0:v(k),this.lastProposed=void 0===b?void 0:v(b),this.participation=x,this.rewardBase=void 0===A?void 0:E(A),this.sigType=D,this.totalBoxBytes=void 0===I?void 0:v(I),this.totalBoxes=void 0===T?void 0:v(T)}getEncodingSchema(){return Ma.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map(e=>e.toEncodingData()):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map(e=>e.toEncodingData()):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["created-apps",void 0!==this.createdApps?this.createdApps.map(e=>e.toEncodingData()):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map(e=>e.toEncodingData()):void 0],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new Ma({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map(e=>Ka.fromEncodingData(e)):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Ga.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map(e=>Wa.fromEncodingData(e)):void 0,authAddr:e.get("auth-addr"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map(e=>_a.fromEncodingData(e)):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map(e=>Ja.fromEncodingData(e)):void 0,incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?Oa.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes")})}}class Va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"app-local-state",valueSchema:new Vt(Ka.encodingSchema),omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"params",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appLocalState:t,createdAtRound:n,deleted:a,params:i}){this.id=v(e),this.appLocalState=t,this.createdAtRound=void 0===n?void 0:v(n),this.deleted=a,this.params=i}getEncodingSchema(){return Va.encodingSchema}toEncodingData(){return new Map([["id",this.id],["app-local-state",void 0!==this.appLocalState?this.appLocalState.toEncodingData():void 0],["created-at-round",this.createdAtRound],["deleted",this.deleted],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationResource: ${e}`);return new Va({id:e.get("id"),appLocalState:void 0!==e.get("app-local-state")?Ka.fromEncodingData(e.get("app-local-state")):void 0,createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),params:void 0!==e.get("params")?Ha.fromEncodingData(e.get("params")):void 0})}}class Ra{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"app-local-state",valueSchema:new Vt(Ka.encodingSchema),omitEmpty:!0},{key:"created-app",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,appLocalState:t,createdApp:n}){this.round=E(e),this.appLocalState=t,this.createdApp=n}getEncodingSchema(){return Ra.encodingSchema}toEncodingData(){return new Map([["round",this.round],["app-local-state",void 0!==this.appLocalState?this.appLocalState.toEncodingData():void 0],["created-app",void 0!==this.createdApp?this.createdApp.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationResponse: ${e}`);return new Ra({round:e.get("round"),appLocalState:void 0!==e.get("app-local-state")?Ka.fromEncodingData(e.get("app-local-state")):void 0,createdApp:void 0!==e.get("created-app")?Ha.fromEncodingData(e.get("created-app")):void 0})}}class Ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"application-resources",valueSchema:new Vt(new bt(Va.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,applicationResources:t,nextToken:n}){this.round=v(e),this.applicationResources=t,this.nextToken=n}getEncodingSchema(){return Ba.encodingSchema}toEncodingData(){return new Map([["round",this.round],["application-resources",void 0!==this.applicationResources?this.applicationResources.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationsInformationResponse: ${e}`);return new Ba({round:e.get("round"),applicationResources:void 0!==e.get("application-resources")?e.get("application-resources").map(e=>Va.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class Ca{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset-holding",valueSchema:Wa.encodingSchema,omitEmpty:!0},{key:"asset-params",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetHolding:e,assetParams:t}){this.assetHolding=e,this.assetParams=t}getEncodingSchema(){return Ca.encodingSchema}toEncodingData(){return new Map([["asset-holding",this.assetHolding.toEncodingData()],["asset-params",void 0!==this.assetParams?this.assetParams.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetHolding: ${e}`);return new Ca({assetHolding:Wa.fromEncodingData(e.get("asset-holding")??new Map),assetParams:void 0!==e.get("asset-params")?Xa.fromEncodingData(e.get("asset-params")):void 0})}}class Ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"asset-holding",valueSchema:new Vt(Wa.encodingSchema),omitEmpty:!0},{key:"created-asset",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHolding:t,createdAsset:n}){this.round=E(e),this.assetHolding=t,this.createdAsset=n}getEncodingSchema(){return Ua.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holding",void 0!==this.assetHolding?this.assetHolding.toEncodingData():void 0],["created-asset",void 0!==this.createdAsset?this.createdAsset.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetResponse: ${e}`);return new Ua({round:e.get("round"),assetHolding:void 0!==e.get("asset-holding")?Wa.fromEncodingData(e.get("asset-holding")):void 0,createdAsset:void 0!==e.get("created-asset")?Xa.fromEncodingData(e.get("created-asset")):void 0})}}class $a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"asset-holdings",valueSchema:new Vt(new bt(Ca.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHoldings:t,nextToken:n}){this.round=v(e),this.assetHoldings=t,this.nextToken=n}getEncodingSchema(){return $a.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetsInformationResponse: ${e}`);return new $a({round:e.get("round"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map(e=>Ca.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class Oa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new St,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new St,omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?he(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?he(i):i,this.stateProofKey="string"==typeof r?he(r):r}getEncodingSchema(){return Oa.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new Oa({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class Na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"delta",valueSchema:new bt(gi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return Na.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new Na({address:e.get("address"),delta:(e.get("delta")??[]).map(e=>gi.fromEncodingData(e))})}}class La{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-index",valueSchema:new Be,omitEmpty:!0},{key:"logs",valueSchema:new bt(new St),omitEmpty:!0},{key:"txId",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationIndex:e,logs:t,txid:n}){this.applicationIndex=v(e),this.logs=t,this.txid=n}getEncodingSchema(){return La.encodingSchema}toEncodingData(){return new Map([["application-index",this.applicationIndex],["logs",this.logs],["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppCallLogs: ${e}`);return new La({applicationIndex:e.get("application-index"),logs:e.get("logs"),txid:e.get("txId")})}}class _a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t}){this.id=E(e),this.params=t}getEncodingSchema(){return _a.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new _a({id:e.get("id"),params:void 0!==e.get("params")?Ha.fromEncodingData(e.get("params")):void 0})}}class Fa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"app-boxes",valueSchema:new Vt(qa.encodingSchema),omitEmpty:!0},{key:"app-globals",valueSchema:new Vt(qa.encodingSchema),omitEmpty:!0},{key:"app-locals",valueSchema:new Vt(new bt(qa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appBoxes:t,appGlobals:n,appLocals:a}){this.id=E(e),this.appBoxes=t,this.appGlobals=n,this.appLocals=a}getEncodingSchema(){return Fa.encodingSchema}toEncodingData(){return new Map([["id",this.id],["app-boxes",void 0!==this.appBoxes?this.appBoxes.toEncodingData():void 0],["app-globals",void 0!==this.appGlobals?this.appGlobals.toEncodingData():void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationInitialStates: ${e}`);return new Fa({id:e.get("id"),appBoxes:void 0!==e.get("app-boxes")?qa.fromEncodingData(e.get("app-boxes")):void 0,appGlobals:void 0!==e.get("app-globals")?qa.fromEncodingData(e.get("app-globals")):void 0,appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map(e=>qa.fromEncodingData(e)):void 0})}}class qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"kvs",valueSchema:new bt(Qa.encodingSchema),omitEmpty:!0},{key:"account",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({kvs:e,account:t}){this.kvs=e,this.account="string"==typeof t?ut.fromString(t):t}getEncodingSchema(){return qa.encodingSchema}toEncodingData(){return new Map([["kvs",this.kvs.map(e=>e.toEncodingData())],["account",void 0!==this.account?this.account.toString():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationKVStorage: ${e}`);return new qa({kvs:(e.get("kvs")??[]).map(e=>Qa.fromEncodingData(e)),account:e.get("account")})}}class za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new Re,omitEmpty:!0},{key:"app",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,app:t}){this.account="string"==typeof e?ut.fromString(e):e,this.app=E(t)}getEncodingSchema(){return za.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["app",this.app]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalReference: ${e}`);return new za({account:e.get("account"),app:e.get("app")})}}class Ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"schema",valueSchema:Ga.encodingSchema,omitEmpty:!0},{key:"key-value",valueSchema:new Vt(new bt(Li.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,keyValue:n}){this.id=E(e),this.schema=t,this.keyValue=n}getEncodingSchema(){return Ka.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["key-value",void 0!==this.keyValue?this.keyValue.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new Ka({id:e.get("id"),schema:Ga.fromEncodingData(e.get("schema")??new Map),keyValue:void 0!==e.get("key-value")?e.get("key-value").map(e=>Li.fromEncodingData(e)):void 0})}}class Ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new St,omitEmpty:!0},{key:"clear-state-program",valueSchema:new St,omitEmpty:!0},{key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"global-state",valueSchema:new Vt(new bt(Li.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"size-sponsor",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:i,globalStateSchema:r,localStateSchema:o,sizeSponsor:s,version:c}){this.approvalProgram="string"==typeof e?he(e):e,this.clearStateProgram="string"==typeof t?he(t):t,this.creator="string"==typeof n?ut.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.globalState=i,this.globalStateSchema=r,this.localStateSchema=o,this.sizeSponsor="string"==typeof s?ut.fromString(s):s,this.version=void 0===c?void 0:v(c)}getEncodingSchema(){return Ha.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",this.creator.toString()],["extra-program-pages",this.extraProgramPages],["global-state",void 0!==this.globalState?this.globalState.map(e=>e.toEncodingData()):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["size-sponsor",void 0!==this.sizeSponsor?this.sizeSponsor.toString():void 0],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new Ha({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),globalState:void 0!==e.get("global-state")?e.get("global-state").map(e=>Li.fromEncodingData(e)):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Ga.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Ga.fromEncodingData(e.get("local-state-schema")):void 0,sizeSponsor:e.get("size-sponsor"),version:e.get("version")})}}class ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app-state-type",valueSchema:new Re,omitEmpty:!0},{key:"key",valueSchema:new St,omitEmpty:!0},{key:"operation",valueSchema:new Re,omitEmpty:!0},{key:"account",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"new-value",valueSchema:new Vt(Za.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({appStateType:e,key:t,operation:n,account:a,newValue:i}){this.appStateType=e,this.key="string"==typeof t?he(t):t,this.operation=n,this.account="string"==typeof a?ut.fromString(a):a,this.newValue=i}getEncodingSchema(){return ja.encodingSchema}toEncodingData(){return new Map([["app-state-type",this.appStateType],["key",this.key],["operation",this.operation],["account",void 0!==this.account?this.account.toString():void 0],["new-value",void 0!==this.newValue?this.newValue.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateOperation: ${e}`);return new ja({appStateType:e.get("app-state-type"),key:e.get("key"),operation:e.get("operation"),account:e.get("account"),newValue:void 0!==e.get("new-value")?Za.fromEncodingData(e.get("new-value")):void 0})}}class Ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Ga.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new Ga({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t}){this.index=E(e),this.params=t}getEncodingSchema(){return Ja.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Ja({index:e.get("index"),params:void 0!==e.get("params")?Xa.fromEncodingData(e.get("params")):void 0})}}class Wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n}getEncodingSchema(){return Wa.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Wa({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen")})}}class Ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new Re,omitEmpty:!0},{key:"asset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,asset:t}){this.account="string"==typeof e?ut.fromString(e):e,this.asset=E(t)}getEncodingSchema(){return Ya.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["asset",this.asset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingReference: ${e}`);return new Ya({account:e.get("account"),asset:e.get("asset")})}}class Xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"decimals",valueSchema:new Be,omitEmpty:!0},{key:"total",valueSchema:new Be,omitEmpty:!0},{key:"clawback",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"default-frozen",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"freeze",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"manager",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"metadata-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"reserve",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"url",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"url-b64",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?he(s):s,this.name=c,this.nameB64="string"==typeof h?he(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?he(l):l,this.url=g,this.urlB64="string"==typeof m?he(m):m}getEncodingSchema(){return Xa.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Xa({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class Qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:Za.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return Qa.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmKeyValue: ${e}`);return new Qa({key:e.get("key"),value:Za.fromEncodingData(e.get("value")??new Map)})}}class Za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"type",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new St),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({type:e,bytes:t,uint:n}){this.type=v(e),this.bytes="string"==typeof t?he(t):t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return Za.encodingSchema}toEncodingData(){return new Map([["type",this.type],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmValue: ${e}`);return new Za({type:e.get("type"),bytes:e.get("bytes"),uint:e.get("uint")})}}class ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blockHash",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockhash:e}){this.blockhash=e}getEncodingSchema(){return ei.encodingSchema}toEncodingData(){return new Map([["blockHash",this.blockhash]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHashResponse: ${e}`);return new ei({blockhash:e.get("blockHash")})}}class ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new bt(La.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e}){this.logs=e}getEncodingSchema(){return ti.encodingSchema}toEncodingData(){return new Map([["logs",this.logs.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockLogsResponse: ${e}`);return new ti({logs:(e.get("logs")??[]).map(e=>La.fromEncodingData(e))})}}class ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"block",valueSchema:ra.encodingSchema,omitEmpty:!0},{key:"cert",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({block:e,cert:t}){this.block=e,this.cert=t}getEncodingSchema(){return ni.encodingSchema}toEncodingData(){return new Map([["block",this.block.toEncodingData()],["cert",void 0!==this.cert?this.cert.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockResponse: ${e}`);return new ni({block:ra.fromEncodingData(e.get("block")??new Map),cert:void 0!==e.get("cert")?oa.fromEncodingData(e.get("cert")):void 0})}}class ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blockTxids",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocktxids:e}){this.blocktxids=e}getEncodingSchema(){return ai.encodingSchema}toEncodingData(){return new Map([["blockTxids",this.blocktxids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockTxidsResponse: ${e}`);return new ai({blocktxids:e.get("blockTxids")})}}class ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"value",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?he(e):e,this.round=E(t),this.value="string"==typeof n?he(n):n}getEncodingSchema(){return ii.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new ii({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,value:t}){this.name="string"==typeof e?he(e):e,this.value="string"==typeof t?he(t):t}getEncodingSchema(){return ri.encodingSchema}toEncodingData(){return new Map([["name",this.name],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new ri({name:e.get("name"),value:e.get("value")})}}class oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new Be,omitEmpty:!0},{key:"name",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=E(e),this.name="string"==typeof t?he(t):t}getEncodingSchema(){return oi.encodingSchema}toEncodingData(){return new Map([["app",this.app],["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxReference: ${e}`);return new oi({app:e.get("app"),name:e.get("name")})}}class si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"boxes",valueSchema:new bt(ri.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({boxes:e,nextToken:t,round:n}){this.boxes=e,this.nextToken=t,this.round=void 0===n?void 0:v(n)}getEncodingSchema(){return si.encodingSchema}toEncodingData(){return new Map([["boxes",this.boxes.map(e=>e.toEncodingData())],["next-token",this.nextToken],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new si({boxes:(e.get("boxes")??[]).map(e=>ri.fromEncodingData(e)),nextToken:e.get("next-token"),round:e.get("round")})}}class ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"branch",valueSchema:new Re,omitEmpty:!0},{key:"build_number",valueSchema:new Be,omitEmpty:!0},{key:"channel",valueSchema:new Re,omitEmpty:!0},{key:"commit_hash",valueSchema:new Re,omitEmpty:!0},{key:"major",valueSchema:new Be,omitEmpty:!0},{key:"minor",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({branch:e,buildNumber:t,channel:n,commitHash:a,major:i,minor:r}){this.branch=e,this.buildNumber=v(t),this.channel=n,this.commitHash=a,this.major=v(i),this.minor=v(r)}getEncodingSchema(){return ci.encodingSchema}toEncodingData(){return new Map([["branch",this.branch],["build_number",this.buildNumber],["channel",this.channel],["commit_hash",this.commitHash],["major",this.major],["minor",this.minor]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BuildVersion: ${e}`);return new ci({branch:e.get("branch"),buildNumber:e.get("build_number"),channel:e.get("channel"),commitHash:e.get("commit_hash"),major:e.get("major"),minor:e.get("minor")})}}class hi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash",valueSchema:new Re,omitEmpty:!0},{key:"result",valueSchema:new Re,omitEmpty:!0},{key:"sourcemap",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({hash:e,result:t,sourcemap:n}){this.hash=e,this.result=t,this.sourcemap=n}getEncodingSchema(){return hi.encodingSchema}toEncodingData(){return new Map([["hash",this.hash],["result",this.result],["sourcemap",void 0!==this.sourcemap?this.sourcemap.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded CompileResponse: ${e}`);return new hi({hash:e.get("hash"),result:e.get("result"),sourcemap:void 0!==e.get("sourcemap")?oa.fromEncodingData(e.get("sourcemap")):void 0})}}class di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"result",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({result:e}){this.result=e}getEncodingSchema(){return di.encodingSchema}toEncodingData(){return new Map([["result",this.result]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DisassembleResponse: ${e}`);return new di({result:e.get("result")})}}class ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return ui.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new ui({message:e.get("message"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0})}}class li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return li.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new li({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class gi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new Re,omitEmpty:!0},{key:"value",valueSchema:li.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return gi.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new gi({key:e.get("key"),value:li.fromEncodingData(e.get("value")??new Map)})}}class mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"alloc",valueSchema:new bt(pi.encodingSchema),omitEmpty:!0},{key:"fees",valueSchema:new Re,omitEmpty:!0},{key:"id",valueSchema:new Re,omitEmpty:!0},{key:"network",valueSchema:new Re,omitEmpty:!0},{key:"proto",valueSchema:new Re,omitEmpty:!0},{key:"rwd",valueSchema:new Re,omitEmpty:!0},{key:"timestamp",valueSchema:new Be,omitEmpty:!0},{key:"comment",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"devmode",valueSchema:new Vt(new Ve),omitEmpty:!0})),this.encodingSchemaValue}constructor({alloc:e,fees:t,id:n,network:a,proto:i,rwd:r,timestamp:o,comment:s,devmode:c}){this.alloc=e,this.fees=t,this.id=n,this.network=a,this.proto=i,this.rwd=r,this.timestamp=v(o),this.comment=s,this.devmode=c}getEncodingSchema(){return mi.encodingSchema}toEncodingData(){return new Map([["alloc",this.alloc.map(e=>e.toEncodingData())],["fees",this.fees],["id",this.id],["network",this.network],["proto",this.proto],["rwd",this.rwd],["timestamp",this.timestamp],["comment",this.comment],["devmode",this.devmode]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Genesis: ${e}`);return new mi({alloc:(e.get("alloc")??[]).map(e=>pi.fromEncodingData(e)),fees:e.get("fees"),id:e.get("id"),network:e.get("network"),proto:e.get("proto"),rwd:e.get("rwd"),timestamp:e.get("timestamp"),comment:e.get("comment"),devmode:e.get("devmode")})}}class pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"addr",valueSchema:new Re,omitEmpty:!0},{key:"comment",valueSchema:new Re,omitEmpty:!0},{key:"state",valueSchema:oa.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({addr:e,comment:t,state:n}){this.addr=e,this.comment=t,this.state=n}getEncodingSchema(){return pi.encodingSchema}toEncodingData(){return new Map([["addr",this.addr],["comment",this.comment],["state",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GenesisAllocation: ${e}`);return new pi({addr:e.get("addr"),comment:e.get("comment"),state:oa.fromEncodingData(e.get("state")??new Map)})}}class fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"offset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({offset:e}){this.offset=v(e)}getEncodingSchema(){return fi.encodingSchema}toEncodingData(){return new Map([["offset",this.offset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetBlockTimeStampOffsetResponse: ${e}`);return new fi({offset:e.get("offset")})}}class yi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e}){this.round=E(e)}getEncodingSchema(){return yi.encodingSchema}toEncodingData(){return new Map([["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetSyncRoundResponse: ${e}`);return new yi({round:e.get("round")})}}class wi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Delta",valueSchema:Pa.encodingSchema,omitEmpty:!0},{key:"Ids",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({delta:e,ids:t}){this.delta=e,this.ids=t}getEncodingSchema(){return wi.encodingSchema}toEncodingData(){return new Map([["Delta",this.delta.toEncodingData()],["Ids",this.ids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDeltaForTransactionGroup: ${e}`);return new wi({delta:Pa.fromEncodingData(e.get("Delta")??new Map),ids:e.get("Ids")})}}class vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"proof",valueSchema:new St,omitEmpty:!0},{key:"treedepth",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,proof:t,treedepth:n}){this.index=v(e),this.proof="string"==typeof t?he(t):t,this.treedepth=v(n)}getEncodingSchema(){return vi.encodingSchema}toEncodingData(){return new Map([["index",this.index],["proof",this.proof],["treedepth",this.treedepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LightBlockHeaderProof: ${e}`);return new vi({index:e.get("index"),proof:e.get("proof"),treedepth:e.get("treedepth")})}}class Si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"catchup-time",valueSchema:new Be,omitEmpty:!0},{key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"last-version",valueSchema:new Re,omitEmpty:!0},{key:"next-version",valueSchema:new Re,omitEmpty:!0},{key:"next-version-round",valueSchema:new Be,omitEmpty:!0},{key:"next-version-supported",valueSchema:new Ve,omitEmpty:!0},{key:"stopped-at-unsupported-round",valueSchema:new Ve,omitEmpty:!0},{key:"time-since-last-round",valueSchema:new Be,omitEmpty:!0},{key:"catchpoint",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"catchpoint-acquired-blocks",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-processed-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-processed-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-blocks",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-verified-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-verified-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-catchpoint",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-next-protocol-vote-before",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-no-votes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-node-vote",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"upgrade-vote-rounds",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-votes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-votes-required",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-yes-votes",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({catchupTime:e,lastRound:t,lastVersion:n,nextVersion:a,nextVersionRound:i,nextVersionSupported:r,stoppedAtUnsupportedRound:o,timeSinceLastRound:s,catchpoint:c,catchpointAcquiredBlocks:h,catchpointProcessedAccounts:d,catchpointProcessedKvs:u,catchpointTotalAccounts:l,catchpointTotalBlocks:g,catchpointTotalKvs:m,catchpointVerifiedAccounts:p,catchpointVerifiedKvs:f,lastCatchpoint:y,upgradeDelay:w,upgradeNextProtocolVoteBefore:S,upgradeNoVotes:k,upgradeNodeVote:b,upgradeVoteRounds:x,upgradeVotes:A,upgradeVotesRequired:D,upgradeYesVotes:I}){this.catchupTime=E(e),this.lastRound=E(t),this.lastVersion=n,this.nextVersion=a,this.nextVersionRound=E(i),this.nextVersionSupported=r,this.stoppedAtUnsupportedRound=o,this.timeSinceLastRound=E(s),this.catchpoint=c,this.catchpointAcquiredBlocks=void 0===h?void 0:v(h),this.catchpointProcessedAccounts=void 0===d?void 0:v(d),this.catchpointProcessedKvs=void 0===u?void 0:v(u),this.catchpointTotalAccounts=void 0===l?void 0:v(l),this.catchpointTotalBlocks=void 0===g?void 0:v(g),this.catchpointTotalKvs=void 0===m?void 0:v(m),this.catchpointVerifiedAccounts=void 0===p?void 0:v(p),this.catchpointVerifiedKvs=void 0===f?void 0:v(f),this.lastCatchpoint=y,this.upgradeDelay=void 0===w?void 0:E(w),this.upgradeNextProtocolVoteBefore=void 0===S?void 0:E(S),this.upgradeNoVotes=void 0===k?void 0:v(k),this.upgradeNodeVote=b,this.upgradeVoteRounds=void 0===x?void 0:v(x),this.upgradeVotes=void 0===A?void 0:v(A),this.upgradeVotesRequired=void 0===D?void 0:v(D),this.upgradeYesVotes=void 0===I?void 0:v(I)}getEncodingSchema(){return Si.encodingSchema}toEncodingData(){return new Map([["catchup-time",this.catchupTime],["last-round",this.lastRound],["last-version",this.lastVersion],["next-version",this.nextVersion],["next-version-round",this.nextVersionRound],["next-version-supported",this.nextVersionSupported],["stopped-at-unsupported-round",this.stoppedAtUnsupportedRound],["time-since-last-round",this.timeSinceLastRound],["catchpoint",this.catchpoint],["catchpoint-acquired-blocks",this.catchpointAcquiredBlocks],["catchpoint-processed-accounts",this.catchpointProcessedAccounts],["catchpoint-processed-kvs",this.catchpointProcessedKvs],["catchpoint-total-accounts",this.catchpointTotalAccounts],["catchpoint-total-blocks",this.catchpointTotalBlocks],["catchpoint-total-kvs",this.catchpointTotalKvs],["catchpoint-verified-accounts",this.catchpointVerifiedAccounts],["catchpoint-verified-kvs",this.catchpointVerifiedKvs],["last-catchpoint",this.lastCatchpoint],["upgrade-delay",this.upgradeDelay],["upgrade-next-protocol-vote-before",this.upgradeNextProtocolVoteBefore],["upgrade-no-votes",this.upgradeNoVotes],["upgrade-node-vote",this.upgradeNodeVote],["upgrade-vote-rounds",this.upgradeVoteRounds],["upgrade-votes",this.upgradeVotes],["upgrade-votes-required",this.upgradeVotesRequired],["upgrade-yes-votes",this.upgradeYesVotes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded NodeStatusResponse: ${e}`);return new Si({catchupTime:e.get("catchup-time"),lastRound:e.get("last-round"),lastVersion:e.get("last-version"),nextVersion:e.get("next-version"),nextVersionRound:e.get("next-version-round"),nextVersionSupported:e.get("next-version-supported"),stoppedAtUnsupportedRound:e.get("stopped-at-unsupported-round"),timeSinceLastRound:e.get("time-since-last-round"),catchpoint:e.get("catchpoint"),catchpointAcquiredBlocks:e.get("catchpoint-acquired-blocks"),catchpointProcessedAccounts:e.get("catchpoint-processed-accounts"),catchpointProcessedKvs:e.get("catchpoint-processed-kvs"),catchpointTotalAccounts:e.get("catchpoint-total-accounts"),catchpointTotalBlocks:e.get("catchpoint-total-blocks"),catchpointTotalKvs:e.get("catchpoint-total-kvs"),catchpointVerifiedAccounts:e.get("catchpoint-verified-accounts"),catchpointVerifiedKvs:e.get("catchpoint-verified-kvs"),lastCatchpoint:e.get("last-catchpoint"),upgradeDelay:e.get("upgrade-delay"),upgradeNextProtocolVoteBefore:e.get("upgrade-next-protocol-vote-before"),upgradeNoVotes:e.get("upgrade-no-votes"),upgradeNodeVote:e.get("upgrade-node-vote"),upgradeVoteRounds:e.get("upgrade-vote-rounds"),upgradeVotes:e.get("upgrade-votes"),upgradeVotesRequired:e.get("upgrade-votes-required"),upgradeYesVotes:e.get("upgrade-yes-votes")})}}class Ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"pool-error",valueSchema:new Re,omitEmpty:!0},{key:"txn",valueSchema:Kn.encodingSchema,omitEmpty:!0},{key:"application-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"confirmed-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"global-state-delta",valueSchema:new Vt(new bt(gi.encodingSchema)),omitEmpty:!0},{key:"inner-txns",valueSchema:new Vt(new bt(Ei.encodingSchema)),omitEmpty:!0},{key:"local-state-delta",valueSchema:new Vt(new bt(Na.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sender-rewards",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({poolError:e,txn:t,applicationIndex:n,assetClosingAmount:a,assetIndex:i,closeRewards:r,closingAmount:o,confirmedRound:s,globalStateDelta:c,innerTxns:h,localStateDelta:d,logs:u,receiverRewards:l,senderRewards:g}){this.poolError=e,this.txn=t,this.applicationIndex=void 0===n?void 0:E(n),this.assetClosingAmount=void 0===a?void 0:E(a),this.assetIndex=void 0===i?void 0:E(i),this.closeRewards=void 0===r?void 0:E(r),this.closingAmount=void 0===o?void 0:E(o),this.confirmedRound=void 0===s?void 0:E(s),this.globalStateDelta=c,this.innerTxns=h,this.localStateDelta=d,this.logs=u,this.receiverRewards=void 0===l?void 0:E(l),this.senderRewards=void 0===g?void 0:E(g)}getEncodingSchema(){return Ei.encodingSchema}toEncodingData(){return new Map([["pool-error",this.poolError],["txn",this.txn.toEncodingData()],["application-index",this.applicationIndex],["asset-closing-amount",this.assetClosingAmount],["asset-index",this.assetIndex],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map(e=>e.toEncodingData()):void 0],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map(e=>e.toEncodingData()):void 0],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map(e=>e.toEncodingData()):void 0],["logs",this.logs],["receiver-rewards",this.receiverRewards],["sender-rewards",this.senderRewards]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionResponse: ${e}`);return new Ei({poolError:e.get("pool-error"),txn:Kn.fromEncodingData(e.get("txn")??new Map),applicationIndex:e.get("application-index"),assetClosingAmount:e.get("asset-closing-amount"),assetIndex:e.get("asset-index"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map(e=>gi.fromEncodingData(e)):void 0,innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map(e=>Ei.fromEncodingData(e)):void 0,localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map(e=>Na.fromEncodingData(e)):void 0,logs:e.get("logs"),receiverRewards:e.get("receiver-rewards"),senderRewards:e.get("sender-rewards")})}}class ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"top-transactions",valueSchema:new bt(Kn.encodingSchema),omitEmpty:!0},{key:"total-transactions",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({topTransactions:e,totalTransactions:t}){this.topTransactions=e,this.totalTransactions=v(t)}getEncodingSchema(){return ki.encodingSchema}toEncodingData(){return new Map([["top-transactions",this.topTransactions.map(e=>e.toEncodingData())],["total-transactions",this.totalTransactions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionsResponse: ${e}`);return new ki({topTransactions:(e.get("top-transactions")??[]).map(e=>Kn.fromEncodingData(e)),totalTransactions:e.get("total-transactions")})}}class bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txId",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({txid:e}){this.txid=e}getEncodingSchema(){return bi.encodingSchema}toEncodingData(){return new Map([["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PostTransactionsResponse: ${e}`);return new bi({txid:e.get("txId")})}}class xi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"new-value",valueSchema:Za.encodingSchema,omitEmpty:!0},{key:"slot",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({newValue:e,slot:t}){this.newValue=e,this.slot=v(t)}getEncodingSchema(){return xi.encodingSchema}toEncodingData(){return new Map([["new-value",this.newValue.toEncodingData()],["slot",this.slot]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ScratchChange: ${e}`);return new xi({newValue:Za.fromEncodingData(e.get("new-value")??new Map),slot:e.get("slot")})}}class Ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app-initial-states",valueSchema:new Vt(new bt(Fa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({appInitialStates:e}){this.appInitialStates=e}getEncodingSchema(){return Ai.encodingSchema}toEncodingData(){return new Map([["app-initial-states",void 0!==this.appInitialStates?this.appInitialStates.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateInitialStates: ${e}`);return new Ai({appInitialStates:void 0!==e.get("app-initial-states")?e.get("app-initial-states").map(e=>Fa.fromEncodingData(e)):void 0})}}class Di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-groups",valueSchema:new bt(Ii.encodingSchema),omitEmpty:!0},{key:"allow-empty-signatures",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-more-logging",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new Vt(Pi.encodingSchema),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fix-signers",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:n,allowUnnamedResources:a,execTraceConfig:i,extraOpcodeBudget:r,fixSigners:o,round:s}){this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=n,this.allowUnnamedResources=a,this.execTraceConfig=i,this.extraOpcodeBudget=void 0===r?void 0:v(r),this.fixSigners=o,this.round=void 0===s?void 0:E(s)}getEncodingSchema(){return Di.encodingSchema}toEncodingData(){return new Map([["txn-groups",this.txnGroups.map(e=>e.toEncodingData())],["allow-empty-signatures",this.allowEmptySignatures],["allow-more-logging",this.allowMoreLogging],["allow-unnamed-resources",this.allowUnnamedResources],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequest: ${e}`);return new Di({txnGroups:(e.get("txn-groups")??[]).map(e=>Ii.fromEncodingData(e)),allowEmptySignatures:e.get("allow-empty-signatures"),allowMoreLogging:e.get("allow-more-logging"),allowUnnamedResources:e.get("allow-unnamed-resources"),execTraceConfig:void 0!==e.get("exec-trace-config")?Pi.fromEncodingData(e.get("exec-trace-config")):void 0,extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),round:e.get("round")})}}class Ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txns",valueSchema:new bt(Kn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txns:e}){this.txns=e}getEncodingSchema(){return Ii.encodingSchema}toEncodingData(){return new Map([["txns",this.txns.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequestTransactionGroup: ${e}`);return new Ii({txns:(e.get("txns")??[]).map(e=>Kn.fromEncodingData(e))})}}class Ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"txn-groups",valueSchema:new bt(Mi.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new Be,omitEmpty:!0},{key:"eval-overrides",valueSchema:new Vt(Bi.encodingSchema),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new Vt(Pi.encodingSchema),omitEmpty:!0},{key:"initial-states",valueSchema:new Vt(Ai.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lastRound:e,txnGroups:t,version:n,evalOverrides:a,execTraceConfig:i,initialStates:r}){this.lastRound=E(e),this.txnGroups=t,this.version=v(n),this.evalOverrides=a,this.execTraceConfig=i,this.initialStates=r}getEncodingSchema(){return Ti.encodingSchema}toEncodingData(){return new Map([["last-round",this.lastRound],["txn-groups",this.txnGroups.map(e=>e.toEncodingData())],["version",this.version],["eval-overrides",void 0!==this.evalOverrides?this.evalOverrides.toEncodingData():void 0],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["initial-states",void 0!==this.initialStates?this.initialStates.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateResponse: ${e}`);return new Ti({lastRound:e.get("last-round"),txnGroups:(e.get("txn-groups")??[]).map(e=>Mi.fromEncodingData(e)),version:e.get("version"),evalOverrides:void 0!==e.get("eval-overrides")?Bi.fromEncodingData(e.get("eval-overrides")):void 0,execTraceConfig:void 0!==e.get("exec-trace-config")?Pi.fromEncodingData(e.get("exec-trace-config")):void 0,initialStates:void 0!==e.get("initial-states")?Ai.fromEncodingData(e.get("initial-states")):void 0})}}class Pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"enable",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"scratch-change",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"stack-change",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"state-change",valueSchema:new Vt(new Ve),omitEmpty:!0})),this.encodingSchemaValue}constructor({enable:e,scratchChange:t,stackChange:n,stateChange:a}){this.enable=e,this.scratchChange=t,this.stackChange=n,this.stateChange=a}getEncodingSchema(){return Pi.encodingSchema}toEncodingData(){return new Map([["enable",this.enable],["scratch-change",this.scratchChange],["stack-change",this.stackChange],["state-change",this.stateChange]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTraceConfig: ${e}`);return new Pi({enable:e.get("enable"),scratchChange:e.get("scratch-change"),stackChange:e.get("stack-change"),stateChange:e.get("state-change")})}}class Mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-results",valueSchema:new bt(Vi.encodingSchema),omitEmpty:!0},{key:"app-budget-added",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"failed-at",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"failure-message",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new Vt(Ri.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:n,failedAt:a,failureMessage:i,unnamedResourcesAccessed:r}){this.txnResults=e,this.appBudgetAdded=void 0===t?void 0:v(t),this.appBudgetConsumed=void 0===n?void 0:v(n),this.failedAt=void 0===a?void 0:a.map(v),this.failureMessage=i,this.unnamedResourcesAccessed=r}getEncodingSchema(){return Mi.encodingSchema}toEncodingData(){return new Map([["txn-results",this.txnResults.map(e=>e.toEncodingData())],["app-budget-added",this.appBudgetAdded],["app-budget-consumed",this.appBudgetConsumed],["failed-at",this.failedAt],["failure-message",this.failureMessage],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionGroupResult: ${e}`);return new Mi({txnResults:(e.get("txn-results")??[]).map(e=>Vi.fromEncodingData(e)),appBudgetAdded:e.get("app-budget-added"),appBudgetConsumed:e.get("app-budget-consumed"),failedAt:e.get("failed-at"),failureMessage:e.get("failure-message"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?Ri.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class Vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-result",valueSchema:Ei.encodingSchema,omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"exec-trace",valueSchema:new Vt(Ui.encodingSchema),omitEmpty:!0},{key:"fixed-signer",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"logic-sig-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new Vt(Ri.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResult:e,appBudgetConsumed:t,execTrace:n,fixedSigner:a,logicSigBudgetConsumed:i,unnamedResourcesAccessed:r}){this.txnResult=e,this.appBudgetConsumed=void 0===t?void 0:v(t),this.execTrace=n,this.fixedSigner="string"==typeof a?ut.fromString(a):a,this.logicSigBudgetConsumed=void 0===i?void 0:v(i),this.unnamedResourcesAccessed=r}getEncodingSchema(){return Vi.encodingSchema}toEncodingData(){return new Map([["txn-result",this.txnResult.toEncodingData()],["app-budget-consumed",this.appBudgetConsumed],["exec-trace",void 0!==this.execTrace?this.execTrace.toEncodingData():void 0],["fixed-signer",void 0!==this.fixedSigner?this.fixedSigner.toString():void 0],["logic-sig-budget-consumed",this.logicSigBudgetConsumed],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionResult: ${e}`);return new Vi({txnResult:Ei.fromEncodingData(e.get("txn-result")??new Map),appBudgetConsumed:e.get("app-budget-consumed"),execTrace:void 0!==e.get("exec-trace")?Ui.fromEncodingData(e.get("exec-trace")):void 0,fixedSigner:e.get("fixed-signer"),logicSigBudgetConsumed:e.get("logic-sig-budget-consumed"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?Ri.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class Ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"app-locals",valueSchema:new Vt(new bt(za.encodingSchema)),omitEmpty:!0},{key:"apps",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"asset-holdings",valueSchema:new Vt(new bt(Ya.encodingSchema)),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"boxes",valueSchema:new Vt(new bt(oi.encodingSchema)),omitEmpty:!0},{key:"extra-box-refs",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,appLocals:t,apps:n,assetHoldings:a,assets:i,boxes:r,extraBoxRefs:o}){this.accounts=void 0!==e?e.map(e=>"string"==typeof e?ut.fromString(e):e):void 0,this.appLocals=t,this.apps=void 0===n?void 0:n.map(E),this.assetHoldings=a,this.assets=void 0===i?void 0:i.map(E),this.boxes=r,this.extraBoxRefs=void 0===o?void 0:v(o)}getEncodingSchema(){return Ri.encodingSchema}toEncodingData(){return new Map([["accounts",void 0!==this.accounts?this.accounts.map(e=>e.toString()):void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map(e=>e.toEncodingData()):void 0],["apps",this.apps],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map(e=>e.toEncodingData()):void 0],["assets",this.assets],["boxes",void 0!==this.boxes?this.boxes.map(e=>e.toEncodingData()):void 0],["extra-box-refs",this.extraBoxRefs]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateUnnamedResourcesAccessed: ${e}`);return new Ri({accounts:e.get("accounts"),appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map(e=>za.fromEncodingData(e)):void 0,apps:e.get("apps"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map(e=>Ya.fromEncodingData(e)):void 0,assets:e.get("assets"),boxes:void 0!==e.get("boxes")?e.get("boxes").map(e=>oi.fromEncodingData(e)):void 0,extraBoxRefs:e.get("extra-box-refs")})}}class Bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"allow-empty-signatures",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fix-signers",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"max-log-calls",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"max-log-size",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:n,fixSigners:a,maxLogCalls:i,maxLogSize:r}){this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=void 0===n?void 0:v(n),this.fixSigners=a,this.maxLogCalls=void 0===i?void 0:v(i),this.maxLogSize=void 0===r?void 0:v(r)}getEncodingSchema(){return Bi.encodingSchema}toEncodingData(){return new Map([["allow-empty-signatures",this.allowEmptySignatures],["allow-unnamed-resources",this.allowUnnamedResources],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["max-log-calls",this.maxLogCalls],["max-log-size",this.maxLogSize]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationEvalOverrides: ${e}`);return new Bi({allowEmptySignatures:e.get("allow-empty-signatures"),allowUnnamedResources:e.get("allow-unnamed-resources"),extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),maxLogCalls:e.get("max-log-calls"),maxLogSize:e.get("max-log-size")})}}class Ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"pc",valueSchema:new Be,omitEmpty:!0},{key:"scratch-changes",valueSchema:new Vt(new bt(xi.encodingSchema)),omitEmpty:!0},{key:"spawned-inners",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"stack-additions",valueSchema:new Vt(new bt(Za.encodingSchema)),omitEmpty:!0},{key:"stack-pop-count",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"state-changes",valueSchema:new Vt(new bt(ja.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({pc:e,scratchChanges:t,spawnedInners:n,stackAdditions:a,stackPopCount:i,stateChanges:r}){this.pc=v(e),this.scratchChanges=t,this.spawnedInners=void 0===n?void 0:n.map(v),this.stackAdditions=a,this.stackPopCount=void 0===i?void 0:v(i),this.stateChanges=r}getEncodingSchema(){return Ci.encodingSchema}toEncodingData(){return new Map([["pc",this.pc],["scratch-changes",void 0!==this.scratchChanges?this.scratchChanges.map(e=>e.toEncodingData()):void 0],["spawned-inners",this.spawnedInners],["stack-additions",void 0!==this.stackAdditions?this.stackAdditions.map(e=>e.toEncodingData()):void 0],["stack-pop-count",this.stackPopCount],["state-changes",void 0!==this.stateChanges?this.stateChanges.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationOpcodeTraceUnit: ${e}`);return new Ci({pc:e.get("pc"),scratchChanges:void 0!==e.get("scratch-changes")?e.get("scratch-changes").map(e=>xi.fromEncodingData(e)):void 0,spawnedInners:e.get("spawned-inners"),stackAdditions:void 0!==e.get("stack-additions")?e.get("stack-additions").map(e=>Za.fromEncodingData(e)):void 0,stackPopCount:e.get("stack-pop-count"),stateChanges:void 0!==e.get("state-changes")?e.get("state-changes").map(e=>ja.fromEncodingData(e)):void 0})}}class Ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"approval-program-trace",valueSchema:new Vt(new bt(Ci.encodingSchema)),omitEmpty:!0},{key:"clear-state-program-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"clear-state-program-trace",valueSchema:new Vt(new bt(Ci.encodingSchema)),omitEmpty:!0},{key:"clear-state-rollback",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"clear-state-rollback-error",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"inner-trace",valueSchema:new Vt(new bt(Ui.encodingSchema)),omitEmpty:!0},{key:"logic-sig-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new Vt(new bt(Ci.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:n,clearStateProgramTrace:a,clearStateRollback:i,clearStateRollbackError:r,innerTrace:o,logicSigHash:s,logicSigTrace:c}){this.approvalProgramHash="string"==typeof e?he(e):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof n?he(n):n,this.clearStateProgramTrace=a,this.clearStateRollback=i,this.clearStateRollbackError=r,this.innerTrace=o,this.logicSigHash="string"==typeof s?he(s):s,this.logicSigTrace=c}getEncodingSchema(){return Ui.encodingSchema}toEncodingData(){return new Map([["approval-program-hash",this.approvalProgramHash],["approval-program-trace",void 0!==this.approvalProgramTrace?this.approvalProgramTrace.map(e=>e.toEncodingData()):void 0],["clear-state-program-hash",this.clearStateProgramHash],["clear-state-program-trace",void 0!==this.clearStateProgramTrace?this.clearStateProgramTrace.map(e=>e.toEncodingData()):void 0],["clear-state-rollback",this.clearStateRollback],["clear-state-rollback-error",this.clearStateRollbackError],["inner-trace",void 0!==this.innerTrace?this.innerTrace.map(e=>e.toEncodingData()):void 0],["logic-sig-hash",this.logicSigHash],["logic-sig-trace",void 0!==this.logicSigTrace?this.logicSigTrace.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationTransactionExecTrace: ${e}`);return new Ui({approvalProgramHash:e.get("approval-program-hash"),approvalProgramTrace:void 0!==e.get("approval-program-trace")?e.get("approval-program-trace").map(e=>Ci.fromEncodingData(e)):void 0,clearStateProgramHash:e.get("clear-state-program-hash"),clearStateProgramTrace:void 0!==e.get("clear-state-program-trace")?e.get("clear-state-program-trace").map(e=>Ci.fromEncodingData(e)):void 0,clearStateRollback:e.get("clear-state-rollback"),clearStateRollbackError:e.get("clear-state-rollback-error"),innerTrace:void 0!==e.get("inner-trace")?e.get("inner-trace").map(e=>Ui.fromEncodingData(e)):void 0,logicSigHash:e.get("logic-sig-hash"),logicSigTrace:void 0!==e.get("logic-sig-trace")?e.get("logic-sig-trace").map(e=>Ci.fromEncodingData(e)):void 0})}}class $i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Message",valueSchema:Oi.encodingSchema,omitEmpty:!0},{key:"StateProof",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateproof:t}){this.message=e,this.stateproof="string"==typeof t?he(t):t}getEncodingSchema(){return $i.encodingSchema}toEncodingData(){return new Map([["Message",this.message.toEncodingData()],["StateProof",this.stateproof]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new $i({message:Oi.fromEncodingData(e.get("Message")??new Map),stateproof:e.get("StateProof")})}}class Oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"BlockHeadersCommitment",valueSchema:new St,omitEmpty:!0},{key:"FirstAttestedRound",valueSchema:new Be,omitEmpty:!0},{key:"LastAttestedRound",valueSchema:new Be,omitEmpty:!0},{key:"LnProvenWeight",valueSchema:new Be,omitEmpty:!0},{key:"VotersCommitment",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:n,lnprovenweight:a,voterscommitment:i}){this.blockheaderscommitment="string"==typeof e?he(e):e,this.firstattestedround=E(t),this.lastattestedround=E(n),this.lnprovenweight=E(a),this.voterscommitment="string"==typeof i?he(i):i}getEncodingSchema(){return Oi.encodingSchema}toEncodingData(){return new Map([["BlockHeadersCommitment",this.blockheaderscommitment],["FirstAttestedRound",this.firstattestedround],["LastAttestedRound",this.lastattestedround],["LnProvenWeight",this.lnprovenweight],["VotersCommitment",this.voterscommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new Oi({blockheaderscommitment:e.get("BlockHeadersCommitment"),firstattestedround:e.get("FirstAttestedRound"),lastattestedround:e.get("LastAttestedRound"),lnprovenweight:e.get("LnProvenWeight"),voterscommitment:e.get("VotersCommitment")})}}class Ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current_round",valueSchema:new Be,omitEmpty:!0},{key:"online-money",valueSchema:new Be,omitEmpty:!0},{key:"online-stake",valueSchema:new Be,omitEmpty:!0},{key:"total-money",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,onlineMoney:t,onlineStake:n,totalMoney:a}){this.currentRound=E(e),this.onlineMoney=E(t),this.onlineStake=E(n),this.totalMoney=E(a)}getEncodingSchema(){return Ni.encodingSchema}toEncodingData(){return new Map([["current_round",this.currentRound],["online-money",this.onlineMoney],["online-stake",this.onlineStake],["total-money",this.totalMoney]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SupplyResponse: ${e}`);return new Ni({currentRound:e.get("current_round"),onlineMoney:e.get("online-money"),onlineStake:e.get("online-stake"),totalMoney:e.get("total-money")})}}class Li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:_i.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return Li.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new Li({key:e.get("key"),value:_i.fromEncodingData(e.get("value")??new Map)})}}class _i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new St,omitEmpty:!0},{key:"type",valueSchema:new Be,omitEmpty:!0},{key:"uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?he(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return _i.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new _i({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class Fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Deltas",valueSchema:new bt(wi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({deltas:e}){this.deltas=e}getEncodingSchema(){return Fi.encodingSchema}toEncodingData(){return new Map([["Deltas",this.deltas.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionGroupLedgerStateDeltasForRoundResponse: ${e}`);return new Fi({deltas:(e.get("Deltas")??[]).map(e=>wi.fromEncodingData(e))})}}class qi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"consensus-version",valueSchema:new Re,omitEmpty:!0},{key:"fee",valueSchema:new Be,omitEmpty:!0},{key:"genesis-hash",valueSchema:new St,omitEmpty:!0},{key:"genesis-id",valueSchema:new Re,omitEmpty:!0},{key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"min-fee",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({consensusVersion:e,fee:t,genesisHash:n,genesisId:a,lastRound:i,minFee:r}){this.consensusVersion=e,this.fee=E(t),this.genesisHash="string"==typeof n?he(n):n,this.genesisId=a,this.lastRound=E(i),this.minFee=E(r)}getEncodingSchema(){return qi.encodingSchema}toEncodingData(){return new Map([["consensus-version",this.consensusVersion],["fee",this.fee],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["last-round",this.lastRound],["min-fee",this.minFee]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionParametersResponse: ${e}`);return new qi({consensusVersion:e.get("consensus-version"),fee:e.get("fee"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),lastRound:e.get("last-round"),minFee:e.get("min-fee")})}}class zi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"idx",valueSchema:new Be,omitEmpty:!0},{key:"proof",valueSchema:new St,omitEmpty:!0},{key:"stibhash",valueSchema:new St,omitEmpty:!0},{key:"treedepth",valueSchema:new Be,omitEmpty:!0},{key:"hashtype",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({idx:e,proof:t,stibhash:n,treedepth:a,hashtype:i}){this.idx=v(e),this.proof="string"==typeof t?he(t):t,this.stibhash="string"==typeof n?he(n):n,this.treedepth=v(a),this.hashtype=i}getEncodingSchema(){return zi.encodingSchema}toEncodingData(){return new Map([["idx",this.idx],["proof",this.proof],["stibhash",this.stibhash],["treedepth",this.treedepth],["hashtype",this.hashtype]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionProof: ${e}`);return new zi({idx:e.get("idx"),proof:e.get("proof"),stibhash:e.get("stibhash"),treedepth:e.get("treedepth"),hashtype:e.get("hashtype")})}}class Ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"build",valueSchema:ci.encodingSchema,omitEmpty:!0},{key:"genesis_hash_b64",valueSchema:new St,omitEmpty:!0},{key:"genesis_id",valueSchema:new Re,omitEmpty:!0},{key:"versions",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({build:e,genesisHashB64:t,genesisId:n,versions:a}){this.build=e,this.genesisHashB64="string"==typeof t?he(t):t,this.genesisId=n,this.versions=a}getEncodingSchema(){return Ki.encodingSchema}toEncodingData(){return new Map([["build",this.build.toEncodingData()],["genesis_hash_b64",this.genesisHashB64],["genesis_id",this.genesisId],["versions",this.versions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Version: ${e}`);return new Ki({build:ci.fromEncodingData(e.get("build")??new Map),genesisHashB64:e.get("genesis_hash_b64"),genesisId:e.get("genesis_id"),versions:e.get("versions")})}}class Hi{constructor(e){this.c=e,this.query={}}executeRequest(e,t){return this.c.get({relativePath:this.path(),query:this.query,requestHeaders:e,customOptions:t})}async do(e,t){const n=await this.executeRequest(e,t);return this.prepare(n)}async doRaw(e,t){return(await this.executeRequest(e,t)).body}}class ji extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}prepare(e){return Pe(e.getJSONText(),Ma)}}class Gi extends Hi{constructor(e,t,n){super(e),this.account=t.toString(),this.assetID=BigInt(n)}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}prepare(e){return Pe(e.getJSONText(),Ua)}}class Ji extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}next(e){return this.query.next=e,this}prepare(e){return Pe(e.getJSONText(),$a)}}class Wi extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/applications`}include(e){return this.query.include=e.join(","),this}limit(e){return this.query.limit=e,this}next(e){return this.query.next=e,this}prepare(e){return Pe(e.getJSONText(),Ba)}}class Yi extends Hi{constructor(e,t,n){super(e),this.account=t.toString(),this.applicationID=BigInt(n)}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}prepare(e){return Pe(e.getJSONText(),Ra)}}class Xi extends Hi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return Ie(e.body,ni)}}class Qi extends Hi{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:le(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),hi)}}class Zi extends Hi{path(){return"/genesis"}prepare(e){return e.getJSONText()}}class er extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}prepare(e){return Pe(e.getJSONText(),Ja)}}class tr extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}prepare(e){return Pe(e.getJSONText(),_a)}}class nr extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/hash`}prepare(e){return Pe(e.getJSONText(),ei)}}class ar extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/txids`}prepare(e){return Pe(e.getJSONText(),ai)}}class ir extends Hi{constructor(e,t,n){super(e),this.index=BigInt(t);const a=de(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return Pe(e.getJSONText(),ii)}}class rr extends Hi{constructor(e,t){super(e),this.index=BigInt(t),this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}next(e){return this.query.next=e,this}prefix(e){return this.query.prefix=`b64:${de(e)}`,this}include(...e){return this.query.include=e.join(","),this}limit(e){return this.query.limit=e,this}round(e){return this.query.round=v(e),this}prepare(e){return Pe(e.getJSONText(),si)}}class or extends Hi{path(){return"/health"}prepare(e){}}class sr extends Hi{constructor(e,t){super(e),this.txid=t,this.query.format="msgpack"}prepare(e){return Ie(e.body,Ei)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class cr extends Hi{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){return Ie(e.body,ki)}max(e){return this.query.max=e,this}}class hr extends Hi{constructor(e,t){super(e),this.address=t.toString(),this.query.format="msgpack"}prepare(e){return Ie(e.body,ki)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class dr extends Hi{constructor(e,t,n){super(e),this.txID=n,this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}prepare(e){return Pe(e.getJSONText(),zi)}}function ur(e){return e&&void 0!==e.byteLength}class lr extends Hi{constructor(e,t){super(e);let n=t;if(Array.isArray(t)){if(!t.every(ur))throw new TypeError("Array elements must be byte arrays");n=y(...t)}else if(!ur(n))throw new TypeError("Argument must be byte array");this.txnBytesToPost=n}path(){return"/v2/transactions"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="application/x-binary"),t}(e);return this.c.post({relativePath:this.path(),data:this.txnBytesToPost,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),bi)}}class gr extends Hi{path(){return"/v2/status"}prepare(e){return Pe(e.getJSONText(),Si)}}class mr extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/status/wait-for-block-after/${this.round}`}prepare(e){return Pe(e.getJSONText(),Si)}}class pr extends Hi{path(){return"/v2/transactions/params"}prepare(e){const t=Pe(e.getJSONText(),qi);return{flatFee:!1,fee:t.fee,firstValid:t.lastRound,lastValid:t.lastRound+BigInt(1e3),genesisID:t.genesisId,genesisHash:t.genesisHash,minFee:t.minFee,consensusVersion:t.consensusVersion}}}class fr extends Hi{path(){return"/v2/ledger/supply"}prepare(e){return Pe(e.getJSONText(),Ni)}}class yr extends Hi{path(){return"/versions"}prepare(e){return Pe(e.getJSONText(),Ki)}}class wr extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/lightheader/proof`}prepare(e){return Pe(e.getJSONText(),vi)}}class vr extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/stateproofs/${this.round}`}prepare(e){return Pe(e.getJSONText(),$i)}}class Sr extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/ledger/sync/${this.round}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class Er extends Hi{path(){return"/v2/ledger/sync"}prepare(e){return Pe(e.getJSONText(),yi)}}class kr extends Hi{constructor(e,t){super(e),this.offset=BigInt(t)}path(){return`/v2/devmode/blocks/offset/${this.offset}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class br extends Hi{path(){return"/v2/devmode/blocks/offset"}prepare(e){return Pe(e.getJSONText(),fi)}}class xr extends Hi{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/disassemble"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:le(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),di)}}class Ar extends Hi{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=Te(t)}path(){return"/v2/transactions/simulate"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="application/msgpack"),t}(e);return this.c.post({relativePath:this.path(),data:this.requestBytes,query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Ie(e.body,Ti)}}class Dr extends Hi{path(){return"/ready"}prepare(e){}}class Ir extends Hi{path(){return"/v2/ledger/sync"}executeRequest(e,t){return this.c.delete({relativePath:this.path(),data:void 0,requestHeaders:e,customOptions:t})}prepare(e){}}class Tr extends Hi{constructor(e,t){super(e),this.id=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/txn/group/${this.id}`}prepare(e){return Ie(e.body,Pa)}}class Pr extends Hi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}`}prepare(e){return Ie(e.body,Pa)}}class Mr extends Hi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return Ie(e.body,Fi)}}class Vr extends T{constructor(e,t,n,a={}){super("X-Algo-API-Token",e,t,n,a)}healthCheck(){return new or(this.c)}versionsCheck(){return new yr(this.c)}sendRawTransaction(e){return new lr(this.c,e)}accountInformation(e){return new ji(this.c,e)}accountAssetInformation(e,t){return new Gi(this.c,e,t)}accountAssetsInformation(e){return new Ji(this.c,e)}accountApplicationsInformation(e){return new Wi(this.c,e)}accountApplicationInformation(e,t){return new Yi(this.c,e,t)}block(e){return new Xi(this.c,e)}getBlockHash(e){return new nr(this.c,e)}getBlockTxids(e){return new ar(this.c,e)}pendingTransactionInformation(e){return new sr(this.c,e)}pendingTransactionsInformation(){return new cr(this.c)}pendingTransactionByAddress(e){return new hr(this.c,e)}status(){return new gr(this.c)}statusAfterBlock(e){return new mr(this.c,e)}getTransactionParams(){return new pr(this.c)}supply(){return new fr(this.c)}compile(e){return new Qi(this.c,e)}disassemble(e){return new xr(this.c,e)}getAssetByID(e){return new er(this.c,e)}getApplicationByID(e){return new tr(this.c,e)}getApplicationBoxByName(e,t){return new ir(this.c,e,t)}getApplicationBoxes(e){return new rr(this.c,e)}genesis(){return new Zi(this.c)}getTransactionProof(e,t){return new dr(this.c,e,t)}getLightBlockHeaderProof(e){return new wr(this.c,e)}getStateProof(e){return new vr(this.c,e)}simulateRawTransactions(e){const t=[];if(Array.isArray(e))for(const n of e)t.push(Ie(n,Kn));else t.push(Ie(e,Kn));const n=new Di({txnGroups:[new Ii({txns:t})]});return this.simulateTransactions(n)}simulateTransactions(e){return new Ar(this.c,e)}setBlockOffsetTimestamp(e){return new kr(this.c,e)}getBlockOffsetTimestamp(){return new br(this.c)}setSyncRound(e){return new Sr(this.c,e)}unsetSyncRound(){return new Ir(this.c)}getSyncRound(){return new Er(this.c)}ready(){return new Dr(this.c)}getLedgerStateDeltaForTransactionGroup(e){return new Tr(this.c,e)}getLedgerStateDelta(e){return new Pr(this.c,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new Mr(this.c,e)}}class Rr extends T{constructor(e,t="http://127.0.0.1",n=7833,a={}){super("X-KMD-API-Token",e,t,n,a)}async get(e){return(await this.c.get({relativePath:e})).parseBodyAsJSON({intDecoding:l.SAFE})}async delete(e,t){return(await this.c.delete({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async post(e,t){return(await this.c.post({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async versions(){return this.get("/versions")}async listWallets(){return this.get("/v1/wallets")}async createWallet(e,t,n=new Uint8Array,a="sqlite"){const i={wallet_name:e,wallet_driver_name:a,wallet_password:t,master_derivation_key:de(n)};return this.post("/v1/wallet",i)}async initWalletHandle(e,t){const n={wallet_id:e,wallet_password:t};return this.post("/v1/wallet/init",n)}async releaseWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/release",t)}async renewWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/renew",t)}async renameWallet(e,t,n){const a={wallet_id:e,wallet_password:t,wallet_name:n};return this.post("/v1/wallet/rename",a)}async getWallet(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/info",t)}async exportMasterDerivationKey(e,t){const n={wallet_handle_token:e,wallet_password:t};return{master_derivation_key:he((await this.post("/v1/master-key/export",n)).master_derivation_key)}}async importKey(e,t){const n={wallet_handle_token:e,private_key:de(t)};return this.post("/v1/key/import",n)}async exportKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return{private_key:he((await this.post("/v1/key/export",a)).private_key)}}async generateKey(e){const t={wallet_handle_token:e,display_mnemonic:!1};return this.post("/v1/key",t)}async deleteKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/key",a)}async listKeys(e){const t={wallet_handle_token:e};return this.post("/v1/key/list",t)}async signTransaction(e,t,n){const a={wallet_handle_token:e,wallet_password:t,transaction:de(n.toByte())};return he((await this.post("/v1/transaction/sign",a)).signed_transaction)}async signTransactionWithSpecificPublicKey(e,t,n,a){const i=le(a),r={wallet_handle_token:e,wallet_password:t,transaction:de(n.toByte()),public_key:de(i)};return he((await this.post("/v1/transaction/sign",r)).signed_transaction)}async listMultisig(e){const t={wallet_handle_token:e};return this.post("/v1/multisig/list",t)}async importMultisig(e,t,n,a){const i={wallet_handle_token:e,multisig_version:t,threshold:n,pks:a};return this.post("/v1/multisig/import",i)}async exportMultisig(e,t){const n={wallet_handle_token:e,address:t};return this.post("/v1/multisig/export",n)}async signMultisigTransaction(e,t,n,a,i){const r=le(a),o={wallet_handle_token:e,transaction:de(n.toByte()),public_key:de(r),partial_multisig:i,wallet_password:t};return this.post("/v1/multisig/sign",o)}async deleteMultisig(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/multisig",a)}}class Br{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"min-balance",valueSchema:new Be,omitEmpty:!0},{key:"pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"rewards",valueSchema:new Be,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"status",valueSchema:new Re,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-box-bytes",valueSchema:new Be,omitEmpty:!0},{key:"total-boxes",valueSchema:new Be,omitEmpty:!0},{key:"total-created-apps",valueSchema:new Be,omitEmpty:!0},{key:"total-created-assets",valueSchema:new Be,omitEmpty:!0},{key:"apps-local-state",valueSchema:new Vt(new bt(Lr.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new Vt(Hr.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(Wr.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"closed-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-apps",valueSchema:new Vt(new bt(Nr.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new Vt(new bt(Gr.encodingSchema)),omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-proposed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation",valueSchema:new Vt(Cr.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-type",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalBoxBytes:d,totalBoxes:u,totalCreatedApps:l,totalCreatedAssets:g,appsLocalState:m,appsTotalExtraPages:p,appsTotalSchema:f,assets:y,authAddr:w,closedAtRound:S,createdApps:k,createdAssets:b,createdAtRound:x,deleted:A,incentiveEligible:D,lastHeartbeat:I,lastProposed:T,participation:P,rewardBase:M,sigType:V}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=v(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalBoxBytes=v(d),this.totalBoxes=v(u),this.totalCreatedApps=v(l),this.totalCreatedAssets=v(g),this.appsLocalState=m,this.appsTotalExtraPages=void 0===p?void 0:v(p),this.appsTotalSchema=f,this.assets=y,this.authAddr="string"==typeof w?ut.fromString(w):w,this.closedAtRound=void 0===S?void 0:E(S),this.createdApps=k,this.createdAssets=b,this.createdAtRound=void 0===x?void 0:E(x),this.deleted=A,this.incentiveEligible=D,this.lastHeartbeat=void 0===I?void 0:v(I),this.lastProposed=void 0===T?void 0:v(T),this.participation=P,this.rewardBase=void 0===M?void 0:E(M),this.sigType=V}getEncodingSchema(){return Br.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map(e=>e.toEncodingData()):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map(e=>e.toEncodingData()):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["closed-at-round",this.closedAtRound],["created-apps",void 0!==this.createdApps?this.createdApps.map(e=>e.toEncodingData()):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map(e=>e.toEncodingData()):void 0],["created-at-round",this.createdAtRound],["deleted",this.deleted],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new Br({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map(e=>Lr.fromEncodingData(e)):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Hr.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map(e=>Wr.fromEncodingData(e)):void 0,authAddr:e.get("auth-addr"),closedAtRound:e.get("closed-at-round"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map(e=>Nr.fromEncodingData(e)):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map(e=>Gr.fromEncodingData(e)):void 0,createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?Cr.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type")})}}class Cr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new St,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new St,omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?he(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?he(i):i,this.stateProofKey="string"==typeof r?he(r):r}getEncodingSchema(){return Cr.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new Cr({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class Ur{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:Br.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,currentRound:t}){this.account=e,this.currentRound=E(t)}getEncodingSchema(){return Ur.encodingSchema}toEncodingData(){return new Map([["account",this.account.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountResponse: ${e}`);return new Ur({account:Br.fromEncodingData(e.get("account")??new Map),currentRound:e.get("current-round")})}}class $r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"delta",valueSchema:new bt(lo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return $r.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new $r({address:e.get("address"),delta:(e.get("delta")??[]).map(e=>lo.fromEncodingData(e))})}}class Or{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new bt(Br.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,currentRound:t,nextToken:n}){this.accounts=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Or.encodingSchema}toEncodingData(){return new Map([["accounts",this.accounts.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountsResponse: ${e}`);return new Or({accounts:(e.get("accounts")??[]).map(e=>Br.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Nr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:zr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"deleted-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t,createdAtRound:n,deleted:a,deletedAtRound:i}){this.id=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.deletedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return Nr.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["deleted-at-round",this.deletedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new Nr({id:e.get("id"),params:zr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),deletedAtRound:e.get("deleted-at-round")})}}class Lr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"schema",valueSchema:Hr.encodingSchema,omitEmpty:!0},{key:"closed-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"key-value",valueSchema:new Vt(new bt(Vo.encodingSchema)),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,closedOutAtRound:n,deleted:a,keyValue:i,optedInAtRound:r}){this.id=E(e),this.schema=t,this.closedOutAtRound=void 0===n?void 0:E(n),this.deleted=a,this.keyValue=i,this.optedInAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Lr.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["closed-out-at-round",this.closedOutAtRound],["deleted",this.deleted],["key-value",void 0!==this.keyValue?this.keyValue.map(e=>e.toEncodingData()):void 0],["opted-in-at-round",this.optedInAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new Lr({id:e.get("id"),schema:Hr.fromEncodingData(e.get("schema")??new Map),closedOutAtRound:e.get("closed-out-at-round"),deleted:e.get("deleted"),keyValue:void 0!==e.get("key-value")?e.get("key-value").map(e=>Vo.fromEncodingData(e)):void 0,optedInAtRound:e.get("opted-in-at-round")})}}class _r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"apps-local-states",valueSchema:new bt(Lr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({appsLocalStates:e,currentRound:t,nextToken:n}){this.appsLocalStates=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return _r.encodingSchema}toEncodingData(){return new Map([["apps-local-states",this.appsLocalStates.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalStatesResponse: ${e}`);return new _r({appsLocalStates:(e.get("apps-local-states")??[]).map(e=>Lr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Fr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new bt(new St),omitEmpty:!0},{key:"txid",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e,txid:t}){this.logs=e,this.txid=t}getEncodingSchema(){return Fr.encodingSchema}toEncodingData(){return new Map([["logs",this.logs],["txid",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogData: ${e}`);return new Fr({logs:e.get("logs"),txid:e.get("txid")})}}class qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"log-data",valueSchema:new Vt(new bt(Fr.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,currentRound:t,logData:n,nextToken:a}){this.applicationId=E(e),this.currentRound=E(t),this.logData=n,this.nextToken=a}getEncodingSchema(){return qr.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["current-round",this.currentRound],["log-data",void 0!==this.logData?this.logData.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogsResponse: ${e}`);return new qr({applicationId:e.get("application-id"),currentRound:e.get("current-round"),logData:void 0!==e.get("log-data")?e.get("log-data").map(e=>Fr.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new St,omitEmpty:!0},{key:"clear-state-program",valueSchema:new St,omitEmpty:!0},{key:"creator",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"global-state",valueSchema:new Vt(new bt(Vo.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Hr.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Hr.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:i,globalStateSchema:r,localStateSchema:o,version:s}){this.approvalProgram="string"==typeof e?he(e):e,this.clearStateProgram="string"==typeof t?he(t):t,this.creator="string"==typeof n?ut.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.globalState=i,this.globalStateSchema=r,this.localStateSchema=o,this.version=void 0===s?void 0:v(s)}getEncodingSchema(){return zr.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",void 0!==this.creator?this.creator.toString():void 0],["extra-program-pages",this.extraProgramPages],["global-state",void 0!==this.globalState?this.globalState.map(e=>e.toEncodingData()):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new zr({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),globalState:void 0!==e.get("global-state")?e.get("global-state").map(e=>Vo.fromEncodingData(e)):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Hr.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Hr.fromEncodingData(e.get("local-state-schema")):void 0,version:e.get("version")})}}class Kr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"application",valueSchema:new Vt(Nr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,application:t}){this.currentRound=E(e),this.application=t}getEncodingSchema(){return Kr.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["application",void 0!==this.application?this.application.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationResponse: ${e}`);return new Kr({currentRound:e.get("current-round"),application:void 0!==e.get("application")?Nr.fromEncodingData(e.get("application")):void 0})}}class Hr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Hr.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new Hr({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"applications",valueSchema:new bt(Nr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({applications:e,currentRound:t,nextToken:n}){this.applications=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return jr.encodingSchema}toEncodingData(){return new Map([["applications",this.applications.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationsResponse: ${e}`);return new jr({applications:(e.get("applications")??[]).map(e=>Nr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Gr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:Xr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"destroyed-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t,createdAtRound:n,deleted:a,destroyedAtRound:i}){this.index=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.destroyedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return Gr.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["destroyed-at-round",this.destroyedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Gr({index:e.get("index"),params:Xr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),destroyedAtRound:e.get("destroyed-at-round")})}}class Jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"balances",valueSchema:new bt(So.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({balances:e,currentRound:t,nextToken:n}){this.balances=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Jr.encodingSchema}toEncodingData(){return new Map([["balances",this.balances.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetBalancesResponse: ${e}`);return new Jr({balances:(e.get("balances")??[]).map(e=>So.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Wr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Wr.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Wr({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class Yr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new bt(Wr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Yr.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingsResponse: ${e}`);return new Yr({assets:(e.get("assets")??[]).map(e=>Wr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Xr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"decimals",valueSchema:new Be,omitEmpty:!0},{key:"total",valueSchema:new Be,omitEmpty:!0},{key:"clawback",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"default-frozen",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"freeze",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"manager",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"metadata-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"reserve",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"url",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"url-b64",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?he(s):s,this.name=c,this.nameB64="string"==typeof h?he(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?he(l):l,this.url=g,this.urlB64="string"==typeof m?he(m):m}getEncodingSchema(){return Xr.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Xr({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class Qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset",valueSchema:Gr.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({asset:e,currentRound:t}){this.asset=e,this.currentRound=E(t)}getEncodingSchema(){return Qr.encodingSchema}toEncodingData(){return new Map([["asset",this.asset.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResponse: ${e}`);return new Qr({asset:Gr.fromEncodingData(e.get("asset")??new Map),currentRound:e.get("current-round")})}}class Zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new bt(Gr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Zr.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetsResponse: ${e}`);return new Zr({assets:(e.get("assets")??[]).map(e=>Gr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"genesis-hash",valueSchema:new St,omitEmpty:!0},{key:"genesis-id",valueSchema:new Re,omitEmpty:!0},{key:"previous-block-hash",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"seed",valueSchema:new St,omitEmpty:!0},{key:"timestamp",valueSchema:new Be,omitEmpty:!0},{key:"transactions-root",valueSchema:new St,omitEmpty:!0},{key:"transactions-root-sha256",valueSchema:new St,omitEmpty:!0},{key:"bonus",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fees-collected",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation-updates",valueSchema:new Vt(Eo.encodingSchema),omitEmpty:!0},{key:"previous-block-hash-512",valueSchema:new Vt(new St),omitEmpty:!0},{key:"proposer",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"proposer-payout",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"rewards",valueSchema:new Vt(no.encodingSchema),omitEmpty:!0},{key:"state-proof-tracking",valueSchema:new Vt(new bt(To.encodingSchema)),omitEmpty:!0},{key:"transactions",valueSchema:new Vt(new bt(Bo.encodingSchema)),omitEmpty:!0},{key:"transactions-root-sha512",valueSchema:new Vt(new St),omitEmpty:!0},{key:"txn-counter",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-state",valueSchema:new Vt(ao.encodingSchema),omitEmpty:!0},{key:"upgrade-vote",valueSchema:new Vt(io.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({genesisHash:e,genesisId:t,previousBlockHash:n,round:a,seed:i,timestamp:r,transactionsRoot:o,transactionsRootSha256:s,bonus:c,feesCollected:h,participationUpdates:d,previousBlockHash512:u,proposer:l,proposerPayout:g,rewards:m,stateProofTracking:p,transactions:f,transactionsRootSha512:y,txnCounter:w,upgradeState:S,upgradeVote:k}){this.genesisHash="string"==typeof e?he(e):e,this.genesisId=t,this.previousBlockHash="string"==typeof n?he(n):n,this.round=E(a),this.seed="string"==typeof i?he(i):i,this.timestamp=v(r),this.transactionsRoot="string"==typeof o?he(o):o,this.transactionsRootSha256="string"==typeof s?he(s):s,this.bonus=void 0===c?void 0:v(c),this.feesCollected=void 0===h?void 0:v(h),this.participationUpdates=d,this.previousBlockHash512="string"==typeof u?he(u):u,this.proposer="string"==typeof l?ut.fromString(l):l,this.proposerPayout=void 0===g?void 0:v(g),this.rewards=m,this.stateProofTracking=p,this.transactions=f,this.transactionsRootSha512="string"==typeof y?he(y):y,this.txnCounter=void 0===w?void 0:v(w),this.upgradeState=S,this.upgradeVote=k}getEncodingSchema(){return eo.encodingSchema}toEncodingData(){return new Map([["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["previous-block-hash",this.previousBlockHash],["round",this.round],["seed",this.seed],["timestamp",this.timestamp],["transactions-root",this.transactionsRoot],["transactions-root-sha256",this.transactionsRootSha256],["bonus",this.bonus],["fees-collected",this.feesCollected],["participation-updates",void 0!==this.participationUpdates?this.participationUpdates.toEncodingData():void 0],["previous-block-hash-512",this.previousBlockHash512],["proposer",void 0!==this.proposer?this.proposer.toString():void 0],["proposer-payout",this.proposerPayout],["rewards",void 0!==this.rewards?this.rewards.toEncodingData():void 0],["state-proof-tracking",void 0!==this.stateProofTracking?this.stateProofTracking.map(e=>e.toEncodingData()):void 0],["transactions",void 0!==this.transactions?this.transactions.map(e=>e.toEncodingData()):void 0],["transactions-root-sha512",this.transactionsRootSha512],["txn-counter",this.txnCounter],["upgrade-state",void 0!==this.upgradeState?this.upgradeState.toEncodingData():void 0],["upgrade-vote",void 0!==this.upgradeVote?this.upgradeVote.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Block: ${e}`);return new eo({genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),previousBlockHash:e.get("previous-block-hash"),round:e.get("round"),seed:e.get("seed"),timestamp:e.get("timestamp"),transactionsRoot:e.get("transactions-root"),transactionsRootSha256:e.get("transactions-root-sha256"),bonus:e.get("bonus"),feesCollected:e.get("fees-collected"),participationUpdates:void 0!==e.get("participation-updates")?Eo.fromEncodingData(e.get("participation-updates")):void 0,previousBlockHash512:e.get("previous-block-hash-512"),proposer:e.get("proposer"),proposerPayout:e.get("proposer-payout"),rewards:void 0!==e.get("rewards")?no.fromEncodingData(e.get("rewards")):void 0,stateProofTracking:void 0!==e.get("state-proof-tracking")?e.get("state-proof-tracking").map(e=>To.fromEncodingData(e)):void 0,transactions:void 0!==e.get("transactions")?e.get("transactions").map(e=>Bo.fromEncodingData(e)):void 0,transactionsRootSha512:e.get("transactions-root-sha512"),txnCounter:e.get("txn-counter"),upgradeState:void 0!==e.get("upgrade-state")?ao.fromEncodingData(e.get("upgrade-state")):void 0,upgradeVote:void 0!==e.get("upgrade-vote")?io.fromEncodingData(e.get("upgrade-vote")):void 0})}}class to{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blocks",valueSchema:new bt(eo.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocks:e,currentRound:t,nextToken:n}){this.blocks=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return to.encodingSchema}toEncodingData(){return new Map([["blocks",this.blocks.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeadersResponse: ${e}`);return new to({blocks:(e.get("blocks")??[]).map(e=>eo.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class no{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"fee-sink",valueSchema:new Re,omitEmpty:!0},{key:"rewards-calculation-round",valueSchema:new Be,omitEmpty:!0},{key:"rewards-level",valueSchema:new Be,omitEmpty:!0},{key:"rewards-pool",valueSchema:new Re,omitEmpty:!0},{key:"rewards-rate",valueSchema:new Be,omitEmpty:!0},{key:"rewards-residue",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:n,rewardsPool:a,rewardsRate:i,rewardsResidue:r}){this.feeSink=e,this.rewardsCalculationRound=E(t),this.rewardsLevel=E(n),this.rewardsPool=a,this.rewardsRate=E(i),this.rewardsResidue=E(r)}getEncodingSchema(){return no.encodingSchema}toEncodingData(){return new Map([["fee-sink",this.feeSink],["rewards-calculation-round",this.rewardsCalculationRound],["rewards-level",this.rewardsLevel],["rewards-pool",this.rewardsPool],["rewards-rate",this.rewardsRate],["rewards-residue",this.rewardsResidue]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockRewards: ${e}`);return new no({feeSink:e.get("fee-sink"),rewardsCalculationRound:e.get("rewards-calculation-round"),rewardsLevel:e.get("rewards-level"),rewardsPool:e.get("rewards-pool"),rewardsRate:e.get("rewards-rate"),rewardsResidue:e.get("rewards-residue")})}}class ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-protocol",valueSchema:new Re,omitEmpty:!0},{key:"next-protocol",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"next-protocol-approvals",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"next-protocol-switch-on",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"next-protocol-vote-before",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:n,nextProtocolSwitchOn:a,nextProtocolVoteBefore:i}){this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=void 0===n?void 0:v(n),this.nextProtocolSwitchOn=void 0===a?void 0:E(a),this.nextProtocolVoteBefore=void 0===i?void 0:E(i)}getEncodingSchema(){return ao.encodingSchema}toEncodingData(){return new Map([["current-protocol",this.currentProtocol],["next-protocol",this.nextProtocol],["next-protocol-approvals",this.nextProtocolApprovals],["next-protocol-switch-on",this.nextProtocolSwitchOn],["next-protocol-vote-before",this.nextProtocolVoteBefore]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeState: ${e}`);return new ao({currentProtocol:e.get("current-protocol"),nextProtocol:e.get("next-protocol"),nextProtocolApprovals:e.get("next-protocol-approvals"),nextProtocolSwitchOn:e.get("next-protocol-switch-on"),nextProtocolVoteBefore:e.get("next-protocol-vote-before")})}}class io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"upgrade-approve",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-propose",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:n}){this.upgradeApprove=e,this.upgradeDelay=void 0===t?void 0:E(t),this.upgradePropose=n}getEncodingSchema(){return io.encodingSchema}toEncodingData(){return new Map([["upgrade-approve",this.upgradeApprove],["upgrade-delay",this.upgradeDelay],["upgrade-propose",this.upgradePropose]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeVote: ${e}`);return new io({upgradeApprove:e.get("upgrade-approve"),upgradeDelay:e.get("upgrade-delay"),upgradePropose:e.get("upgrade-propose")})}}class ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"value",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?he(e):e,this.round=E(t),this.value="string"==typeof n?he(n):n}getEncodingSchema(){return ro.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new ro({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e}){this.name="string"==typeof e?he(e):e}getEncodingSchema(){return oo.encodingSchema}toEncodingData(){return new Map([["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new oo({name:e.get("name")})}}class so{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new Be,omitEmpty:!0},{key:"name",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=v(e),this.name="string"==typeof t?he(t):t}getEncodingSchema(){return so.encodingSchema}toEncodingData(){return new Map([["app",this.app],["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxReference: ${e}`);return new so({app:e.get("app"),name:e.get("name")})}}class co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"boxes",valueSchema:new bt(oo.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,boxes:t,nextToken:n}){this.applicationId=E(e),this.boxes=t,this.nextToken=n}getEncodingSchema(){return co.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["boxes",this.boxes.map(e=>e.toEncodingData())],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new co({applicationId:e.get("application-id"),boxes:(e.get("boxes")??[]).map(e=>oo.fromEncodingData(e)),nextToken:e.get("next-token")})}}class ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return ho.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new ho({message:e.get("message"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0})}}class uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return uo.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new uo({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new Re,omitEmpty:!0},{key:"value",valueSchema:uo.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return lo.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new lo({key:e.get("key"),value:uo.fromEncodingData(e.get("value")??new Map)})}}class go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash-type",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashType:e}){this.hashType=void 0===e?void 0:v(e)}getEncodingSchema(){return go.encodingSchema}toEncodingData(){return new Map([["hash-type",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new go({hashType:e.get("hash-type")})}}class mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hb-pk",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk1sig",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk2",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk2sig",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-sig",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({hbPk:e,hbPk1sig:t,hbPk2:n,hbPk2sig:a,hbSig:i}){this.hbPk="string"==typeof e?he(e):e,this.hbPk1sig="string"==typeof t?he(t):t,this.hbPk2="string"==typeof n?he(n):n,this.hbPk2sig="string"==typeof a?he(a):a,this.hbSig="string"==typeof i?he(i):i}getEncodingSchema(){return mo.encodingSchema}toEncodingData(){return new Map([["hb-pk",this.hbPk],["hb-pk1sig",this.hbPk1sig],["hb-pk2",this.hbPk2],["hb-pk2sig",this.hbPk2sig],["hb-sig",this.hbSig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HbProofFields: ${e}`);return new mo({hbPk:e.get("hb-pk"),hbPk1sig:e.get("hb-pk1sig"),hbPk2:e.get("hb-pk2"),hbPk2sig:e.get("hb-pk2sig"),hbSig:e.get("hb-sig")})}}class po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"db-available",valueSchema:new Ve,omitEmpty:!0},{key:"is-migrating",valueSchema:new Ve,omitEmpty:!0},{key:"message",valueSchema:new Re,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"version",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0},{key:"errors",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0})),this.encodingSchemaValue}constructor({dbAvailable:e,isMigrating:t,message:n,round:a,version:i,data:r,errors:o}){this.dbAvailable=e,this.isMigrating=t,this.message=n,this.round=E(a),this.version=i,this.data=r,this.errors=o}getEncodingSchema(){return po.encodingSchema}toEncodingData(){return new Map([["db-available",this.dbAvailable],["is-migrating",this.isMigrating],["message",this.message],["round",this.round],["version",this.version],["data",void 0!==this.data?this.data.toEncodingData():void 0],["errors",this.errors]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HealthCheck: ${e}`);return new po({dbAvailable:e.get("db-available"),isMigrating:e.get("is-migrating"),message:e.get("message"),round:e.get("round"),version:e.get("version"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0,errors:e.get("errors")})}}class fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"asset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,asset:t}){this.address="string"==typeof e?ut.fromString(e):e,this.asset=v(t)}getEncodingSchema(){return fo.encodingSchema}toEncodingData(){return new Map([["address",this.address.toString()],["asset",this.asset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HoldingRef: ${e}`);return new fo({address:e.get("address"),asset:e.get("asset")})}}class yo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"block-headers-commitment",valueSchema:new Vt(new St),omitEmpty:!0},{key:"first-attested-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"latest-attested-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"ln-proven-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"voters-commitment",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:n,lnProvenWeight:a,votersCommitment:i}){this.blockHeadersCommitment="string"==typeof e?he(e):e,this.firstAttestedRound=void 0===t?void 0:E(t),this.latestAttestedRound=void 0===n?void 0:E(n),this.lnProvenWeight=void 0===a?void 0:E(a),this.votersCommitment="string"==typeof i?he(i):i}getEncodingSchema(){return yo.encodingSchema}toEncodingData(){return new Map([["block-headers-commitment",this.blockHeadersCommitment],["first-attested-round",this.firstAttestedRound],["latest-attested-round",this.latestAttestedRound],["ln-proven-weight",this.lnProvenWeight],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IndexerStateProofMessage: ${e}`);return new yo({blockHeadersCommitment:e.get("block-headers-commitment"),firstAttestedRound:e.get("first-attested-round"),latestAttestedRound:e.get("latest-attested-round"),lnProvenWeight:e.get("ln-proven-weight"),votersCommitment:e.get("voters-commitment")})}}class wo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"app",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,app:t}){this.address="string"==typeof e?ut.fromString(e):e,this.app=v(t)}getEncodingSchema(){return wo.encodingSchema}toEncodingData(){return new Map([["address",this.address.toString()],["app",this.app]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LocalsRef: ${e}`);return new wo({address:e.get("address"),app:e.get("app")})}}class vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash-factory",valueSchema:new Vt(go.encodingSchema),omitEmpty:!0},{key:"path",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"tree-depth",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashFactory:e,path:t,treeDepth:n}){this.hashFactory=e,this.path=t,this.treeDepth=void 0===n?void 0:v(n)}getEncodingSchema(){return vo.encodingSchema}toEncodingData(){return new Map([["hash-factory",void 0!==this.hashFactory?this.hashFactory.toEncodingData():void 0],["path",this.path],["tree-depth",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new vo({hashFactory:void 0!==e.get("hash-factory")?go.fromEncodingData(e.get("hash-factory")):void 0,path:e.get("path"),treeDepth:e.get("tree-depth")})}}class So{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.address=e,this.amount=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return So.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MiniAssetHolding: ${e}`);return new So({address:e.get("address"),amount:e.get("amount"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class Eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"absent-participation-accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"expired-participation-accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0})),this.encodingSchemaValue}constructor({absentParticipationAccounts:e,expiredParticipationAccounts:t}){this.absentParticipationAccounts=e,this.expiredParticipationAccounts=t}getEncodingSchema(){return Eo.encodingSchema}toEncodingData(){return new Map([["absent-participation-accounts",this.absentParticipationAccounts],["expired-participation-accounts",this.expiredParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new Eo({absentParticipationAccounts:e.get("absent-participation-accounts"),expiredParticipationAccounts:e.get("expired-participation-accounts")})}}class ko{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"application-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"box",valueSchema:new Vt(so.encodingSchema),omitEmpty:!0},{key:"holding",valueSchema:new Vt(fo.encodingSchema),omitEmpty:!0},{key:"local",valueSchema:new Vt(wo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,applicationId:t,assetId:n,box:a,holding:i,local:r}){this.address="string"==typeof e?ut.fromString(e):e,this.applicationId=void 0===t?void 0:v(t),this.assetId=void 0===n?void 0:v(n),this.box=a,this.holding=i,this.local=r}getEncodingSchema(){return ko.encodingSchema}toEncodingData(){return new Map([["address",void 0!==this.address?this.address.toString():void 0],["application-id",this.applicationId],["asset-id",this.assetId],["box",void 0!==this.box?this.box.toEncodingData():void 0],["holding",void 0!==this.holding?this.holding.toEncodingData():void 0],["local",void 0!==this.local?this.local.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ResourceRef: ${e}`);return new ko({address:e.get("address"),applicationId:e.get("application-id"),assetId:e.get("asset-id"),box:void 0!==e.get("box")?so.fromEncodingData(e.get("box")):void 0,holding:void 0!==e.get("holding")?fo.fromEncodingData(e.get("holding")):void 0,local:void 0!==e.get("local")?wo.fromEncodingData(e.get("local")):void 0})}}class bo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"part-proofs",valueSchema:new Vt(vo.encodingSchema),omitEmpty:!0},{key:"positions-to-reveal",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"reveals",valueSchema:new Vt(new bt(Ao.encodingSchema)),omitEmpty:!0},{key:"salt-version",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-commit",valueSchema:new Vt(new St),omitEmpty:!0},{key:"sig-proofs",valueSchema:new Vt(vo.encodingSchema),omitEmpty:!0},{key:"signed-weight",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({partProofs:e,positionsToReveal:t,reveals:n,saltVersion:a,sigCommit:i,sigProofs:r,signedWeight:o}){this.partProofs=e,this.positionsToReveal=void 0===t?void 0:t.map(E),this.reveals=n,this.saltVersion=void 0===a?void 0:v(a),this.sigCommit="string"==typeof i?he(i):i,this.sigProofs=r,this.signedWeight=void 0===o?void 0:E(o)}getEncodingSchema(){return bo.encodingSchema}toEncodingData(){return new Map([["part-proofs",void 0!==this.partProofs?this.partProofs.toEncodingData():void 0],["positions-to-reveal",this.positionsToReveal],["reveals",void 0!==this.reveals?this.reveals.map(e=>e.toEncodingData()):void 0],["salt-version",this.saltVersion],["sig-commit",this.sigCommit],["sig-proofs",void 0!==this.sigProofs?this.sigProofs.toEncodingData():void 0],["signed-weight",this.signedWeight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofFields: ${e}`);return new bo({partProofs:void 0!==e.get("part-proofs")?vo.fromEncodingData(e.get("part-proofs")):void 0,positionsToReveal:e.get("positions-to-reveal"),reveals:void 0!==e.get("reveals")?e.get("reveals").map(e=>Ao.fromEncodingData(e)):void 0,saltVersion:e.get("salt-version"),sigCommit:e.get("sig-commit"),sigProofs:void 0!==e.get("sig-proofs")?vo.fromEncodingData(e.get("sig-proofs")):void 0,signedWeight:e.get("signed-weight")})}}class xo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"verifier",valueSchema:new Vt(Po.encodingSchema),omitEmpty:!0},{key:"weight",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({verifier:e,weight:t}){this.verifier=e,this.weight=void 0===t?void 0:E(t)}getEncodingSchema(){return xo.encodingSchema}toEncodingData(){return new Map([["verifier",void 0!==this.verifier?this.verifier.toEncodingData():void 0],["weight",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofParticipant: ${e}`);return new xo({verifier:void 0!==e.get("verifier")?Po.fromEncodingData(e.get("verifier")):void 0,weight:e.get("weight")})}}class Ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"participant",valueSchema:new Vt(xo.encodingSchema),omitEmpty:!0},{key:"position",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-slot",valueSchema:new Vt(Do.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({participant:e,position:t,sigSlot:n}){this.participant=e,this.position=void 0===t?void 0:E(t),this.sigSlot=n}getEncodingSchema(){return Ao.encodingSchema}toEncodingData(){return new Map([["participant",void 0!==this.participant?this.participant.toEncodingData():void 0],["position",this.position],["sig-slot",void 0!==this.sigSlot?this.sigSlot.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofReveal: ${e}`);return new Ao({participant:void 0!==e.get("participant")?xo.fromEncodingData(e.get("participant")):void 0,position:e.get("position"),sigSlot:void 0!==e.get("sig-slot")?Do.fromEncodingData(e.get("sig-slot")):void 0})}}class Do{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"lower-sig-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"signature",valueSchema:new Vt(Io.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lowerSigWeight:e,signature:t}){this.lowerSigWeight=void 0===e?void 0:E(e),this.signature=t}getEncodingSchema(){return Do.encodingSchema}toEncodingData(){return new Map([["lower-sig-weight",this.lowerSigWeight],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSigSlot: ${e}`);return new Do({lowerSigWeight:e.get("lower-sig-weight"),signature:void 0!==e.get("signature")?Io.fromEncodingData(e.get("signature")):void 0})}}class Io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"falcon-signature",valueSchema:new Vt(new St),omitEmpty:!0},{key:"merkle-array-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"proof",valueSchema:new Vt(vo.encodingSchema),omitEmpty:!0},{key:"verifying-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({falconSignature:e,merkleArrayIndex:t,proof:n,verifyingKey:a}){this.falconSignature="string"==typeof e?he(e):e,this.merkleArrayIndex=void 0===t?void 0:v(t),this.proof=n,this.verifyingKey="string"==typeof a?he(a):a}getEncodingSchema(){return Io.encodingSchema}toEncodingData(){return new Map([["falcon-signature",this.falconSignature],["merkle-array-index",this.merkleArrayIndex],["proof",void 0!==this.proof?this.proof.toEncodingData():void 0],["verifying-key",this.verifyingKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSignature: ${e}`);return new Io({falconSignature:e.get("falcon-signature"),merkleArrayIndex:e.get("merkle-array-index"),proof:void 0!==e.get("proof")?vo.fromEncodingData(e.get("proof")):void 0,verifyingKey:e.get("verifying-key")})}}class To{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"next-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"online-total-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"type",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"voters-commitment",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({nextRound:e,onlineTotalWeight:t,type:n,votersCommitment:a}){this.nextRound=void 0===e?void 0:E(e),this.onlineTotalWeight=void 0===t?void 0:E(t),this.type=void 0===n?void 0:v(n),this.votersCommitment="string"==typeof a?he(a):a}getEncodingSchema(){return To.encodingSchema}toEncodingData(){return new Map([["next-round",this.nextRound],["online-total-weight",this.onlineTotalWeight],["type",this.type],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTracking: ${e}`);return new To({nextRound:e.get("next-round"),onlineTotalWeight:e.get("online-total-weight"),type:e.get("type"),votersCommitment:e.get("voters-commitment")})}}class Po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"commitment",valueSchema:new Vt(new St),omitEmpty:!0},{key:"key-lifetime",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({commitment:e,keyLifetime:t}){this.commitment="string"==typeof e?he(e):e,this.keyLifetime=void 0===t?void 0:E(t)}getEncodingSchema(){return Po.encodingSchema}toEncodingData(){return new Map([["commitment",this.commitment],["key-lifetime",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofVerifier: ${e}`);return new Po({commitment:e.get("commitment"),keyLifetime:e.get("key-lifetime")})}}class Mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Mo.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new Mo({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:Ro.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return Vo.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new Vo({key:e.get("key"),value:Ro.fromEncodingData(e.get("value")??new Map)})}}class Ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new St,omitEmpty:!0},{key:"type",valueSchema:new Be,omitEmpty:!0},{key:"uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?he(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return Ro.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new Ro({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class Bo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"fee",valueSchema:new Be,omitEmpty:!0},{key:"first-valid",valueSchema:new Be,omitEmpty:!0},{key:"last-valid",valueSchema:new Be,omitEmpty:!0},{key:"sender",valueSchema:new Re,omitEmpty:!0},{key:"application-transaction",valueSchema:new Vt(Co.encodingSchema),omitEmpty:!0},{key:"asset-config-transaction",valueSchema:new Vt(Uo.encodingSchema),omitEmpty:!0},{key:"asset-freeze-transaction",valueSchema:new Vt($o.encodingSchema),omitEmpty:!0},{key:"asset-transfer-transaction",valueSchema:new Vt(Oo.encodingSchema),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"close-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"confirmed-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-application-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-asset-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"genesis-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"genesis-id",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"global-state-delta",valueSchema:new Vt(new bt(lo.encodingSchema)),omitEmpty:!0},{key:"group",valueSchema:new Vt(new St),omitEmpty:!0},{key:"heartbeat-transaction",valueSchema:new Vt(No.encodingSchema),omitEmpty:!0},{key:"id",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"inner-txns",valueSchema:new Vt(new bt(Bo.encodingSchema)),omitEmpty:!0},{key:"intra-round-offset",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"keyreg-transaction",valueSchema:new Vt(Lo.encodingSchema),omitEmpty:!0},{key:"lease",valueSchema:new Vt(new St),omitEmpty:!0},{key:"local-state-delta",valueSchema:new Vt(new bt($r.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"note",valueSchema:new Vt(new St),omitEmpty:!0},{key:"payment-transaction",valueSchema:new Vt(_o.encodingSchema),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"rekey-to",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"round-time",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sender-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"signature",valueSchema:new Vt(qo.encodingSchema),omitEmpty:!0},{key:"state-proof-transaction",valueSchema:new Vt(jo.encodingSchema),omitEmpty:!0},{key:"tx-type",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({fee:e,firstValid:t,lastValid:n,sender:a,applicationTransaction:i,assetConfigTransaction:r,assetFreezeTransaction:o,assetTransferTransaction:s,authAddr:c,closeRewards:h,closingAmount:d,confirmedRound:u,createdApplicationIndex:l,createdAssetIndex:g,genesisHash:m,genesisId:p,globalStateDelta:f,group:y,heartbeatTransaction:w,id:S,innerTxns:k,intraRoundOffset:b,keyregTransaction:x,lease:A,localStateDelta:D,logs:I,note:T,paymentTransaction:P,receiverRewards:M,rekeyTo:V,roundTime:R,senderRewards:B,signature:C,stateProofTransaction:U,txType:$}){this.fee=E(e),this.firstValid=E(t),this.lastValid=E(n),this.sender=a,this.applicationTransaction=i,this.assetConfigTransaction=r,this.assetFreezeTransaction=o,this.assetTransferTransaction=s,this.authAddr="string"==typeof c?ut.fromString(c):c,this.closeRewards=void 0===h?void 0:E(h),this.closingAmount=void 0===d?void 0:E(d),this.confirmedRound=void 0===u?void 0:E(u),this.createdApplicationIndex=void 0===l?void 0:E(l),this.createdAssetIndex=void 0===g?void 0:E(g),this.genesisHash="string"==typeof m?he(m):m,this.genesisId=p,this.globalStateDelta=f,this.group="string"==typeof y?he(y):y,this.heartbeatTransaction=w,this.id=S,this.innerTxns=k,this.intraRoundOffset=void 0===b?void 0:v(b),this.keyregTransaction=x,this.lease="string"==typeof A?he(A):A,this.localStateDelta=D,this.logs=I,this.note="string"==typeof T?he(T):T,this.paymentTransaction=P,this.receiverRewards=void 0===M?void 0:E(M),this.rekeyTo="string"==typeof V?ut.fromString(V):V,this.roundTime=void 0===R?void 0:v(R),this.senderRewards=void 0===B?void 0:E(B),this.signature=C,this.stateProofTransaction=U,this.txType=$}getEncodingSchema(){return Bo.encodingSchema}toEncodingData(){return new Map([["fee",this.fee],["first-valid",this.firstValid],["last-valid",this.lastValid],["sender",this.sender],["application-transaction",void 0!==this.applicationTransaction?this.applicationTransaction.toEncodingData():void 0],["asset-config-transaction",void 0!==this.assetConfigTransaction?this.assetConfigTransaction.toEncodingData():void 0],["asset-freeze-transaction",void 0!==this.assetFreezeTransaction?this.assetFreezeTransaction.toEncodingData():void 0],["asset-transfer-transaction",void 0!==this.assetTransferTransaction?this.assetTransferTransaction.toEncodingData():void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["created-application-index",this.createdApplicationIndex],["created-asset-index",this.createdAssetIndex],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map(e=>e.toEncodingData()):void 0],["group",this.group],["heartbeat-transaction",void 0!==this.heartbeatTransaction?this.heartbeatTransaction.toEncodingData():void 0],["id",this.id],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map(e=>e.toEncodingData()):void 0],["intra-round-offset",this.intraRoundOffset],["keyreg-transaction",void 0!==this.keyregTransaction?this.keyregTransaction.toEncodingData():void 0],["lease",this.lease],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map(e=>e.toEncodingData()):void 0],["logs",this.logs],["note",this.note],["payment-transaction",void 0!==this.paymentTransaction?this.paymentTransaction.toEncodingData():void 0],["receiver-rewards",this.receiverRewards],["rekey-to",void 0!==this.rekeyTo?this.rekeyTo.toString():void 0],["round-time",this.roundTime],["sender-rewards",this.senderRewards],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0],["state-proof-transaction",void 0!==this.stateProofTransaction?this.stateProofTransaction.toEncodingData():void 0],["tx-type",this.txType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Transaction: ${e}`);return new Bo({fee:e.get("fee"),firstValid:e.get("first-valid"),lastValid:e.get("last-valid"),sender:e.get("sender"),applicationTransaction:void 0!==e.get("application-transaction")?Co.fromEncodingData(e.get("application-transaction")):void 0,assetConfigTransaction:void 0!==e.get("asset-config-transaction")?Uo.fromEncodingData(e.get("asset-config-transaction")):void 0,assetFreezeTransaction:void 0!==e.get("asset-freeze-transaction")?$o.fromEncodingData(e.get("asset-freeze-transaction")):void 0,assetTransferTransaction:void 0!==e.get("asset-transfer-transaction")?Oo.fromEncodingData(e.get("asset-transfer-transaction")):void 0,authAddr:e.get("auth-addr"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),createdApplicationIndex:e.get("created-application-index"),createdAssetIndex:e.get("created-asset-index"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map(e=>lo.fromEncodingData(e)):void 0,group:e.get("group"),heartbeatTransaction:void 0!==e.get("heartbeat-transaction")?No.fromEncodingData(e.get("heartbeat-transaction")):void 0,id:e.get("id"),innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map(e=>Bo.fromEncodingData(e)):void 0,intraRoundOffset:e.get("intra-round-offset"),keyregTransaction:void 0!==e.get("keyreg-transaction")?Lo.fromEncodingData(e.get("keyreg-transaction")):void 0,lease:e.get("lease"),localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map(e=>$r.fromEncodingData(e)):void 0,logs:e.get("logs"),note:e.get("note"),paymentTransaction:void 0!==e.get("payment-transaction")?_o.fromEncodingData(e.get("payment-transaction")):void 0,receiverRewards:e.get("receiver-rewards"),rekeyTo:e.get("rekey-to"),roundTime:e.get("round-time"),senderRewards:e.get("sender-rewards"),signature:void 0!==e.get("signature")?qo.fromEncodingData(e.get("signature")):void 0,stateProofTransaction:void 0!==e.get("state-proof-transaction")?jo.fromEncodingData(e.get("state-proof-transaction")):void 0,txType:e.get("tx-type")})}}class Co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"access",valueSchema:new Vt(new bt(ko.encodingSchema)),omitEmpty:!0},{key:"accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"application-args",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"approval-program",valueSchema:new Vt(new St),omitEmpty:!0},{key:"box-references",valueSchema:new Vt(new bt(so.encodingSchema)),omitEmpty:!0},{key:"clear-state-program",valueSchema:new Vt(new St),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"foreign-apps",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"foreign-assets",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Mo.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Mo.encodingSchema),omitEmpty:!0},{key:"on-completion",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"reject-version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,access:t,accounts:n,applicationArgs:a,approvalProgram:i,boxReferences:r,clearStateProgram:o,extraProgramPages:s,foreignApps:c,foreignAssets:h,globalStateSchema:d,localStateSchema:u,onCompletion:l,rejectVersion:g}){this.applicationId=E(e),this.access=t,this.accounts=void 0!==n?n.map(e=>"string"==typeof e?ut.fromString(e):e):void 0,this.applicationArgs=a,this.approvalProgram="string"==typeof i?he(i):i,this.boxReferences=r,this.clearStateProgram="string"==typeof o?he(o):o,this.extraProgramPages=void 0===s?void 0:v(s),this.foreignApps=void 0===c?void 0:c.map(E),this.foreignAssets=void 0===h?void 0:h.map(E),this.globalStateSchema=d,this.localStateSchema=u,this.onCompletion=l,this.rejectVersion=void 0===g?void 0:v(g)}getEncodingSchema(){return Co.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["access",void 0!==this.access?this.access.map(e=>e.toEncodingData()):void 0],["accounts",void 0!==this.accounts?this.accounts.map(e=>e.toString()):void 0],["application-args",this.applicationArgs],["approval-program",this.approvalProgram],["box-references",void 0!==this.boxReferences?this.boxReferences.map(e=>e.toEncodingData()):void 0],["clear-state-program",this.clearStateProgram],["extra-program-pages",this.extraProgramPages],["foreign-apps",this.foreignApps],["foreign-assets",this.foreignAssets],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["on-completion",this.onCompletion],["reject-version",this.rejectVersion]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionApplication: ${e}`);return new Co({applicationId:e.get("application-id"),access:void 0!==e.get("access")?e.get("access").map(e=>ko.fromEncodingData(e)):void 0,accounts:e.get("accounts"),applicationArgs:e.get("application-args"),approvalProgram:e.get("approval-program"),boxReferences:void 0!==e.get("box-references")?e.get("box-references").map(e=>so.fromEncodingData(e)):void 0,clearStateProgram:e.get("clear-state-program"),extraProgramPages:e.get("extra-program-pages"),foreignApps:e.get("foreign-apps"),foreignAssets:e.get("foreign-assets"),globalStateSchema:void 0!==e.get("global-state-schema")?Mo.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Mo.fromEncodingData(e.get("local-state-schema")):void 0,onCompletion:e.get("on-completion"),rejectVersion:e.get("reject-version")})}}class Uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"params",valueSchema:new Vt(Xr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetId:e,params:t}){this.assetId=void 0===e?void 0:E(e),this.params=t}getEncodingSchema(){return Uo.encodingSchema}toEncodingData(){return new Map([["asset-id",this.assetId],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetConfig: ${e}`);return new Uo({assetId:e.get("asset-id"),params:void 0!==e.get("params")?Xr.fromEncodingData(e.get("params")):void 0})}}class $o{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"new-freeze-status",valueSchema:new Ve,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,assetId:t,newFreezeStatus:n}){this.address=e,this.assetId=E(t),this.newFreezeStatus=n}getEncodingSchema(){return $o.encodingSchema}toEncodingData(){return new Map([["address",this.address],["asset-id",this.assetId],["new-freeze-status",this.newFreezeStatus]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetFreeze: ${e}`);return new $o({address:e.get("address"),assetId:e.get("asset-id"),newFreezeStatus:e.get("new-freeze-status")})}}class Oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"receiver",valueSchema:new Re,omitEmpty:!0},{key:"close-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-to",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"sender",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,receiver:n,closeAmount:a,closeTo:i,sender:r}){this.amount=E(e),this.assetId=E(t),this.receiver=n,this.closeAmount=void 0===a?void 0:E(a),this.closeTo=i,this.sender=r}getEncodingSchema(){return Oo.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["receiver",this.receiver],["close-amount",this.closeAmount],["close-to",this.closeTo],["sender",this.sender]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetTransfer: ${e}`);return new Oo({amount:e.get("amount"),assetId:e.get("asset-id"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeTo:e.get("close-to"),sender:e.get("sender")})}}class No{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hb-address",valueSchema:new Re,omitEmpty:!0},{key:"hb-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"hb-proof",valueSchema:mo.encodingSchema,omitEmpty:!0},{key:"hb-seed",valueSchema:new St,omitEmpty:!0},{key:"hb-vote-id",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({hbAddress:e,hbKeyDilution:t,hbProof:n,hbSeed:a,hbVoteId:i}){this.hbAddress=e,this.hbKeyDilution=E(t),this.hbProof=n,this.hbSeed="string"==typeof a?he(a):a,this.hbVoteId="string"==typeof i?he(i):i}getEncodingSchema(){return No.encodingSchema}toEncodingData(){return new Map([["hb-address",this.hbAddress],["hb-key-dilution",this.hbKeyDilution],["hb-proof",this.hbProof.toEncodingData()],["hb-seed",this.hbSeed],["hb-vote-id",this.hbVoteId]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionHeartbeat: ${e}`);return new No({hbAddress:e.get("hb-address"),hbKeyDilution:e.get("hb-key-dilution"),hbProof:mo.fromEncodingData(e.get("hb-proof")??new Map),hbSeed:e.get("hb-seed"),hbVoteId:e.get("hb-vote-id")})}}class Lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"non-participation",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"selection-participation-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-participation-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({nonParticipation:e,selectionParticipationKey:t,stateProofKey:n,voteFirstValid:a,voteKeyDilution:i,voteLastValid:r,voteParticipationKey:o}){this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?he(t):t,this.stateProofKey="string"==typeof n?he(n):n,this.voteFirstValid=void 0===a?void 0:E(a),this.voteKeyDilution=void 0===i?void 0:E(i),this.voteLastValid=void 0===r?void 0:E(r),this.voteParticipationKey="string"==typeof o?he(o):o}getEncodingSchema(){return Lo.encodingSchema}toEncodingData(){return new Map([["non-participation",this.nonParticipation],["selection-participation-key",this.selectionParticipationKey],["state-proof-key",this.stateProofKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionKeyreg: ${e}`);return new Lo({nonParticipation:e.get("non-participation"),selectionParticipationKey:e.get("selection-participation-key"),stateProofKey:e.get("state-proof-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key")})}}class _o{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"receiver",valueSchema:new Re,omitEmpty:!0},{key:"close-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-remainder-to",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,receiver:t,closeAmount:n,closeRemainderTo:a}){this.amount=E(e),this.receiver=t,this.closeAmount=void 0===n?void 0:E(n),this.closeRemainderTo=a}getEncodingSchema(){return _o.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["receiver",this.receiver],["close-amount",this.closeAmount],["close-remainder-to",this.closeRemainderTo]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionPayment: ${e}`);return new _o({amount:e.get("amount"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeRemainderTo:e.get("close-remainder-to")})}}class Fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"transaction",valueSchema:Bo.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transaction:t}){this.currentRound=E(e),this.transaction=t}getEncodingSchema(){return Fo.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transaction",this.transaction.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionResponse: ${e}`);return new Fo({currentRound:e.get("current-round"),transaction:Bo.fromEncodingData(e.get("transaction")??new Map)})}}class qo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logicsig",valueSchema:new Vt(zo.encodingSchema),omitEmpty:!0},{key:"multisig",valueSchema:new Vt(Ko.encodingSchema),omitEmpty:!0},{key:"sig",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({logicsig:e,multisig:t,sig:n}){this.logicsig=e,this.multisig=t,this.sig="string"==typeof n?he(n):n}getEncodingSchema(){return qo.encodingSchema}toEncodingData(){return new Map([["logicsig",void 0!==this.logicsig?this.logicsig.toEncodingData():void 0],["multisig",void 0!==this.multisig?this.multisig.toEncodingData():void 0],["sig",this.sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignature: ${e}`);return new qo({logicsig:void 0!==e.get("logicsig")?zo.fromEncodingData(e.get("logicsig")):void 0,multisig:void 0!==e.get("multisig")?Ko.fromEncodingData(e.get("multisig")):void 0,sig:e.get("sig")})}}class zo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logic",valueSchema:new St,omitEmpty:!0},{key:"args",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"logic-multisig-signature",valueSchema:new Vt(Ko.encodingSchema),omitEmpty:!0},{key:"multisig-signature",valueSchema:new Vt(Ko.encodingSchema),omitEmpty:!0},{key:"signature",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({logic:e,args:t,logicMultisigSignature:n,multisigSignature:a,signature:i}){this.logic="string"==typeof e?he(e):e,this.args=t,this.logicMultisigSignature=n,this.multisigSignature=a,this.signature="string"==typeof i?he(i):i}getEncodingSchema(){return zo.encodingSchema}toEncodingData(){return new Map([["logic",this.logic],["args",this.args],["logic-multisig-signature",void 0!==this.logicMultisigSignature?this.logicMultisigSignature.toEncodingData():void 0],["multisig-signature",void 0!==this.multisigSignature?this.multisigSignature.toEncodingData():void 0],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureLogicsig: ${e}`);return new zo({logic:e.get("logic"),args:e.get("args"),logicMultisigSignature:void 0!==e.get("logic-multisig-signature")?Ko.fromEncodingData(e.get("logic-multisig-signature")):void 0,multisigSignature:void 0!==e.get("multisig-signature")?Ko.fromEncodingData(e.get("multisig-signature")):void 0,signature:e.get("signature")})}}class Ko{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"subsignature",valueSchema:new Vt(new bt(Ho.encodingSchema)),omitEmpty:!0},{key:"threshold",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({subsignature:e,threshold:t,version:n}){this.subsignature=e,this.threshold=void 0===t?void 0:v(t),this.version=void 0===n?void 0:v(n)}getEncodingSchema(){return Ko.encodingSchema}toEncodingData(){return new Map([["subsignature",void 0!==this.subsignature?this.subsignature.map(e=>e.toEncodingData()):void 0],["threshold",this.threshold],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisig: ${e}`);return new Ko({subsignature:void 0!==e.get("subsignature")?e.get("subsignature").map(e=>Ho.fromEncodingData(e)):void 0,threshold:e.get("threshold"),version:e.get("version")})}}class Ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"public-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"signature",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({publicKey:e,signature:t}){this.publicKey="string"==typeof e?he(e):e,this.signature="string"==typeof t?he(t):t}getEncodingSchema(){return Ho.encodingSchema}toEncodingData(){return new Map([["public-key",this.publicKey],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisigSubsignature: ${e}`);return new Ho({publicKey:e.get("public-key"),signature:e.get("signature")})}}class jo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Vt(yo.encodingSchema),omitEmpty:!0},{key:"state-proof",valueSchema:new Vt(bo.encodingSchema),omitEmpty:!0},{key:"state-proof-type",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateProof:t,stateProofType:n}){this.message=e,this.stateProof=t,this.stateProofType=void 0===n?void 0:v(n)}getEncodingSchema(){return jo.encodingSchema}toEncodingData(){return new Map([["message",void 0!==this.message?this.message.toEncodingData():void 0],["state-proof",void 0!==this.stateProof?this.stateProof.toEncodingData():void 0],["state-proof-type",this.stateProofType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionStateProof: ${e}`);return new jo({message:void 0!==e.get("message")?yo.fromEncodingData(e.get("message")):void 0,stateProof:void 0!==e.get("state-proof")?bo.fromEncodingData(e.get("state-proof")):void 0,stateProofType:e.get("state-proof-type")})}}class Go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"transactions",valueSchema:new bt(Bo.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transactions:t,nextToken:n}){this.currentRound=E(e),this.transactions=t,this.nextToken=n}getEncodingSchema(){return Go.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transactions",this.transactions.map(e=>e.toEncodingData())],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionsResponse: ${e}`);return new Go({currentRound:e.get("current-round"),transactions:(e.get("transactions")??[]).map(e=>Bo.fromEncodingData(e)),nextToken:e.get("next-token")})}}class Jo extends Hi{path(){return"/health"}prepare(e){return Pe(e.getJSONText(),po)}}class Wo extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Jr)}}function Yo(e){return"string"==typeof e?e:de(e)}class Xo extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=Yo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return Pe(e.getJSONText(),Go)}}class Qo extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=Yo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return Pe(e.getJSONText(),Go)}}class Zo extends Hi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return Pe(e.getJSONText(),eo)}}class es extends Hi{constructor(e,t){super(e),this.txID=t}path(){return`/v2/transactions/${this.txID}`}prepare(e){return Pe(e.getJSONText(),Fo)}}class ts extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}prepare(e){return Pe(e.getJSONText(),Ur)}}class ns extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}prepare(e){return Pe(e.getJSONText(),Yr)}}class as extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}prepare(e){return Pe(e.getJSONText(),Zr)}}class is extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return Pe(e.getJSONText(),_r)}}class rs extends Hi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return Pe(e.getJSONText(),jr)}}class os extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Qr)}}class ss extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Kr)}}class cs extends Hi{constructor(e,t){super(e),this.appID=BigInt(t)}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}prepare(e){return Pe(e.getJSONText(),qr)}}class hs extends Hi{constructor(e,t,n){super(e),this.index=BigInt(t);const a=de(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return Pe(e.getJSONText(),ro)}}class ds extends Hi{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e.toString(),this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}onlineOnly(e){return this.query["online-only"]=e,this}prepare(e){return Pe(e.getJSONText(),Or)}}class us extends Hi{path(){return"/v2/block-headers"}absent(e){return this.query.absent=e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}expired(e){return this.query.expired=e,this}limit(e){return this.query.limit=e,this}maxRound(e){return this.query["max-round"]=e,this}minRound(e){return this.query["min-round"]=e,this}nextToken(e){return this.query.next=e,this}proposers(e){return this.query.proposers=e,this}prepare(e){return Pe(e.getJSONText(),to)}}class ls extends Hi{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=Yo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}groupid(e){return this.query["group-id"]=Yo(e),this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}prepare(e){return Pe(e.getJSONText(),Go)}}class gs extends Hi{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e.toString(),this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Zr)}}class ms extends Hi{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e.toString(),this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),jr)}}class ps extends Hi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return Pe(e.getJSONText(),co)}}class fs extends T{constructor(e,t="http://127.0.0.1",n=8080,a={}){super("X-Indexer-API-Token",e,t,n,a)}makeHealthCheck(){return new Jo(this.c)}lookupAssetBalances(e){return new Wo(this.c,e)}lookupAssetTransactions(e){return new Qo(this.c,e)}lookupAccountTransactions(e){return new Xo(this.c,e)}lookupBlock(e){return new Zo(this.c,e)}lookupTransactionByID(e){return new es(this.c,e)}lookupAccountByID(e){return new ts(this.c,e)}lookupAccountAssets(e){return new ns(this.c,e)}lookupAccountCreatedAssets(e){return new as(this.c,e)}lookupAccountAppLocalStates(e){return new is(this.c,e)}lookupAccountCreatedApplications(e){return new rs(this.c,e)}lookupAssetByID(e){return new os(this.c,e)}lookupApplications(e){return new ss(this.c,e)}lookupApplicationLogs(e){return new cs(this.c,e)}searchAccounts(){return new ds(this.c)}searchForBlockHeaders(){return new us(this.c)}searchForTransactions(){return new ls(this.c)}searchForAssets(){return new gs(this.c)}searchForApplications(){return new ms(this.c)}searchForApplicationBoxes(e){return new ps(this.c,e)}lookupApplicationBoxByIDandName(e,t){return new hs(this.c,e,t)}}async function ys(e,t,n){const a=await e.status().do();if(void 0===a)throw new Error("Unable to get node status");const i=a.lastRound+BigInt(1),r=i+BigInt(n);let o=i;for(;o<r;){let n=!1;try{const a=await e.pendingTransactionInformation(t).do();if(a.confirmedRound)return a;if(a.poolError)throw n=!0,new Error(`Transaction Rejected: ${a.poolError}`)}catch(e){if(n)throw e}await e.statusAfterBlock(o).do(),o+=BigInt(1)}throw new Error(`Transaction not confirmed after ${n} rounds`)}function ws(e,t){let n=e.toString(16);n.length!==2*t&&(n=n.padStart(2*t,"0"));const a=new Uint8Array(n.length/2);for(let e=0,t=0;e<n.length/2;e++,t+=2)a[e]=parseInt(n.slice(t,t+2),16);return a}function vs(e){let t=BigInt(0);const n=new DataView(e.buffer,e.byteOffset);for(let a=0;a<e.length;a++)t=BigInt(Number(n.getUint8(a)))+t*BigInt(256);return t}function Ss(){const e=Fe((t=Oe().box.secretKeyLength,function(){const{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),Oe().randomBytes(t)));var t;return{addr:new ut(e.publicKey),sk:e.secretKey}}const Es=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],ks="failed to decode mnemonic",bs="the mnemonic contains a word that is not in the wordlist";function xs(e){const t=[];let n=0,a=0;return e.forEach(function(e){n|=e<<a,a+=8,a>=11&&(t.push(2047&n),n>>=11,a-=11)}),a&&t.push(n),t}function As(e){return e.map(e=>Es[e])}function Ds(e){return As(xs(_e(e)))[0]}function Is(e){if(e.length!==Je)throw new RangeError(`Seed length must be ${Je}`);const t=As(xs(e)),n=Ds(e);return`${t.join(" ")} ${n}`}function Ts(e){const t=e.split(" "),n=t.slice(0,24);for(const e of n)if(-1===Es.indexOf(e))throw new Error(bs);const a=t[t.length-1];let i=function(e){const t=[];let n=0,a=0;return e.forEach(function(e){for(n|=e<<a,a+=11;a>=8;)t.push(255&n),n>>=8,a-=8}),a&&t.push(n),new Uint8Array(t)}(n.map(e=>Es.indexOf(e)));if(33!==i.length)throw new Error(ks);if(0!==i[i.length-1])throw new Error(ks);if(i=i.slice(0,i.length-1),Ds(i)===a)return i;throw new Error(ks)}function Ps(e){const t=Fe(Ts(e));return{addr:new ut(t.publicKey),sk:t.secretKey}}function Ms(e){return Is(e.slice(0,Je))}function Vs(e){return Ts(e)}function Rs(e){return Is(e)}const Bs=(new TextEncoder).encode("PQK");function Cs(e,t){if(t.length!==ct)throw new Error(`invalid PQ scheme length: expected ${ct} bytes, got ${t.length}`);return new Uint8Array(_e(y(Bs,t,Ts(e))))}const Us=16,$s=(new TextEncoder).encode("TG");function Os(e){const t=[];for(const n of e)t.push(n.rawTxID());const n=_e(function(e){if(e.length>Us)throw new Error(`${e.length} transactions grouped together but max group size is ${Us}`);if(0===e.length)throw new Error("Cannot compute group ID of zero transactions");const t=fe({txlist:e});return y($s,t)}(t));return Uint8Array.from(n)}function Ns(e){const t=Os(e);for(const n of e)n.group=t;return e}const Ls=Uint8Array.from([77,88]);function _s(e,t){return{txID:e.txID(),blob:e.signTxn(t)}}async function Fs(e,t){const[n]=await t([e],[0]);return{blob:n,txID:e.txID(),stxn:Ie(n,Kn)}}function qs(e,t){return Ke(y(Ls,e),t)}function zs(e,t,n){return je(y(Ls,e),t,("string"==typeof n?ut.fromString(n):n).publicKey)}function Ks(e,t){let n,a;return t instanceof Nn?(n=t.lsig,a=t.address()):(n=t,a=n.pqsig?wt(n.pqsig):n.sig?new ut(e.sender.publicKey):n.lmsig?Sn({version:n.lmsig.v,threshold:n.lmsig.thr,pks:n.lmsig.subsig.map(e=>e.pk)}):n.address()),function(e,t,n){if([t.sig,t.msig,t.lmsig,t.pqsig].filter(Boolean).length>1)throw new Error("LogicSig has too many signatures. At most one of sig, msig, lmsig, or pqsig may be present");if(t.pqsig)try{Bn(t.logic)}catch(e){throw new Error(`Logic signature verification failed. Ensure the program is valid: ${e.message}`)}else if(!t.verify(n.publicKey))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");let a;He(n.publicKey,e.sender.publicKey)||(a=n);const i=new Kn({lsig:t,txn:e,sgnr:a});return{txID:e.txID(),blob:Te(i)}}(e,n,a)}function Hs(e,t){return Ks(e,t)}const js="Not enough multisig transactions to merge. Need at least two",Gs="Cannot merge txs. txIDs differ",Js="Cannot merge txs. Auth addrs differ",Ws="Cannot merge txs. Multisig preimages differ",Ys="Cannot merge txs. subsigs are mismatched.",Xs="Cannot add multisig signature. Signature is not of the correct length.",Qs="Key does not exist";function Zs(e,{version:t,threshold:n,addrs:a}){const i=vn(a),r={v:t,thr:n,subsig:i.map(e=>({pk:e}))},o=Sn({version:t,threshold:n,pks:i});let s;return e.sender.equals(o)||(s=o),Te(new Kn({txn:e,msig:r,sgnr:s}))}function ec(e,{rawSig:t,myPk:n},{version:a,threshold:i,pks:r}){const o=Ie(Zs(e,{version:a,threshold:i,addrs:r.map(e=>new ut(e))}),Kn);let s=!1;if(o.msig.subsig.forEach((e,a)=>{He(e.pk,n)&&(s=!0,o.msig.subsig[a].s=t)}),!s)throw new Error(Qs);return Te(o)}function tc(e,{version:t,threshold:n,pks:a},i){const r=ze(i).publicKey;return ec(e,{rawSig:e.rawSignTxn(i),myPk:r},{version:t,threshold:n,pks:a})}async function nc(e,{version:t,threshold:n,pks:a},i){const{stxn:r}=await Fs(e,i),o=r.sig;if(void 0===o)throw Error("Expected TransactionSigner to return a signed transaction with a sig, but sig was empty");return ec(e,{rawSig:o,myPk:(r.sgnr??e.sender).publicKey},{version:t,threshold:n,pks:a})}function ac(e){if(e.length<2)throw new Error(js);const t=Ie(e[0],Kn);if(!t.msig)throw new Error("Invalid multisig transaction, multisig structure missing at index 0");const n=t.txn.txID(),a=t.sgnr?t.sgnr.toString():void 0,i=Sn({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map(e=>e.pk)}),r=t.msig.subsig.map(e=>({...e}));for(let o=1;o<e.length;o++){const s=Ie(e[o],Kn);if(!s.msig)throw new Error(`Invalid multisig transaction, multisig structure missing at index ${o}`);if(s.txn.txID()!==n)throw new Error(Gs);if(a!==(s.sgnr?s.sgnr.toString():void 0))throw new Error(Js);if(s.msig.subsig.length!==t.msig.subsig.length)throw new Error(Ws);const c=Sn({version:s.msig.v,threshold:s.msig.thr,pks:s.msig.subsig.map(e=>e.pk)});if(!i.equals(c))throw new Error(Ws);s.msig.subsig.forEach((e,t)=>{if(!e.s)return;const n=r[t];if(n.s&&!f(e.s,n.s))throw new Error(Ys);n.s=e.s})}const o={v:t.msig.v,thr:t.msig.thr,subsig:r},s=void 0!==a?t.sgnr:void 0;return Te(new Kn({msig:o,txn:t.txn,sgnr:s}))}function ic(e,{version:t,threshold:n,addrs:a},i){const r=tc(e,{version:t,threshold:n,pks:vn(a)},i);return{txID:e.txID(),blob:r}}async function rc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=await nc(e,{version:t,threshold:n,pks:r},i);return{txID:e.txID(),blob:o}}function oc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=Ie(e,Kn),s=tc(o.txn,{version:t,threshold:n,pks:r},i);return{txID:o.txn.txID(),blob:ac([e,s])}}async function sc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=Ie(e,Kn),s=await nc(o.txn,{version:t,threshold:n,pks:r},i);return{txID:o.txn.txID(),blob:ac([e,s])}}function cc(e,{version:t,threshold:n,addrs:a},i,r){const o=vn(a),s=Ie(e,Kn),c=function(e,t,n,a){if(!qe(a.length))throw new Error(Xs);return ec(e,{rawSig:a,myPk:("string"==typeof n?ut.fromString(n):n).publicKey},t)}(s.txn,{version:t,threshold:n,pks:o},i,r);return{txID:s.txn.txID(),blob:ac([e,c])}}let hc={},dc={};function uc(e){let t=[],n=0,a=0;for(let i=0;i<e.length;i+=1){let r=hc[e[i]];if(void 0===r)throw new Error("Invalid character ("+e[i]+")");const o=32&r;if(r&=31,a+=r<<n,o)n+=5;else{const e=1&a;a>>>=1,e?t.push(0===a?-2147483648:-a):t.push(a),a=n=0}}return t}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach(function(e,t){hc[e]=t,dc[t]=e});class lc{constructor({version:e,sources:t,names:n,mappings:a}){if(this.version=e,this.sources=t,this.names=n,this.mappings=a,3!==this.version)throw new Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw new Error("mapping undefined, cannot build source map without `mapping`");const i=this.mappings.split(";").map(uc);this.pcToLocation=new Map,this.sourceAndLineToPc=new Map;const r={line:0,column:0,sourceIndex:0,nameIndex:0};for(const[e,t]of i.entries()){if(t.length<4)continue;const n=t.length>4?t[4]:void 0,[,a,i,o]=t;r.sourceIndex+=a,r.line+=i,r.column+=o,void 0!==n&&(r.nameIndex+=n);const s=`${r.sourceIndex}:${r.line}`;let c=this.sourceAndLineToPc.get(s);void 0===c&&(c=[],this.sourceAndLineToPc.set(s,c));const h={pc:e,column:r.column},d={line:r.line,column:r.column,sourceIndex:r.sourceIndex};void 0!==n&&(h.nameIndex=r.nameIndex,d.nameIndex=r.nameIndex),c.push(h),this.pcToLocation.set(e,d)}}getPcs(){return Array.from(this.pcToLocation.keys())}getLocationForPc(e){return this.pcToLocation.get(e)}getPcsOnSourceLine(e,t){const n=this.sourceAndLineToPc.get(`${e}:${t}`);return void 0===n?[]:n}}function gc(e,t=new ut(e.ed25519PublicKey)){const n=new ut(e.ed25519PublicKey),{ed25519Signer:a}=e;return{address:t,programDataSigner:async(e,t)=>{const n=y(t.address().publicKey,e),i=y(_n,n);return a(i)},txnSigner:async(e,t)=>{const i=[];for(const r of t){const t=e[r],o=await a(t.bytesToSign()),s=new Kn({txn:t,sig:o,sgnr:t.sender.equals(n)?void 0:n});i.push(s)}return i.map(e=>Te(e))},delegatedLsigSigner:async(e,t)=>{if(t){const i=vn(t.addrs),r=Sn({version:t.version,threshold:t.threshold,pks:i}),o=y($n,r.publicKey,e.logic),s=i.map(e=>({pk:e})),c=s.find(e=>f(e.pk,n.publicKey));if(void 0===c)throw Error(`DelegatedLsigSigner could not find ${n} as a signer in the multisig`);const h=await a(o);return c.s=h,{address:n,lmsig:{v:t.version,thr:t.threshold,subsig:s}}}const i=y(Cn,e.logic),r=await a(i);return{address:n,sig:r}},mxBytesSigner:async e=>{const t=y(Ls,e);return a(t)}}}function mc(e,t){const{pqPublicKey:n,pqSigner:a,pqScheme:i}=e,{address:r,salt:o}=yt(i,n);return{address:t??r,txnSigner:async(e,t)=>{const s=[];for(const c of t){const t=e[c],h=await a(t.bytesToSign()),d=new Kn({txn:t,pqsig:{sch:i,slt:o,pk:n,sig:h},sgnr:t.sender.equals(r)?void 0:r});s.push(d)}return s.map(e=>Te(e))},delegatedLsigSigner:async(e,t)=>{if(t)throw Error(`post-quantum scheme ${(new TextDecoder).decode(i)} does not support multisig signing`);const s=new Uint8Array(y(Un,r.publicKey,e.logic)),c=await a(s);return{address:r,pqsig:{sch:i,slt:o,pk:n,sig:c}}}}}const pc=(new TextEncoder).encode("f1");function fc(e,t){return mc({pqScheme:pc,pqPublicKey:e.falcon1024PublicKey,pqSigner:e.falcon1024Signer},t)}function yc({sender:e,receiver:t,amount:n,closeRemainderTo:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new un({type:Bt.pay,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,paymentParams:{receiver:t,amount:n,closeRemainderTo:a}})}function wc({sender:e,voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s,suggestedParams:c,note:h,lease:d,rekeyTo:u}){return new un({type:Bt.keyreg,sender:e,note:h,lease:d,rekeyTo:u,suggestedParams:c,keyregParams:{voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s}})}function vc({sender:e,assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l,note:g,lease:m,rekeyTo:p,suggestedParams:f}){return new un({type:Bt.acfg,sender:e,note:g,lease:m,rekeyTo:p,suggestedParams:f,assetConfigParams:{assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l}})}function Sc({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p}){return vc({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p})}function Ec({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,strictEmptyAddressChecking:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("assetIndex must be provided");if((o??1)&&(null==n||null==a||null==i||null==r))throw Error("strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.");return vc({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function kc({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r}){if(!t)throw Error("assetIndex must be provided");return vc({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r})}function bc({sender:e,assetIndex:t,freezeTarget:n,frozen:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new un({type:Bt.afrz,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,assetFreezeParams:{assetIndex:t,freezeTarget:n,frozen:a}})}function xc({sender:e,receiver:t,amount:n,closeRemainderTo:a,assetSender:i,note:r,assetIndex:o,suggestedParams:s,rekeyTo:c,lease:h}){if(!o)throw Error("assetIndex must be provided");return new un({type:Bt.axfer,sender:e,note:r,lease:h,rekeyTo:c,suggestedParams:s,assetTransferParams:{assetIndex:o,receiver:t,amount:n,assetSender:i,closeRemainderTo:a}})}function Ac({sender:e,appIndex:t,onComplete:n,appArgs:a,accounts:i,foreignApps:r,foreignAssets:o,boxes:s,convertToAccess:c,holdings:h,locals:d,access:u,approvalProgram:l,clearProgram:g,numLocalInts:m,numLocalByteSlices:p,numGlobalInts:f,numGlobalByteSlices:y,extraPages:w,rejectVersion:v,note:S,lease:E,rekeyTo:k,suggestedParams:b}){if(null==n)throw Error("onComplete must be provided");if(u&&(i||r||o||s||h||d))throw Error("cannot specify both access and other access fields");let x=u;return c&&(x=function({appIndex:e,accounts:t,foreignAssets:n,foreignApps:a,holdings:i,locals:r,boxes:o}){const s=[];function c(e){let t;if("string"==typeof e){if(""===e)return;t=ut.fromString(e)}else t=e;if(t.equals(ut.zeroAddress()))return;let n=!1;for(const e of s){if(!e.address)continue;let a=e.address;if("string"==typeof e.address&&(a=ut.fromString(e.address)),a.equals(t)){n=!0;break}}n||s.push({address:e})}function h(e){let t=!1;for(const n of s)if(n.assetIndex===e){t=!0;break}t||s.push({assetIndex:e})}function d(e){let t=!1;for(const n of s)if(n.appIndex===e){t=!0;break}t||s.push({appIndex:e})}for(const e of t??[])c(e);for(const e of n??[])h(e);for(const e of a??[])d(e);for(const e of i??[])e.address&&c(e.address),h(e.assetIndex),s.push({holding:e});for(const t of r??[])t.address&&c(t.address),t.appIndex&&BigInt(t.appIndex)!==e&&d(t.appIndex),s.push({locals:t});for(const t of o??[])t.appIndex&&BigInt(t.appIndex)!==e&&d(t.appIndex),s.push({box:t});return s}({appIndex:t,accounts:i,foreignApps:r,foreignAssets:o,holdings:h,locals:d,boxes:s})),new un({type:Bt.appl,sender:e,note:S,lease:E,rekeyTo:k,suggestedParams:b,appCallParams:{appIndex:t,onComplete:n,appArgs:a,accounts:x?void 0:i,foreignAssets:x?void 0:o,foreignApps:x?void 0:r,boxes:x?void 0:s,access:x,approvalProgram:l,clearProgram:g,numLocalInts:m,numLocalByteSlices:p,numGlobalInts:f,numGlobalByteSlices:y,extraPages:w,rejectVersion:v}})}function Dc({sender:e,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numLocalInts:g,numLocalByteSlices:m,numGlobalInts:p,numGlobalByteSlices:f,extraPages:y,note:w,lease:v,rekeyTo:S,suggestedParams:E}){if(!u||!l)throw Error("approvalProgram and clearProgram must be provided");if(null==t)throw Error("onComplete must be provided");return Ac({sender:e,appIndex:0,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numLocalInts:g,numLocalByteSlices:m,numGlobalInts:p,numGlobalByteSlices:f,extraPages:y,note:w,lease:v,rekeyTo:S,suggestedParams:E})}function Ic({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,note:g,lease:m,rekeyTo:p,suggestedParams:f}){if(!t)throw Error("appIndex must be provided");if(!u||!l)throw Error("approvalProgram and clearProgram must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.UpdateApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,note:g,lease:m,rekeyTo:p,suggestedParams:f})}function Tc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.DeleteApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Pc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.OptInOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:u,convertToAccess:s,holdings:c,locals:h,access:d,lease:l,rekeyTo:g,suggestedParams:m})}function Mc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.CloseOutOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Vc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.ClearStateOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Rc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Ac({sender:e,appIndex:t,onComplete:Ct.NoOpOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Bc(e){return(t,n)=>{const a=[];for(const i of n)a.push(t[i].signTxn(e.sk));return Promise.resolve(a)}}function Cc(e){return(t,n)=>{const a=[];for(const i of n){const{blob:n}=Ks(t[i],e);a.push(n)}return Promise.resolve(a)}}function Uc(e,t){return(n,a)=>{const i=[];for(const r of a){const a=n[r],o=[];for(const n of t){const{blob:t}=ic(a,e,n);o.push(t)}o.length>1?i.push(ac(o)):i.push(o[0])}return Promise.resolve(i)}}function $c(){return(e,t)=>{const n=[];for(const a of t)n.push(jn(e[a]));return Promise.resolve(n)}}function Oc(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}const Nc=65535,Lc=32,_c=1,Fc=1,qc=2,zc=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,Kc=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class Hc{static from(e){if(e.endsWith("[]")){const t=Hc.from(e.slice(0,e.length-2));return new Zc(t)}if(e.endsWith("]")){const t=e.match(zc);if(!t||3!==t.length)throw new Error(`malformed static array string: ${e}`);const n=t[2],a=parseInt(n,10);if(a>Nc)throw new Error(`array length exceeds limit ${Nc}`);const i=Hc.from(t[1]);return new Qc(i,a)}if(e.startsWith("uint")){const t=e=>[...e].every(e=>"0123456789".includes(e)),n=e.slice(4,e.length);if(!t(n))throw new Error(`malformed uint string: ${n}`);const a=parseInt(n,10);if(a>Nc)throw new Error(`malformed uint string: ${a}`);return new jc(a)}if("byte"===e)return new Yc;if(e.startsWith("ufixed")){const t=e.match(Kc);if(!t||3!==t.length)throw new Error(`malformed ufixed type: ${e}`);const n=parseInt(t[1],10),a=parseInt(t[2],10);return new Gc(n,a)}if("bool"===e)return new Wc;if("address"===e)return new Jc;if("string"===e)return new Xc;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){const t=eh.parseTupleContent(e.slice(1,e.length-1)),n=[];for(let e=0;e<t.length;e++){const a=Hc.from(t[e]);n.push(a)}return new eh(n)}throw new Error(`cannot convert a string ${e} to an ABI type`)}}class jc extends Hc{constructor(e){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof jc&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return ws(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a uint${this.bitSize}`);return vs(e)}}class Gc extends Hc{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw new Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof Gc&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return ws(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return vs(e)}}class Jc extends Hc{toString(){return"address"}equals(e){return e instanceof Jc}isDynamic(){return!1}byteLen(){return Lc}encode(e){if("string"==typeof e)return lt(e).publicKey;if(e instanceof ut)return e.publicKey;if(e instanceof Uint8Array){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return e}throw new Error(`Cannot encode value as ${this.toString()}: ${e}`)}decode(e){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return mt(e)}}class Wc extends Hc{toString(){return"bool"}equals(e){return e instanceof Wc}isDynamic(){return!1}byteLen(){return Fc}encode(e){if("boolean"!=typeof e)throw new Error(`Cannot encode value as bool: ${e}`);return e?new Uint8Array([128]):new Uint8Array([0])}decode(e){if(1!==e.byteLength)throw new Error("bool string must be 1 byte long");const t=e[0];if(128===t)return!0;if(0===t)return!1;throw new Error("boolean could not be decoded from the byte string")}}class Yc extends Hc{toString(){return"byte"}equals(e){return e instanceof Yc}isDynamic(){return!1}byteLen(){return _c}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw new Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw new Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw new Error("byte string must be 1 byte long");return e[0]}}class Xc extends Hc{toString(){return"string"}equals(e){return e instanceof Xc}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as string: ${e}`);let t;t="string"==typeof e?(new TextEncoder).encode(e):e;const n=ws(t.length,qc),a=new Uint8Array(t.length+qc);return a.set(n),a.set(t,qc),a}decode(e){if(e.length<qc)throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${qc}`);const t=new DataView(e.buffer,e.byteOffset,qc).getUint16(0),n=e.slice(qc,e.length);if(t!==n.length)throw new Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${n.length}`);return new TextDecoder("utf-8").decode(n)}}class Qc extends Hc{constructor(e,t){if(super(),t<0)throw new Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof Qc&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===Wc?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new eh(Array(this.staticLength).fill(this.childType))}}class Zc extends Hc{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof Zc&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=this.toABITupleType(e.length),n=t.encode(e);return y(ws(t.childTypes.length,qc),n)}decode(e){const t=new DataView(e.buffer,0,qc).getUint16(0);return this.toABITupleType(t).decode(e.slice(qc,e.length))}toABITupleType(e){return new eh(Array(e).fill(this.childType))}}class eh extends Hc{constructor(e){if(super(),e.length>=Nc)throw new Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){const e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof eh&&this.childTypes.length===e.childTypes.length&&this.childTypes.every((t,n)=>t.equals(e.childTypes[n]))}isDynamic(){return this.childTypes.some(e=>e.isDynamic())}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===Wc){const n=nh(this.childTypes,t,1),a=n+1;t+=n,e+=Math.trunc((a+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=Array.from(e);if(e.length>Nc)throw new Error("length of tuple array should not exceed a uint16");const n=this.childTypes,a=[],i=[],r=new Map;let o=0;for(;o<n.length;){const e=n[o];if(e.isDynamic())r.set(a.length,!0),a.push(new Uint8Array([0,0])),i.push(e.encode(t[o]));else{if(e.constructor===Wc){const e=nh(n,o,-1);let i=nh(n,o,1);if(e%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");i=Math.min(7,i);const r=th(t.slice(o,o+i+1));a.push(ws(r,1)),o+=i}else{const n=e.encode(t[o]);a.push(n)}r.set(o,!1),i.push(new Uint8Array)}o+=1}let s=0;for(const e of a)s+=e.length;let c=0;for(let e=0;e<a.length;e++){if(r.get(e)){const t=s+c;if(t>Nc)throw new Error(`byte length of ${t} should not exceed a uint16`);a[e]=ws(t,qc)}c+=i[e].length}return y(...a,...i)}decode(e){const t=this.childTypes,n=[],a=[];let i=0,r=0;const o=new DataView(e.buffer);for(;i<t.length;){const s=t[i];if(s.isDynamic()){if(e.slice(r,e.length).length<qc)throw new Error("dynamic type in tuple is too short to be decoded");const t=o.getUint16(r);if(n.length>0&&(n[n.length-1].right=t,t<n[n.length-1].left))throw new Error("dynamic index segment miscalculation: left is greater than right index");const i={left:t,right:-1};n.push(i),a.push(null),r+=qc}else if(s.constructor===Wc){const t=nh(this.childTypes,i,-1);let n=nh(this.childTypes,i,1);if(t%8!=0)throw new Error("expected before bool number mod 8 === 0");n=Math.min(7,n);for(let t=0;t<=n;t++){const n=128>>t;(e[r]&n)>0?a.push(new Uint8Array([128])):a.push(new Uint8Array([0]))}i+=n,r+=1}else{const t=s.byteLen();a.push(e.slice(r,r+t)),r+=t}if(i!==t.length-1&&r>=e.length)throw new Error("input byte not enough to decode");i+=1}if(n.length>0&&(n[n.length-1].right=e.length,r=e.length),r<e.length)throw new Error("input byte not fully consumed");for(let e=0;e<n.length;e++){const t=n[e];if(t.left>t.right)throw new Error("dynamic segment should display a [l, r] space with l <= r");if(e!==n.length-1&&t.right!==n[e+1].left)throw new Error("dynamic segment should be consecutive")}let s=0;for(let i=0;i<t.length;i++)t[i].isDynamic()&&(a[i]=e.slice(n[s].left,n[s].right),s+=1);const c=[];for(let e=0;e<t.length;e++){const n=t[e].decode(a[e]);c.push(n)}return c}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw new Error("tuple string should not start with comma");if(e.includes(",,"))throw new Error("tuple string should not have consecutive commas");const t=[];let n=0,a="";for(const i of e)a+=i,"("===i?n+=1:")"===i?n-=1:","===i&&0===n&&(t.push(a.slice(0,a.length-1)),a="");if(0!==a.length&&t.push(a),0!==n)throw new Error("tuple string has mismatched parentheses");return t}}function th(e){let t=0;if(e.length>8)throw new Error("value list passed in should be no greater than length 8");for(let n=0;n<e.length;n++){const a=e[n];if("boolean"!=typeof a)throw new Error("non-boolean values cannot be compressed into a byte");a&&(t|=1<<7-n)}return t}function nh(e,t,n){let a=0;for(;;){const i=t+n*a;if(e[i].constructor!==Wc){a-=1;break}if(i!==e.length-1&&1===n)a+=1;else{if(!(i>0&&-1===n))break;a+=1}}return a}var ah,ih;function rh(e){return e===ah.any||e===ah.pay||e===ah.keyreg||e===ah.acfg||e===ah.axfer||e===ah.afrz||e===ah.appl}function oh(e,t){return e===ah.any||!!t.type&&t.type.toString()===e.toString()}function sh(e){return e===ih.account||e===ih.application||e===ih.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(ah||(ah={})),function(e){e.account="account",e.application="application",e.asset="asset"}(ih||(ih={}));class ch{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw new Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map(({type:e,name:t,desc:n})=>rh(e)||sh(e)?{type:e,name:t,description:n}:{type:Hc.from(e),name:t,description:n}),this.returns={type:"void"===e.returns.type?e.returns.type:Hc.from(e.returns.type),description:e.returns.desc},this.events=e.events,this.readonly=e.readonly}getSignature(){const e=this.args.map(e=>e.type.toString()).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){const e=_e(this.getSignature());return new Uint8Array(e.slice(0,4))}txnCount(){let e=1;for(const t of this.args)"string"==typeof t.type&&rh(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map(({type:e,name:t,description:n})=>({type:e.toString(),name:t,desc:n})),returns:{type:this.returns.type.toString(),desc:this.returns.description},events:this.events,readonly:this.readonly}}static fromSignature(e){const{name:t,args:n,returns:a}=function(e){const t=e.indexOf("(");if(-1===t)throw new Error(`Invalid method signature: ${e}`);let n=-1,a=0;for(let i=t;i<e.length;i++){const t=e[i];if("("===t)a+=1;else if(")"===t){if(0===a)break;if(a-=1,0===a){n=i;break}}}if(-1===n)throw new Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:eh.parseTupleContent(e.slice(t+1,n)),returns:e.slice(n+1)}}(e);return new ch({name:t,args:n.map(e=>({type:e})),returns:{type:a}})}}function hh(e,t){if(null===e||!Array.isArray(e)||!e.every(e=>e instanceof ch))throw new Error("Methods list provided is null or not the correct type");const n=e.filter(e=>e.name===t);if(n.length>1)throw new Error(`found ${n.length} methods with the same name ${n.map(e=>e.getSignature()).join(",")}`);if(0===n.length)throw new Error(`found 0 methods with the name ${t}`);return n[0]}class dh{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw new Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map(e=>new ch(e)),this.events=e.events}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map(e=>e.toJSON()),events:this.events}}getMethodByName(e){return hh(this.methods,e)}}class uh{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw new Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map(e=>new ch(e))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map(e=>e.toJSON())}}getMethodByName(e){return hh(this.methods,e)}}const lh=new Uint8Array([21,31,124,117]);var gh;function mh(e,t,n){if(null!=n&&e===n)return 0;const a=null==n?0:1;for(let n=0;n<t.length;n++)if(e===t[n])return n+a;return t.push(e),t.length-1+a}!function(e){e[e.BUILDING=0]="BUILDING",e[e.BUILT=1]="BUILT",e[e.SIGNED=2]="SIGNED",e[e.SUBMITTED=3]="SUBMITTED",e[e.COMMITTED=4]="COMMITTED"}(gh||(gh={}));class ph{constructor(){this.status=gh.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const e=new ph;return e.transactions=this.transactions.map(({txn:e,signer:t})=>{const n=e.toEncodingData();return n.delete("grp"),{txn:un.fromEncodingData(n),signer:t}}),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==gh.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===ph.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${ph.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some(e=>0!==e))throw new Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:n,sender:a,suggestedParams:i,onComplete:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,appAccounts:g,appForeignApps:m,appForeignAssets:p,boxes:f,access:y,note:w,lease:v,rekeyTo:S,rejectVersion:E,signer:b}){if(this.status!==gh.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>ph.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${ph.MAX_GROUP_SIZE}`);if(BigInt(e)===BigInt(0)){if(null==o||null==s||null==c||null==h||null==d||null==u)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(r===Ct.UpdateApplicationOC){if(null==o||null==s)throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=c||null!=h||null!=d||null!=u||null!=l)throw new Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=o||null!=s||null!=c||null!=h||null!=d||null!=u||null!=l)throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(y&&(g||m||p||f))throw new Error("Cannot specify both access and legacy foreign arrays (appAccounts, appForeignApps, appForeignAssets, boxes)");if(null==n&&(n=[]),n.length!==t.args.length)throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${n.length}`);let x=[],A=[];const D=[],I=[],T=[],P=new Map,M=f||[];for(let e=0;e<n.length;e++){let a=t.args[e].type;const i=n[e];if(rh(a)){if(!Oc(i)||!oh(a,i.txn))throw new Error(`Expected ${a} TransactionWithSigner for argument at index ${e}`);if(i.txn.group&&i.txn.group.some(e=>0!==e))throw new Error("Cannot add a transaction with nonzero group ID");D.push(i)}else{if(Oc(i))throw new Error(`Expected non-transaction value for argument at index ${e}`);if(sh(a)&&(P.set(I.length,x.length),I.push(a),T.push(i),a=new jc(8)),"string"==typeof a)throw new Error(`Unknown ABI type: ${a}`);x.push(a),A.push(i)}}const V=[],R=null==g?[]:g.map(e=>e.toString()),B=null==m?[]:m.map(k),C=null==p?[]:p.map(k);for(let t=0;t<I.length;t++){const n=I[t],i=T[t];let r=0;switch(n){case ih.account:{const e=new Jc;r=mh(e.decode(e.encode(i)),R,a.toString());break}case ih.application:{const t=new jc(64),n=t.decode(t.encode(i));if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${n}`);r=mh(n,B,k(e));break}case ih.asset:{const e=new jc(64),t=e.decode(e.encode(i));if(t>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${t}`);r=mh(t,C);break}default:throw new Error(`Unknown reference type: ${n}`)}V.push(r)}for(let e=0;e<V.length;e++)A[P.get(e)]=V[e];if(x.length>15){const e=x.slice(14),t=A.slice(14);x=x.slice(0,14),A=A.slice(0,14),x.push(new eh(e)),A.push(t)}const U=[t.getSelector()];for(let e=0;e<x.length;e++)U.push(x[e].encode(A[e]));const $={txn:Ac({sender:a,appIndex:e,appArgs:U,accounts:y?void 0:R,foreignApps:y?void 0:B,foreignAssets:y?void 0:C,boxes:y?void 0:M,access:y,onComplete:null==r?Ct.NoOpOC:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,rejectVersion:E,lease:v,note:w,rekeyTo:S,suggestedParams:i}),signer:b};this.transactions.push(...D,$),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===gh.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&Ns(this.transactions.map(e=>e.txn)),this.status=gh.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=gh.SIGNED)return this.signedTxns;const e=this.buildGroup(),t=e.map(e=>e.txn),n=new Map;for(let t=0;t<e.length;t++){const{signer:a}=e[t];n.has(a)||n.set(a,[]),n.get(a).push(t)}const a=Array.from(n),i=await Promise.all(a.map(([e,n])=>e(t,n))),r=e.map(()=>null);for(let e=0;e<a.length;e++){const t=a[e][1],n=i[e];for(let e=0;e<t.length;e++)r[t[e]]=n[e]}if(!r.every(e=>null!=e))throw new Error(`Missing signatures. Got ${r}`);const o=r.map((e,t)=>{try{return Ie(e,Kn).txn.txID()}catch(e){throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`)}});return this.signedTxns=r,this.txIDs=o,this.status=gh.SIGNED,r}async submit(e){if(this.status>gh.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=gh.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>gh.SUBMITTED)throw new Error("Simulated Transaction group has already been submitted to the network");const n=(await this.gatherSignatures()).map(e=>Ie(e,Kn)),a=null==t?new Di({txnGroups:[]}):t;a.txnGroups=[new Ii({txns:n})];const i=await e.simulateTransactions(a).do(),r=[];for(const[e,t]of this.methodCalls){const n=this.txIDs[e],a=i.txnGroups[0].txnResults[e].txnResult,o={txID:n,rawReturnValue:new Uint8Array,method:t};r.push(ph.parseMethodResponse(t,o,a))}return{methodResults:r,simulateResponse:i}}async execute(e,t){if(this.status===gh.COMMITTED)throw new Error("Transaction group has already been executed successfully");const n=await this.submit(e);this.status=gh.SUBMITTED;const a=this.transactions.findIndex((e,t)=>this.methodCalls.has(t)),i=-1===a?0:a,r=await ys(e,n[i],t);this.status=gh.COMMITTED;const o=r.confirmedRound,s=[];for(const[t,i]of this.methodCalls){const o=n[t];let c={txID:o,rawReturnValue:new Uint8Array,method:i};try{const n=t===a?r:await e.pendingTransactionInformation(o).do();c=ph.parseMethodResponse(i,c,n)}catch(e){c.decodeError=e}s.push(c)}return{confirmedRound:o,txIDs:n,methodResults:s}}static parseMethodResponse(e,t,n){const a=t;try{if(a.txInfo=n,"void"!==e.returns.type){const i=n.logs||[];if(0===i.length)throw new Error(`App call transaction did not log a return value ${p(n)}`);const r=i[i.length-1];if(r.byteLength<4||!f(r.slice(0,4),lh))throw new Error(`App call transaction did not log a ABI return value ${p(n)}`);a.rawReturnValue=new Uint8Array(r.slice(4)),a.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){a.decodeError=e}return a}}ph.MAX_GROUP_SIZE=16;const fh="The transaction sender address and multisig preimage do not match.",yh=new Error(fh),wh=new Error(o),vh=i})(),a})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.algosdk=t():e.algosdk=t()}(self,()=>(()=>{var e={180(e,t,n){var a;!function(){"use strict";var i,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,s=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",d=1e14,u=14,l=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function f(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,a=1,i=e.length,r=e[0]+"";a<i;){for(t=e[a++]+"",n=u-t.length;n--;t="0"+t);r+=t}for(i=r.length;48===r.charCodeAt(--i););return r.slice(0,i+1||1)}function w(e,t){var n,a,i=e.c,r=t.c,o=e.s,s=t.s,c=e.e,h=t.e;if(!o||!s)return null;if(n=i&&!i[0],a=r&&!r[0],n||a)return n?a?0:-s:o;if(o!=s)return o;if(n=o<0,a=c==h,!i||!r)return a?0:!i^n?1:-1;if(!a)return c>h^n?1:-1;for(s=(c=i.length)<(h=r.length)?c:h,o=0;o<s;o++)if(i[o]!=r[o])return i[o]>r[o]^n?1:-1;return c==h?0:c>h^n?1:-1}function v(e,t,n,a){if(e<t||e>n||e!==s(e))throw Error(c+(a||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function S(e){var t=e.c.length-1;return f(e.e/u)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,n){var a,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(a=e.length)){for(i=n,t-=a;--t;i+=n);e+=i}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var n,a,i,b,x,A,D,I,T,P,M=z.prototype={constructor:z,toString:null,valueOf:null},V=new z(1),R=20,B=4,C=-7,U=21,$=-1e7,O=1e7,N=!1,L=1,_=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var n,o,c,d,g,m,p,f,y=this;if(!(y instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>O?y.c=y.e=null:e.e<$?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((m="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,g=e;g>=10;g/=10,d++);return void(d>O?y.c=y.e=null:(y.e=d,y.c=[e]))}f=String(e)}else{if(!r.test(f=String(e)))return i(y,f,m);y.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(d=f.indexOf("."))>-1&&(f=f.replace(".","")),(g=f.search(/e/i))>0?(d<0&&(d=g),d+=+f.slice(g+1),f=f.substring(0,g)):d<0&&(d=f.length)}else{if(v(t,2,F.length,"Base"),10==t)return G(y=new z(e),R+y.e+1,B);if(f=String(e),m="number"==typeof e){if(0*e!=0)return i(y,f,m,t);if(y.s=1/e<0?(f=f.slice(1),-1):1,z.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(h+e)}else y.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=F.slice(0,t),d=g=0,p=f.length;g<p;g++)if(n.indexOf(o=f.charAt(g))<0){if("."==o){if(g>d){d=p;continue}}else if(!c&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){c=!0,g=-1,d=0;continue}return i(y,String(e),m,t)}m=!1,(d=(f=a(f,t,10,y.s)).indexOf("."))>-1?f=f.replace(".",""):d=f.length}for(g=0;48===f.charCodeAt(g);g++);for(p=f.length;48===f.charCodeAt(--p););if(f=f.slice(g,++p)){if(p-=g,m&&z.DEBUG&&p>15&&(e>l||e!==s(e)))throw Error(h+y.s*e);if((d=d-g-1)>O)y.c=y.e=null;else if(d<$)y.c=[y.e=0];else{if(y.e=d,y.c=[],g=(d+1)%u,d<0&&(g+=u),g<p){for(g&&y.c.push(+f.slice(0,g)),p-=u;g<p;)y.c.push(+f.slice(g,g+=u));g=u-(f=f.slice(g)).length}else g-=p;for(;g--;f+="0");y.c.push(+f)}}else y.c=[y.e=0]}function K(e,t,n,a){var i,r,o,s,c;if(null==n?n=B:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)c=y(e.c),c=1==a||2==a&&(o<=C||o>=U)?E(c,o):k(c,o,"0");else if(r=(e=G(new z(e),t,n)).e,s=(c=y(e.c)).length,1==a||2==a&&(t<=r||r<=C)){for(;s<t;c+="0",s++);c=E(c,r)}else if(t-=o,c=k(c,r,"0"),r+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=r-s)>0)for(r+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function H(e,t){for(var n,a=1,i=new z(e[0]);a<e.length;a++){if(!(n=new z(e[a])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function j(e,t,n){for(var a=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,a++);return(n=a+n*u-1)>O?e.c=e.e=null:n<$?e.c=[e.e=0]:(e.e=n,e.c=t),e}function G(e,t,n,a){var i,r,c,h,l,m,p,f=e.c,y=g;if(f){e:{for(i=1,h=f[0];h>=10;h/=10,i++);if((r=t-i)<0)r+=u,c=t,p=(l=f[m=0])/y[i-c-1]%10|0;else if((m=o((r+1)/u))>=f.length){if(!a)break e;for(;f.length<=m;f.push(0));l=p=0,i=1,c=(r%=u)-u+1}else{for(l=h=f[m],i=1;h>=10;h/=10,i++);p=(c=(r%=u)-u+i)<0?0:l/y[i-c-1]%10|0}if(a=a||t<0||null!=f[m+1]||(c<0?l:l%y[i-c-1]),a=n<4?(p||a)&&(0==n||n==(e.s<0?3:2)):p>5||5==p&&(4==n||a||6==n&&(r>0?c>0?l/y[i-c]:0:f[m-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=y[(u-t%u)%u],e.e=-t||0):f[0]=e.e=0,e;if(0==r?(f.length=m,h=1,m--):(f.length=m+1,h=y[u-r],f[m]=c>0?s(l/y[i-c]%y[c])*h:0),a)for(;;){if(0==m){for(r=1,c=f[0];c>=10;c/=10,r++);for(c=f[0]+=h,h=1;c>=10;c/=10,h++);r!=h&&(e.e++,f[0]==d&&(f[0]=1));break}if(f[m]+=h,f[m]!=d)break;f[m--]=0,h=1}for(r=f.length;0===f[--r];f.pop());}e.e>O?e.c=e.e=null:e.e<$&&(e.c=[e.e=0])}return e}function J(e){var t,n=e.e;return null===n?e.toString():(t=y(e.c),t=n<=C||n>=U?E(t,n):k(t,n,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(n=e[t],0,p,t),R=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(n=e[t],0,8,t),B=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),C=n[0],U=n[1]):(v(n,-p,p,t),C=-(U=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),$=n[0],O=n[1];else{if(v(n,-p,p,t),!n)throw Error(c+t+" cannot be zero: "+n);$=-(O=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(c+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(c+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(n=e[t],0,9,t),L=n),e.hasOwnProperty(t="POW_PRECISION")&&(v(n=e[t],0,p,t),_=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(c+t+" not an object: "+n);q=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);F=n}}return{DECIMAL_PLACES:R,ROUNDING_MODE:B,EXPONENTIAL_AT:[C,U],RANGE:[$,O],CRYPTO:N,MODULO_MODE:L,POW_PRECISION:_,FORMAT:q,ALPHABET:F}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,n,a=e.c,i=e.e,r=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===r||-1===r)&&i>=-p&&i<=p&&i===s(i)){if(0===a[0]){if(0===i&&1===a.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(a[0]).length==t){for(t=0;t<a.length;t++)if((n=a[t])<0||n>=d||n!==s(n))break e;if(0!==n)return!0}}}else if(null===a&&null===i&&(null===r||1===r||-1===r))return!0;throw Error(c+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return H(arguments,M.lt)},z.minimum=z.min=function(){return H(arguments,M.gt)},z.random=(b=9007199254740992,x=Math.random()*b&2097151?function(){return s(Math.random()*b)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,a,i,r,h=0,d=[],l=new z(V);if(null==e?e=R:v(e,0,p),i=o(e/u),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));h<i;)(r=131072*t[h]+(t[h+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[h]=n[0],t[h+1]=n[1]):(d.push(r%1e14),h+=2);h=i/2}else{if(!crypto.randomBytes)throw N=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);h<i;)(r=281474976710656*(31&t[h])+1099511627776*t[h+1]+4294967296*t[h+2]+16777216*t[h+3]+(t[h+4]<<16)+(t[h+5]<<8)+t[h+6])>=9e15?crypto.randomBytes(7).copy(t,h):(d.push(r%1e14),h+=7);h=i/7}if(!N)for(;h<i;)(r=x())<9e15&&(d[h++]=r%1e14);for(i=d[--h],e%=u,i&&e&&(r=g[u-e],d[h]=s(i/r)*r);0===d[h];d.pop(),h--);if(h<0)d=[a=0];else{for(a=-1;0===d[0];d.splice(0,1),a-=u);for(h=1,r=d[0];r>=10;r/=10,h++);h<u&&(a-=u-h)}return l.e=a,l.c=d,l}),z.sum=function(){for(var e=1,t=arguments,n=new z(t[0]);e<t.length;)n=n.plus(t[e++]);return n},a=function(){var e="0123456789";function t(e,t,n,a){for(var i,r,o=[0],s=0,c=e.length;s<c;){for(r=o.length;r--;o[r]*=t);for(o[0]+=a.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>n-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(a,i,r,o,s){var c,h,d,u,l,g,m,p,f=a.indexOf("."),w=R,v=B;for(f>=0&&(u=_,_=0,a=a.replace(".",""),g=(p=new z(i)).pow(a.length-f),_=u,p.c=t(k(y(g.c),g.e,"0"),10,r,e),p.e=p.c.length),d=u=(m=t(a,i,r,s?(c=F,e):(c=e,F))).length;0==m[--u];m.pop());if(!m[0])return c.charAt(0);if(f<0?--d:(g.c=m,g.e=d,g.s=o,m=(g=n(g,p,w,v,r)).c,l=g.r,d=g.e),f=m[h=d+w+1],u=r/2,l=l||h<0||null!=m[h+1],l=v<4?(null!=f||l)&&(0==v||v==(g.s<0?3:2)):f>u||f==u&&(4==v||l||6==v&&1&m[h-1]||v==(g.s<0?8:7)),h<1||!m[0])a=l?k(c.charAt(1),-w,c.charAt(0)):c.charAt(0);else{if(m.length=h,l)for(--r;++m[--h]>r;)m[h]=0,h||(++d,m=[1].concat(m));for(u=m.length;!m[--u];);for(f=0,a="";f<=u;a+=c.charAt(m[f++]));a=k(a,d,c.charAt(0))}return a}}(),n=function(){function e(e,t,n){var a,i,r,o,s=0,c=e.length,h=t%m,d=t/m|0;for(e=e.slice();c--;)s=((i=h*(r=e[c]%m)+(a=d*r+(o=e[c]/m|0)*h)%m*m+s)/n|0)+(a/m|0)+d*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,a){var i,r;if(n!=a)r=n>a?1:-1;else for(i=r=0;i<n;i++)if(e[i]!=t[i]){r=e[i]>t[i]?1:-1;break}return r}function n(e,t,n,a){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*a+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,i,r,o,c){var h,l,g,m,p,y,w,v,S,E,k,b,x,A,D,I,T,P=a.s==i.s?1:-1,M=a.c,V=i.c;if(!(M&&M[0]&&V&&V[0]))return new z(a.s&&i.s&&(M?!V||M[0]!=V[0]:V)?M&&0==M[0]||!V?0*P:P/0:NaN);for(S=(v=new z(P)).c=[],P=r+(l=a.e-i.e)+1,c||(c=d,l=f(a.e/u)-f(i.e/u),P=P/u|0),g=0;V[g]==(M[g]||0);g++);if(V[g]>(M[g]||0)&&l--,P<0)S.push(1),m=!0;else{for(A=M.length,I=V.length,g=0,P+=2,(p=s(c/(V[0]+1)))>1&&(V=e(V,p,c),M=e(M,p,c),I=V.length,A=M.length),x=I,k=(E=M.slice(0,I)).length;k<I;E[k++]=0);T=V.slice(),T=[0].concat(T),D=V[0],V[1]>=c/2&&D++;do{if(p=0,(h=t(V,E,I,k))<0){if(b=E[0],I!=k&&(b=b*c+(E[1]||0)),(p=s(b/D))>1)for(p>=c&&(p=c-1),w=(y=e(V,p,c)).length,k=E.length;1==t(y,E,w,k);)p--,n(y,I<w?T:V,w,c),w=y.length,h=1;else 0==p&&(h=p=1),w=(y=V.slice()).length;if(w<k&&(y=[0].concat(y)),n(E,y,k,c),k=E.length,-1==h)for(;t(V,E,I,k)<1;)p++,n(E,I<k?T:V,k,c),k=E.length}else 0===h&&(p++,E=[0]);S[g++]=p,E[0]?E[k++]=M[x]||0:(E=[M[x]],k=1)}while((x++<A||null!=E[0])&&P--);m=null!=E[0],S[0]||S.splice(0,1)}if(c==d){for(g=1,P=S[0];P>=10;P/=10,g++);G(v,r+(v.e=g+l*u-1)+1,o,m)}else v.e=l,v.r=+m;return v}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,I=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,a){var i,r=n?t:t.replace(P,"");if(T.test(r))e.s=isNaN(r)?null:r<0?-1:1;else{if(!n&&(r=r.replace(A,function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,a&&a!=i?e:t}),a&&(i=a,r=r.replace(D,"$1").replace(I,"0.$1")),t!=r))return new z(r,i);if(z.DEBUG)throw Error(c+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},M.absoluteValue=M.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},M.comparedTo=function(e,t){return w(this,new z(e,t))},M.decimalPlaces=M.dp=function(e,t){var n,a,i,r=this;if(null!=e)return v(e,0,p),null==t?t=B:v(t,0,8),G(new z(r),e+r.e+1,t);if(!(n=r.c))return null;if(a=((i=n.length-1)-f(this.e/u))*u,i=n[i])for(;i%10==0;i/=10,a--);return a<0&&(a=0),a},M.dividedBy=M.div=function(e,t){return n(this,new z(e,t),R,B)},M.dividedToIntegerBy=M.idiv=function(e,t){return n(this,new z(e,t),0,1)},M.exponentiatedBy=M.pow=function(e,t){var n,a,i,r,h,d,l,g,m=this;if((e=new z(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+J(e));if(null!=t&&(t=new z(t)),h=e.e>14,!m.c||!m.c[0]||1==m.c[0]&&!m.e&&1==m.c.length||!e.c||!e.c[0])return g=new z(Math.pow(+J(m),h?2-S(e):+J(e))),t?g.mod(t):g;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(a=!d&&m.isInteger()&&t.isInteger())&&(m=m.mod(t))}else{if(e.e>9&&(m.e>0||m.e<-1||(0==m.e?m.c[0]>1||h&&m.c[1]>=24e7:m.c[0]<8e13||h&&m.c[0]<=9999975e7)))return r=m.s<0&&S(e)?-0:0,m.e>-1&&(r=1/r),new z(d?1/r:r);_&&(r=o(_/u+2))}for(h?(n=new z(.5),d&&(e.s=1),l=S(e)):l=(i=Math.abs(+J(e)))%2,g=new z(V);;){if(l){if(!(g=g.times(m)).c)break;r?g.c.length>r&&(g.c.length=r):a&&(g=g.mod(t))}if(i){if(0===(i=s(i/2)))break;l=i%2}else if(G(e=e.times(n),e.e+1,1),e.e>14)l=S(e);else{if(0===(i=+J(e)))break;l=i%2}m=m.times(m),r?m.c&&m.c.length>r&&(m.c.length=r):a&&(m=m.mod(t))}return a?g:(d&&(g=V.div(g)),t?g.mod(t):r?G(g,_,B,void 0):g)},M.integerValue=function(e){var t=new z(this);return null==e?e=B:v(e,0,8),G(t,t.e+1,e)},M.isEqualTo=M.eq=function(e,t){return 0===w(this,new z(e,t))},M.isFinite=function(){return!!this.c},M.isGreaterThan=M.gt=function(e,t){return w(this,new z(e,t))>0},M.isGreaterThanOrEqualTo=M.gte=function(e,t){return 1===(t=w(this,new z(e,t)))||0===t},M.isInteger=function(){return!!this.c&&f(this.e/u)>this.c.length-2},M.isLessThan=M.lt=function(e,t){return w(this,new z(e,t))<0},M.isLessThanOrEqualTo=M.lte=function(e,t){return-1===(t=w(this,new z(e,t)))||0===t},M.isNaN=function(){return!this.s},M.isNegative=function(){return this.s<0},M.isPositive=function(){return this.s>0},M.isZero=function(){return!!this.c&&0==this.c[0]},M.minus=function(e,t){var n,a,i,r,o=this,s=o.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,h=e.e/u,l=o.c,g=e.c;if(!c||!h){if(!l||!g)return l?(e.s=-t,e):new z(g?o:NaN);if(!l[0]||!g[0])return g[0]?(e.s=-t,e):new z(l[0]?o:3==B?-0:0)}if(c=f(c),h=f(h),l=l.slice(),s=c-h){for((r=s<0)?(s=-s,i=l):(h=c,i=g),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(a=(r=(s=l.length)<(t=g.length))?s:t,s=t=0;t<a;t++)if(l[t]!=g[t]){r=l[t]<g[t];break}if(r&&(i=l,l=g,g=i,e.s=-e.s),(t=(a=g.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=d-1;a>s;){if(l[--a]<g[a]){for(n=a;n&&!l[--n];l[n]=t);--l[n],l[a]+=d}l[a]-=g[a]}for(;0==l[0];l.splice(0,1),--h);return l[0]?j(e,l,h):(e.s=3==B?-1:1,e.c=[e.e=0],e)},M.modulo=M.mod=function(e,t){var a,i,r=this;return e=new z(e,t),!r.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||r.c&&!r.c[0]?new z(r):(9==L?(i=e.s,e.s=1,a=n(r,e,0,3),e.s=i,a.s*=i):a=n(r,e,0,L),(e=r.minus(a.times(e))).c[0]||1!=L||(e.s=r.s),e)},M.multipliedBy=M.times=function(e,t){var n,a,i,r,o,s,c,h,l,g,p,y,w,v,S,E=this,k=E.c,b=(e=new z(e,t)).c;if(!(k&&b&&k[0]&&b[0]))return!E.s||!e.s||k&&!k[0]&&!b||b&&!b[0]&&!k?e.c=e.e=e.s=null:(e.s*=E.s,k&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=f(E.e/u)+f(e.e/u),e.s*=E.s,(c=k.length)<(g=b.length)&&(w=k,k=b,b=w,i=c,c=g,g=i),i=c+g,w=[];i--;w.push(0));for(v=d,S=m,i=g;--i>=0;){for(n=0,p=b[i]%S,y=b[i]/S|0,r=i+(o=c);r>i;)n=((h=p*(h=k[--o]%S)+(s=y*h+(l=k[o]/S|0)*p)%S*S+w[r]+n)/v|0)+(s/S|0)+y*l,w[r--]=h%v;w[r]=n}return n?++a:w.splice(0,1),j(e,w,a)},M.negated=function(){var e=new z(this);return e.s=-e.s||null,e},M.plus=function(e,t){var n,a=this,i=a.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,a.minus(e);var r=a.e/u,o=e.e/u,s=a.c,c=e.c;if(!r||!o){if(!s||!c)return new z(i/0);if(!s[0]||!c[0])return c[0]?e:new z(s[0]?a:0*i)}if(r=f(r),o=f(o),s=s.slice(),i=r-o){for(i>0?(o=r,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/d|0,s[t]=d===s[t]?0:s[t]%d;return i&&(s=[i].concat(s),++o),j(e,s,o)},M.precision=M.sd=function(e,t){var n,a,i,r=this;if(null!=e&&e!==!!e)return v(e,1,p),null==t?t=B:v(t,0,8),G(new z(r),e,t);if(!(n=r.c))return null;if(a=(i=n.length-1)*u+1,i=n[i]){for(;i%10==0;i/=10,a--);for(i=n[0];i>=10;i/=10,a++);}return e&&r.e+1>a&&(a=r.e+1),a},M.shiftedBy=function(e){return v(e,-9007199254740991,l),this.times("1e"+e)},M.squareRoot=M.sqrt=function(){var e,t,a,i,r,o=this,s=o.c,c=o.s,h=o.e,d=R+4,u=new z("0.5");if(1!==c||!s||!s[0])return new z(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+J(o)))||c==1/0?(((t=y(s)).length+h)%2==0&&(t+="0"),c=Math.sqrt(+t),h=f((h+1)/2)-(h<0||h%2),a=new z(t=c==1/0?"5e"+h:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+h)):a=new z(c+""),a.c[0])for((c=(h=a.e)+d)<3&&(c=0);;)if(r=a,a=u.times(r.plus(n(o,r,d,1))),y(r.c).slice(0,c)===(t=y(a.c)).slice(0,c)){if(a.e<h&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(a,a.e+R+2,1),e=!a.times(a).eq(o));break}if(!i&&(G(r,r.e+R+2,0),r.times(r).eq(o))){a=r;break}d+=4,c+=4,i=1}return G(a,a.e+R+1,B,e)},M.toExponential=function(e,t){return null!=e&&(v(e,0,p),e++),K(this,e,t,1)},M.toFixed=function(e,t){return null!=e&&(v(e,0,p),e=e+this.e+1),K(this,e,t)},M.toFormat=function(e,t,n){var a,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=q;else if("object"!=typeof n)throw Error(c+"Argument not an object: "+n);if(a=i.toFixed(e,t),i.c){var r,o=a.split("."),s=+n.groupSize,h=+n.secondaryGroupSize,d=n.groupSeparator||"",u=o[0],l=o[1],g=i.s<0,m=g?u.slice(1):u,p=m.length;if(h&&(r=s,s=h,h=r,p-=r),s>0&&p>0){for(r=p%s||s,u=m.substr(0,r);r<p;r+=s)u+=d+m.substr(r,s);h>0&&(u+=d+m.slice(r)),g&&(u="-"+u)}a=l?u+(n.decimalSeparator||"")+((h=+n.fractionGroupSize)?l.replace(new RegExp("\\d{"+h+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):l):u}return(n.prefix||"")+a+(n.suffix||"")},M.toFraction=function(e){var t,a,i,r,o,s,h,d,l,m,p,f,w=this,v=w.c;if(null!=e&&(!(h=new z(e)).isInteger()&&(h.c||1!==h.s)||h.lt(V)))throw Error(c+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+J(h));if(!v)return new z(w);for(t=new z(V),l=a=new z(V),i=d=new z(V),f=y(v),o=t.e=f.length-w.e-1,t.c[0]=g[(s=o%u)<0?u+s:s],e=!e||h.comparedTo(t)>0?o>0?t:l:h,s=O,O=1/0,h=new z(f),d.c[0]=0;m=n(h,t,0,1),1!=(r=a.plus(m.times(i))).comparedTo(e);)a=i,i=r,l=d.plus(m.times(r=l)),d=r,t=h.minus(m.times(r=t)),h=r;return r=n(e.minus(a),i,0,1),d=d.plus(r.times(l)),a=a.plus(r.times(i)),d.s=l.s=w.s,p=n(l,i,o*=2,B).minus(w).abs().comparedTo(n(d,a,o,B).minus(w).abs())<1?[l,i]:[d,a],O=s,p},M.toNumber=function(){return+J(this)},M.toPrecision=function(e,t){return null!=e&&v(e,1,p),K(this,e,t,2)},M.toString=function(e){var t,n=this,i=n.s,r=n.e;return null===r?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=r<=C||r>=U?E(y(n.c),r):k(y(n.c),r,"0"):10===e?t=k(y((n=G(new z(n),R+r+1,B)).c),n.e,"0"):(v(e,2,F.length,"Base"),t=a(k(y(n.c),r,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},M.valueOf=M.toJSON=function(){return J(this)},M._isBigNumber=!0,null!=t&&z.set(t),z}(),i.default=i.BigNumber=i,void 0===(a=function(){return i}.call(t,n,t,e))||(e.exports=a)}()},584(e,t,n){var a;!function(){"use strict";var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=n.g);var i=!t.HI_BASE32_NO_COMMON_JS&&e.exports,r=n.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),s={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],h=function(e,t){t.length>10&&(t="..."+t.substr(-10));var n=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw n.position=e,n},d=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,n,a,i,r,o,c,h,d=[],u=0,l=(e=e.replace(/=/g,"")).length,g=0,m=l>>3<<3;g<m;)t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],h=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3),d[u++]=255&(c<<5|h);var p=l-m;return 2===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2)):4===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4)):5===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1)):7===p&&(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3)),d},u=function(e,t){if(!t)return function(e){for(var t,n,a="",i=e.length,r=0,o=0;r<i;)if((t=e[r++])<=127)a+=String.fromCharCode(t);else{t>191&&t<=223?(n=31&t,o=1):t<=239?(n=15&t,o=2):t<=247?(n=7&t,o=3):h(r,a);for(var s=0;s<o;++s)((t=e[r++])<128||t>191)&&h(r,a),n<<=6,n+=63&t;n>=55296&&n<=57343&&h(r,a),n>1114111&&h(r,a),n<=65535?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296+(n>>10)),a+=String.fromCharCode(56320+(1023&n)))}return a}(d(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var n,a,i,r,o,c,u,l,g="",m=e.indexOf("=");-1===m&&(m=e.length);for(var p=0,f=m>>3<<3;p<f;)n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],l=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))+String.fromCharCode(255&(u<<5|l));var y=m-f;return 2===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))):4===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))):5===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))):7===y&&(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))),g},l={encode:function(e,t){var n="string"!=typeof e;return n&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),n?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e[h++],n=e[h++],a=e[h++],i=e[h++],r=e[h++],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e[h],s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e[h++],n=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e[h++],n=e[h++],a=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e[h++],n=e[h++],a=e[h++],i=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):t?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e.charCodeAt(h),s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):function(e){var t,n,a,i,r,s,h,d=!1,u="",l=0,g=0,m=e.length;if(""===e)return u;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],h=g;l<m&&h<5;++l)(s=e.charCodeAt(l))<128?c[h++]=s:s<2048?(c[h++]=192|s>>6,c[h++]=128|63&s):s<55296||s>=57344?(c[h++]=224|s>>12,c[h++]=128|s>>6&63,c[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++l)),c[h++]=240|s>>18,c[h++]=128|s>>12&63,c[h++]=128|s>>6&63,c[h++]=128|63&s);g=h-5,l===m&&++l,l>m&&h<6&&(d=!0),t=c[0],h>4?(n=c[1],a=c[2],i=c[3],r=c[4],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r]):1===h?u+=o[t>>>3]+o[t<<2&31]+"======":2===h?(n=c[1],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===h?(n=c[1],a=c[2],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):(n=c[1],a=c[2],i=c[3],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"=")}while(!d);return u}(e)},decode:u};u.asBytes=d,i?e.exports=l:(t.base32=l,r&&(void 0===(a=function(){return l}.call(l,n,l,e))||(e.exports=a)))}()},404(e,t,n){var a;!function(){"use strict";var t="input is invalid type",i="object"==typeof window,r=i?window:{};r.JS_SHA512_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=n.g:o&&(r=self);var s=!r.JS_SHA512_NO_COMMON_JS&&e.exports,c=n.amdO,h=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=["hex","array","digest","arrayBuffer"],p=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var f=function(e,t){return function(n){return new S(t,!0).update(n)[e]()}},y=function(e){var t=f("hex",e);t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=f(a,e)}return t},w=function(e,t){return function(n,a){return new E(n,t,!0).update(a)[e]()}},v=function(e){var t=w("hex",e);t.create=function(t){return new E(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=w(a,e)}return t};function S(e,t){t?(p[0]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=p[16]=p[17]=p[18]=p[19]=p[20]=p[21]=p[22]=p[23]=p[24]=p[25]=p[26]=p[27]=p[28]=p[29]=p[30]=p[31]=p[32]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==e?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==e?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function E(e,n,a){var i,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);i=!0}var o=e.length;if(!i){for(var s,c=[],d=(o=e.length,0),u=0;u<o;++u)(s=e.charCodeAt(u))<128?c[d++]=s:s<2048?(c[d++]=192|s>>6,c[d++]=128|63&s):s<55296||s>=57344?(c[d++]=224|s>>12,c[d++]=128|s>>6&63,c[d++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++u)),c[d++]=240|s>>18,c[d++]=128|s>>12&63,c[d++]=128|s>>6&63,c[d++]=128|63&s);e=c}e.length>128&&(e=new S(n,!0).update(e).array());var l=[],g=[];for(u=0;u<128;++u){var m=e[u]||0;l[u]=92^m,g[u]=54^m}S.call(this,n,a),this.update(g),this.oKeyPad=l,this.inner=!0,this.sharedMemory=a}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,r,o=0,s=e.length,c=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=c[16]=c[17]=c[18]=c[19]=c[20]=c[21]=c[22]=c[23]=c[24]=c[25]=c[26]=c[27]=c[28]=c[29]=c[30]=c[31]=c[32]=0),n)for(r=this.start;o<s&&r<128;++o)c[r>>2]|=e[o]<<l[3&r++];else for(r=this.start;o<s&&r<128;++o)(i=e.charCodeAt(o))<128?c[r>>2]|=i<<l[3&r++]:i<2048?(c[r>>2]|=(192|i>>6)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):i<55296||i>=57344?(c[r>>2]|=(224|i>>12)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[r>>2]|=(240|i>>18)<<l[3&r++],c[r>>2]|=(128|i>>12&63)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=128?(this.block=c[32],this.start=r-128,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=u[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,n,a,i,r,o,s,c,h,d,u,l,m,p,f,y,w,v,S,E,k,b,x,A,D=this.h0h,I=this.h0l,T=this.h1h,P=this.h1l,M=this.h2h,V=this.h2l,R=this.h3h,B=this.h3l,C=this.h4h,U=this.h4l,$=this.h5h,O=this.h5l,N=this.h6h,L=this.h6l,_=this.h7h,q=this.h7l,F=this.blocks;for(e=32;e<160;e+=2)t=((S=F[e-30])>>>1|(E=F[e-29])<<31)^(S>>>8|E<<24)^S>>>7,n=(E>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25),a=((S=F[e-4])>>>19|(E=F[e-3])<<13)^(E>>>29|S<<3)^S>>>6,i=(E>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26),S=F[e-32],E=F[e-31],c=((k=F[e-14])>>>16)+(S>>>16)+(t>>>16)+(a>>>16)+((s=(65535&k)+(65535&S)+(65535&t)+(65535&a)+((o=((b=F[e-13])>>>16)+(E>>>16)+(n>>>16)+(i>>>16)+((r=(65535&b)+(65535&E)+(65535&n)+(65535&i))>>>16))>>>16))>>>16),F[e]=c<<16|65535&s,F[e+1]=o<<16|65535&r;var z=D,K=I,H=T,j=P,G=M,J=V,W=R,Y=B,X=C,Q=U,Z=$,ee=O,te=N,ne=L,ae=_,ie=q;for(f=H&G,y=j&J,e=0;e<160;e+=8)t=(z>>>28|K<<4)^(K>>>2|z<<30)^(K>>>7|z<<25),n=(K>>>28|z<<4)^(z>>>2|K<<30)^(z>>>7|K<<25),a=(X>>>14|Q<<18)^(X>>>18|Q<<14)^(Q>>>9|X<<23),i=(Q>>>14|X<<18)^(Q>>>18|X<<14)^(X>>>9|Q<<23),w=(h=z&H)^z&G^f,v=(d=K&j)^K&J^y,x=X&Z^~X&te,A=Q&ee^~Q&ne,S=F[e],E=F[e+1],S=(c=((k=g[e])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(ae>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&ae)+((o=((b=g[e+1])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ie>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ie))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,ae=(c=(W>>>16)+(S>>>16)+((s=(65535&W)+(65535&S)+((o=(Y>>>16)+(E>>>16)+((r=(65535&Y)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ie=o<<16|65535&r,t=((W=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Y=o<<16|65535&r)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),n=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),a=(ae>>>14|ie<<18)^(ae>>>18|ie<<14)^(ie>>>9|ae<<23),i=(ie>>>14|ae<<18)^(ie>>>18|ae<<14)^(ae>>>9|ie<<23),w=(u=W&z)^W&H^h,v=(l=Y&K)^Y&j^d,x=ae&X^~ae&Z,A=ie&Q^~ie&ee,S=F[e+2],E=F[e+3],S=(c=((k=g[e+2])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(te>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&te)+((o=((b=g[e+3])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ne>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ne))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,te=(c=(G>>>16)+(S>>>16)+((s=(65535&G)+(65535&S)+((o=(J>>>16)+(E>>>16)+((r=(65535&J)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ne=o<<16|65535&r,t=((G=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(J=o<<16|65535&r)<<4)^(J>>>2|G<<30)^(J>>>7|G<<25),n=(J>>>28|G<<4)^(G>>>2|J<<30)^(G>>>7|J<<25),a=(te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23),i=(ne>>>14|te<<18)^(ne>>>18|te<<14)^(te>>>9|ne<<23),w=(m=G&W)^G&z^u,v=(p=J&Y)^J&K^l,x=te&ae^~te&X,A=ne&ie^~ne&Q,S=F[e+4],E=F[e+5],S=(c=((k=g[e+4])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(Z>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&Z)+((o=((b=g[e+5])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ee>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ee))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,Z=(c=(H>>>16)+(S>>>16)+((s=(65535&H)+(65535&S)+((o=(j>>>16)+(E>>>16)+((r=(65535&j)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ee=o<<16|65535&r,t=((H=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(j=o<<16|65535&r)<<4)^(j>>>2|H<<30)^(j>>>7|H<<25),n=(j>>>28|H<<4)^(H>>>2|j<<30)^(H>>>7|j<<25),a=(Z>>>14|ee<<18)^(Z>>>18|ee<<14)^(ee>>>9|Z<<23),i=(ee>>>14|Z<<18)^(ee>>>18|Z<<14)^(Z>>>9|ee<<23),w=(f=H&G)^H&W^m,v=(y=j&J)^j&Y^p,x=Z&te^~Z&ae,A=ee&ne^~ee&ie,S=F[e+6],E=F[e+7],S=(c=((k=g[e+6])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(X>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&X)+((o=((b=g[e+7])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(Q>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&Q))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,X=(c=(z>>>16)+(S>>>16)+((s=(65535&z)+(65535&S)+((o=(K>>>16)+(E>>>16)+((r=(65535&K)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,Q=o<<16|65535&r,z=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,K=o<<16|65535&r;c=(D>>>16)+(z>>>16)+((s=(65535&D)+(65535&z)+((o=(I>>>16)+(K>>>16)+((r=(65535&I)+(65535&K))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&s,this.h0l=o<<16|65535&r,c=(T>>>16)+(H>>>16)+((s=(65535&T)+(65535&H)+((o=(P>>>16)+(j>>>16)+((r=(65535&P)+(65535&j))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&s,this.h1l=o<<16|65535&r,c=(M>>>16)+(G>>>16)+((s=(65535&M)+(65535&G)+((o=(V>>>16)+(J>>>16)+((r=(65535&V)+(65535&J))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&s,this.h2l=o<<16|65535&r,c=(R>>>16)+(W>>>16)+((s=(65535&R)+(65535&W)+((o=(B>>>16)+(Y>>>16)+((r=(65535&B)+(65535&Y))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&s,this.h3l=o<<16|65535&r,c=(C>>>16)+(X>>>16)+((s=(65535&C)+(65535&X)+((o=(U>>>16)+(Q>>>16)+((r=(65535&U)+(65535&Q))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&s,this.h4l=o<<16|65535&r,c=($>>>16)+(Z>>>16)+((s=(65535&$)+(65535&Z)+((o=(O>>>16)+(ee>>>16)+((r=(65535&O)+(65535&ee))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&s,this.h5l=o<<16|65535&r,c=(N>>>16)+(te>>>16)+((s=(65535&N)+(65535&te)+((o=(L>>>16)+(ne>>>16)+((r=(65535&L)+(65535&ne))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&s,this.h6l=o<<16|65535&r,c=(_>>>16)+(ae>>>16)+((s=(65535&_)+(65535&ae)+((o=(q>>>16)+(ie>>>16)+((r=(65535&q)+(65535&ie))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&s,this.h7l=o<<16|65535&r},S.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,u=this.h5h,l=this.h5l,g=this.h6h,m=this.h6l,p=this.h7h,f=this.h7l,y=this.bits,w=d[e>>28&15]+d[e>>24&15]+d[e>>20&15]+d[e>>16&15]+d[e>>12&15]+d[e>>8&15]+d[e>>4&15]+d[15&e]+d[t>>28&15]+d[t>>24&15]+d[t>>20&15]+d[t>>16&15]+d[t>>12&15]+d[t>>8&15]+d[t>>4&15]+d[15&t]+d[n>>28&15]+d[n>>24&15]+d[n>>20&15]+d[n>>16&15]+d[n>>12&15]+d[n>>8&15]+d[n>>4&15]+d[15&n]+d[a>>28&15]+d[a>>24&15]+d[a>>20&15]+d[a>>16&15]+d[a>>12&15]+d[a>>8&15]+d[a>>4&15]+d[15&a]+d[i>>28&15]+d[i>>24&15]+d[i>>20&15]+d[i>>16&15]+d[i>>12&15]+d[i>>8&15]+d[i>>4&15]+d[15&i]+d[r>>28&15]+d[r>>24&15]+d[r>>20&15]+d[r>>16&15]+d[r>>12&15]+d[r>>8&15]+d[r>>4&15]+d[15&r]+d[o>>28&15]+d[o>>24&15]+d[o>>20&15]+d[o>>16&15]+d[o>>12&15]+d[o>>8&15]+d[o>>4&15]+d[15&o];return y>=256&&(w+=d[s>>28&15]+d[s>>24&15]+d[s>>20&15]+d[s>>16&15]+d[s>>12&15]+d[s>>8&15]+d[s>>4&15]+d[15&s]),y>=384&&(w+=d[c>>28&15]+d[c>>24&15]+d[c>>20&15]+d[c>>16&15]+d[c>>12&15]+d[c>>8&15]+d[c>>4&15]+d[15&c]+d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[15&h]+d[u>>28&15]+d[u>>24&15]+d[u>>20&15]+d[u>>16&15]+d[u>>12&15]+d[u>>8&15]+d[u>>4&15]+d[15&u]+d[l>>28&15]+d[l>>24&15]+d[l>>20&15]+d[l>>16&15]+d[l>>12&15]+d[l>>8&15]+d[l>>4&15]+d[15&l]),512==y&&(w+=d[g>>28&15]+d[g>>24&15]+d[g>>20&15]+d[g>>16&15]+d[g>>12&15]+d[g>>8&15]+d[g>>4&15]+d[15&g]+d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[15&m]+d[p>>28&15]+d[p>>24&15]+d[p>>20&15]+d[p>>16&15]+d[p>>12&15]+d[p>>8&15]+d[p>>4&15]+d[15&p]+d[f>>28&15]+d[f>>24&15]+d[f>>20&15]+d[f>>16&15]+d[f>>12&15]+d[f>>8&15]+d[f>>4&15]+d[15&f]),w},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,d=this.h5h,u=this.h5l,l=this.h6h,g=this.h6l,m=this.h7h,p=this.h7l,f=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o];return f>=256&&y.push(s>>24&255,s>>16&255,s>>8&255,255&s),f>=384&&y.push(c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,u>>24&255,u>>16&255,u>>8&255,255&u),512==f&&y.push(l>>24&255,l>>16&255,l>>8&255,255&l,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,p>>24&255,p>>16&255,p>>8&255,255&p),y},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),n=new DataView(t);return n.setUint32(0,this.h0h),n.setUint32(4,this.h0l),n.setUint32(8,this.h1h),n.setUint32(12,this.h1l),n.setUint32(16,this.h2h),n.setUint32(20,this.h2l),n.setUint32(24,this.h3h),e>=256&&n.setUint32(28,this.h3l),e>=384&&(n.setUint32(32,this.h4h),n.setUint32(36,this.h4l),n.setUint32(40,this.h5h),n.setUint32(44,this.h5l)),512==e&&(n.setUint32(48,this.h6h),n.setUint32(52,this.h6l),n.setUint32(56,this.h7h),n.setUint32(60,this.h7l)),t},S.prototype.clone=function(){var e=new S(this.bits,!1);return this.copyTo(e),e},S.prototype.copyTo=function(e){var t=0,n=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<n.length;++t)e[n[t]]=this[n[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},E.prototype=new S,E.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}},E.prototype.clone=function(){var e=new E([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var k=y(512);k.sha512=k,k.sha384=y(384),k.sha512_256=y(256),k.sha512_224=y(224),k.sha512.hmac=v(512),k.sha384.hmac=v(384),k.sha512_256.hmac=v(256),k.sha512_224.hmac=v(224),s?e.exports=k:(r.sha512=k.sha512,r.sha384=k.sha384,r.sha512_256=k.sha512_256,r.sha512_224=k.sha512_224,c&&(void 0===(a=function(){return k}.call(k,n,k,e))||(e.exports=a)))}()},215(e,t,n){var a=n(902).stringify,i=n(440);e.exports=function(e){return{parse:i(e),stringify:a}},e.exports.parse=i(),e.exports.stringify=a},440(e,t,n){var a=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,r=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,s,c,h,d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},l=function(e){return e&&e!==s&&u("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(o),o+=1,s},g=function(){var e,i="";for("-"===s&&(i="-",l("-"));s>="0"&&s<="9";)i+=s,l();if("."===s)for(i+=".";l()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,l(),"-"!==s&&"+"!==s||(i+=s,l());s>="0"&&s<="9";)i+=s,l();if(e=+i,isFinite(e))return null==a&&(a=n(180)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new a(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new a(e):e;u("Bad number")},m=function(){var e,t,n,a="";if('"'===s)for(var i=o;l();){if('"'===s)return o-1>i&&(a+=c.substring(i,o-1)),l(),a;if("\\"===s){if(o-1>i&&(a+=c.substring(i,o-1)),l(),"u"===s){for(n=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)n=16*n+e;a+=String.fromCharCode(n)}else{if("string"!=typeof d[s])break;a+=d[s]}i=o}}u("Bad string")},p=function(){for(;s&&s<=" ";)l()};return h=function(){switch(p(),s){case"{":return function(){var e,n=Object.create(null);if("{"===s){if(l("{"),p(),"}"===s)return l("}"),n;for(;s;){if(e=m(),p(),l(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&u('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?u("Object contains forbidden prototype property"):"ignore"===t.protoAction?h():n[e]=h():!0===r.test(e)?"error"===t.constructorAction?u("Object contains forbidden constructor property"):"ignore"===t.constructorAction?h():n[e]=h():n[e]=h(),p(),"}"===s)return l("}"),n;l(","),p()}}u("Bad object")}();case"[":return function(){var e=[];if("["===s){if(l("["),p(),"]"===s)return l("]"),e;for(;s;){if(e.push(h()),p(),"]"===s)return l("]"),e;l(","),p()}}u("Bad array")}();case'"':return m();case"-":return g();default:return s>="0"&&s<="9"?g():function(){switch(s){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}u("Unexpected '"+s+"'")}()}},function(e,t){var n;return c=e+"",o=0,s=" ",n=h(),p(),s&&u("Syntax error"),"function"==typeof t?function e(n,a){var i,r=n[a];return r&&"object"==typeof r&&Object.keys(r).forEach(function(t){void 0!==(i=e(r,t))?r[t]=i:delete r[t]}),t.call(n,a,r)}({"":n},""):n}}},902(e,t,n){var a=n(180),i=e.exports;!function(){"use strict";var e,t,n,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return r.lastIndex=0,r.test(e)?'"'+e.replace(r,function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function c(i,r){var o,h,d,u,l,g=e,m=r[i],p=null!=m&&(m instanceof a||a.isBigNumber(m));switch(m&&"object"==typeof m&&"function"==typeof m.toJSON&&(m=m.toJSON(i)),"function"==typeof n&&(m=n.call(r,i,m)),typeof m){case"string":return p?m:s(m);case"number":return isFinite(m)?String(m):"null";case"boolean":case"null":case"bigint":return String(m);case"object":if(!m)return"null";if(e+=t,l=[],"[object Array]"===Object.prototype.toString.apply(m)){for(u=m.length,o=0;o<u;o+=1)l[o]=c(o,m)||"null";return d=0===l.length?"[]":e?"[\n"+e+l.join(",\n"+e)+"\n"+g+"]":"["+l.join(",")+"]",e=g,d}if(n&&"object"==typeof n)for(u=n.length,o=0;o<u;o+=1)"string"==typeof n[o]&&(d=c(h=n[o],m))&&l.push(s(h)+(e?": ":":")+d);else Object.keys(m).forEach(function(t){var n=c(t,m);n&&l.push(s(t)+(e?": ":":")+n)});return d=0===l.length?"{}":e?"{\n"+e+l.join(",\n"+e)+"\n"+g+"}":"{"+l.join(",")+"}",e=g,d}}"function"!=typeof i.stringify&&(i.stringify=function(a,i,r){var o;if(e="",t="","number"==typeof r)for(o=0;o<r;o+=1)t+=" ";else"string"==typeof r&&(t=r);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return c("",{"":a})})}()},601(e,t){!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var r=t(),o=t([1]),s=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t,n,a){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=a>>24&255,e[t+5]=a>>16&255,e[t+6]=a>>8&255,e[t+7]=255&a}function m(e,t,n,a,i){var r,o=0;for(r=0;r<i;r++)o|=e[t+r]^n[a+r];return(1&o-1>>>8)-1}function p(e,t,n,a){return m(e,t,n,a,16)}function f(e,t,n,a){return m(e,t,n,a,32)}function y(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=r,k=o,b=s,x=c,A=h,D=d,I=u,T=l,P=g,M=m,V=p,R=f,B=y,C=w,U=v,$=S,O=0;O<20;O+=2)E^=(i=(B^=(i=(P^=(i=(A^=(i=E+B|0)<<7|i>>>25)+E|0)<<9|i>>>23)+A|0)<<13|i>>>19)+P|0)<<18|i>>>14,D^=(i=(k^=(i=(C^=(i=(M^=(i=D+k|0)<<7|i>>>25)+D|0)<<9|i>>>23)+M|0)<<13|i>>>19)+C|0)<<18|i>>>14,V^=(i=(I^=(i=(b^=(i=(U^=(i=V+I|0)<<7|i>>>25)+V|0)<<9|i>>>23)+U|0)<<13|i>>>19)+b|0)<<18|i>>>14,$^=(i=(R^=(i=(T^=(i=(x^=(i=$+R|0)<<7|i>>>25)+$|0)<<9|i>>>23)+x|0)<<13|i>>>19)+T|0)<<18|i>>>14,E^=(i=(x^=(i=(b^=(i=(k^=(i=E+x|0)<<7|i>>>25)+E|0)<<9|i>>>23)+k|0)<<13|i>>>19)+b|0)<<18|i>>>14,D^=(i=(A^=(i=(T^=(i=(I^=(i=D+A|0)<<7|i>>>25)+D|0)<<9|i>>>23)+I|0)<<13|i>>>19)+T|0)<<18|i>>>14,V^=(i=(M^=(i=(P^=(i=(R^=(i=V+M|0)<<7|i>>>25)+V|0)<<9|i>>>23)+R|0)<<13|i>>>19)+P|0)<<18|i>>>14,$^=(i=(U^=(i=(C^=(i=(B^=(i=$+U|0)<<7|i>>>25)+$|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14;E=E+r|0,k=k+o|0,b=b+s|0,x=x+c|0,A=A+h|0,D=D+d|0,I=I+u|0,T=T+l|0,P=P+g|0,M=M+m|0,V=V+p|0,R=R+f|0,B=B+y|0,C=C+w|0,U=U+v|0,$=$+S|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=A>>>0&255,e[17]=A>>>8&255,e[18]=A>>>16&255,e[19]=A>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=I>>>0&255,e[25]=I>>>8&255,e[26]=I>>>16&255,e[27]=I>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=M>>>0&255,e[37]=M>>>8&255,e[38]=M>>>16&255,e[39]=M>>>24&255,e[40]=V>>>0&255,e[41]=V>>>8&255,e[42]=V>>>16&255,e[43]=V>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=B>>>0&255,e[49]=B>>>8&255,e[50]=B>>>16&255,e[51]=B>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=U>>>0&255,e[57]=U>>>8&255,e[58]=U>>>16&255,e[59]=U>>>24&255,e[60]=$>>>0&255,e[61]=$>>>8&255,e[62]=$>>>16&255,e[63]=$>>>24&255}(e,t,n,a)}function w(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=0;E<20;E+=2)r^=(i=(y^=(i=(g^=(i=(h^=(i=r+y|0)<<7|i>>>25)+r|0)<<9|i>>>23)+h|0)<<13|i>>>19)+g|0)<<18|i>>>14,d^=(i=(o^=(i=(w^=(i=(m^=(i=d+o|0)<<7|i>>>25)+d|0)<<9|i>>>23)+m|0)<<13|i>>>19)+w|0)<<18|i>>>14,p^=(i=(u^=(i=(s^=(i=(v^=(i=p+u|0)<<7|i>>>25)+p|0)<<9|i>>>23)+v|0)<<13|i>>>19)+s|0)<<18|i>>>14,S^=(i=(f^=(i=(l^=(i=(c^=(i=S+f|0)<<7|i>>>25)+S|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,r^=(i=(c^=(i=(s^=(i=(o^=(i=r+c|0)<<7|i>>>25)+r|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,d^=(i=(h^=(i=(l^=(i=(u^=(i=d+h|0)<<7|i>>>25)+d|0)<<9|i>>>23)+u|0)<<13|i>>>19)+l|0)<<18|i>>>14,p^=(i=(m^=(i=(g^=(i=(f^=(i=p+m|0)<<7|i>>>25)+p|0)<<9|i>>>23)+f|0)<<13|i>>>19)+g|0)<<18|i>>>14,S^=(i=(v^=(i=(w^=(i=(y^=(i=S+v|0)<<7|i>>>25)+S|0)<<9|i>>>23)+y|0)<<13|i>>>19)+w|0)<<18|i>>>14;e[0]=r>>>0&255,e[1]=r>>>8&255,e[2]=r>>>16&255,e[3]=r>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=g>>>0&255,e[25]=g>>>8&255,e[26]=g>>>16&255,e[27]=g>>>24&255,e[28]=m>>>0&255,e[29]=m>>>8&255,e[30]=m>>>16&255,e[31]=m>>>24&255}(e,t,n,a)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function S(e,t,n,a,i,r,o){var s,c,h=new Uint8Array(16),d=new Uint8Array(64);for(c=0;c<16;c++)h[c]=0;for(c=0;c<8;c++)h[c]=r[c];for(;i>=64;){for(y(d,h,o,v),c=0;c<64;c++)e[t+c]=n[a+c]^d[c];for(s=1,c=8;c<16;c++)s=s+(255&h[c])|0,h[c]=255&s,s>>>=8;i-=64,t+=64,a+=64}if(i>0)for(y(d,h,o,v),c=0;c<i;c++)e[t+c]=n[a+c]^d[c];return 0}function E(e,t,n,a,i){var r,o,s=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=a[o];for(;n>=64;){for(y(c,s,i,v),o=0;o<64;o++)e[t+o]=c[o];for(r=1,o=8;o<16;o++)r=r+(255&s[o])|0,s[o]=255&r,r>>>=8;n-=64,t+=64}if(n>0)for(y(c,s,i,v),o=0;o<n;o++)e[t+o]=c[o];return 0}function k(e,t,n,a,i){var r=new Uint8Array(32);w(r,a,i,v);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=a[s+16];return E(e,t,n,o,r)}function b(e,t,n,a,i,r,o){var s=new Uint8Array(32);w(s,r,o,v);for(var c=new Uint8Array(8),h=0;h<8;h++)c[h]=r[h+16];return S(e,t,n,a,i,c,s)}var x=function(e){var t,n,a,i,r,o,s,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),a=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|a<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(a>>>7|i<<9),r=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|r<<12),this.r[5]=r>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(r>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,n,a,i,r){var o=new x(r);return o.update(n,a,i),o.finish(e,t),0}function D(e,t,n,a,i,r){var o=new Uint8Array(16);return A(o,0,n,a,i,r),p(e,t,o,0)}function I(e,t,n,a,i){var r;if(n<32)return-1;for(b(e,0,t,0,n,a,i),A(e,16,e,32,n-32,e),r=0;r<16;r++)e[r]=0;return 0}function T(e,t,n,a,i){var r,o=new Uint8Array(32);if(n<32)return-1;if(k(o,0,32,a,i),0!==D(t,16,t,32,n-32,o))return-1;for(b(e,0,t,0,n,a,i),r=0;r<32;r++)e[r]=0;return 0}function P(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function M(e){var t,n,a=1;for(t=0;t<16;t++)n=e[t]+a+65535,a=Math.floor(n/65536),e[t]=n-65536*a;e[0]+=a-1+37*(a-1)}function V(e,t,n){for(var a,i=~(n-1),r=0;r<16;r++)a=i&(e[r]^t[r]),e[r]^=a,t[r]^=a}function R(e,n){var a,i,r,o=t(),s=t();for(a=0;a<16;a++)s[a]=n[a];for(M(s),M(s),M(s),i=0;i<2;i++){for(o[0]=s[0]-65517,a=1;a<15;a++)o[a]=s[a]-65535-(o[a-1]>>16&1),o[a-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),r=o[15]>>16&1,o[14]&=65535,V(s,o,1-r)}for(a=0;a<16;a++)e[2*a]=255&s[a],e[2*a+1]=s[a]>>8}function B(e,t){var n=new Uint8Array(32),a=new Uint8Array(32);return R(n,e),R(a,t),f(n,0,a,0)}function C(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function $(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]+n[a]}function O(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]-n[a]}function N(e,t,n){var a,i,r=0,o=0,s=0,c=0,h=0,d=0,u=0,l=0,g=0,m=0,p=0,f=0,y=0,w=0,v=0,S=0,E=0,k=0,b=0,x=0,A=0,D=0,I=0,T=0,P=0,M=0,V=0,R=0,B=0,C=0,U=0,$=n[0],O=n[1],N=n[2],L=n[3],_=n[4],q=n[5],F=n[6],z=n[7],K=n[8],H=n[9],j=n[10],G=n[11],J=n[12],W=n[13],Y=n[14],X=n[15];r+=(a=t[0])*$,o+=a*O,s+=a*N,c+=a*L,h+=a*_,d+=a*q,u+=a*F,l+=a*z,g+=a*K,m+=a*H,p+=a*j,f+=a*G,y+=a*J,w+=a*W,v+=a*Y,S+=a*X,o+=(a=t[1])*$,s+=a*O,c+=a*N,h+=a*L,d+=a*_,u+=a*q,l+=a*F,g+=a*z,m+=a*K,p+=a*H,f+=a*j,y+=a*G,w+=a*J,v+=a*W,S+=a*Y,E+=a*X,s+=(a=t[2])*$,c+=a*O,h+=a*N,d+=a*L,u+=a*_,l+=a*q,g+=a*F,m+=a*z,p+=a*K,f+=a*H,y+=a*j,w+=a*G,v+=a*J,S+=a*W,E+=a*Y,k+=a*X,c+=(a=t[3])*$,h+=a*O,d+=a*N,u+=a*L,l+=a*_,g+=a*q,m+=a*F,p+=a*z,f+=a*K,y+=a*H,w+=a*j,v+=a*G,S+=a*J,E+=a*W,k+=a*Y,b+=a*X,h+=(a=t[4])*$,d+=a*O,u+=a*N,l+=a*L,g+=a*_,m+=a*q,p+=a*F,f+=a*z,y+=a*K,w+=a*H,v+=a*j,S+=a*G,E+=a*J,k+=a*W,b+=a*Y,x+=a*X,d+=(a=t[5])*$,u+=a*O,l+=a*N,g+=a*L,m+=a*_,p+=a*q,f+=a*F,y+=a*z,w+=a*K,v+=a*H,S+=a*j,E+=a*G,k+=a*J,b+=a*W,x+=a*Y,A+=a*X,u+=(a=t[6])*$,l+=a*O,g+=a*N,m+=a*L,p+=a*_,f+=a*q,y+=a*F,w+=a*z,v+=a*K,S+=a*H,E+=a*j,k+=a*G,b+=a*J,x+=a*W,A+=a*Y,D+=a*X,l+=(a=t[7])*$,g+=a*O,m+=a*N,p+=a*L,f+=a*_,y+=a*q,w+=a*F,v+=a*z,S+=a*K,E+=a*H,k+=a*j,b+=a*G,x+=a*J,A+=a*W,D+=a*Y,I+=a*X,g+=(a=t[8])*$,m+=a*O,p+=a*N,f+=a*L,y+=a*_,w+=a*q,v+=a*F,S+=a*z,E+=a*K,k+=a*H,b+=a*j,x+=a*G,A+=a*J,D+=a*W,I+=a*Y,T+=a*X,m+=(a=t[9])*$,p+=a*O,f+=a*N,y+=a*L,w+=a*_,v+=a*q,S+=a*F,E+=a*z,k+=a*K,b+=a*H,x+=a*j,A+=a*G,D+=a*J,I+=a*W,T+=a*Y,P+=a*X,p+=(a=t[10])*$,f+=a*O,y+=a*N,w+=a*L,v+=a*_,S+=a*q,E+=a*F,k+=a*z,b+=a*K,x+=a*H,A+=a*j,D+=a*G,I+=a*J,T+=a*W,P+=a*Y,M+=a*X,f+=(a=t[11])*$,y+=a*O,w+=a*N,v+=a*L,S+=a*_,E+=a*q,k+=a*F,b+=a*z,x+=a*K,A+=a*H,D+=a*j,I+=a*G,T+=a*J,P+=a*W,M+=a*Y,V+=a*X,y+=(a=t[12])*$,w+=a*O,v+=a*N,S+=a*L,E+=a*_,k+=a*q,b+=a*F,x+=a*z,A+=a*K,D+=a*H,I+=a*j,T+=a*G,P+=a*J,M+=a*W,V+=a*Y,R+=a*X,w+=(a=t[13])*$,v+=a*O,S+=a*N,E+=a*L,k+=a*_,b+=a*q,x+=a*F,A+=a*z,D+=a*K,I+=a*H,T+=a*j,P+=a*G,M+=a*J,V+=a*W,R+=a*Y,B+=a*X,v+=(a=t[14])*$,S+=a*O,E+=a*N,k+=a*L,b+=a*_,x+=a*q,A+=a*F,D+=a*z,I+=a*K,T+=a*H,P+=a*j,M+=a*G,V+=a*J,R+=a*W,B+=a*Y,C+=a*X,S+=(a=t[15])*$,o+=38*(k+=a*N),s+=38*(b+=a*L),c+=38*(x+=a*_),h+=38*(A+=a*q),d+=38*(D+=a*F),u+=38*(I+=a*z),l+=38*(T+=a*K),g+=38*(P+=a*H),m+=38*(M+=a*j),p+=38*(V+=a*G),f+=38*(R+=a*J),y+=38*(B+=a*W),w+=38*(C+=a*Y),v+=38*(U+=a*X),r=(a=(r+=38*(E+=a*O))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r=(a=(r+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r+=i-1+37*(i-1),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=h,e[5]=d,e[6]=u,e[7]=l,e[8]=g,e[9]=m,e[10]=p,e[11]=f,e[12]=y,e[13]=w,e[14]=v,e[15]=S}function L(e,t){N(e,t,t)}function _(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=253;a>=0;a--)L(i,i),2!==a&&4!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function q(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=250;a>=0;a--)L(i,i),1!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function F(e,n,a){var i,r,o=new Uint8Array(32),c=new Float64Array(80),h=t(),d=t(),u=t(),l=t(),g=t(),m=t();for(r=0;r<31;r++)o[r]=n[r];for(o[31]=127&n[31]|64,o[0]&=248,U(c,a),r=0;r<16;r++)d[r]=c[r],l[r]=h[r]=u[r]=0;for(h[0]=l[0]=1,r=254;r>=0;--r)V(h,d,i=o[r>>>3]>>>(7&r)&1),V(u,l,i),$(g,h,u),O(h,h,u),$(u,d,l),O(d,d,l),L(l,g),L(m,h),N(h,u,h),N(u,d,g),$(g,h,u),O(h,h,u),L(d,h),O(u,l,m),N(h,u,s),$(h,h,l),N(u,u,h),N(h,l,m),N(l,d,c),L(d,g),V(h,d,i),V(u,l,i);for(r=0;r<16;r++)c[r+16]=h[r],c[r+32]=u[r],c[r+48]=d[r],c[r+64]=l[r];var p=c.subarray(32),f=c.subarray(16);return _(p,p),N(f,f,p),R(e,f),0}function z(e,t){return F(e,t,i)}function K(e,t){return n(t,32),z(e,t)}function H(e,t,n){var i=new Uint8Array(32);return F(i,n,t),w(e,a,i,v)}x.prototype.blocks=function(e,t,n){for(var a,i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k=this.fin?0:2048,b=this.h[0],x=this.h[1],A=this.h[2],D=this.h[3],I=this.h[4],T=this.h[5],P=this.h[6],M=this.h[7],V=this.h[8],R=this.h[9],B=this.r[0],C=this.r[1],U=this.r[2],$=this.r[3],O=this.r[4],N=this.r[5],L=this.r[6],_=this.r[7],q=this.r[8],F=this.r[9];n>=16;)l=u=0,l+=(b+=8191&(a=255&e[t+0]|(255&e[t+1])<<8))*B,l+=(x+=8191&(a>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),l+=(A+=8191&(i>>>10|(r=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*q),l+=(D+=8191&(r>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*_),u=(l+=(I+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,l&=8191,l+=(T+=s>>>1&8191)*(5*N),l+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*O),l+=(M+=8191&(c>>>11|(h=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*$),l+=(V+=8191&(h>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*U),g=u+=(l+=(R+=d>>>5|k)*(5*C))>>>13,g+=b*C,g+=x*B,g+=A*(5*F),g+=D*(5*q),u=(g+=I*(5*_))>>>13,g&=8191,g+=T*(5*L),g+=P*(5*N),g+=M*(5*O),g+=V*(5*$),u+=(g+=R*(5*U))>>>13,g&=8191,m=u,m+=b*U,m+=x*C,m+=A*B,m+=D*(5*F),u=(m+=I*(5*q))>>>13,m&=8191,m+=T*(5*_),m+=P*(5*L),m+=M*(5*N),m+=V*(5*O),p=u+=(m+=R*(5*$))>>>13,p+=b*$,p+=x*U,p+=A*C,p+=D*B,u=(p+=I*(5*F))>>>13,p&=8191,p+=T*(5*q),p+=P*(5*_),p+=M*(5*L),p+=V*(5*N),f=u+=(p+=R*(5*O))>>>13,f+=b*O,f+=x*$,f+=A*U,f+=D*C,u=(f+=I*B)>>>13,f&=8191,f+=T*(5*F),f+=P*(5*q),f+=M*(5*_),f+=V*(5*L),y=u+=(f+=R*(5*N))>>>13,y+=b*N,y+=x*O,y+=A*$,y+=D*U,u=(y+=I*C)>>>13,y&=8191,y+=T*B,y+=P*(5*F),y+=M*(5*q),y+=V*(5*_),w=u+=(y+=R*(5*L))>>>13,w+=b*L,w+=x*N,w+=A*O,w+=D*$,u=(w+=I*U)>>>13,w&=8191,w+=T*C,w+=P*B,w+=M*(5*F),w+=V*(5*q),v=u+=(w+=R*(5*_))>>>13,v+=b*_,v+=x*L,v+=A*N,v+=D*O,u=(v+=I*$)>>>13,v&=8191,v+=T*U,v+=P*C,v+=M*B,v+=V*(5*F),S=u+=(v+=R*(5*q))>>>13,S+=b*q,S+=x*_,S+=A*L,S+=D*N,u=(S+=I*O)>>>13,S&=8191,S+=T*$,S+=P*U,S+=M*C,S+=V*B,E=u+=(S+=R*(5*F))>>>13,E+=b*F,E+=x*q,E+=A*_,E+=D*L,u=(E+=I*N)>>>13,E&=8191,E+=T*O,E+=P*$,E+=M*U,E+=V*C,b=l=8191&(u=(u=((u+=(E+=R*B)>>>13)<<2)+u|0)+(l&=8191)|0),x=g+=u>>>=13,A=m&=8191,D=p&=8191,I=f&=8191,T=y&=8191,P=w&=8191,M=v&=8191,V=S&=8191,R=E&=8191,t+=16,n-=16;this.h[0]=b,this.h[1]=x,this.h[2]=A,this.h[3]=D,this.h[4]=I,this.h[5]=T,this.h[6]=P,this.h[7]=M,this.h[8]=V,this.h[9]=R},x.prototype.finish=function(e,t){var n,a,i,r,o=new Uint16Array(10);if(this.leftover){for(r=this.leftover,this.buffer[r++]=1;r<16;r++)this.buffer[r]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,r=2;r<10;r++)this.h[r]+=n,n=this.h[r]>>>13,this.h[r]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,r=1;r<10;r++)o[r]=this.h[r]+n,n=o[r]>>>13,o[r]&=8191;for(o[9]-=8192,a=(1^n)-1,r=0;r<10;r++)o[r]&=a;for(a=~a,r=0;r<10;r++)this.h[r]=this.h[r]&a|o[r];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,r=1;r<8;r++)i=(this.h[r]+this.pad[r]|0)+(i>>>16)|0,this.h[r]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},x.prototype.update=function(e,t,n){var a,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),a=0;a<i;a++)this.buffer[this.leftover+a]=e[t+a];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(a=0;a<n;a++)this.buffer[this.leftover+a]=e[t+a];this.leftover+=n}};var j=I,G=T,J=[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 W(e,t,n,a){for(var i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k,b,x,A,D,I,T,P,M=new Int32Array(16),V=new Int32Array(16),R=e[0],B=e[1],C=e[2],U=e[3],$=e[4],O=e[5],N=e[6],L=e[7],_=t[0],q=t[1],F=t[2],z=t[3],K=t[4],H=t[5],j=t[6],G=t[7],W=0;a>=128;){for(k=0;k<16;k++)b=8*k+W,M[k]=n[b+0]<<24|n[b+1]<<16|n[b+2]<<8|n[b+3],V[k]=n[b+4]<<24|n[b+5]<<16|n[b+6]<<8|n[b+7];for(k=0;k<80;k++)if(i=R,r=B,o=C,s=U,c=$,h=O,d=N,l=_,g=q,m=F,p=z,f=K,y=H,w=j,D=65535&(A=G),I=A>>>16,T=65535&(x=L),P=x>>>16,D+=65535&(A=(K>>>14|$<<18)^(K>>>18|$<<14)^($>>>9|K<<23)),I+=A>>>16,T+=65535&(x=($>>>14|K<<18)^($>>>18|K<<14)^(K>>>9|$<<23)),P+=x>>>16,D+=65535&(A=K&H^~K&j),I+=A>>>16,T+=65535&(x=$&O^~$&N),P+=x>>>16,D+=65535&(A=J[2*k+1]),I+=A>>>16,T+=65535&(x=J[2*k]),P+=x>>>16,x=M[k%16],I+=(A=V[k%16])>>>16,T+=65535&x,P+=x>>>16,T+=(I+=(D+=65535&A)>>>16)>>>16,D=65535&(A=E=65535&D|I<<16),I=A>>>16,T=65535&(x=S=65535&T|(P+=T>>>16)<<16),P=x>>>16,D+=65535&(A=(_>>>28|R<<4)^(R>>>2|_<<30)^(R>>>7|_<<25)),I+=A>>>16,T+=65535&(x=(R>>>28|_<<4)^(_>>>2|R<<30)^(_>>>7|R<<25)),P+=x>>>16,I+=(A=_&q^_&F^q&F)>>>16,T+=65535&(x=R&B^R&C^B&C),P+=x>>>16,u=65535&(T+=(I+=(D+=65535&A)>>>16)>>>16)|(P+=T>>>16)<<16,v=65535&D|I<<16,D=65535&(A=p),I=A>>>16,T=65535&(x=s),P=x>>>16,I+=(A=E)>>>16,T+=65535&(x=S),P+=x>>>16,B=i,C=r,U=o,$=s=65535&(T+=(I+=(D+=65535&A)>>>16)>>>16)|(P+=T>>>16)<<16,O=c,N=h,L=d,R=u,q=l,F=g,z=m,K=p=65535&D|I<<16,H=f,j=y,G=w,_=v,k%16==15)for(b=0;b<16;b++)x=M[b],D=65535&(A=V[b]),I=A>>>16,T=65535&x,P=x>>>16,x=M[(b+9)%16],D+=65535&(A=V[(b+9)%16]),I+=A>>>16,T+=65535&x,P+=x>>>16,S=M[(b+1)%16],D+=65535&(A=((E=V[(b+1)%16])>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25)),I+=A>>>16,T+=65535&(x=(S>>>1|E<<31)^(S>>>8|E<<24)^S>>>7),P+=x>>>16,S=M[(b+14)%16],I+=(A=((E=V[(b+14)%16])>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26))>>>16,T+=65535&(x=(S>>>19|E<<13)^(E>>>29|S<<3)^S>>>6),P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,M[b]=65535&T|P<<16,V[b]=65535&D|I<<16;D=65535&(A=_),I=A>>>16,T=65535&(x=R),P=x>>>16,x=e[0],I+=(A=t[0])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[0]=R=65535&T|P<<16,t[0]=_=65535&D|I<<16,D=65535&(A=q),I=A>>>16,T=65535&(x=B),P=x>>>16,x=e[1],I+=(A=t[1])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[1]=B=65535&T|P<<16,t[1]=q=65535&D|I<<16,D=65535&(A=F),I=A>>>16,T=65535&(x=C),P=x>>>16,x=e[2],I+=(A=t[2])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[2]=C=65535&T|P<<16,t[2]=F=65535&D|I<<16,D=65535&(A=z),I=A>>>16,T=65535&(x=U),P=x>>>16,x=e[3],I+=(A=t[3])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[3]=U=65535&T|P<<16,t[3]=z=65535&D|I<<16,D=65535&(A=K),I=A>>>16,T=65535&(x=$),P=x>>>16,x=e[4],I+=(A=t[4])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[4]=$=65535&T|P<<16,t[4]=K=65535&D|I<<16,D=65535&(A=H),I=A>>>16,T=65535&(x=O),P=x>>>16,x=e[5],I+=(A=t[5])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[5]=O=65535&T|P<<16,t[5]=H=65535&D|I<<16,D=65535&(A=j),I=A>>>16,T=65535&(x=N),P=x>>>16,x=e[6],I+=(A=t[6])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[6]=N=65535&T|P<<16,t[6]=j=65535&D|I<<16,D=65535&(A=G),I=A>>>16,T=65535&(x=L),P=x>>>16,x=e[7],I+=(A=t[7])>>>16,T+=65535&x,P+=x>>>16,P+=(T+=(I+=(D+=65535&A)>>>16)>>>16)>>>16,e[7]=L=65535&T|P<<16,t[7]=G=65535&D|I<<16,W+=128,a-=128}return a}function Y(e,t,n){var a,i=new Int32Array(8),r=new Int32Array(8),o=new Uint8Array(256),s=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,r[0]=4089235720,r[1]=2227873595,r[2]=4271175723,r[3]=1595750129,r[4]=2917565137,r[5]=725511199,r[6]=4215389547,r[7]=327033209,W(i,r,t,n),n%=128,a=0;a<n;a++)o[a]=t[s-n+a];for(o[n]=128,o[(n=256-128*(n<112?1:0))-9]=0,g(o,n-8,s/536870912|0,s<<3),W(i,r,o,n),a=0;a<8;a++)g(e,8*a,i[a],r[a]);return 0}function X(e,n){var a=t(),i=t(),r=t(),o=t(),s=t(),c=t(),d=t(),u=t(),l=t();O(a,e[1],e[0]),O(l,n[1],n[0]),N(a,a,l),$(i,e[0],e[1]),$(l,n[0],n[1]),N(i,i,l),N(r,e[3],n[3]),N(r,r,h),N(o,e[2],n[2]),$(o,o,o),O(s,i,a),O(c,o,r),$(d,o,r),$(u,i,a),N(e[0],s,c),N(e[1],u,d),N(e[2],d,c),N(e[3],s,u)}function Q(e,t,n){var a;for(a=0;a<4;a++)V(e[a],t[a],n)}function Z(e,n){var a=t(),i=t(),r=t();_(r,n[2]),N(a,n[0],r),N(i,n[1],r),R(e,i),e[31]^=C(a)<<7}function ee(e,t,n){var a,i;for(P(e[0],r),P(e[1],o),P(e[2],o),P(e[3],r),i=255;i>=0;--i)Q(e,t,a=n[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Q(e,t,a)}function te(e,n){var a=[t(),t(),t(),t()];P(a[0],d),P(a[1],u),P(a[2],o),N(a[3],d,u),ee(e,a,n)}function ne(e,a,i){var r,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(a,32),Y(o,a,32),o[0]&=248,o[31]&=127,o[31]|=64,te(s,o),Z(e,s),r=0;r<32;r++)a[r+32]=e[r];return 0}var ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var n,a,i,r;for(a=63;a>=32;--a){for(n=0,i=a-32,r=a-12;i<r;++i)t[i]+=n-16*t[a]*ae[i-(a-32)],n=Math.floor((t[i]+128)/256),t[i]-=256*n;t[i]+=n,t[a]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*ae[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ae[i];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function re(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,n)}function oe(e,n,a,i){var r,o,s=new Uint8Array(64),c=new Uint8Array(64),h=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];Y(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var l=a+64;for(r=0;r<a;r++)e[64+r]=n[r];for(r=0;r<32;r++)e[32+r]=s[32+r];for(Y(h,e.subarray(32),a+32),re(h),te(u,h),Z(e,u),r=32;r<64;r++)e[r]=i[r];for(Y(c,e,a+64),re(c),r=0;r<64;r++)d[r]=0;for(r=0;r<32;r++)d[r]=h[r];for(r=0;r<32;r++)for(o=0;o<32;o++)d[r+o]+=c[r]*s[o];return ie(e.subarray(32),d),l}function se(e,n,a,i){var s,h=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],g=[t(),t(),t(),t()];if(a<64)return-1;if(function(e,n){var a=t(),i=t(),s=t(),h=t(),d=t(),u=t(),g=t();return P(e[2],o),U(e[1],n),L(s,e[1]),N(h,s,c),O(s,s,e[2]),$(h,e[2],h),L(d,h),L(u,d),N(g,u,d),N(a,g,s),N(a,a,h),q(a,a),N(a,a,s),N(a,a,h),N(a,a,h),N(e[0],a,h),L(i,e[0]),N(i,i,h),B(i,s)&&N(e[0],e[0],l),L(i,e[0]),N(i,i,h),B(i,s)?-1:(C(e[0])===n[31]>>7&&O(e[0],r,e[0]),N(e[3],e[0],e[1]),0)}(g,i))return-1;for(s=0;s<a;s++)e[s]=n[s];for(s=0;s<32;s++)e[s+32]=i[s];if(Y(d,e,a),re(d),ee(u,g,d),te(g,n.subarray(32)),X(u,g),Z(h,u),a-=64,f(n,0,h,0)){for(s=0;s<a;s++)e[s]=0;return-1}for(s=0;s<a;s++)e[s]=n[s+64];return a}var ce=64,he=32,de=64;function ue(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function ge(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:b,crypto_stream:k,crypto_stream_salsa20_xor:S,crypto_stream_salsa20:E,crypto_onetimeauth:A,crypto_onetimeauth_verify:D,crypto_verify_16:p,crypto_verify_32:f,crypto_secretbox:I,crypto_secretbox_open:T,crypto_scalarmult:F,crypto_scalarmult_base:z,crypto_box_beforenm:H,crypto_box_afternm:j,crypto_box:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),j(e,t,n,a,o)},crypto_box_open:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),G(e,t,n,a,o)},crypto_box_keypair:K,crypto_hash:Y,crypto_sign:oe,crypto_sign_keypair:ne,crypto_sign_open:se,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:de,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ae,pack25519:R,unpack25519:U,M:N,A:$,S:L,Z:O,pow2523:q,add:X,set25519:P,modL:ie,scalarmult:ee,scalarbase:te},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){le(e,t,n),ue(n,t);for(var a=new Uint8Array(32+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+32]=e[r];return I(i,a,a.length,t,n),i.subarray(16)},e.secretbox.open=function(e,t,n){le(e,t,n),ue(n,t);for(var a=new Uint8Array(16+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+16]=e[r];return a.length<32||0!==T(i,a,a.length,t,n)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(le(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return F(n,e,t),n},e.scalarMult.base=function(e){if(le(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return z(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox(t,n,r)},e.box.before=function(e,t){le(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return H(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox.open(t,n,r)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return K(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(le(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return z(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(le(e,t),t.length!==de)throw new Error("bad secret key size");var n=new Uint8Array(ce+e.length);return oe(n,e,e.length,t),n},e.sign.open=function(e,t){if(le(e,t),t.length!==he)throw new Error("bad public key size");var n=new Uint8Array(e.length),a=se(n,e,e.length,t);if(a<0)return null;for(var i=new Uint8Array(a),r=0;r<i.length;r++)i[r]=n[r];return i},e.sign.detached=function(t,n){for(var a=e.sign(t,n),i=new Uint8Array(ce),r=0;r<i.length;r++)i[r]=a[r];return i},e.sign.detached.verify=function(e,t,n){if(le(e,t,n),t.length!==ce)throw new Error("bad signature size");if(n.length!==he)throw new Error("bad public key size");var a,i=new Uint8Array(ce+e.length),r=new Uint8Array(ce+e.length);for(a=0;a<ce;a++)i[a]=t[a];for(a=0;a<e.length;a++)i[a+ce]=e[a];return se(r,i,i.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(de);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(le(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(he),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(le(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),n=new Uint8Array(de),a=0;a<32;a++)n[a]=e[a];return ne(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=de,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){le(e);var t=new Uint8Array(64);return Y(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return le(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===m(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG(function(e,n){var a,i=new Uint8Array(n);for(a=0;a<n;a+=65536)t.getRandomValues(i.subarray(a,a+Math.min(n-a,65536)));for(a=0;a<n;a++)e[a]=i[a];ge(i)}):"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&e.setPRNG(function(e,n){var a,i=t.randomBytes(n);for(a=0;a<n;a++)e[a]=i[a];ge(i)})}()}(void 0!==e&&e.exports?e.exports:self.nacl=self.nacl||{})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a].call(r.exports,r,r.exports,n),r.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{ABIAddressType:()=>Xc,ABIArrayDynamicType:()=>nh,ABIArrayStaticType:()=>th,ABIBoolType:()=>Qc,ABIByteType:()=>Zc,ABIContract:()=>gh,ABIInterface:()=>mh,ABIMethod:()=>uh,ABIReferenceType:()=>sh,ABIStringType:()=>eh,ABITransactionType:()=>oh,ABITupleType:()=>ah,ABIType:()=>Jc,ABIUfixedType:()=>Yc,ABIUintType:()=>Wc,ADDR_BYTE_SIZE:()=>Fc,ALGORAND_ZERO_ADDRESS_STRING:()=>rt,AccountBaseData:()=>Sa,AccountData:()=>Ea,AccountDeltas:()=>ba,AccountTotals:()=>Ta,Address:()=>ut,AlgoCount:()=>Ia,Algodv2:()=>Br,AppLocalState:()=>da,AppLocalStateDelta:()=>ua,AppParams:()=>ha,AppParamsDelta:()=>la,AppResourceRecord:()=>ga,ApplyData:()=>na,AssetHolding:()=>ma,AssetHoldingDelta:()=>pa,AssetParams:()=>fa,AssetParamsDelta:()=>ya,AssetResourceRecord:()=>wa,AtomicTransactionComposer:()=>wh,AtomicTransactionComposerStatus:()=>fh,BalanceRecord:()=>ka,Block:()=>ra,BlockHeader:()=>Zn,ENCODED_MULTISIG_SCHEMA:()=>Dn,ENCODED_PQSIG_SCHEMA:()=>Pn,ENCODED_SUBSIG_SCHEMA:()=>bn,ERROR_INVALID_MICROALGOS:()=>Eh,ERROR_MULTISIG_BAD_SENDER:()=>Sh,EvalDelta:()=>ta,FALCON_1024_SCHEME:()=>wc,FalconSignatureStruct:()=>Ft,FalconVerifier:()=>qt,HashFactory:()=>Ot,INVALID_MICROALGOS_ERROR_MSG:()=>o,IncludedTransactions:()=>Aa,Indexer:()=>vs,IntDecoding:()=>l,Kmd:()=>Cr,KvValueDelta:()=>xa,LENGTH_ENCODE_BYTE_SIZE:()=>Hc,LedgerStateDelta:()=>Pa,LogicSig:()=>On,LogicSigAccount:()=>Nn,MAX_LEN:()=>qc,MSIG_PROGRAM_TAG:()=>$n,MULTISIG_BAD_SENDER_ERROR_MSG:()=>vh,MerkleArrayProof:()=>Nt,MerkleSignatureVerifier:()=>Lt,ModifiedCreatable:()=>Da,OnApplicationComplete:()=>Ct,PQ_PROGRAM_TAG:()=>Un,PQ_SALT_MAX:()=>ht,PQ_SCHEME_SIZE:()=>ct,PROGRAM_TAG:()=>Cn,Participant:()=>_t,ParticipationUpdates:()=>Qn,ProgramSourceMap:()=>pc,Reveal:()=>Kt,RewardState:()=>Wn,SIGN_BYTES_PREFIX:()=>Fs,SIGN_PROGRAM_DATA_PREFIX:()=>_n,SINGLE_BOOL_SIZE:()=>Kc,SINGLE_BYTE_SIZE:()=>zc,SignedTransaction:()=>Kn,SignedTxnInBlock:()=>ia,SignedTxnWithAD:()=>aa,SigslotCommit:()=>zt,StateProof:()=>Ht,StateProofMessage:()=>jt,StateProofTrackingData:()=>Gn,StateSchema:()=>ca,TealValue:()=>sa,Transaction:()=>un,TransactionType:()=>Bt,TxnCommitments:()=>Jn,UntypedValue:()=>oa,UpgradeState:()=>Yn,UpgradeVote:()=>Xn,ValueDelta:()=>ea,VotingData:()=>va,abiCheckTransactionType:()=>hh,abiTypeIsReference:()=>dh,abiTypeIsTransaction:()=>ch,addressFromPQKey:()=>yt,addressFromPQSig:()=>wt,addressWithSignersFromRawEd25519Signer:()=>fc,addressWithSignersFromRawFalcon1024Signer:()=>vc,addressWithSignersFromRawPQSigner:()=>yc,algosToMicroalgos:()=>c,appendSignMultisigTransaction:()=>hc,appendSignMultisigTransactionWithSigner:()=>dc,appendSignRawMultisigSignature:()=>uc,assignGroupID:()=>qs,base64ToBytes:()=>he,bigIntToBytes:()=>Es,bytesToBase64:()=>de,bytesToBigInt:()=>ks,bytesToHex:()=>ge,bytesToString:()=>ue,coerceToBytes:()=>le,computeGroupID:()=>_s,createMultisigTransaction:()=>nc,decodeAddress:()=>lt,decodeJSON:()=>Pe,decodeMsgpack:()=>Ie,decodeObj:()=>Se,decodeSignedTransaction:()=>Hn,decodeUint64:()=>Ye,decodeUnsignedTransaction:()=>gn,default:()=>kh,encodeAddress:()=>mt,encodeJSON:()=>Me,encodeMsgpack:()=>Te,encodeObj:()=>ye,encodeUint64:()=>We,encodeUnsignedSimulateTransaction:()=>jn,encodeUnsignedTransaction:()=>ln,encodedMultiSigFromEncodingData:()=>In,encodedMultiSigToEncodingData:()=>Tn,encodedPQSigFromEncodingData:()=>Mn,encodedPQSigToEncodingData:()=>Vn,encodedSubsigFromEncodingData:()=>xn,encodedSubsigToEncodingData:()=>An,generateAccount:()=>bs,getApplicationAddress:()=>ft,getMethodByName:()=>lh,hexToBytes:()=>me,indexerModels:()=>t,isOnApplicationComplete:()=>$t,isTransactionType:()=>Ut,isTransactionWithSigner:()=>_c,isValidAddress:()=>gt,logicSigFromByte:()=>Ln,makeApplicationCallTxnFromObject:()=>Tc,makeApplicationClearStateTxnFromObject:()=>Cc,makeApplicationCloseOutTxnFromObject:()=>Bc,makeApplicationCreateTxnFromObject:()=>Pc,makeApplicationDeleteTxnFromObject:()=>Vc,makeApplicationNoOpTxnFromObject:()=>Uc,makeApplicationOptInTxnFromObject:()=>Rc,makeApplicationUpdateTxnFromObject:()=>Mc,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>xc,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>bc,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>Ac,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>Dc,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>Ic,makeBaseAssetConfigTxn:()=>kc,makeBasicAccountTransactionSigner:()=>$c,makeEmptyTransactionSigner:()=>Lc,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>Ec,makeLogicSigAccountTransactionSigner:()=>Oc,makeMultiSigAccountTransactionSigner:()=>Nc,makePaymentTxnWithSuggestedParamsFromObject:()=>Sc,masterDerivationKeyToMnemonic:()=>Us,mergeMultisigTransactions:()=>oc,microalgosToAlgos:()=>s,mnemonicFromSeed:()=>Ms,mnemonicToMasterDerivationKey:()=>Cs,mnemonicToSecretKey:()=>Rs,modelsv2:()=>e,msgpackRawDecode:()=>ve,msgpackRawDecodeAsMap:()=>Ee,msgpackRawEncode:()=>fe,multisigAddress:()=>kn,parseJSON:()=>m,pq25WordMnemonicToSeed:()=>Os,secretKeyToMnemonic:()=>Bs,seedFromMnemonic:()=>Vs,signBytes:()=>Hs,signLogicSigTransaction:()=>Js,signLogicSigTransactionObject:()=>Gs,signMultisigTransaction:()=>sc,signMultisigTransactionWithSigner:()=>cc,signTransaction:()=>zs,signTransactionWithSigner:()=>Ks,stringifyJSON:()=>p,tealSign:()=>qn,tealSignFromProgram:()=>zn,verifyBytes:()=>js,verifyMultisig:()=>En,verifyTealSign:()=>Fn,waitForConfirmation:()=>Ss});var e={};n.r(e),n.d(e,{Account:()=>Ma,AccountApplicationResource:()=>Va,AccountApplicationResponse:()=>Ra,AccountApplicationsInformationResponse:()=>Ba,AccountAssetHolding:()=>Ca,AccountAssetResponse:()=>Ua,AccountAssetsInformationResponse:()=>$a,AccountParticipation:()=>Oa,AccountStateDelta:()=>Na,AppCallLogs:()=>La,Application:()=>_a,ApplicationInitialStates:()=>qa,ApplicationKVStorage:()=>Fa,ApplicationLocalReference:()=>za,ApplicationLocalState:()=>Ka,ApplicationParams:()=>Ha,ApplicationStateOperation:()=>ja,ApplicationStateSchema:()=>Ga,Asset:()=>Ja,AssetHolding:()=>Wa,AssetHoldingReference:()=>Ya,AssetParams:()=>Xa,AvmKeyValue:()=>Qa,AvmValue:()=>Za,BlockHashResponse:()=>ei,BlockLogsResponse:()=>ti,BlockResponse:()=>ni,BlockTxidsResponse:()=>ai,Box:()=>ii,BoxDescriptor:()=>ri,BoxReference:()=>oi,BoxesResponse:()=>si,BuildVersion:()=>ci,CompileResponse:()=>hi,DisassembleResponse:()=>di,ErrorResponse:()=>ui,EvalDelta:()=>li,EvalDeltaKeyValue:()=>gi,Genesis:()=>mi,GenesisAllocation:()=>pi,GetBlockTimeStampOffsetResponse:()=>fi,GetPeersResponse:()=>yi,GetSyncRoundResponse:()=>wi,LedgerStateDeltaForTransactionGroup:()=>vi,LightBlockHeaderProof:()=>Si,NodeStatusResponse:()=>Ei,PeerStatus:()=>ki,PendingTransactionResponse:()=>bi,PendingTransactionsResponse:()=>xi,PostTransactionsResponse:()=>Ai,ScratchChange:()=>Di,SimulateInitialStates:()=>Ii,SimulateRequest:()=>Ti,SimulateRequestTransactionGroup:()=>Pi,SimulateResponse:()=>Mi,SimulateTraceConfig:()=>Vi,SimulateTransactionGroupResult:()=>Ri,SimulateTransactionResult:()=>Bi,SimulateUnnamedResourcesAccessed:()=>Ci,SimulationEvalOverrides:()=>Ui,SimulationOpcodeTraceUnit:()=>$i,SimulationTransactionExecTrace:()=>Oi,StateProof:()=>Ni,StateProofMessage:()=>Li,SupplyResponse:()=>_i,TealKeyValue:()=>qi,TealValue:()=>Fi,TransactionGroupLedgerStateDeltasForRoundResponse:()=>zi,TransactionParametersResponse:()=>Ki,TransactionProof:()=>Hi,Version:()=>ji});var t={};n.r(t),n.d(t,{Account:()=>Ur,AccountParticipation:()=>$r,AccountResponse:()=>Or,AccountStateDelta:()=>Nr,AccountsResponse:()=>Lr,Application:()=>_r,ApplicationLocalState:()=>qr,ApplicationLocalStatesResponse:()=>Fr,ApplicationLogData:()=>zr,ApplicationLogsResponse:()=>Kr,ApplicationParams:()=>Hr,ApplicationResponse:()=>jr,ApplicationStateSchema:()=>Gr,ApplicationsResponse:()=>Jr,Asset:()=>Wr,AssetBalancesResponse:()=>Yr,AssetHolding:()=>Xr,AssetHoldingsResponse:()=>Qr,AssetParams:()=>Zr,AssetResponse:()=>eo,AssetsResponse:()=>to,Block:()=>no,BlockHeadersResponse:()=>ao,BlockRewards:()=>io,BlockUpgradeState:()=>ro,BlockUpgradeVote:()=>oo,Box:()=>so,BoxDescriptor:()=>co,BoxReference:()=>ho,BoxesResponse:()=>uo,ErrorResponse:()=>lo,EvalDelta:()=>go,EvalDeltaKeyValue:()=>mo,HashFactory:()=>po,HbProofFields:()=>fo,HealthCheck:()=>yo,HoldingRef:()=>wo,IndexerStateProofMessage:()=>vo,LocalsRef:()=>So,MerkleArrayProof:()=>Eo,MiniAssetHolding:()=>ko,ParticipationUpdates:()=>bo,ResourceRef:()=>xo,StateProofFields:()=>Ao,StateProofParticipant:()=>Do,StateProofReveal:()=>Io,StateProofSigSlot:()=>To,StateProofSignature:()=>Po,StateProofTracking:()=>Mo,StateProofVerifier:()=>Vo,StateSchema:()=>Ro,TealKeyValue:()=>Bo,TealValue:()=>Co,Transaction:()=>Uo,TransactionApplication:()=>$o,TransactionAssetConfig:()=>Oo,TransactionAssetFreeze:()=>No,TransactionAssetTransfer:()=>Lo,TransactionHeartbeat:()=>_o,TransactionKeyreg:()=>qo,TransactionPayment:()=>Fo,TransactionResponse:()=>zo,TransactionSignature:()=>Ko,TransactionSignatureLogicsig:()=>Ho,TransactionSignatureMultisig:()=>jo,TransactionSignatureMultisigSubsignature:()=>Go,TransactionSignaturePQsig:()=>Jo,TransactionStateProof:()=>Wo,TransactionsResponse:()=>Yo});var i={};n.r(i),n.d(i,{ABIAddressType:()=>Xc,ABIArrayDynamicType:()=>nh,ABIArrayStaticType:()=>th,ABIBoolType:()=>Qc,ABIByteType:()=>Zc,ABIContract:()=>gh,ABIInterface:()=>mh,ABIMethod:()=>uh,ABIReferenceType:()=>sh,ABIStringType:()=>eh,ABITransactionType:()=>oh,ABITupleType:()=>ah,ABIType:()=>Jc,ABIUfixedType:()=>Yc,ABIUintType:()=>Wc,ADDR_BYTE_SIZE:()=>Fc,ALGORAND_ZERO_ADDRESS_STRING:()=>rt,AccountBaseData:()=>Sa,AccountData:()=>Ea,AccountDeltas:()=>ba,AccountTotals:()=>Ta,Address:()=>ut,AlgoCount:()=>Ia,Algodv2:()=>Br,AppLocalState:()=>da,AppLocalStateDelta:()=>ua,AppParams:()=>ha,AppParamsDelta:()=>la,AppResourceRecord:()=>ga,ApplyData:()=>na,AssetHolding:()=>ma,AssetHoldingDelta:()=>pa,AssetParams:()=>fa,AssetParamsDelta:()=>ya,AssetResourceRecord:()=>wa,AtomicTransactionComposer:()=>wh,AtomicTransactionComposerStatus:()=>fh,BalanceRecord:()=>ka,Block:()=>ra,BlockHeader:()=>Zn,ENCODED_MULTISIG_SCHEMA:()=>Dn,ENCODED_PQSIG_SCHEMA:()=>Pn,ENCODED_SUBSIG_SCHEMA:()=>bn,ERROR_INVALID_MICROALGOS:()=>Eh,ERROR_MULTISIG_BAD_SENDER:()=>Sh,EvalDelta:()=>ta,FALCON_1024_SCHEME:()=>wc,FalconSignatureStruct:()=>Ft,FalconVerifier:()=>qt,HashFactory:()=>Ot,INVALID_MICROALGOS_ERROR_MSG:()=>o,IncludedTransactions:()=>Aa,Indexer:()=>vs,IntDecoding:()=>l,Kmd:()=>Cr,KvValueDelta:()=>xa,LENGTH_ENCODE_BYTE_SIZE:()=>Hc,LedgerStateDelta:()=>Pa,LogicSig:()=>On,LogicSigAccount:()=>Nn,MAX_LEN:()=>qc,MSIG_PROGRAM_TAG:()=>$n,MULTISIG_BAD_SENDER_ERROR_MSG:()=>vh,MerkleArrayProof:()=>Nt,MerkleSignatureVerifier:()=>Lt,ModifiedCreatable:()=>Da,OnApplicationComplete:()=>Ct,PQ_PROGRAM_TAG:()=>Un,PQ_SALT_MAX:()=>ht,PQ_SCHEME_SIZE:()=>ct,PROGRAM_TAG:()=>Cn,Participant:()=>_t,ParticipationUpdates:()=>Qn,ProgramSourceMap:()=>pc,Reveal:()=>Kt,RewardState:()=>Wn,SIGN_BYTES_PREFIX:()=>Fs,SIGN_PROGRAM_DATA_PREFIX:()=>_n,SINGLE_BOOL_SIZE:()=>Kc,SINGLE_BYTE_SIZE:()=>zc,SignedTransaction:()=>Kn,SignedTxnInBlock:()=>ia,SignedTxnWithAD:()=>aa,SigslotCommit:()=>zt,StateProof:()=>Ht,StateProofMessage:()=>jt,StateProofTrackingData:()=>Gn,StateSchema:()=>ca,TealValue:()=>sa,Transaction:()=>un,TransactionType:()=>Bt,TxnCommitments:()=>Jn,UntypedValue:()=>oa,UpgradeState:()=>Yn,UpgradeVote:()=>Xn,ValueDelta:()=>ea,VotingData:()=>va,abiCheckTransactionType:()=>hh,abiTypeIsReference:()=>dh,abiTypeIsTransaction:()=>ch,addressFromPQKey:()=>yt,addressFromPQSig:()=>wt,addressWithSignersFromRawEd25519Signer:()=>fc,addressWithSignersFromRawFalcon1024Signer:()=>vc,addressWithSignersFromRawPQSigner:()=>yc,algosToMicroalgos:()=>c,appendSignMultisigTransaction:()=>hc,appendSignMultisigTransactionWithSigner:()=>dc,appendSignRawMultisigSignature:()=>uc,assignGroupID:()=>qs,base64ToBytes:()=>he,bigIntToBytes:()=>Es,bytesToBase64:()=>de,bytesToBigInt:()=>ks,bytesToHex:()=>ge,bytesToString:()=>ue,coerceToBytes:()=>le,computeGroupID:()=>_s,createMultisigTransaction:()=>nc,decodeAddress:()=>lt,decodeJSON:()=>Pe,decodeMsgpack:()=>Ie,decodeObj:()=>Se,decodeSignedTransaction:()=>Hn,decodeUint64:()=>Ye,decodeUnsignedTransaction:()=>gn,encodeAddress:()=>mt,encodeJSON:()=>Me,encodeMsgpack:()=>Te,encodeObj:()=>ye,encodeUint64:()=>We,encodeUnsignedSimulateTransaction:()=>jn,encodeUnsignedTransaction:()=>ln,encodedMultiSigFromEncodingData:()=>In,encodedMultiSigToEncodingData:()=>Tn,encodedPQSigFromEncodingData:()=>Mn,encodedPQSigToEncodingData:()=>Vn,encodedSubsigFromEncodingData:()=>xn,encodedSubsigToEncodingData:()=>An,generateAccount:()=>bs,getApplicationAddress:()=>ft,getMethodByName:()=>lh,hexToBytes:()=>me,indexerModels:()=>t,isOnApplicationComplete:()=>$t,isTransactionType:()=>Ut,isTransactionWithSigner:()=>_c,isValidAddress:()=>gt,logicSigFromByte:()=>Ln,makeApplicationCallTxnFromObject:()=>Tc,makeApplicationClearStateTxnFromObject:()=>Cc,makeApplicationCloseOutTxnFromObject:()=>Bc,makeApplicationCreateTxnFromObject:()=>Pc,makeApplicationDeleteTxnFromObject:()=>Vc,makeApplicationNoOpTxnFromObject:()=>Uc,makeApplicationOptInTxnFromObject:()=>Rc,makeApplicationUpdateTxnFromObject:()=>Mc,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>xc,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>bc,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>Ac,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>Dc,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>Ic,makeBaseAssetConfigTxn:()=>kc,makeBasicAccountTransactionSigner:()=>$c,makeEmptyTransactionSigner:()=>Lc,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>Ec,makeLogicSigAccountTransactionSigner:()=>Oc,makeMultiSigAccountTransactionSigner:()=>Nc,makePaymentTxnWithSuggestedParamsFromObject:()=>Sc,masterDerivationKeyToMnemonic:()=>Us,mergeMultisigTransactions:()=>oc,microalgosToAlgos:()=>s,mnemonicFromSeed:()=>Ms,mnemonicToMasterDerivationKey:()=>Cs,mnemonicToSecretKey:()=>Rs,modelsv2:()=>e,msgpackRawDecode:()=>ve,msgpackRawDecodeAsMap:()=>Ee,msgpackRawEncode:()=>fe,multisigAddress:()=>kn,parseJSON:()=>m,pq25WordMnemonicToSeed:()=>Os,secretKeyToMnemonic:()=>Bs,seedFromMnemonic:()=>Vs,signBytes:()=>Hs,signLogicSigTransaction:()=>Js,signLogicSigTransactionObject:()=>Gs,signMultisigTransaction:()=>sc,signMultisigTransactionWithSigner:()=>cc,signTransaction:()=>zs,signTransactionWithSigner:()=>Ks,stringifyJSON:()=>p,tealSign:()=>qn,tealSignFromProgram:()=>zn,verifyBytes:()=>js,verifyMultisig:()=>En,verifyTealSign:()=>Fn,waitForConfirmation:()=>Ss});const r=1e6,o="Microalgos should be positive and less than 2^53 - 1.";function s(e){if(e<0||!Number.isSafeInteger(e))throw new Error(o);return e/r}function c(e){const t=e*r;return Math.round(t)}var h,d=n(215),u=n.n(d);!function(e){e.UNSAFE="unsafe",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(h||(h={}));const l=h,g=u()({useNativeBigInt:!0,strict:!0});function m(e,{intDecoding:t}){if(t!==l.SAFE&&t!==l.UNSAFE&&t!==l.BIGINT&&t!==l.MIXED)throw new Error(`Invalid intDecoding option: ${t}`);return g.parse(e,(e,n)=>{if(null!=n&&"object"==typeof n&&null==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,Object.prototype),"bigint"==typeof n){if(t===l.SAFE&&n>Number.MAX_SAFE_INTEGER)throw new Error(`Integer exceeds maximum safe integer: ${n.toString()}. Try parsing with a different intDecoding option.`);return t===l.BIGINT||t===l.MIXED&&n>Number.MAX_SAFE_INTEGER?n:Number(n)}return"number"==typeof n&&t===l.BIGINT&&Number.isInteger(n)?BigInt(n):n})}function p(e,t,n){return g.stringify(e,t,n)}function f(e,t){return e.length===t.length&&Array.from(e).every((e,n)=>e===t[n])}function y(...e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let a=0;for(let t=0;t<e.length;t++)n.set(e[t],a),a+=e[t].length;return n}function w(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function v(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error(`BigInt value ${e} is not a safe integer`);return Number(e)}if("number"==typeof e){if(Number.isSafeInteger(e))return e;throw new Error(`Value ${e} is not a safe integer`)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function S(e){const t=v(e);if(t<0)throw new Error(`Value ${t} is negative`);return t}function E(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e)return e;if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error(`Value ${e} is not a safe integer`);return BigInt(e)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function k(e){const t=E(e);if(t<0||t>BigInt("0xffffffffffffffff"))throw new Error(`Value ${t} is not a uint64`);return t}class b extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class x{constructor(e,t,n,a={}){this.defaultHeaders=a;const i=t.endsWith("/")?t:`${t}/`,r=new URL(i);if(void 0!==n&&(r.port=n.toString()),0===r.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=r,this.tokenHeader=e}getURL(e,t){let n;n=e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`;const a=new URL(n,this.baseURL);if(t)for(const[e,n]of Object.entries(t))a.searchParams.set(e,n.toString());return a.toString()}static formatFetchResponseHeaders(e){const t={};return e.forEach((e,n)=>{t[e]=n}),t}static async checkHttpError(e){if(e.ok)return;let t,n;try{t=new Uint8Array(await e.arrayBuffer());const a=JSON.parse((new TextDecoder).decode(t));a.message&&(n=a.message)}catch(e){}let a=`Network request error. Received status ${e.status} (${e.statusText})`;throw n&&(a+=`: ${n}`),new b(a,{body:t??new Uint8Array,status:e.status,headers:x.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:x.formatFetchResponseHeaders(e.headers)}}async get(e,t,n,a){const i={...this.tokenHeader,...this.defaultHeaders,...n??{}},r=await fetch(this.getURL(e,t),{headers:i,...a??{}});return x.formatFetchResponse(r)}async post(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"POST",body:t,headers:r,...i??{}});return x.formatFetchResponse(o)}async delete(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"DELETE",body:t,headers:r,...i??{}});return x.formatFetchResponse(o)}}class A{constructor(e){this.body=e.body,this.text=e.text,this.format=e.format,this.headers=e.headers,this.status=e.status,this.ok=e.ok}getJSONText(){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return this.text}parseBodyAsJSON(e){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return I.parseJSON(this.text,this.status,e)}}function D(e){return Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})}class I{constructor(e,t,n,a={}){this.bc=void 0!==t?new x(e,t,n,a):e}static parseJSON(e,t,n){try{return e?m(e,n):null}catch(n){const a=n;throw a.rawResponse=e||null,a.statusCode=t,a}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return(new TextEncoder).encode(p(e));if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Uint8Array)return e;throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t){const{body:n}=e;let a;return"application/msgpack"!==t&&(a=n&&(new TextDecoder).decode(n)||""),new A({...e,format:t,text:a,ok:2===Math.trunc(e.status/100)})}static prepareResponseError(e){return e.response&&(e.response=I.prepareResponse(e.response,"application/json"),e.status=e.response.status),e}async get({relativePath:e,query:t,requestHeaders:n,customOptions:a}){const i=function(e){return void 0!==e&&Object.prototype.hasOwnProperty.call(e,"format")&&"msgpack"===e.format?"application/msgpack":"application/json"}(t),r={...n??{},accept:i};try{const n=await this.bc.get(e,t?function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(e[t]&&0!==e[t].length||delete e[t]);return e}(t):void 0,r,a);return I.prepareResponse(n,i)}catch(e){throw I.prepareResponseError(e)}}async post({relativePath:e,data:t,query:n,requestHeaders:a,customOptions:i}){const r={"content-type":"application/json",...D(a??{})};try{const a=await this.bc.post(e,I.serializeData(t,r),n,r,i);return I.prepareResponse(a,"application/json")}catch(e){throw I.prepareResponseError(e)}}async delete({relativePath:e,data:t,requestHeaders:n,customOptions:a}){const i={"content-type":"application/json",...D(n??{})};try{const n=await this.bc.delete(e,void 0!==t?I.serializeData(t,i):void 0,void 0,i,a);return I.prepareResponse(n,"application/json")}catch(e){throw I.prepareResponseError(e)}}}class T{constructor(e,t,n,a,i={}){if("function"==typeof t.get)this.c=new I(t);else{let r;r="string"==typeof t?function(e,t=""){const n={};return""===t||(n[e]=t),n}(e,t):t,this.c=new I(r,n,a,i)}}}var P=new TextEncoder;function M(e,t,n){for(var a=t,i=a+n,r=[],o="";a<i;){var s=e[a++];if(128&s)if(192==(224&s)){var c=63&e[a++];r.push((31&s)<<6|c)}else if(224==(240&s)){c=63&e[a++];var h=63&e[a++];r.push((31&s)<<12|c<<6|h)}else if(240==(248&s)){var d=(7&s)<<18|(c=63&e[a++])<<12|(h=63&e[a++])<<6|63&e[a++];d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d)}else r.push(s);else r.push(s);r.length>=4096&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return r.length>0&&(o+=String.fromCharCode.apply(String,r)),o}var V=new TextDecoder;var R,B,C=function(e,t){this.type=e,this.data=t},U=(R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$=function(e){function t(n){var a=e.call(this,n)||this,i=Object.create(t.prototype);return Object.setPrototypeOf(a,i),Object.defineProperty(a,"name",{configurable:!0,enumerable:!1,value:t.name}),a}return U(t,e),t}(Error);!function(e){e[e.UNSAFE_NUMBER=0]="UNSAFE_NUMBER",e[e.SAFE_NUMBER=1]="SAFE_NUMBER",e[e.AS_ENCODED=2]="AS_ENCODED",e[e.MIXED=3]="MIXED",e[e.BIGINT=4]="BIGINT"}(B||(B={}));var O=4294967295;function N(e,t,n){var a=Math.floor(n/4294967296),i=n;e.setUint32(t,a),e.setUint32(t+4,i)}function L(e,t,n){if(n===B.UNSAFE_NUMBER||n===B.SAFE_NUMBER){var a=e.getInt32(t),i=e.getUint32(t+4);if(n===B.SAFE_NUMBER&&(a<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||a===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===i||a>(Number.MAX_SAFE_INTEGER-i)/4294967296)){var r="".concat(a<0?"-":"","0x").concat(Math.abs(a).toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigInt64(t);return n===B.MIXED&&o>=Number.MIN_SAFE_INTEGER&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}var _={type:-1,encode:function(e){var t,n,a,i;return e instanceof Date?function(e){var t,n=e.sec,a=e.nsec;if(n>=0&&a>=0&&n<=17179869183){if(0===a&&n<=4294967295){var i=new Uint8Array(4);return(t=new DataView(i.buffer)).setUint32(0,n),i}var r=n/4294967296,o=4294967295&n;return i=new Uint8Array(8),(t=new DataView(i.buffer)).setUint32(0,a<<2|3&r),t.setUint32(4,o),i}return i=new Uint8Array(12),(t=new DataView(i.buffer)).setUint32(0,a),N(t,4,n),i}((a=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(i=Math.floor(a/1e9)),nsec:a-1e9*i})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:L(t,4,B.UNSAFE_NUMBER),nsec:t.getUint32(0)};default:throw new $("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},q=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(_)}return e.prototype.register=function(e){var t=e.type,n=e.encode,a=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=a;else{var i=1+t;this.builtInEncoders[i]=n,this.builtInDecoders[i]=a}},e.prototype.tryToEncode=function(e,t){for(var n=0;n<this.builtInEncoders.length;n++)if(null!=(a=this.builtInEncoders[n])&&null!=(i=a(e,t)))return new C(-1-n,i);for(n=0;n<this.encoders.length;n++){var a,i;if(null!=(a=this.encoders[n])&&null!=(i=a(e,t)))return new C(n,i)}return e instanceof C?e:null},e.prototype.decode=function(e,t,n){var a=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return a?a(e,t,n):new C(t,e)},e.defaultCodec=new e,e}();function F(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}function z(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++){var i=e[a]-t[a];if(0!==i)return i}return e.length-t.length}var K=function(e){if(this.rawBinaryValue=e,!ArrayBuffer.isView(e))throw new TypeError("RawBinaryString: rawBinaryValue must be an ArrayBufferView")},H=function(){function e(e){var t,n,a,i,r,o,s,c;this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:q.defaultCodec,this.context=null==e?void 0:e.context,this.forceBigIntToInt64=null!==(n=null==e?void 0:e.forceBigIntToInt64)&&void 0!==n&&n,this.maxDepth=null!==(a=null==e?void 0:e.maxDepth)&&void 0!==a?a:100,this.initialBufferSize=null!==(i=null==e?void 0:e.initialBufferSize)&&void 0!==i?i:2048,this.sortKeys=null!==(r=null==e?void 0:e.sortKeys)&&void 0!==r&&r,this.forceFloat32=null!==(o=null==e?void 0:e.forceFloat32)&&void 0!==o&&o,this.ignoreUndefined=null!==(s=null==e?void 0:e.ignoreUndefined)&&void 0!==s&&s,this.forceIntegerToFloat=null!==(c=null==e?void 0:e.forceIntegerToFloat)&&void 0!==c&&c,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),n=new Uint8Array(t),a=new DataView(t);n.set(this.bytes),this.view=a,this.bytes=n},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},e.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodeBigInt=function(e){if(this.forceBigIntToInt64)this.encodeBigIntAsInt64(e);else if(e>=0)if(e<4294967296||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e<BigInt("0x10000000000000000")))throw new Error("Bigint is too large for uint64: ".concat(e));this.encodeBigIntAsInt64(e)}else if(e>=-2147483648||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e>=BigInt(-1)*BigInt("0x8000000000000000")))throw new Error("Bigint is too small for int64: ".concat(e));this.encodeBigIntAsInt64(e)}},e.prototype.encodeBigIntAsInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){var t,n,a,i=function(e){for(var t=e.length,n=0,a=0;a<t;){var i=e.charCodeAt(a++);if(4294967168&i)if(4294965248&i){if(i>=55296&&i<=56319&&a<t){var r=e.charCodeAt(a);56320==(64512&r)&&(++a,i=((1023&i)<<10)+(1023&r)+65536)}n+=4294901760&i?4:3}else n+=2;else n++}return n}(e);this.ensureBufferSizeToWrite(5+i),this.writeStringHeader(i),t=e,n=this.bytes,a=this.pos,t.length>50?function(e,t,n){P.encodeInto(e,t.subarray(n))}(t,n,a):function(e,t,n){for(var a=e.length,i=n,r=0;r<a;){var o=e.charCodeAt(r++);if(4294967168&o){if(4294965248&o){if(o>=55296&&o<=56319&&r<a){var s=e.charCodeAt(r);56320==(64512&s)&&(++r,o=((1023&o)<<10)+(1023&s)+65536)}4294901760&o?(t[i++]=o>>18&7|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128):(t[i++]=o>>12&15|224,t[i++]=o>>6&63|128)}else t[i++]=o>>6&31|192;t[i++]=63&o|128}else t[i++]=o}}(t,n,a),this.pos+=i},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(e instanceof K)this.encodeBinaryAsString(e);else if("bigint"==typeof e)this.encodeBigInt(e);else if(e instanceof Map)this.encodeMap(e,t);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMapObject(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=F(e);this.writeU8a(n)},e.prototype.encodeBinaryAsString=function(e){var t=e.rawBinaryValue;this.writeStringHeader(t.byteLength);var n=F(t);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var a=0,i=e;a<i.length;a++){var r=i[a];this.doEncode(r,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var n=0,a=0,i=t;a<i.length;a++){var r=i[a];void 0!==e.get(r)&&n++}return n},e.prototype.sortMapKeys=function(e){for(var t=[],n=[],a=[],i=[],r=0,o=e;r<o.length;r++){var s=o[r];if("number"==typeof s){if(isNaN(s))throw new Error("Cannot sort map keys with NaN value");t.push(s)}else if("bigint"==typeof s)t.push(s);else if("string"==typeof s)n.push(s);else if(ArrayBuffer.isView(s))i.push(F(s));else{if(!(s instanceof K))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(s)));a.push(s)}}return t.sort(function(e,t){return e<t?-1:e>t?1:0}),n.sort(),a.sort(function(e,t){return z(F(e.rawBinaryValue),F(t.rawBinaryValue))}),i.sort(z),[].concat(t,n,a,i)},e.prototype.encodeMapObject=function(e,t){this.encodeMap(new Map(Object.entries(e)),t)},e.prototype.encodeMap=function(e,t){var n=Array.from(e.keys());this.sortKeys&&(n=this.sortMapKeys(n));var a=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(a<16)this.writeU8(128+a);else if(a<65536)this.writeU8(222),this.writeU16(a);else{if(!(a<4294967296))throw new Error("Too large map object: ".concat(a));this.writeU8(223),this.writeU32(a)}for(var i=0,r=n;i<r.length;i++){var o=r[i],s=e.get(o);if(!this.ignoreUndefined||void 0!==s){if("string"==typeof o)this.encodeString(o);else if("number"==typeof o)this.encodeNumber(o);else if("bigint"==typeof o)this.encodeBigInt(o);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else{if(!(o instanceof K))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(o)));this.encodeBinaryAsString(o)}this.doEncode(s,t+1)}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,n){var a=n/4294967296,i=n;e.setUint32(t,a),e.setUint32(t+4,i)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),N(this.view,this.pos,e),this.pos+=8},e.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},e.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},e}();function j(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var G=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var n=0;n<this.maxKeyLength;n++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var a=0,i=this.caches[n-1];a<i.length;a++){for(var r=i[a],o=r.bytes,s=0;s<n;s++)if(o[s]!==e[t+s])continue e;return r.str}return null},e.prototype.store=function(e,t){var n=this.caches[e.length-1],a={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=a:n.push(a)},e.prototype.decode=function(e,t,n){var a=this.find(e,t,n);if(null!=a)return this.hit++,a;this.miss++;var i=M(e,t,n),r=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(r,i),i},e}(),J=function(e,t){var n,a,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(n=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],a=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},W=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},a("next"),a("throw"),a("return"),t[Symbol.asyncIterator]=function(){return this},t);function a(n){t[n]=e[n]&&function(t){return new Promise(function(a,i){!function(e,t,n,a){Promise.resolve(a).then(function(t){e({value:t,done:n})},t)}(a,i,(t=e[n](t)).done,t.value)})}}},Y=function(e){return this instanceof Y?(this.v=e,this):new Y(e)},X="array",Q="map_key",Z="map_value";function ee(e,t,n){return t?"string"==typeof e||"number"==typeof e||"bigint"==typeof e||e instanceof Uint8Array||e instanceof K:"string"==typeof e||n&&"number"==typeof e}var te=function(){function e(e){this.useMap=e,this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(e.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),e.prototype.top=function(){return this.stack[this.stackHeadPosition]},e.prototype.pushArrayState=function(e){var t=this.getUninitializedStateFromPool();t.type=X,t.position=0,t.size=e,t.array=new Array(e)},e.prototype.pushMapState=function(e){var t=this.getUninitializedStateFromPool();t.type=Q,t.readCount=0,t.size=e,t.map=this.useMap?new Map:{}},e.prototype.getUninitializedStateFromPool=function(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null})}return this.stack[this.stackHeadPosition]},e.prototype.release=function(e){var t;if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");e.type===X&&((t=e).size=0,t.array=void 0,t.position=0,t.type=void 0),e.type!==Q&&e.type!==Z||((t=e).size=0,t.map=void 0,t.readCount=0,t.type=void 0),this.stackHeadPosition--},e.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},e}(),ne=new DataView(new ArrayBuffer(0)),ae=new Uint8Array(ne.buffer);try{ne.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ie=RangeError,re=new ie("Insufficient data"),oe=new G,se=function(){function e(e){var t,n,a,i,r,o,s,c,h,d,u,l;if(this.totalPos=0,this.pos=0,this.view=ne,this.bytes=ae,this.headByte=-1,this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:q.defaultCodec,this.context=null==e?void 0:e.context,this.intMode=null!==(n=null==e?void 0:e.intMode)&&void 0!==n?n:(null==e?void 0:e.useBigInt64)?B.AS_ENCODED:B.UNSAFE_NUMBER,this.rawBinaryStringValues=null!==(a=null==e?void 0:e.rawBinaryStringValues)&&void 0!==a&&a,this.rawBinaryStringKeys=null!==(i=null==e?void 0:e.rawBinaryStringKeys)&&void 0!==i&&i,this.useRawBinaryStringClass=null!==(r=null==e?void 0:e.useRawBinaryStringClass)&&void 0!==r&&r,this.useMap=null!==(o=null==e?void 0:e.useMap)&&void 0!==o&&o,this.supportObjectNumberKeys=null!==(s=null==e?void 0:e.supportObjectNumberKeys)&&void 0!==s&&s,this.maxStrLength=null!==(c=null==e?void 0:e.maxStrLength)&&void 0!==c?c:O,this.maxBinLength=null!==(h=null==e?void 0:e.maxBinLength)&&void 0!==h?h:O,this.maxArrayLength=null!==(d=null==e?void 0:e.maxArrayLength)&&void 0!==d?d:O,this.maxMapLength=null!==(u=null==e?void 0:e.maxMapLength)&&void 0!==u?u:O,this.maxExtLength=null!==(l=null==e?void 0:e.maxExtLength)&&void 0!==l?l:O,this.keyDecoder=void 0!==(null==e?void 0:e.keyDecoder)?e.keyDecoder:oe,this.rawBinaryStringKeys&&!this.useMap)throw new Error("rawBinaryStringKeys is only supported when useMap is true");this.stack=new te(this.useMap)}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.reset()},e.prototype.setBuffer=function(e){this.bytes=F(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=F(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=F(e),a=new Uint8Array(t.length+n.length);a.set(t),a.set(n,t.length),this.setBuffer(a)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return J(this,function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}})},e.prototype.decodeAsync=function(e){var t,n,a,i,r,o,s,c,h,d,u;return c=this,h=void 0,u=function(){var c,h,d,u,l,g,m,p;return J(this,function(f){switch(f.label){case 0:c=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),t=!0,n=W(e),f.label=2;case 2:return[4,n.next()];case 3:if(a=f.sent(),i=a.done)return[3,5];if(s=a.value,t=!1,d=s,c)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{h=this.doDecodeSync(),c=!0}catch(e){if(!(e instanceof ie))throw e}this.totalPos+=this.pos,f.label=4;case 4:return t=!0,[3,2];case 5:return[3,12];case 6:return u=f.sent(),r={error:u},[3,12];case 7:return f.trys.push([7,,10,11]),t||i||!(o=n.return)?[3,9]:[4,o.call(n)];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(c){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,h]}throw g=(l=this).headByte,m=l.pos,p=l.totalPos,new RangeError("Insufficient data in parsing ".concat(j(g)," at ").concat(p," (").concat(m," in the current buffer)"))}})},new((d=void 0)||(d=Promise))(function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function a(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d(function(e){e(i)})).then(n,a)}i((u=u.apply(c,h||[])).next())})},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a,i=n.apply(e,t||[]),r=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(e){i[e]&&(a[e]=function(t){return new Promise(function(n,a){r.push([e,t,n,a])>1||s(e,t)})})}function s(e,t){try{(n=i[e](t)).value instanceof Y?Promise.resolve(n.value.v).then(c,h):d(r[0][2],n)}catch(e){d(r[0][3],e)}var n}function c(e){s("next",e)}function h(e){s("throw",e)}function d(e,t){e(t),r.shift(),r.length&&s(r[0][0],r[0][1])}}(this,arguments,function(){var n,a,i,r,o,s,c,h,d,u,l,g;return J(this,function(m){switch(m.label){case 0:n=t,a=-1,m.label=1;case 1:m.trys.push([1,13,14,19]),i=!0,r=W(e),m.label=2;case 2:return[4,Y(r.next())];case 3:if(o=m.sent(),d=o.done)return[3,12];if(g=o.value,i=!1,s=g,t&&0===a)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(a=this.readArraySize(),n=!1,this.complete()),m.label=4;case 4:m.trys.push([4,9,,10]),m.label=5;case 5:return[4,Y(this.doDecodeSync())];case 6:return[4,m.sent()];case 7:return m.sent(),0===--a?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((c=m.sent())instanceof ie))throw c;return[3,10];case 10:this.totalPos+=this.pos,m.label=11;case 11:return i=!0,[3,2];case 12:return[3,19];case 13:return h=m.sent(),u={error:h},[3,19];case 14:return m.trys.push([14,,17,18]),i||d||!(l=r.return)?[3,16]:[4,Y(l.call(r))];case 15:m.sent(),m.label=16;case 16:return[3,18];case 17:if(u)throw u.error;return[7];case 18:return[7];case 19:return[2]}})})},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=this.convertNumber(e-256);else if(e<192)if(e<128)t=this.convertNumber(e);else if(e<144){if(0!=(a=e-128)){this.pushMapState(a),this.complete();continue e}t=this.useMap?new Map:{}}else if(e<160){if(0!=(a=e-144)){this.pushArrayState(a),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.convertNumber(this.readU8());else if(205===e)t=this.convertNumber(this.readU16());else if(206===e)t=this.convertNumber(this.readU32());else if(207===e)t=this.readU64();else if(208===e)t=this.convertNumber(this.readI8());else if(209===e)t=this.convertNumber(this.readI16());else if(210===e)t=this.convertNumber(this.readI32());else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeString(n,1);else if(218===e)n=this.lookU16(),t=this.decodeString(n,2);else if(219===e)n=this.lookU32(),t=this.decodeString(n,4);else if(220===e){if(0!==(a=this.readU16())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(221===e){if(0!==(a=this.readU32())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(222===e){if(0!==(a=this.readU16())){this.pushMapState(a),this.complete();continue e}t={}}else if(223===e){if(0!==(a=this.readU32())){this.pushMapState(a),this.complete();continue e}t={}}else if(196===e){var a=this.lookU8();t=this.decodeBinary(a,1)}else if(197===e)a=this.lookU16(),t=this.decodeBinary(a,2);else if(198===e)a=this.lookU32(),t=this.decodeBinary(a,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)a=this.lookU8(),t=this.decodeExtension(a,1);else if(200===e)a=this.lookU16(),t=this.decodeExtension(a,2);else{if(201!==e)throw new $("Unrecognized type byte: ".concat(j(e)));a=this.lookU32(),t=this.decodeExtension(a,4)}this.complete();for(var i=this.stack;i.length>0;){var r=i.top();if(r.type===X){if(r.array[r.position]=t,r.position++,r.position!==r.size)continue e;t=r.array,i.release(r)}else{if(r.type===Q){if(!ee(t,this.useMap,this.supportObjectNumberKeys)){var o=this.useMap?"string, number, bigint, or Uint8Array":this.supportObjectNumberKeys?"string or number":"string";throw new $("The type of key must be ".concat(o," but got ").concat(typeof t))}if(!this.useMap&&"__proto__"===t)throw new $("The key __proto__ is not allowed");r.key=t,r.type=Z;continue e}if(this.useMap?r.map.set(r.key,t):r.map[r.key]=t,r.readCount++,r.readCount!==r.size){r.key=null,r.type=Q;continue e}t=r.map,i.release(r)}}return t}},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new $("Unrecognized array type byte: ".concat(j(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new $("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new $("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},e.prototype.decodeString=function(e,t){if(this.stateIsMapKey()?this.rawBinaryStringKeys:this.rawBinaryStringValues){var n=this.decodeBinary(e,t);return this.useRawBinaryStringClass?new K(n):n}return this.decodeUtf8String(e,t)},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new $("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw re;var a,i=this.pos+t;return a=this.stateIsMapKey()&&(null===(n=this.keyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,i,e):function(e,t,n){return n>200?function(e,t,n){var a=e.subarray(t,t+n);return V.decode(a)}(e,t,n):M(e,t,n)}(this.bytes,i,e),this.pos+=t+e,a},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&this.stack.top().type===Q},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new $("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw re;var n=this.pos+t,a=this.bytes.subarray(n,n+e);return this.pos+=t+e,a},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new $("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),a=this.decodeBinary(e,t+1);return this.extensionCodec.decode(a,n,this.context)},e.prototype.convertNumber=function(e){return function(e,t){return t===B.BIGINT?BigInt(e):Number(e)}(e,this.intMode)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e=function(e,t,n){if(n===B.UNSAFE_NUMBER||n===B.SAFE_NUMBER){var a=e.getUint32(t),i=e.getUint32(t+4);if(n===B.SAFE_NUMBER&&a>(Number.MAX_SAFE_INTEGER-i)/4294967296){var r="0x".concat(a.toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigUint64(t);return n===B.MIXED&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readI64=function(){var e=L(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();function ce(e,t){return new se(t).decode(e)}function he(e){if(w())return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e);return Uint8Array.from(t,e=>e.codePointAt(0))}function de(e){if(w())return Buffer.from(e).toString("base64");const t=Array.from(e,e=>String.fromCodePoint(e)).join("");return btoa(t)}function ue(e){return(new TextDecoder).decode(e)}function le(e){return"string"==typeof e?(new TextEncoder).encode(e):e}function ge(e){return w()?Buffer.from(e).toString("hex"):Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}function me(e){if(w())return Buffer.from(e,"hex");let t=e;e.length%2!=0&&(t=e.padStart(1,"0"));const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}const pe="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function fe(e){return t=e,new H({sortKeys:!0}).encodeSharedRef(t);var t}function ye(e){const t=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw new Error(pe+t.firstEmptyKey);return fe(e)}function we(e){switch(e){case l.UNSAFE:return B.UNSAFE_NUMBER;case l.SAFE:return B.SAFE_NUMBER;case l.MIXED:return B.MIXED;case l.BIGINT:return B.BIGINT;default:throw new Error(`Invalid intDecoding: ${e}`)}}function ve(e,t){return ce(e,{intMode:t?.intDecoding?we(t?.intDecoding):B.BIGINT})}function Se(e){return ve(e,{intDecoding:l.MIXED})}function Ee(e,t){return ce(e,{intMode:t?.intDecoding?we(t?.intDecoding):B.BIGINT,useMap:!0})}function ke(e){if(null==e)return e;if(e instanceof Uint8Array)return de(e);if(Array.isArray(e))return e.map(ke);if(e instanceof Map){const t={};for(const[n,a]of e){if("string"!=typeof n)throw new Error(`JSON map key must be a string: ${n}`);t[n]=ke(a)}return t}return e}function be(e){if(null==e)return e;if("string"==typeof e||"number"==typeof e||"bigint"==typeof e||"boolean"==typeof e)return e;if(Array.isArray(e))return e.map(be);if("object"==typeof e){const t=new Map;for(const[n,a]of Object.entries(e))t.set(n,be(a));return t}throw new Error(`Invalid JSON encoding data: ${e}`)}var xe;!function(e){e[e.MAP_VALUE=0]="MAP_VALUE",e[e.ARRAY_ELEMENT=1]="ARRAY_ELEMENT"}(xe||(xe={}));class Ae{constructor({parent:e,segment:t,baseObjectBytes:n}){this.resolvedCache=null,this.resolvedCachePresent=!1,this.parent=e,this.segment=t,this.baseObjectBytes=n}withMapValue(e){return new Ae({parent:this,segment:{kind:xe.MAP_VALUE,key:e}})}withArrayElement(e){return new Ae({parent:this,segment:{kind:xe.ARRAY_ELEMENT,key:e}})}getRawStringAtCurrentLocation(){const e=this.resolve();if(e instanceof K)return e.rawBinaryValue;throw new Error(`Invalid type. Expected RawBinaryString, got ${e} (${typeof e})`)}getRawStringKeysAndValuesAtCurrentLocation(){const e=this.resolve();if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);const t=new Map;for(const[n,a]of e){if(!(n instanceof K))throw new Error(`Invalid type for map key. Expected RawBinaryString, got ${n} (${typeof n})`);t.set(n.rawBinaryValue,a)}return t}resolve(){if(this.resolvedCachePresent)return this.resolvedCache;let e;if(e=this.parent?this.parent.resolve():ce(this.baseObjectBytes,{intMode:B.BIGINT,useMap:!0,rawBinaryStringKeys:!0,rawBinaryStringValues:!0,useRawBinaryStringClass:!0}),!this.segment)return this.resolvedCache=e,this.resolvedCachePresent=!0,e;if(this.segment.kind===xe.MAP_VALUE){if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);if("string"==typeof this.segment.key||this.segment.key instanceof Uint8Array||this.segment.key instanceof K){const t=this.segment.key instanceof K?this.segment.key.rawBinaryValue:le(this.segment.key),n="string"==typeof this.segment.key||this.segment.key instanceof K;for(const[a,i]of e){let e;if(n?a instanceof K&&(e=a.rawBinaryValue):a instanceof Uint8Array&&(e=a),e&&f(t,e)){this.resolvedCache=i;break}}}else this.resolvedCache=e.get(this.segment.key);return this.resolvedCachePresent=!0,this.resolvedCache}if(this.segment.kind===xe.ARRAY_ELEMENT){if(!Array.isArray(e))throw new Error(`Invalid type. Expected Array, got ${e} (${typeof e})`);return this.resolvedCache=e[this.segment.key],this.resolvedCachePresent=!0,this.resolvedCache}throw new Error(`Invalid segment kind: ${this.segment.kind}`)}getPathString(){const e=this.parent?this.parent.getPathString():"root";return this.segment?this.segment.kind===xe.MAP_VALUE?`${e} -> map key "${this.segment.key}" (${typeof this.segment.key})`:this.segment.kind===xe.ARRAY_ELEMENT?`${e} -> array index ${this.segment.key} (${typeof this.segment.key})`:`${e} -> unknown segment kind ${this.segment.kind}`:e}}class De{}function Ie(e,t){const n=Ee(e),a=new Ae({baseObjectBytes:e});return t.fromEncodingData(t.encodingSchema.fromPreparedMsgpack(n,a))}function Te(e){return fe(e.getEncodingSchema().prepareMsgpack(e.toEncodingData()))}function Pe(e,t){const n=m(e,{intDecoding:l.BIGINT});return t.fromEncodingData(t.encodingSchema.fromPreparedJSON(n))}function Me(e,t){const{space:n,...a}=t??{};return p(e.getEncodingSchema().prepareJSON(e.toEncodingData(),a),void 0,n)}class Ve extends De{defaultValue(){return!1}isDefaultValue(e){return!1===e}prepareMsgpack(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedMsgpack(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}prepareJSON(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedJSON(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}}class Re extends De{defaultValue(){return""}isDefaultValue(e){return""===e}prepareMsgpack(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}prepareJSON(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}}class Be extends De{defaultValue(){return BigInt(0)}isDefaultValue(e){return"bigint"==typeof e?e===BigInt(0):"number"==typeof e&&0===e}prepareMsgpack(e){return k(e)}fromPreparedMsgpack(e,t){return k(e)}prepareJSON(e,t){return k(e)}fromPreparedJSON(e){return k(e)}}var Ce=n(584),Ue=n.n(Ce),$e=n(601),Oe=n.n($e),Ne=n(404),Le=n.n(Ne);function _e(e){return Le().sha512_256.array(e)}function qe(e){return Oe().sign.keyPair.fromSeed(e)}function Fe(e){return e===Oe().sign.signatureLength}function ze(e){return Oe().sign.keyPair.fromSecretKey(e)}function Ke(e,t){return Oe().sign.detached(e,t)}function He(e,t){return Oe().verify(e,t)}function je(e,t,n){return Oe().sign.detached.verify(e,t,n)}const Ge=Oe().sign.publicKeyLength,Je=(Oe().sign.secretKeyLength,32);function We(e){if("bigint"!=typeof e&&!Number.isInteger(e)||e<0||e>BigInt("0xffffffffffffffff"))throw new Error("Input is not a 64-bit unsigned integer");const t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}function Ye(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw new Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);const n=y(new Uint8Array(8-e.byteLength),e),a=new DataView(n.buffer).getBigUint64(0),i=a>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(i)throw new Error(`Integer exceeds maximum safe integer: ${a.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(a)}return"mixed"!==t||i?a:Number(a)}const Xe=(1n<<255n)-19n,Qe=32;function Ze(e,t){let n=1n,a=t,i=(e%Xe+Xe)%Xe;for(;a>0n;)1n&a&&(n=n*i%Xe),i=i*i%Xe,a>>=1n;return n}const et=(-121665n*Ze(121666n,Xe-2n)%Xe+Xe)%Xe,tt=Ze(2n,(Xe-1n)/4n);function nt(e){return e.length===Qe&&function(e){const t=(e%Xe+Xe)%Xe,n=t*t%Xe,a=(et*n+1n)%Xe;if(0n===a)return!1;const i=(n-1n+Xe)%Xe*Ze(a,Xe-2n)%Xe,r=Ze(i,(Xe+3n)/8n);if(r*r%Xe===i)return!0;const o=r*tt%Xe;return o*o%Xe===i}(function(e){const t=e.slice();t[31]&=127;let n=0n;for(let e=31;e>=0;e--)n=n<<8n|BigInt(t[e]);return n}(e))}const at=36,it=4,rt="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",ot="address seems to be malformed",st=(new TextEncoder).encode("PQA"),ct=2,ht=255;function dt(e){return Uint8Array.from(_e(e).slice(32-it,32))}class ut{constructor(e){if(!(e instanceof Uint8Array))throw new Error(`${ot}: ${e} is not Uint8Array, type ${typeof e}`);if(e.length!==at-it)throw new Error(`${ot}: 0x${ge(e)}, length ${e.length}`);this.publicKey=e}equals(e){return e instanceof ut&&f(this.publicKey,e.publicKey)}checksum(){return dt(this.publicKey)}toString(){return Ue().encode(y(this.publicKey,this.checksum())).slice(0,58)}static fromString(e){if("string"!=typeof e)throw new Error(`${ot}: expected string, got ${typeof e}, ${e}`);if(58!==e.length)throw new Error(`${ot}: expected length 58, got ${e.length}: ${e}`);const t=Ue().decode.asBytes(e);if(t.length!==at)throw new Error(`${ot}: expected byte length ${at}, got ${t.length}`);const n=new Uint8Array(t.slice(0,at-it)),a=new Uint8Array(t.slice(Ge,at));if(!f(dt(n),a))throw new Error("wrong checksum for address");return new ut(n)}static zeroAddress(){return new ut(new Uint8Array(at-it))}}function lt(e){return ut.fromString(e)}function gt(e){try{ut.fromString(e)}catch(e){return!1}return!0}function mt(e){return new ut(e).toString()}const pt=(new TextEncoder).encode("appID");function ft(e){const t=_e(y(pt,We(e)));return new ut(Uint8Array.from(t))}function yt(e,t){if(e.length!==ct)throw new Error(`invalid PQ scheme length: expected ${ct} bytes, got ${e.length}`);for(let n=0;n<=ht;n++){const a=y(st,e,Uint8Array.of(n),t),i=Uint8Array.from(_e(a));if(!nt(i))return{address:new ut(i),salt:n}}throw new Error("no canonical salt exists for this PQ public key and scheme")}function wt(e){const{address:t,salt:n}=yt(e.sch,e.pk);if(n!==e.slt)throw new Error(`invalid PQ signature salt: expected the canonical salt ${n}, got ${e.slt}`);return t}class vt extends De{defaultValue(){return ut.zeroAddress()}isDefaultValue(e){return ut.zeroAddress().equals(e)}prepareMsgpack(e){if(e instanceof ut)return e.publicKey;throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return new ut(e)}prepareJSON(e,t){if(e instanceof ut)return e.toString();throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedJSON(e){return ut.fromString(e)}}class St extends De{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array)return de(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if(null==e)return this.defaultValue();if("string"==typeof e)return he(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class Et extends De{constructor(e){super(),this.length=e}defaultValue(){return new Uint8Array(this.length)}isDefaultValue(e){return e instanceof Uint8Array&&e.byteLength===this.length&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}prepareJSON(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return de(e);throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedJSON(e){if("string"==typeof e){const t=he(e);if(t.byteLength===this.length)return t;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${t.byteLength}`)}throw new Error("Invalid base64 byte array")}}class kt extends De{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return new K(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return t.getRawStringAtCurrentLocation()}prepareJSON(e,t){if(e instanceof Uint8Array){const n=ue(e);if(!t.lossyBinaryStringConversion&&!f(le(n),e))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${de(e)}`);return n}throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return le(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class bt extends De{constructor(e){super(),this.itemSchema=e}defaultValue(){return[]}isDefaultValue(e){return Array.isArray(e)&&0===e.length}prepareMsgpack(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareMsgpack(e));throw new Error("ArraySchema data must be an array")}fromPreparedMsgpack(e,t){if(Array.isArray(e))return e.map((e,n)=>this.itemSchema.fromPreparedMsgpack(e,t.withArrayElement(n)));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}prepareJSON(e,t){if(Array.isArray(e))return e.map(e=>this.itemSchema.prepareJSON(e,t));throw new Error("ArraySchema data must be an array")}fromPreparedJSON(e){if(Array.isArray(e))return e.map(e=>this.itemSchema.fromPreparedJSON(e));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}}function xt(e){return e.map(e=>({...e,omitEmpty:!0}))}class At extends De{constructor(e){super(),this.entries=e,this.checkEntries()}pushEntries(...e){this.entries.push(...e),this.checkEntries()}checkEntries(){for(const e of this.entries)if(e.embedded){if(""!==e.key)throw new Error("Embedded entries must have an empty key");if(!(e.valueSchema instanceof At))throw new Error("Embedded entry valueSchema must be a NamedMapSchema")}const e=new Set;for(const t of this.getEntries()){if(e.has(t.key))throw new Error(`Duplicate key: ${t.key}`);e.add(t.key)}}getEntries(){const e=[];for(const t of this.entries)if(t.embedded){const n=t.valueSchema;e.push(...n.getEntries())}else e.push(t);return e}defaultValue(){const e=new Map;for(const t of this.getEntries())e.set(t.key,t.valueSchema.defaultValue());return e}isDefaultValue(e){if(!(e instanceof Map))return!1;for(const t of this.getEntries())if(!t.valueSchema.isDefaultValue(e.get(t.key)))return!1;return!0}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`NamedMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const n of this.getEntries()){const a=e.get(n.key);n.omitEmpty&&n.valueSchema.isDefaultValue(a)||t.set(n.key,n.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n=new Map;for(const a of this.getEntries())if(e.has(a.key))n.set(a.key,a.valueSchema.fromPreparedMsgpack(e.get(a.key),t.withMapValue(a.key)));else{if(!a.omitEmpty)throw new Error(`Missing key: ${a.key}`);n.set(a.key,a.valueSchema.defaultValue())}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n={};for(const a of this.getEntries()){const i=e.get(a.key);a.omitEmpty&&a.valueSchema.isDefaultValue(i)||(n[a.key]=a.valueSchema.prepareJSON(i,t))}return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("NamedMapSchema data must be an object");const t=new Map;for(const n of this.getEntries())if(Object.prototype.hasOwnProperty.call(e,n.key))t.set(n.key,n.valueSchema.fromPreparedJSON(e[n.key]));else{if(!n.omitEmpty)throw new Error(`Missing key: ${n.key}`);t.set(n.key,n.valueSchema.defaultValue())}return t}}function Dt(...e){const t=new Map;for(const n of e)for(const[e,a]of n){if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,a)}return t}function It(e,t){const n=new Map;for(const[a,i]of e){const[e,r]=t(a,i);n.set(e,r)}return n}class Tt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){const e=k(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("Uint64MapSchema data must be a Map");const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e.toString()]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("Uint64MapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e)){const e=BigInt(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.fromPreparedJSON(a))}return t}}function Pt(e){if(e instanceof K)return ue(e.rawBinaryValue);if(e instanceof Map){const t=new Map;for(const[n,a]of e)t.set(Pt(n),Pt(a));return t}return Array.isArray(e)?e.map(Pt):e}class Mt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(new K(n),this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){const n=new Map,a=t.getRawStringKeysAndValuesAtCurrentLocation();for(const[e,i]of a)n.set(e,this.valueSchema.fromPreparedMsgpack(Pt(i),t.withMapValue(new K(e))));return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a}`);const e=ue(a);if(!t.lossyBinaryStringConversion&&!f(le(e),a))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${de(a)}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("SpecialCaseBinaryStringMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(le(n),this.valueSchema.fromPreparedJSON(a));return t}}class Vt extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){}isDefaultValue(e){return void 0===e||this.valueSchema.isDefaultValue(e)}prepareMsgpack(e){if(void 0!==e)return this.valueSchema.prepareMsgpack(e)}fromPreparedMsgpack(e,t){if(null!=e)return this.valueSchema.fromPreparedMsgpack(e,t)}prepareJSON(e,t){return void 0===e?null:this.valueSchema.prepareJSON(e,t)}fromPreparedJSON(e){if(null!=e)return this.valueSchema.fromPreparedJSON(e)}}class Rt extends De{defaultValue(){}isDefaultValue(e){return void 0===e}prepareMsgpack(e){return e}fromPreparedMsgpack(e,t){return e}prepareJSON(e,t){return ke(e)}fromPreparedJSON(e){return be(e)}}var Bt,Ct;function Ut(e){return e===Bt.pay||e===Bt.keyreg||e===Bt.acfg||e===Bt.axfer||e===Bt.afrz||e===Bt.appl||e===Bt.stpf||e===Bt.hb}function $t(e){return e===Ct.NoOpOC||e===Ct.OptInOC||e===Ct.CloseOutOC||e===Ct.ClearStateOC||e===Ct.UpdateApplicationOC||e===Ct.DeleteApplicationOC}!function(e){e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl",e.stpf="stpf",e.hb="hb"}(Bt||(Bt={})),function(e){e[e.NoOpOC=0]="NoOpOC",e[e.OptInOC=1]="OptInOC",e[e.CloseOutOC=2]="CloseOutOC",e[e.ClearStateOC=3]="ClearStateOC",e[e.UpdateApplicationOC=4]="UpdateApplicationOC",e[e.DeleteApplicationOC=5]="DeleteApplicationOC"}(Ct||(Ct={}));class Ot{constructor(e){this.hashType=e.hashType}getEncodingSchema(){return Ot.encodingSchema}toEncodingData(){return new Map([["t",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new Ot({hashType:Number(e.get("t"))})}}Ot.encodingSchema=new At(xt([{key:"t",valueSchema:new Be}]));class Nt{constructor(e){this.path=e.path,this.hashFactory=e.hashFactory,this.treeDepth=e.treeDepth}getEncodingSchema(){return Nt.encodingSchema}toEncodingData(){return new Map([["pth",this.path],["hsh",this.hashFactory.toEncodingData()],["td",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new Nt({path:e.get("pth"),hashFactory:Ot.fromEncodingData(e.get("hsh")),treeDepth:Number(e.get("td"))})}}Nt.encodingSchema=new At(xt([{key:"pth",valueSchema:new bt(new St)},{key:"hsh",valueSchema:Ot.encodingSchema},{key:"td",valueSchema:new Be}]));class Lt{constructor(e){this.commitment=e.commitment,this.keyLifetime=e.keyLifetime}getEncodingSchema(){return Lt.encodingSchema}toEncodingData(){return new Map([["cmt",this.commitment],["lf",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleSignatureVerifier: ${e}`);return new Lt({commitment:e.get("cmt"),keyLifetime:e.get("lf")})}}Lt.encodingSchema=new At(xt([{key:"cmt",valueSchema:new Et(64)},{key:"lf",valueSchema:new Be}]));class _t{constructor(e){this.pk=e.pk,this.weight=e.weight}getEncodingSchema(){return _t.encodingSchema}toEncodingData(){return new Map([["p",this.pk.toEncodingData()],["w",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Participant: ${e}`);return new _t({pk:Lt.fromEncodingData(e.get("p")),weight:e.get("w")})}}_t.encodingSchema=new At(xt([{key:"p",valueSchema:Lt.encodingSchema},{key:"w",valueSchema:new Be}]));class qt{constructor(e){this.publicKey=e.publicKey}getEncodingSchema(){return qt.encodingSchema}toEncodingData(){return new Map([["k",this.publicKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconVerifier: ${e}`);return new qt({publicKey:e.get("k")})}}qt.encodingSchema=new At(xt([{key:"k",valueSchema:new Et(1793)}]));class Ft{constructor(e){this.signature=e.signature,this.vectorCommitmentIndex=e.index,this.proof=e.proof,this.verifyingKey=e.verifyingKey}getEncodingSchema(){return Ft.encodingSchema}toEncodingData(){return new Map([["sig",this.signature],["idx",this.vectorCommitmentIndex],["prf",this.proof.toEncodingData()],["vkey",this.verifyingKey.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconSignatureStruct: ${e}`);return new Ft({signature:e.get("sig"),index:e.get("idx"),proof:Nt.fromEncodingData(e.get("prf")),verifyingKey:qt.fromEncodingData(e.get("vkey"))})}}Ft.encodingSchema=new At(xt([{key:"sig",valueSchema:new St},{key:"idx",valueSchema:new Be},{key:"prf",valueSchema:Nt.encodingSchema},{key:"vkey",valueSchema:qt.encodingSchema}]));class zt{constructor(e){this.sig=e.sig,this.l=e.l}getEncodingSchema(){return zt.encodingSchema}toEncodingData(){return new Map([["s",this.sig.toEncodingData()],["l",this.l]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SigslotCommit: ${e}`);return new zt({sig:Ft.fromEncodingData(e.get("s")),l:e.get("l")})}}zt.encodingSchema=new At(xt([{key:"s",valueSchema:Ft.encodingSchema},{key:"l",valueSchema:new Be}]));class Kt{constructor(e){this.sigslot=e.sigslot,this.participant=e.participant}getEncodingSchema(){return Kt.encodingSchema}toEncodingData(){return new Map([["s",this.sigslot.toEncodingData()],["p",this.participant.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Reveal: ${e}`);return new Kt({sigslot:zt.fromEncodingData(e.get("s")),participant:_t.fromEncodingData(e.get("p"))})}}Kt.encodingSchema=new At(xt([{key:"s",valueSchema:zt.encodingSchema},{key:"p",valueSchema:_t.encodingSchema}]));class Ht{constructor(e){this.sigCommit=e.sigCommit,this.signedWeight=e.signedWeight,this.sigProofs=e.sigProofs,this.partProofs=e.partProofs,this.merkleSignatureSaltVersion=e.merkleSignatureSaltVersion,this.reveals=e.reveals,this.positionsToReveal=e.positionsToReveal}getEncodingSchema(){return Ht.encodingSchema}toEncodingData(){return new Map([["c",this.sigCommit],["w",this.signedWeight],["S",this.sigProofs.toEncodingData()],["P",this.partProofs.toEncodingData()],["v",this.merkleSignatureSaltVersion],["r",It(this.reveals,(e,t)=>[e,t.toEncodingData()])],["pr",this.positionsToReveal]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new Ht({sigCommit:e.get("c"),signedWeight:e.get("w"),sigProofs:Nt.fromEncodingData(e.get("S")),partProofs:Nt.fromEncodingData(e.get("P")),merkleSignatureSaltVersion:Number(e.get("v")),reveals:It(e.get("r"),(e,t)=>[e,Kt.fromEncodingData(t)]),positionsToReveal:e.get("pr")})}}Ht.encodingSchema=new At(xt([{key:"c",valueSchema:new St},{key:"w",valueSchema:new Be},{key:"S",valueSchema:Nt.encodingSchema},{key:"P",valueSchema:Nt.encodingSchema},{key:"v",valueSchema:new Be},{key:"r",valueSchema:new Tt(Kt.encodingSchema)},{key:"pr",valueSchema:new bt(new Be)}]));class jt{constructor(e){this.blockHeadersCommitment=e.blockHeadersCommitment,this.votersCommitment=e.votersCommitment,this.lnProvenWeight=e.lnProvenWeight,this.firstAttestedRound=e.firstAttestedRound,this.lastAttestedRound=e.lastAttestedRound}getEncodingSchema(){return jt.encodingSchema}toEncodingData(){return new Map([["b",this.blockHeadersCommitment],["v",this.votersCommitment],["P",this.lnProvenWeight],["f",this.firstAttestedRound],["l",this.lastAttestedRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new jt({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}static fromMap(e){return new jt({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}}jt.encodingSchema=new At(xt([{key:"b",valueSchema:new St},{key:"v",valueSchema:new St},{key:"P",valueSchema:new Be},{key:"f",valueSchema:new Be},{key:"l",valueSchema:new Be}]));class Gt{constructor(e){this.sig=e.sig,this.pk=e.pk,this.pk2=e.pk2,this.pk1Sig=e.pk1Sig,this.pk2Sig=e.pk2Sig}getEncodingSchema(){return Gt.encodingSchema}toEncodingData(){return new Map([["s",this.sig],["p",this.pk],["p2",this.pk2],["p1s",this.pk1Sig],["p2s",this.pk2Sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HeartbeatProof: ${e}`);return new Gt({sig:e.get("s"),pk:e.get("p"),pk2:e.get("p2"),pk1Sig:e.get("p1s"),pk2Sig:e.get("p2s")})}}Gt.encodingSchema=new At(xt([{key:"s",valueSchema:new Et(64)},{key:"p",valueSchema:new Et(32)},{key:"p2",valueSchema:new Et(32)},{key:"p1s",valueSchema:new Et(64)},{key:"p2s",valueSchema:new Et(64)}]));class Jt{constructor(e){this.address=e.address,this.proof=e.proof,this.seed=e.seed,this.voteID=e.voteID,this.keyDilution=e.keyDilution,this.challengeDiscount=e.challengeDiscount??!1}getEncodingSchema(){return Jt.encodingSchema}toEncodingData(){return new Map([["a",this.address],["prf",this.proof.toEncodingData()],["sd",this.seed],["vid",this.voteID],["kd",this.keyDilution],["c",this.challengeDiscount]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Heartbeat: ${e}`);return new Jt({address:e.get("a"),proof:Gt.fromEncodingData(e.get("prf")),seed:e.get("sd"),voteID:e.get("vid"),keyDilution:e.get("kd"),challengeDiscount:e.get("c")})}}function Wt(e){return e.every(e=>0===e)}function Yt(e,t,n){if(null==e)return;let a;if(e instanceof Uint8Array&&(a=e),null==a||a.byteLength!==n)throw Error(`${t} must be a ${n} byte Uint8Array`);return a}function Xt(e){if(null==e)throw new Error("Address must not be null or undefined");if("string"==typeof e)return ut.fromString(e);if(e instanceof ut)return e;throw new Error(`Not an address: ${e}`)}function Qt(e){if(null==e)return;let t;if(e instanceof ut)t=e;else{if("string"!=typeof e)throw new Error(`Not an address: ${e}`);t=ut.fromString(e)}if(Wt(t.publicKey))throw new Error("Invalid use of the zero address. To omit this value, pass in undefined");return t}function Zt(e){if(void 0!==e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}}function en(e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}function tn(e){if(void 0!==e)return k(e)}function nn(e){if(!0===e||!1===e)return e;throw new Error(`Not a boolean: ${e}`)}function an(e){if(Array.isArray(e))return e.slice();throw new Error(`Not an array: ${e}`)}function rn(e,t,n){const a=Zt(e);if(void 0!==a){if(a.byteLength!==t)throw new Error(`${n} must be ${t} bytes long, was ${a.byteLength}`);if(!Wt(a))return a}}function on(e){if(null!=e&&"object"==typeof e){const{appIndex:t,name:n}=e;return{appIndex:k(t),name:en(n)}}throw new Error(`Not a box reference: ${e}`)}function sn(e){if(null!=e&&"object"==typeof e){const{assetIndex:t,address:n}=e;return{assetIndex:k(t),address:Xt(n)}}throw new Error(`Not a holding reference: ${e}`)}function cn(e){if(null!=e&&"object"==typeof e){const{appIndex:t,address:n}=e;return{appIndex:k(t),address:Xt(n)}}throw new Error(`Not a locals reference: ${e}`)}function hn(e){if(null!=e&&"object"==typeof e){const{address:t,appIndex:n,assetIndex:a,holding:i,locals:r,box:o}=e;if(void 0!==t)return{address:Xt(t)};if(void 0!==n)return{appIndex:k(n)};if(void 0!==a)return{assetIndex:k(a)};if(void 0!==i)return{holding:sn(i)};if(void 0!==r)return{locals:cn(r)};if(void 0!==o)return{box:on(o)};if(function(e){if(!e||"object"!=typeof e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t])return!1;return!0}(e))return{}}throw new Error(`Not a resource reference: ${e}`)}Jt.encodingSchema=new At(xt([{key:"a",valueSchema:new vt},{key:"prf",valueSchema:Gt.encodingSchema},{key:"sd",valueSchema:new St},{key:"vid",valueSchema:new Et(32)},{key:"kd",valueSchema:new Be},{key:"c",valueSchema:new Ve}]));const dn=(new TextEncoder).encode("TX");class un{constructor(e){if(!Ut(e.type))throw new Error(`Invalid transaction type: ${e.type}`);if(this.type=e.type,this.sender=Xt(e.sender),this.note=en(e.note??new Uint8Array),this.lease=rn(e.lease,32,"lease"),this.rekeyTo=Qt(e.rekeyTo),this.group=void 0,this.firstValid=k(e.suggestedParams.firstValid),this.lastValid=k(e.suggestedParams.lastValid),e.suggestedParams.genesisID){if("string"!=typeof e.suggestedParams.genesisID)throw new Error("Genesis ID must be a string if present");this.genesisID=e.suggestedParams.genesisID}this.genesisHash=Zt(e.suggestedParams.genesisHash);const t=[];if(e.paymentParams&&t.push(Bt.pay),e.keyregParams&&t.push(Bt.keyreg),e.assetConfigParams&&t.push(Bt.acfg),e.assetTransferParams&&t.push(Bt.axfer),e.assetFreezeParams&&t.push(Bt.afrz),e.appCallParams&&t.push(Bt.appl),e.stateProofParams&&t.push(Bt.stpf),e.heartbeatParams&&t.push(Bt.hb),1!==t.length)throw new Error(`Transaction has wrong number of type fields present (${t.length}): ${t}`);if(this.type!==t[0])throw new Error(`Transaction has type ${this.type} but fields present for ${t[0]}`);if(e.paymentParams&&(this.payment={receiver:Xt(e.paymentParams.receiver),amount:k(e.paymentParams.amount),closeRemainderTo:Qt(e.paymentParams.closeRemainderTo)}),e.keyregParams){if(this.keyreg={voteKey:Yt(e.keyregParams.voteKey,"voteKey",32),selectionKey:Yt(e.keyregParams.selectionKey,"selectionKey",32),stateProofKey:Yt(e.keyregParams.stateProofKey,"stateProofKey",64),voteFirst:tn(e.keyregParams.voteFirst),voteLast:tn(e.keyregParams.voteLast),voteKeyDilution:tn(e.keyregParams.voteKeyDilution),nonParticipation:nn(e.keyregParams.nonParticipation??!1)},this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution))throw new Error("nonParticipation is true but participation params are present.");if(!this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution)&&(!this.keyreg.voteKey||!this.keyreg.selectionKey||void 0===this.keyreg.voteFirst||void 0===this.keyreg.voteLast||void 0===this.keyreg.voteKeyDilution))throw new Error("Online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution")}if(e.assetConfigParams&&(this.assetConfig={assetIndex:k(e.assetConfigParams.assetIndex??0),total:k(e.assetConfigParams.total??0),decimals:S(e.assetConfigParams.decimals??0),defaultFrozen:nn(e.assetConfigParams.defaultFrozen??!1),manager:Qt(e.assetConfigParams.manager),reserve:Qt(e.assetConfigParams.reserve),freeze:Qt(e.assetConfigParams.freeze),clawback:Qt(e.assetConfigParams.clawback),unitName:e.assetConfigParams.unitName,assetName:e.assetConfigParams.assetName,assetURL:e.assetConfigParams.assetURL,assetMetadataHash:rn(e.assetConfigParams.assetMetadataHash,32,"assetMetadataHash")}),e.assetTransferParams&&(this.assetTransfer={assetIndex:k(e.assetTransferParams.assetIndex),amount:k(e.assetTransferParams.amount),assetSender:Qt(e.assetTransferParams.assetSender),receiver:Xt(e.assetTransferParams.receiver),closeRemainderTo:Qt(e.assetTransferParams.closeRemainderTo)}),e.assetFreezeParams&&(this.assetFreeze={assetIndex:k(e.assetFreezeParams.assetIndex),freezeAccount:Xt(e.assetFreezeParams.freezeTarget),frozen:nn(e.assetFreezeParams.frozen)}),e.appCallParams){const{onComplete:t}=e.appCallParams;if(!$t(t))throw new Error(`Invalid onCompletion value: ${t}`);this.applicationCall={appIndex:k(e.appCallParams.appIndex),onComplete:t,numLocalInts:S(e.appCallParams.numLocalInts??0),numLocalByteSlices:S(e.appCallParams.numLocalByteSlices??0),numGlobalInts:S(e.appCallParams.numGlobalInts??0),numGlobalByteSlices:S(e.appCallParams.numGlobalByteSlices??0),extraPages:S(e.appCallParams.extraPages??0),approvalProgram:en(e.appCallParams.approvalProgram??new Uint8Array),clearProgram:en(e.appCallParams.clearProgram??new Uint8Array),appArgs:an(e.appCallParams.appArgs??[]).map(en),accounts:an(e.appCallParams.accounts??[]).map(Xt),foreignApps:an(e.appCallParams.foreignApps??[]).map(k),foreignAssets:an(e.appCallParams.foreignAssets??[]).map(k),boxes:an(e.appCallParams.boxes??[]).map(on),access:an(e.appCallParams.access??[]).map(hn),rejectVersion:S(e.appCallParams.rejectVersion??0)}}if(e.stateProofParams&&(this.stateProof={stateProofType:S(e.stateProofParams.stateProofType??0),stateProof:e.stateProofParams.stateProof,message:e.stateProofParams.message}),e.heartbeatParams&&(this.heartbeat=new Jt({address:e.heartbeatParams.address,proof:e.heartbeatParams.proof,seed:e.heartbeatParams.seed,voteID:e.heartbeatParams.voteID,keyDilution:e.heartbeatParams.keyDilution,challengeDiscount:e.heartbeatParams.challengeDiscount})),this.fee=k(e.suggestedParams.fee),!nn(e.suggestedParams.flatFee??!1)){const t=k(e.suggestedParams.minFee);this.fee*=BigInt(this.estimateSize()),this.fee<t&&(this.fee=t)}}getEncodingSchema(){return un.encodingSchema}toEncodingData(){const e=new Map([["type",this.type],["fv",this.firstValid],["lv",this.lastValid],["snd",this.sender],["gen",this.genesisID],["gh",this.genesisHash],["fee",this.fee],["note",this.note],["lx",this.lease],["rekey",this.rekeyTo],["grp",this.group]]);if(this.payment)return e.set("amt",this.payment.amount),e.set("rcv",this.payment.receiver),e.set("close",this.payment.closeRemainderTo),e;if(this.keyreg)return e.set("votekey",this.keyreg.voteKey),e.set("selkey",this.keyreg.selectionKey),e.set("sprfkey",this.keyreg.stateProofKey),e.set("votefst",this.keyreg.voteFirst),e.set("votelst",this.keyreg.voteLast),e.set("votekd",this.keyreg.voteKeyDilution),e.set("nonpart",this.keyreg.nonParticipation),e;if(this.assetConfig){e.set("caid",this.assetConfig.assetIndex);const t=new Map([["t",this.assetConfig.total],["dc",this.assetConfig.decimals],["df",this.assetConfig.defaultFrozen],["m",this.assetConfig.manager],["r",this.assetConfig.reserve],["f",this.assetConfig.freeze],["c",this.assetConfig.clawback],["un",this.assetConfig.unitName],["an",this.assetConfig.assetName],["au",this.assetConfig.assetURL],["am",this.assetConfig.assetMetadataHash]]);return e.set("apar",t),e}if(this.assetTransfer)return e.set("xaid",this.assetTransfer.assetIndex),e.set("aamt",this.assetTransfer.amount),e.set("arcv",this.assetTransfer.receiver),e.set("aclose",this.assetTransfer.closeRemainderTo),e.set("asnd",this.assetTransfer.assetSender),e;if(this.assetFreeze)return e.set("faid",this.assetFreeze.assetIndex),e.set("afrz",this.assetFreeze.frozen),e.set("fadd",this.assetFreeze.freezeAccount),e;if(this.applicationCall)return e.set("apid",this.applicationCall.appIndex),e.set("apan",this.applicationCall.onComplete),e.set("apaa",this.applicationCall.appArgs),e.set("apat",this.applicationCall.accounts),e.set("apas",this.applicationCall.foreignAssets),e.set("apfa",this.applicationCall.foreignApps),e.set("apbx",function(e,t,n){const a=BigInt(n),i=t.map(BigInt);return e.map(e=>function(e,t,n){const a=BigInt(e.appIndex),i=e.name,r=a===BigInt(0)||a===n,o=t.indexOf(a)+1;if(0===o&&!r)throw new Error(`Box ref with appId ${a} not in foreign-apps`);return new Map([["i",o],["n",i]])}(e,i,a))}(this.applicationCall.boxes,this.applicationCall.foreignApps,this.applicationCall.appIndex)),e.set("al",function(e,t){const n=[];function a(e){for(let t=0;t<n.length;t++){const a=n[t],i=a.get("d");if((!e.address&&!i||e.address&&i&&e.address.equals(i))&&a.get("s")===e.assetIndex&&a.get("p")===e.appIndex)return t+1}return e.address&&n.push(new Map([["d",e.address]])),e.assetIndex&&n.push(new Map([["s",e.assetIndex]])),e.appIndex&&n.push(new Map([["p",e.appIndex]])),n.length}const i=ut.zeroAddress();for(const r of t)if(r.address||r.assetIndex||r.appIndex)a(r);else{if(r.holding){const e=r.holding;let t=0;e.address&&!e.address.equals(i)&&(t=a({address:e.address}));const o=a({assetIndex:e.assetIndex});n.push(new Map([["h",new Map([["d",t],["s",o]])]]));continue}if(r.locals){const t=r.locals;let o=0;t.address&&!t.address.equals(i)&&(o=a({address:t.address}));let s=0;t.appIndex&&BigInt(t.appIndex)!==e&&(s=a({appIndex:t.appIndex})),n.push(new Map([["l",new Map([["d",o],["p",s]])]]));continue}if(r.box){const t=r.box;let i=0;t.appIndex&&BigInt(t.appIndex)!==e&&(i=a({appIndex:t.appIndex})),n.push(new Map([["b",new Map([["i",i],["n",t.name]])]]));continue}n.push(new Map)}return n}(this.applicationCall.appIndex,this.applicationCall.access)),e.set("apap",this.applicationCall.approvalProgram),e.set("apsu",this.applicationCall.clearProgram),e.set("apls",new Map([["nui",this.applicationCall.numLocalInts],["nbs",this.applicationCall.numLocalByteSlices]])),e.set("apgs",new Map([["nui",this.applicationCall.numGlobalInts],["nbs",this.applicationCall.numGlobalByteSlices]])),e.set("apep",this.applicationCall.extraPages),e.set("aprv",this.applicationCall.rejectVersion),e;if(this.stateProof)return e.set("sptype",this.stateProof.stateProofType),e.set("sp",this.stateProof.stateProof?this.stateProof.stateProof.toEncodingData():void 0),e.set("spmsg",this.stateProof.message?this.stateProof.message.toEncodingData():void 0),e;if(this.heartbeat){const t=new Jt({address:this.heartbeat.address,proof:this.heartbeat.proof,seed:this.heartbeat.seed,voteID:this.heartbeat.voteID,keyDilution:this.heartbeat.keyDilution,challengeDiscount:this.heartbeat.challengeDiscount});return e.set("hb",t.toEncodingData()),e}throw new Error(`Unexpected transaction type: ${this.type}`)}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t={minFee:BigInt(0),flatFee:!0,fee:e.get("fee")??0,firstValid:e.get("fv")??0,lastValid:e.get("lv")??0,genesisHash:e.get("gh"),genesisID:e.get("gen")},n=e.get("type");if(!Ut(n))throw new Error(`Unrecognized transaction type: ${n}`);const a={type:n,sender:e.get("snd")??ut.zeroAddress(),note:e.get("note"),lease:e.get("lx"),suggestedParams:t};if(e.get("rekey")&&(a.rekeyTo=e.get("rekey")),a.type===Bt.pay){const t={amount:e.get("amt")??0,receiver:e.get("rcv")??ut.zeroAddress()};e.get("close")&&(t.closeRemainderTo=e.get("close")),a.paymentParams=t}else if(a.type===Bt.keyreg){const t={voteKey:e.get("votekey"),selectionKey:e.get("selkey"),stateProofKey:e.get("sprfkey"),voteFirst:e.get("votefst"),voteLast:e.get("votelst"),voteKeyDilution:e.get("votekd"),nonParticipation:e.get("nonpart")};a.keyregParams=t}else if(a.type===Bt.acfg){const t={assetIndex:e.get("caid")};if(e.get("apar")){const n=e.get("apar");t.total=n.get("t"),t.decimals=n.get("dc"),t.defaultFrozen=n.get("df"),t.unitName=n.get("un"),t.assetName=n.get("an"),t.assetURL=n.get("au"),t.assetMetadataHash=n.get("am"),n.get("m")&&(t.manager=n.get("m")),n.get("r")&&(t.reserve=n.get("r")),n.get("f")&&(t.freeze=n.get("f")),n.get("c")&&(t.clawback=n.get("c"))}a.assetConfigParams=t}else if(a.type===Bt.axfer){const t={assetIndex:e.get("xaid")??0,amount:e.get("aamt")??0,receiver:e.get("arcv")??ut.zeroAddress()};e.get("aclose")&&(t.closeRemainderTo=e.get("aclose")),e.get("asnd")&&(t.assetSender=e.get("asnd")),a.assetTransferParams=t}else if(a.type===Bt.afrz){const t={assetIndex:e.get("faid")??0,freezeTarget:e.get("fadd")??ut.zeroAddress(),frozen:e.get("afrz")??!1};a.assetFreezeParams=t}else if(a.type===Bt.appl){const t={appIndex:e.get("apid")??0,onComplete:S(e.get("apan")??0),appArgs:e.get("apaa"),accounts:e.get("apat"),foreignAssets:e.get("apas"),foreignApps:e.get("apfa"),approvalProgram:e.get("apap"),clearProgram:e.get("apsu"),extraPages:e.get("apep"),rejectVersion:e.get("aprv")??0},n=e.get("apls");n&&(t.numLocalInts=n.get("nui"),t.numLocalByteSlices=n.get("nbs"));const i=e.get("apgs");i&&(t.numGlobalInts=i.get("nui"),t.numGlobalByteSlices=i.get("nbs"));const r=e.get("apbx");r&&(t.boxes=r.map(e=>{const n=S(e.get("i")??0),a=en(e.get("n")??new Uint8Array);if(0===n)return{appIndex:0,name:a};if(!t.foreignApps||n>t.foreignApps.length)throw new Error(`Cannot find foreign app index ${n} in ${t.foreignApps}`);return{appIndex:t.foreignApps[n-1],name:a}}));const o=e.get("al");o&&(t.access=function(e){const t=[];for(const n of e){const a=n.get("d"),i=n.get("s"),r=n.get("p");if(a){t.push({address:a});continue}if(i){t.push({assetIndex:i});continue}if(r){t.push({appIndex:r});continue}const o=n.get("h");if(o){const n=S(o.get("d")??0),a=S(o.get("s"));if(!a)throw new Error(`Holding missing asset index: ${o}`);const i=0===n?ut.zeroAddress():e[n-1].get("d"),r=e[a-1].get("s");t.push({holding:{address:i,assetIndex:r}});continue}const s=n.get("l");if(s){const n=S(s.get("d")??0),a=S(s.get("p")??0),i=0===n?ut.zeroAddress():e[n-1].get("d"),r=0===a?BigInt(0):e[a-1].get("p");t.push({locals:{address:i,appIndex:r}});continue}const c=n.get("b");if(c){const n=S(c.get("i")??0),a=c.get("n");if(!a)throw new Error(`Box missing name: ${c}`);const i=0===n?BigInt(0):e[n-1].get("p");t.push({box:{appIndex:i,name:a}});continue}t.push({box:{appIndex:BigInt(0),name:new Uint8Array(0)}})}return t}(o)),a.appCallParams=t}else if(a.type===Bt.stpf){const t={stateProofType:e.get("sptype"),stateProof:e.get("sp")?Ht.fromEncodingData(e.get("sp")):void 0,message:e.get("spmsg")?jt.fromEncodingData(e.get("spmsg")):void 0};a.stateProofParams=t}else{if(a.type!==Bt.hb){const e=a.type;throw new Error(`Unexpected transaction type: ${e}`)}{const t=Jt.fromEncodingData(e.get("hb")),n={address:t.address,proof:t.proof,seed:t.seed,voteID:t.voteID,keyDilution:t.keyDilution,challengeDiscount:t.challengeDiscount};a.heartbeatParams=n}}const i=new un(a);if(e.get("grp")){const t=en(e.get("grp"));if(32!==t.byteLength)throw new Error(`Invalid group length: ${t.byteLength}`);i.group=t}return i}estimateSize(){return this.toByte().length+75}bytesToSign(){const e=this.toByte();return y(dn,e)}toByte(){return Te(this)}rawSignTxn(e){return Ke(this.bytesToSign(),e)}signTxn(e){const t=ze(e),n=new ut(t.publicKey),a=this.rawSignTxn(e);return this.attachSignature(n,a)}attachSignature(e,t){if(!Fe(t.length))throw new Error("Invalid signature length");const n=new Map([["sig",t],["txn",this.toEncodingData()]]),a=Xt(e);return this.sender.equals(a)||n.set("sgnr",a),fe(new At(xt([{key:"txn",valueSchema:un.encodingSchema},{key:"sig",valueSchema:new Et(64)},{key:"sgnr",valueSchema:new Vt(new vt)}])).prepareMsgpack(n))}rawTxID(){const e=this.toByte(),t=y(dn,e);return Uint8Array.from(_e(t))}txID(){const e=this.rawTxID();return Ue().encode(e).slice(0,52)}}function ln(e){return Te(e)}function gn(e){return Ie(e,un)}un.encodingSchema=new At(xt([{key:"type",valueSchema:new Re},{key:"snd",valueSchema:new vt},{key:"lv",valueSchema:new Be},{key:"gen",valueSchema:new Vt(new Re)},{key:"gh",valueSchema:new Vt(new Et(32))},{key:"fee",valueSchema:new Be},{key:"fv",valueSchema:new Be},{key:"note",valueSchema:new St},{key:"lx",valueSchema:new Vt(new Et(32))},{key:"rekey",valueSchema:new Vt(new vt)},{key:"grp",valueSchema:new Vt(new Et(32))},{key:"amt",valueSchema:new Vt(new Be)},{key:"rcv",valueSchema:new Vt(new vt)},{key:"close",valueSchema:new Vt(new vt)},{key:"votekey",valueSchema:new Vt(new Et(32))},{key:"selkey",valueSchema:new Vt(new Et(32))},{key:"sprfkey",valueSchema:new Vt(new Et(64))},{key:"votefst",valueSchema:new Vt(new Be)},{key:"votelst",valueSchema:new Vt(new Be)},{key:"votekd",valueSchema:new Vt(new Be)},{key:"nonpart",valueSchema:new Vt(new Ve)},{key:"caid",valueSchema:new Vt(new Be)},{key:"apar",valueSchema:new Vt(new At(xt([{key:"t",valueSchema:new Be},{key:"dc",valueSchema:new Be},{key:"df",valueSchema:new Ve},{key:"m",valueSchema:new Vt(new vt)},{key:"r",valueSchema:new Vt(new vt)},{key:"f",valueSchema:new Vt(new vt)},{key:"c",valueSchema:new Vt(new vt)},{key:"un",valueSchema:new Vt(new Re)},{key:"an",valueSchema:new Vt(new Re)},{key:"au",valueSchema:new Vt(new Re)},{key:"am",valueSchema:new Vt(new Et(32))}])))},{key:"xaid",valueSchema:new Vt(new Be)},{key:"aamt",valueSchema:new Vt(new Be)},{key:"arcv",valueSchema:new Vt(new vt)},{key:"aclose",valueSchema:new Vt(new vt)},{key:"asnd",valueSchema:new Vt(new vt)},{key:"faid",valueSchema:new Vt(new Be)},{key:"afrz",valueSchema:new Vt(new Ve)},{key:"fadd",valueSchema:new Vt(new vt)},{key:"apid",valueSchema:new Vt(new Be)},{key:"apan",valueSchema:new Vt(new Be)},{key:"apaa",valueSchema:new Vt(new bt(new St))},{key:"apat",valueSchema:new Vt(new bt(new vt))},{key:"apas",valueSchema:new Vt(new bt(new Be))},{key:"apfa",valueSchema:new Vt(new bt(new Be))},{key:"apbx",valueSchema:new Vt(new bt(new At(xt([{key:"i",valueSchema:new Be},{key:"n",valueSchema:new St}]))))},{key:"al",valueSchema:new Vt(new bt(new At(xt([{key:"d",valueSchema:new Vt(new vt)},{key:"s",valueSchema:new Vt(new Be)},{key:"p",valueSchema:new Vt(new Be)},{key:"h",valueSchema:new Vt(new At(xt([{key:"d",valueSchema:new Be},{key:"s",valueSchema:new Be}])))},{key:"l",valueSchema:new Vt(new At(xt([{key:"d",valueSchema:new Be},{key:"p",valueSchema:new Be}])))},{key:"b",valueSchema:new Vt(new At(xt([{key:"i",valueSchema:new Be},{key:"n",valueSchema:new St}])))}]))))},{key:"apap",valueSchema:new Vt(new St)},{key:"apsu",valueSchema:new Vt(new St)},{key:"apls",valueSchema:new Vt(new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}])))},{key:"apgs",valueSchema:new Vt(new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}])))},{key:"apep",valueSchema:new Vt(new Be)},{key:"aprv",valueSchema:new Vt(new Be)},{key:"sptype",valueSchema:new Vt(new Be)},{key:"sp",valueSchema:new Vt(Ht.encodingSchema)},{key:"spmsg",valueSchema:new Vt(jt.encodingSchema)},{key:"hb",valueSchema:new Vt(Jt.encodingSchema)}]));const mn=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),pn="invalid multisig version",fn="bad multisig threshold",yn="bad multisig public key - wrong length",wn="nacl public key length is not 32 bytes";function vn(e){return e.map(e=>"string"==typeof e?ut.fromString(e).publicKey:e.publicKey)}function Sn({version:e,threshold:t,pks:n}){if(1!==e||e>255||e<0)throw new Error(pn);if(0===t||0===n.length||t>n.length||t>255)throw new Error(fn);const a=at-it;if(a!==Ge)throw new Error(wn);const i=new Uint8Array(mn.length+2+a*n.length);i.set(mn,0),i.set([e],mn.length),i.set([t],mn.length+1);for(let e=0;e<n.length;e++){if(n[e].length!==a)throw new Error(yn);i.set(n[e],mn.length+2+e*a)}return new ut(Uint8Array.from(_e(i)))}function En(e,t,n){const a=t.v,i=t.thr,r=t.subsig,o=r.map(e=>e.pk);if(t.subsig.length<i)return!1;let s;try{s=Sn({version:a,threshold:i,pks:o}).publicKey}catch(e){return!1}if(!f(s,n))return!1;let c=0;for(const e of r)void 0!==e.s&&(c+=1);if(c<i)return!1;let h=0;for(const t of r)void 0!==t.s&&je(e,t.s,t.pk)&&(h+=1);return!(h<i)}function kn({version:e,threshold:t,addrs:n}){return function({version:e,threshold:t,addrs:n}){return Sn({version:e,threshold:t,pks:vn(n)})}({version:e,threshold:t,addrs:n})}const bn=new At(xt([{key:"pk",valueSchema:new Et(32)},{key:"s",valueSchema:new Vt(new Et(64))}]));function xn(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedSubsig: ${e}`);const t={pk:e.get("pk")};return e.get("s")&&(t.s=e.get("s")),t}function An(e){const t=new Map([["pk",e.pk]]);return e.s&&t.set("s",e.s),t}const Dn=new At(xt([{key:"v",valueSchema:new Be},{key:"thr",valueSchema:new Be},{key:"subsig",valueSchema:new bt(bn)}]));function In(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedMultiSig: ${e}`);return{v:S(e.get("v")),thr:S(e.get("thr")),subsig:e.get("subsig").map(xn)}}function Tn(e){return new Map([["v",e.v],["thr",e.thr],["subsig",e.subsig.map(An)]])}const Pn=new At(xt([{key:"sch",valueSchema:new St},{key:"slt",valueSchema:new Be},{key:"pk",valueSchema:new St},{key:"sig",valueSchema:new St}]));function Mn(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedPQSig: ${e}`);const t=e.get("sch");if(t.length!==ct)throw new Error(`Invalid decoded EncodedPQSig: expected a ${ct}-byte scheme, got ${t.length} bytes`);const n=S(e.get("slt"));if(n>ht)throw new Error(`Invalid decoded EncodedPQSig: salt ${n} exceeds the maximum of ${ht}`);return{sch:t,slt:n,pk:e.get("pk"),sig:e.get("sig")}}function Vn(e){return new Map([["sch",e.sch],["slt",e.slt],["pk",e.pk],["sig",e.sig]])}const Rn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;function Bn(e){if(!e||0===e.length)throw new Error("empty program");const t="\n".charCodeAt(0),n=" ".charCodeAt(0),a="~".charCodeAt(0);if(e.every(e=>e===t||(e=>n<=e&&e<=a)(e))){const t=(new TextDecoder).decode(e);if(gt(t))throw new Error("requesting program bytes, get Algorand address");if(Rn.test(t))throw new Error("program should not be b64 encoded");throw new Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}const Cn=(new TextEncoder).encode("Program"),Un=(new TextEncoder).encode("PQProgram"),$n=(new TextEncoder).encode("MsigProgram");class On{constructor(e,t){if(t&&(!Array.isArray(t)||!t.every(e=>e.constructor===Uint8Array)))throw new TypeError("Invalid arguments");let n=[];null!=t&&(n=t.map(e=>new Uint8Array(e))),Bn(e),this.logic=e,this.args=n,this.sig=void 0,this.msig=void 0,this.lmsig=void 0,this.pqsig=void 0}getEncodingSchema(){return On.encodingSchema}toEncodingData(){const e=new Map([["l",this.logic],["arg",this.args],["sig",this.sig]]);return this.msig&&e.set("msig",Tn(this.msig)),this.lmsig&&e.set("lmsig",Tn(this.lmsig)),this.pqsig&&e.set("pqsig",Vn(this.pqsig)),e}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig: ${e}`);const t=new On(e.get("l"),e.get("arg"));return t.sig=e.get("sig"),e.get("msig")&&(t.msig=In(e.get("msig"))),e.get("lmsig")&&(t.lmsig=In(e.get("lmsig"))),e.get("pqsig")&&(t.pqsig=Mn(e.get("pqsig"))),t}verify(e){if([this.sig,this.msig,this.lmsig,this.pqsig].filter(Boolean).length>1)return!1;try{Bn(this.logic)}catch(e){return!1}const t=y(Cn,this.logic);if(!(this.sig||this.msig||this.lmsig||this.pqsig))return f(_e(t),e);if(this.pqsig)return!1;if(this.sig)return je(t,this.sig,e);if(this.lmsig){const t=Sn({version:this.lmsig.v,threshold:this.lmsig.thr,pks:this.lmsig.subsig.map(e=>e.pk)});return En(y($n,t.publicKey,this.logic),this.lmsig,e)}return!!this.msig&&En(t,this.msig,e)}address(){const e=_e(y(Cn,this.logic));return new ut(Uint8Array.from(e))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{const n=vn(t.addrs).map(e=>({pk:e}));this.lmsig={v:t.version,thr:t.threshold,subsig:n};const[a,i]=this.singleSignMultisig(e,this.lmsig);this.lmsig.subsig[i].s=a}}async signWithSigner(e,t){const n=await e(this,t);if(null==t){if("pqsig"in n&&n.pqsig)return this.clearSignatures(),this.pqsig=n.pqsig,n.address;if(!("sig"in n)||!n.sig)throw Error("Expected DelegatedLsigSigner to return sig or pqsig, but both are undefined. If signing for an msig, be sure to pass the msig argument");this.clearSignatures(),this.sig=n.sig}else{if(!("lmsig"in n)||!n.lmsig)throw Error("Expected DelegatedLsigSigner to return lmsig, but lmsig is undefined. If signing for a single account, do not pass msig argument");const{lmsig:e}=n,a=vn(t.addrs);if(e.v!==t.version||e.thr!==t.threshold||e.subsig.length!==a.length||!e.subsig.every((e,t)=>f(e.pk,a[t])))throw Error("DelegatedLsigSigner returned an lmsig whose version, threshold or public keys do not match the requested multisig");this.clearSignatures(),this.lmsig=n.lmsig}return n.address}clearSignatures(){this.sig=void 0,this.msig=void 0,this.lmsig=void 0,this.pqsig=void 0}appendToMultisig(e){if(void 0===this.lmsig)throw new Error("no multisig present");const[t,n]=this.singleSignMultisig(e,this.lmsig);this.lmsig.subsig[n].s=t}async appendToMultisigWithSigner(e){if(void 0===this.lmsig)throw new Error("no multisig present");const t=await e(this,{version:this.lmsig.v,threshold:this.lmsig.thr,addrs:this.lmsig.subsig.map(e=>new ut(e.pk))});if(!("lmsig"in t)||!t.lmsig)throw Error("Expected DelegatedLsigSigner to return lmsig, but lmsig is undefined");if(t.lmsig.v!==this.lmsig.v||t.lmsig.thr!==this.lmsig.thr)throw Error("DelegatedLsigSigner returned an lmsig whose version or threshold does not match the current msig");let n=!1;for(const e of t.lmsig.subsig)if(e.s){n=!0;const t=this.lmsig.subsig.find(t=>f(t.pk,e.pk));if(void 0===t)throw Error(`DelegatedLsigSigner returned a signature for ${new ut(e.pk)} but this pk is not in the current msig`);if(t.s&&!f(t.s,e.s))throw Error(`DelegatedLsigSigner returned a signature for ${new ut(e.pk)} that conflicts with the signature already collected for it`);t.s=e.s}if(!n)throw Error("DelegatedLsigSigner returned an lmsig with no signatures")}signProgram(e){return Ke(y(Cn,this.logic),e)}signProgramMultisig(e,t){const n=Sn({version:t.v,threshold:t.thr,pks:t.subsig.map(e=>e.pk)});return Ke(y($n,n.publicKey,this.logic),e)}singleSignMultisig(e,t){let n=-1;const a=ze(e).publicKey;for(let e=0;e<t.subsig.length;e++){const{pk:i}=t.subsig[e];if(f(i,a)){n=e;break}}if(-1===n)throw new Error("invalid secret key");return[this.signProgramMultisig(e,t),n]}toByte(){return Te(this)}static fromByte(e){return Ie(e,On)}async signDataWithSigner(e,t){return e(t,this)}}On.encodingSchema=new At(xt([{key:"l",valueSchema:new St},{key:"arg",valueSchema:new bt(new St)},{key:"sig",valueSchema:new Vt(new Et(64))},{key:"msig",valueSchema:new Vt(Dn)},{key:"lmsig",valueSchema:new Vt(Dn)},{key:"pqsig",valueSchema:new Vt(Pn)}]));class Nn{constructor(e,t){this.lsig=new On(e,t),this.sigkey=void 0}getEncodingSchema(){return Nn.encodingSchema}toEncodingData(){return new Map([["lsig",this.lsig.toEncodingData()],["sigkey",this.sigkey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t=e,n=On.fromEncodingData(t.get("lsig")),a=new Nn(n.logic,n.args);return a.lsig=n,a.sigkey=t.get("sigkey"),a}toByte(){return Te(this)}static fromByte(e){return Ie(e,Nn)}isDelegated(){return!!(this.lsig.sig||this.lsig.msig||this.lsig.lmsig||this.lsig.pqsig)}verify(){const e=this.address();return this.lsig.verify(e.publicKey)}address(){if([this.lsig.sig,this.lsig.msig,this.lsig.lmsig,this.lsig.pqsig].filter(Boolean).length>1)throw new Error("LogicSig has too many signatures. At most one of sig, msig, lmsig, or pqsig may be present");if(this.lsig.pqsig){const e=wt(this.lsig.pqsig);if(this.sigkey&&!f(this.sigkey,e.publicKey))throw new Error(`Signing key for delegated account does not match the PQ signature. The signature authorizes ${e}, but sigkey is ${new ut(this.sigkey)}`);return e}if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return new ut(this.sigkey)}const e=this.lsig.lmsig||this.lsig.msig;return e?Sn({version:e.v,threshold:e.thr,pks:e.subsig.map(e=>e.pk)}):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}async signMultisigWithSigner(e,t){await this.lsig.signWithSigner(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}async appendToMultisigWithSigner(e){await this.lsig.appendToMultisigWithSigner(e)}sign(e){this.lsig.sign(e),this.sigkey=ze(e).publicKey}async signWithSigner(e){const t=await this.lsig.signWithSigner(e);this.sigkey=t.publicKey}}function Ln(e){return Ie(e,On)}Nn.encodingSchema=new At(xt([{key:"lsig",valueSchema:On.encodingSchema},{key:"sigkey",valueSchema:new Vt(new Et(32))}]));const _n=(new TextEncoder).encode("ProgData");function qn(e,t,n){const a=y(("string"==typeof n?ut.fromString(n):n).publicKey,t);return Ke(y(_n,a),e)}function Fn(e,t,n,a){const i=y(("string"==typeof t?ut.fromString(t):t).publicKey,e);return je(y(_n,i),n,a)}function zn(e,t,n){return qn(e,t,new On(n).address())}class Kn{constructor({txn:e,sig:t,msig:n,lsig:a,pqsig:i,sgnr:r}){this.txn=e,this.sig=t,this.msig=n,this.lsig=a,this.pqsig=i,this.sgnr=r;let o=0;if(t&&(o+=1),n&&(o+=1),a&&(o+=1),i&&(o+=1),o>1)throw new Error(`SignedTransaction must not have more than 1 signature. Got ${o}`)}getEncodingSchema(){return Kn.encodingSchema}toEncodingData(){return new Map([["txn",this.txn.toEncodingData()],["sig",this.sig],["msig",this.msig?Tn(this.msig):void 0],["lsig",this.lsig?this.lsig.toEncodingData():void 0],["pqsig",this.pqsig?Vn(this.pqsig):void 0],["sgnr",this.sgnr]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTransaction: ${e}`);return new Kn({txn:un.fromEncodingData(e.get("txn")),sig:e.get("sig"),msig:e.get("msig")?In(e.get("msig")):void 0,lsig:e.get("lsig")?On.fromEncodingData(e.get("lsig")):void 0,pqsig:e.get("pqsig")?Mn(e.get("pqsig")):void 0,sgnr:e.get("sgnr")})}}function Hn(e){return Ie(e,Kn)}function jn(e){return Te(new Kn({txn:e}))}Kn.encodingSchema=new At(xt([{key:"txn",valueSchema:un.encodingSchema},{key:"sig",valueSchema:new Vt(new Et(64))},{key:"msig",valueSchema:new Vt(Dn)},{key:"lsig",valueSchema:new Vt(On.encodingSchema)},{key:"pqsig",valueSchema:new Vt(Pn)},{key:"sgnr",valueSchema:new Vt(new vt)}]));class Gn{constructor(e){this.stateProofVotersCommitment=e.stateProofVotersCommitment,this.stateProofOnlineTotalWeight=e.stateProofOnlineTotalWeight,this.stateProofNextRound=e.stateProofNextRound}getEncodingSchema(){return Gn.encodingSchema}toEncodingData(){return new Map([["v",this.stateProofVotersCommitment],["t",this.stateProofOnlineTotalWeight],["n",this.stateProofNextRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTrackingData: ${e}`);return new Gn({stateProofVotersCommitment:e.get("v"),stateProofOnlineTotalWeight:e.get("t"),stateProofNextRound:e.get("n")})}}Gn.encodingSchema=new At(xt([{key:"v",valueSchema:new St},{key:"t",valueSchema:new Be},{key:"n",valueSchema:new Be}]));class Jn{constructor(e){this.nativeSha512_256Commitment=e.nativeSha512_256Commitment,this.sha256Commitment=e.sha256Commitment,this.sha512Commitment=e.sha512Commitment??new Uint8Array(64)}getEncodingSchema(){return Jn.encodingSchema}toEncodingData(){return new Map([["txn",this.nativeSha512_256Commitment],["txn256",this.sha256Commitment],["txn512",this.sha512Commitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TxnCommitments: ${e}`);return new Jn({nativeSha512_256Commitment:e.get("txn"),sha256Commitment:e.get("txn256"),sha512Commitment:e.get("txn512")})}}Jn.encodingSchema=new At(xt([{key:"txn",valueSchema:new Et(32)},{key:"txn256",valueSchema:new Et(32)},{key:"txn512",valueSchema:new Et(64)}]));class Wn{constructor(e){this.feeSink=e.feeSink,this.rewardsPool=e.rewardsPool,this.rewardsLevel=e.rewardsLevel,this.rewardsRate=e.rewardsRate,this.rewardsResidue=e.rewardsResidue,this.rewardsRecalculationRound=e.rewardsRecalculationRound}getEncodingSchema(){return Wn.encodingSchema}toEncodingData(){return new Map([["fees",this.feeSink],["rwd",this.rewardsPool],["earn",this.rewardsLevel],["rate",this.rewardsRate],["frac",this.rewardsResidue],["rwcalr",this.rewardsRecalculationRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded RewardState: ${e}`);return new Wn({feeSink:e.get("fees"),rewardsPool:e.get("rwd"),rewardsLevel:e.get("earn"),rewardsRate:e.get("rate"),rewardsResidue:e.get("frac"),rewardsRecalculationRound:e.get("rwcalr")})}}Wn.encodingSchema=new At(xt([{key:"fees",valueSchema:new vt},{key:"rwd",valueSchema:new vt},{key:"earn",valueSchema:new Be},{key:"rate",valueSchema:new Be},{key:"frac",valueSchema:new Be},{key:"rwcalr",valueSchema:new Be}]));class Yn{constructor(e){this.currentProtocol=e.currentProtocol,this.nextProtocol=e.nextProtocol,this.nextProtocolApprovals=e.nextProtocolApprovals,this.nextProtocolVoteBefore=e.nextProtocolVoteBefore,this.nextProtocolSwitchOn=e.nextProtocolSwitchOn}getEncodingSchema(){return Yn.encodingSchema}toEncodingData(){return new Map([["proto",this.currentProtocol],["nextproto",this.nextProtocol],["nextyes",this.nextProtocolApprovals],["nextbefore",this.nextProtocolVoteBefore],["nextswitch",this.nextProtocolSwitchOn]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeState: ${e}`);return new Yn({currentProtocol:e.get("proto"),nextProtocol:e.get("nextproto"),nextProtocolApprovals:e.get("nextyes"),nextProtocolVoteBefore:e.get("nextbefore"),nextProtocolSwitchOn:e.get("nextswitch")})}}Yn.encodingSchema=new At(xt([{key:"proto",valueSchema:new Re},{key:"nextproto",valueSchema:new Re},{key:"nextyes",valueSchema:new Be},{key:"nextbefore",valueSchema:new Be},{key:"nextswitch",valueSchema:new Be}]));class Xn{constructor(e){this.upgradePropose=e.upgradePropose,this.upgradeDelay=e.upgradeDelay,this.upgradeApprove=e.upgradeApprove}getEncodingSchema(){return Xn.encodingSchema}toEncodingData(){return new Map([["upgradeprop",this.upgradePropose],["upgradedelay",this.upgradeDelay],["upgradeyes",this.upgradeApprove]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeVote: ${e}`);return new Xn({upgradePropose:e.get("upgradeprop"),upgradeDelay:e.get("upgradedelay"),upgradeApprove:e.get("upgradeyes")})}}Xn.encodingSchema=new At(xt([{key:"upgradeprop",valueSchema:new Re},{key:"upgradedelay",valueSchema:new Be},{key:"upgradeyes",valueSchema:new Ve}]));class Qn{constructor(e){this.expiredParticipationAccounts=e.expiredParticipationAccounts,this.absentParticipationAccounts=e.absentParticipationAccounts}getEncodingSchema(){return Qn.encodingSchema}toEncodingData(){return new Map([["partupdrmv",this.expiredParticipationAccounts],["partupdabs",this.absentParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new Qn({expiredParticipationAccounts:e.get("partupdrmv"),absentParticipationAccounts:e.get("partupdabs")})}}Qn.encodingSchema=new At(xt([{key:"partupdrmv",valueSchema:new bt(new vt)},{key:"partupdabs",valueSchema:new bt(new vt)}]));class Zn{constructor(e){this.round=e.round,this.branch=e.branch,this.branch512=e.branch512??new Uint8Array(64),this.seed=e.seed,this.txnCommitments=e.txnCommitments,this.timestamp=e.timestamp,this.genesisID=e.genesisID,this.genesisHash=e.genesisHash,this.proposer=e.proposer,this.feesCollected=e.feesCollected,this.bonus=e.bonus,this.proposerPayout=e.proposerPayout,this.rewardState=e.rewardState,this.upgradeState=e.upgradeState,this.upgradeVote=e.upgradeVote,this.txnCounter=e.txnCounter,this.stateproofTracking=e.stateproofTracking,this.participationUpdates=e.participationUpdates,this.load=e.load??BigInt(0),this.congestionTax=e.congestionTax??BigInt(0)}getEncodingSchema(){return Zn.encodingSchema}toEncodingData(){return Dt(new Map([["rnd",this.round],["prev",this.branch],["prev512",this.branch512],["seed",this.seed],["ts",this.timestamp],["gen",this.genesisID],["gh",this.genesisHash],["prp",this.proposer],["fc",this.feesCollected],["bi",this.bonus],["pp",this.proposerPayout],["tc",this.txnCounter],["ld",this.load],["ct",this.congestionTax],["spt",It(this.stateproofTracking,(e,t)=>[e,t.toEncodingData()])]]),this.txnCommitments.toEncodingData(),this.rewardState.toEncodingData(),this.upgradeState.toEncodingData(),this.upgradeVote.toEncodingData(),this.participationUpdates.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new Zn({round:e.get("rnd"),branch:e.get("prev"),branch512:e.get("prev512"),seed:e.get("seed"),txnCommitments:Jn.fromEncodingData(e),timestamp:e.get("ts"),genesisID:e.get("gen"),genesisHash:e.get("gh"),proposer:e.get("prp"),feesCollected:e.get("fc"),bonus:e.get("bi"),proposerPayout:e.get("pp"),rewardState:Wn.fromEncodingData(e),upgradeState:Yn.fromEncodingData(e),upgradeVote:Xn.fromEncodingData(e),txnCounter:e.get("tc"),stateproofTracking:It(e.get("spt"),(e,t)=>[Number(e),Gn.fromEncodingData(t)]),participationUpdates:Qn.fromEncodingData(e),load:e.get("ld"),congestionTax:e.get("ct")})}}Zn.encodingSchema=new At(xt([{key:"rnd",valueSchema:new Be},{key:"prev",valueSchema:new class extends De{defaultValue(){return new Uint8Array(32)}isDefaultValue(e){return e instanceof Uint8Array&&32===e.byteLength&&e.every(e=>0===e)}prepareMsgpack(e){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return`blk-${Ue().encode(e).slice(0,52)}`;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e&&56===e.length&&e.startsWith("blk-"))return Uint8Array.from(Ue().decode.asBytes(e.slice(4)));throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}}},{key:"prev512",valueSchema:new Et(64)},{key:"seed",valueSchema:new St},{key:"",valueSchema:Jn.encodingSchema,embedded:!0},{key:"ts",valueSchema:new Be},{key:"gen",valueSchema:new Re},{key:"gh",valueSchema:new Et(32)},{key:"prp",valueSchema:new vt},{key:"fc",valueSchema:new Be},{key:"bi",valueSchema:new Be},{key:"pp",valueSchema:new Be},{key:"",valueSchema:Wn.encodingSchema,embedded:!0},{key:"",valueSchema:Yn.encodingSchema,embedded:!0},{key:"",valueSchema:Xn.encodingSchema,embedded:!0},{key:"tc",valueSchema:new Be},{key:"spt",valueSchema:new Tt(Gn.encodingSchema)},{key:"",valueSchema:Qn.encodingSchema,embedded:!0},{key:"ld",valueSchema:new Be},{key:"ct",valueSchema:new Be}]));class ea{constructor(e){this.action=e.action,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return ea.encodingSchema}toEncodingData(){return new Map([["at",this.action],["bs",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ValueDelta: ${e}`);return new ea({action:Number(e.get("at")),bytes:e.get("bs"),uint:e.get("ui")})}}ea.encodingSchema=new At(xt([{key:"at",valueSchema:new Be},{key:"bs",valueSchema:new kt},{key:"ui",valueSchema:new Be}]));class ta{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"gd",valueSchema:new Vt(new Mt(ea.encodingSchema))},{key:"ld",valueSchema:new Vt(new Tt(new Mt(ea.encodingSchema)))},{key:"sa",valueSchema:new Vt(new bt(new vt))},{key:"lg",valueSchema:new Vt(new bt(new kt))},{key:"itx",valueSchema:new Vt(new bt(aa.encodingSchema))}]))),this.encodingSchemaValue}constructor(e){this.globalDelta=e.globalDelta??new Map,this.localDeltas=e.localDeltas??new Map,this.sharedAccts=e.sharedAccts??[],this.logs=e.logs??[],this.innerTxns=e.innerTxns??[]}getEncodingSchema(){return ta.encodingSchema}toEncodingData(){return new Map([["gd",It(this.globalDelta,(e,t)=>[e,t.toEncodingData()])],["ld",It(this.localDeltas,(e,t)=>[e,It(t,(e,t)=>[e,t.toEncodingData()])])],["sa",this.sharedAccts],["lg",this.logs],["itx",this.innerTxns.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new ta({globalDelta:e.get("gd")?It(e.get("gd"),(e,t)=>[e,ea.fromEncodingData(t)]):void 0,localDeltas:e.get("ld")?It(e.get("ld"),(e,t)=>[Number(e),It(t,(e,t)=>[e,ea.fromEncodingData(t)])]):void 0,sharedAccts:e.get("sa"),logs:e.get("lg"),innerTxns:(e.get("itx")??[]).map(aa.fromEncodingData)})}}class na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"ca",valueSchema:new Vt(new Be)},{key:"aca",valueSchema:new Vt(new Be)},{key:"rs",valueSchema:new Vt(new Be)},{key:"rr",valueSchema:new Vt(new Be)},{key:"rc",valueSchema:new Vt(new Be)},{key:"dt",valueSchema:new Vt(ta.encodingSchema)},{key:"caid",valueSchema:new Vt(new Be)},{key:"apid",valueSchema:new Vt(new Be)}]))),this.encodingSchemaValue}constructor(e){this.closingAmount=e.closingAmount,this.assetClosingAmount=e.assetClosingAmount,this.senderRewards=e.senderRewards,this.receiverRewards=e.receiverRewards,this.closeRewards=e.closeRewards,this.evalDelta=e.evalDelta,this.configAsset=e.configAsset,this.applicationID=e.applicationID}getEncodingSchema(){return na.encodingSchema}toEncodingData(){return new Map([["ca",this.closingAmount],["aca",this.assetClosingAmount],["rs",this.senderRewards],["rr",this.receiverRewards],["rc",this.closeRewards],["dt",this.evalDelta?this.evalDelta.toEncodingData():void 0],["caid",this.configAsset],["apid",this.applicationID]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplyData: ${e}`);return new na({closingAmount:e.get("ca"),assetClosingAmount:e.get("aca"),senderRewards:e.get("rs"),receiverRewards:e.get("rr"),closeRewards:e.get("rc"),evalDelta:e.get("dt")?ta.fromEncodingData(e.get("dt")):void 0,configAsset:e.get("caid"),applicationID:e.get("apid")})}}class aa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries(...xt([{key:"",valueSchema:Kn.encodingSchema,embedded:!0},{key:"",valueSchema:na.encodingSchema,embedded:!0}]))),this.encodingSchemaValue}constructor(e){this.signedTxn=e.signedTxn,this.applyData=e.applyData}getEncodingSchema(){return aa.encodingSchema}toEncodingData(){return Dt(this.signedTxn.toEncodingData(),this.applyData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnWithAD: ${e}`);return new aa({signedTxn:Kn.fromEncodingData(e),applyData:na.fromEncodingData(e)})}}class ia{constructor(e){this.signedTxn=e.signedTxn,this.hasGenesisID=e.hasGenesisID,this.hasGenesisHash=e.hasGenesisHash}getEncodingSchema(){return ia.encodingSchema}toEncodingData(){return Dt(new Map([["hgi",this.hasGenesisID],["hgh",this.hasGenesisHash]]),this.signedTxn.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnInBlock: ${e}`);return new ia({signedTxn:aa.fromEncodingData(e),hasGenesisID:e.get("hgi"),hasGenesisHash:e.get("hgh")})}}ia.encodingSchema=new At(xt([{key:"",valueSchema:aa.encodingSchema,embedded:!0},{key:"hgi",valueSchema:new Ve},{key:"hgh",valueSchema:new Ve}]));class ra{constructor(e){this.header=e.header,this.payset=e.payset}getEncodingSchema(){return ra.encodingSchema}toEncodingData(){const e=new Map([["txns",this.payset.map(e=>e.toEncodingData())]]);return Dt(e,this.header.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new ra({header:Zn.fromEncodingData(e),payset:e.get("txns").map(ia.fromEncodingData)})}}ra.encodingSchema=new At(xt([{key:"",valueSchema:Zn.encodingSchema,embedded:!0},{key:"txns",valueSchema:new bt(ia.encodingSchema)}]));class oa{constructor(e){this.data=e}getEncodingSchema(){return oa.encodingSchema}toEncodingData(){return this.data}static fromEncodingData(e){return new oa(e)}}oa.encodingSchema=new Rt;class sa{constructor(e){this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return sa.encodingSchema}toEncodingData(){return new Map([["tt",this.type],["tb",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new sa({type:Number(e.get("tt")),bytes:e.get("tb"),uint:e.get("ui")})}}sa.encodingSchema=new At(xt([{key:"tt",valueSchema:new Be},{key:"tb",valueSchema:new Vt(new kt)},{key:"ui",valueSchema:new Vt(new Be)}]));class ca{constructor(e){this.numUints=e.numUints,this.numByteSlices=e.numByteSlices}getEncodingSchema(){return ca.encodingSchema}toEncodingData(){return new Map([["nui",this.numUints],["nbs",this.numByteSlices]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new ca({numUints:Number(e.get("nui")),numByteSlices:Number(e.get("nbs"))})}}ca.encodingSchema=new At(xt([{key:"nui",valueSchema:new Be},{key:"nbs",valueSchema:new Be}]));class ha{constructor(e){this.approvalProgram=e.approvalProgram,this.clearStateProgram=e.clearStateProgram,this.globalState=e.globalState,this.localStateSchema=e.localStateSchema,this.globalStateSchema=e.globalStateSchema,this.extraProgramPages=e.extraProgramPages,this.version=e.version??BigInt(0),this.sizeSponsor=e.sizeSponsor??ut.zeroAddress(),this.foreignBoxReads=e.foreignBoxReads??!1,this.familyBoxAccess=e.familyBoxAccess??!1}getEncodingSchema(){return ha.encodingSchema}toEncodingData(){return new Map([["approv",this.approvalProgram],["clearp",this.clearStateProgram],["gs",It(this.globalState,(e,t)=>[e,t.toEncodingData()])],["lsch",this.localStateSchema.toEncodingData()],["gsch",this.globalStateSchema.toEncodingData()],["epp",this.extraProgramPages],["v",this.version],["ss",this.sizeSponsor],["fbr",this.foreignBoxReads],["fba",this.familyBoxAccess]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParams: ${e}`);return new ha({approvalProgram:e.get("approv"),clearStateProgram:e.get("clearp"),globalState:It(e.get("gs"),(e,t)=>[e,sa.fromEncodingData(t)]),localStateSchema:ca.fromEncodingData(e.get("lsch")),globalStateSchema:ca.fromEncodingData(e.get("gsch")),extraProgramPages:Number(e.get("epp")),version:e.get("v"),sizeSponsor:e.get("ss"),foreignBoxReads:e.get("fbr"),familyBoxAccess:e.get("fba")})}}ha.encodingSchema=new At(xt([{key:"approv",valueSchema:new St},{key:"clearp",valueSchema:new St},{key:"gs",valueSchema:new Mt(sa.encodingSchema)},{key:"lsch",valueSchema:ca.encodingSchema},{key:"gsch",valueSchema:ca.encodingSchema},{key:"epp",valueSchema:new Be},{key:"v",valueSchema:new Be},{key:"ss",valueSchema:new vt},{key:"fbr",valueSchema:new Ve},{key:"fba",valueSchema:new Ve}]));class da{constructor(e){this.schema=e.schema,this.keyValue=e.keyValue}getEncodingSchema(){return da.encodingSchema}toEncodingData(){return new Map([["hsch",this.schema.toEncodingData()],["tkv",It(this.keyValue,(e,t)=>[e,t.toEncodingData()])]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalState: ${e}`);return new da({schema:ca.fromEncodingData(e.get("hsch")),keyValue:It(e.get("tkv"),(e,t)=>[e,sa.fromEncodingData(t)])})}}da.encodingSchema=new At(xt([{key:"hsch",valueSchema:ca.encodingSchema},{key:"tkv",valueSchema:new Mt(sa.encodingSchema)}]));class ua{constructor(e){this.localState=e.localState,this.deleted=e.deleted}getEncodingSchema(){return ua.encodingSchema}toEncodingData(){return new Map([["LocalState",this.localState?this.localState.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalStateDelta: ${e}`);return new ua({localState:e.get("LocalState")?da.fromEncodingData(e.get("LocalState")):void 0,deleted:e.get("Deleted")})}}ua.encodingSchema=new At(xt([{key:"LocalState",valueSchema:new Vt(da.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class la{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return la.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParamsDelta: ${e}`);return new la({params:e.get("Params")?ha.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}la.encodingSchema=new At(xt([{key:"Params",valueSchema:new Vt(ha.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class ga{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.state=e.state}getEncodingSchema(){return ga.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["State",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppResourceRecord: ${e}`);return new ga({id:e.get("Aidx"),address:e.get("Addr"),params:la.fromEncodingData(e.get("Params")),state:ua.fromEncodingData(e.get("State"))})}}ga.encodingSchema=new At(xt([{key:"Aidx",valueSchema:new Be},{key:"Addr",valueSchema:new vt},{key:"Params",valueSchema:la.encodingSchema},{key:"State",valueSchema:ua.encodingSchema}]));class ma{constructor(e){this.amount=e.amount,this.frozen=e.frozen}getEncodingSchema(){return ma.encodingSchema}toEncodingData(){return new Map([["a",this.amount],["f",this.frozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new ma({amount:e.get("a"),frozen:e.get("f")})}}ma.encodingSchema=new At(xt([{key:"a",valueSchema:new Be},{key:"f",valueSchema:new Ve}]));class pa{constructor(e){this.holding=e.holding,this.deleted=e.deleted}getEncodingSchema(){return pa.encodingSchema}toEncodingData(){return new Map([["Holding",this.holding?this.holding.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingDelta: ${e}`);return new pa({holding:e.get("Holding")?ma.fromEncodingData(e.get("Holding")):void 0,deleted:e.get("Deleted")})}}pa.encodingSchema=new At(xt([{key:"Holding",valueSchema:new Vt(ma.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class fa{constructor(e){this.total=e.total,this.decimals=e.decimals,this.defaultFrozen=e.defaultFrozen,this.unitName=e.unitName,this.assetName=e.assetName,this.url=e.url,this.metadataHash=e.metadataHash,this.manager=e.manager,this.reserve=e.reserve,this.freeze=e.freeze,this.clawback=e.clawback}getEncodingSchema(){return fa.encodingSchema}toEncodingData(){return new Map([["t",this.total],["dc",this.decimals],["df",this.defaultFrozen],["un",this.unitName],["an",this.assetName],["au",this.url],["am",this.metadataHash],["m",this.manager],["r",this.reserve],["f",this.freeze],["c",this.clawback]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new fa({total:e.get("t"),decimals:e.get("dc"),defaultFrozen:e.get("df"),unitName:e.get("un"),assetName:e.get("an"),url:e.get("au"),metadataHash:e.get("am"),manager:e.get("m"),reserve:e.get("r"),freeze:e.get("f"),clawback:e.get("c")})}}fa.encodingSchema=new At(xt([{key:"t",valueSchema:new Be},{key:"dc",valueSchema:new Be},{key:"df",valueSchema:new Ve},{key:"un",valueSchema:new Vt(new kt)},{key:"an",valueSchema:new Vt(new kt)},{key:"au",valueSchema:new Vt(new kt)},{key:"am",valueSchema:new Et(32)},{key:"m",valueSchema:new Vt(new vt)},{key:"r",valueSchema:new Vt(new vt)},{key:"f",valueSchema:new Vt(new vt)},{key:"c",valueSchema:new Vt(new vt)}]));class ya{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return ya.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParamsDelta: ${e}`);return new ya({params:e.get("Params")?fa.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}ya.encodingSchema=new At(xt([{key:"Params",valueSchema:new Vt(fa.encodingSchema)},{key:"Deleted",valueSchema:new Ve}]));class wa{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.holding=e.holding}getEncodingSchema(){return wa.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["Holding",this.holding.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResourceRecord: ${e}`);return new wa({id:e.get("Aidx"),address:e.get("Addr"),params:ya.fromEncodingData(e.get("Params")),holding:pa.fromEncodingData(e.get("Holding"))})}}wa.encodingSchema=new At(xt([{key:"Aidx",valueSchema:new Be},{key:"Addr",valueSchema:new vt},{key:"Params",valueSchema:ya.encodingSchema},{key:"Holding",valueSchema:pa.encodingSchema}]));class va{constructor(e){this.voteID=e.voteID,this.selectionID=e.selectionID,this.stateProofID=e.stateProofID,this.voteFirstValid=e.voteFirstValid,this.voteLastValid=e.voteLastValid,this.voteKeyDilution=e.voteKeyDilution}getEncodingSchema(){return va.encodingSchema}toEncodingData(){return new Map([["VoteID",this.voteID],["SelectionID",this.selectionID],["StateProofID",this.stateProofID],["VoteFirstValid",this.voteFirstValid],["VoteLastValid",this.voteLastValid],["VoteKeyDilution",this.voteKeyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded VotingData: ${e}`);return new va({voteID:e.get("VoteID"),selectionID:e.get("SelectionID"),stateProofID:e.get("StateProofID"),voteFirstValid:e.get("VoteFirstValid"),voteLastValid:e.get("VoteLastValid"),voteKeyDilution:e.get("VoteKeyDilution")})}}va.encodingSchema=new At(xt([{key:"VoteID",valueSchema:new Et(32)},{key:"SelectionID",valueSchema:new Et(32)},{key:"StateProofID",valueSchema:new Et(64)},{key:"VoteFirstValid",valueSchema:new Be},{key:"VoteLastValid",valueSchema:new Be},{key:"VoteKeyDilution",valueSchema:new Be}]));class Sa{constructor(e){this.status=e.status,this.microAlgos=e.microAlgos,this.rewardsBase=e.rewardsBase,this.rewardedMicroAlgos=e.rewardedMicroAlgos,this.authAddr=e.authAddr,this.incentiveEligible=e.incentiveEligible,this.totalAppSchema=e.totalAppSchema,this.totalExtraAppPages=e.totalExtraAppPages,this.totalAppParams=e.totalAppParams,this.totalAppLocalStates=e.totalAppLocalStates,this.totalAssetParams=e.totalAssetParams,this.totalAssets=e.totalAssets,this.totalBoxes=e.totalBoxes,this.totalBoxBytes=e.totalBoxBytes,this.lastProposed=e.lastProposed,this.lastHeartbeat=e.lastHeartbeat}getEncodingSchema(){return Sa.encodingSchema}toEncodingData(){return new Map([["Status",this.status],["MicroAlgos",this.microAlgos],["RewardsBase",this.rewardsBase],["RewardedMicroAlgos",this.rewardedMicroAlgos],["AuthAddr",this.authAddr],["IncentiveEligible",this.incentiveEligible],["TotalAppSchema",this.totalAppSchema.toEncodingData()],["TotalExtraAppPages",this.totalExtraAppPages],["TotalAppParams",this.totalAppParams],["TotalAppLocalStates",this.totalAppLocalStates],["TotalAssetParams",this.totalAssetParams],["TotalAssets",this.totalAssets],["TotalBoxes",this.totalBoxes],["TotalBoxBytes",this.totalBoxBytes],["LastProposed",this.lastProposed],["LastHeartbeat",this.lastHeartbeat]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountBaseData: ${e}`);return new Sa({status:Number(e.get("Status")),microAlgos:e.get("MicroAlgos"),rewardsBase:e.get("RewardsBase"),rewardedMicroAlgos:e.get("RewardedMicroAlgos"),authAddr:e.get("AuthAddr"),incentiveEligible:e.get("IncentiveEligible"),totalAppSchema:ca.fromEncodingData(e.get("TotalAppSchema")),totalExtraAppPages:Number(e.get("TotalExtraAppPages")),totalAppParams:e.get("TotalAppParams"),totalAppLocalStates:e.get("TotalAppLocalStates"),totalAssetParams:e.get("TotalAssetParams"),totalAssets:e.get("TotalAssets"),totalBoxes:e.get("TotalBoxes"),totalBoxBytes:e.get("TotalBoxBytes"),lastProposed:e.get("LastProposed"),lastHeartbeat:e.get("LastHeartbeat")})}}Sa.encodingSchema=new At(xt([{key:"Status",valueSchema:new Be},{key:"MicroAlgos",valueSchema:new Be},{key:"RewardsBase",valueSchema:new Be},{key:"RewardedMicroAlgos",valueSchema:new Be},{key:"AuthAddr",valueSchema:new vt},{key:"IncentiveEligible",valueSchema:new Ve},{key:"TotalAppSchema",valueSchema:ca.encodingSchema},{key:"TotalExtraAppPages",valueSchema:new Be},{key:"TotalAppParams",valueSchema:new Be},{key:"TotalAppLocalStates",valueSchema:new Be},{key:"TotalAssetParams",valueSchema:new Be},{key:"TotalAssets",valueSchema:new Be},{key:"TotalBoxes",valueSchema:new Be},{key:"TotalBoxBytes",valueSchema:new Be},{key:"LastProposed",valueSchema:new Be},{key:"LastHeartbeat",valueSchema:new Be}]));class Ea{constructor(e){this.accountBaseData=e.accountBaseData,this.votingData=e.votingData}getEncodingSchema(){return Ea.encodingSchema}toEncodingData(){return Dt(this.accountBaseData.toEncodingData(),this.votingData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountData: ${e}`);return new Ea({accountBaseData:Sa.fromEncodingData(e),votingData:va.fromEncodingData(e)})}}Ea.encodingSchema=new At(xt([{key:"",valueSchema:Sa.encodingSchema,embedded:!0},{key:"",valueSchema:va.encodingSchema,embedded:!0}]));class ka{constructor(e){this.addr=e.addr,this.accountData=e.accountData}getEncodingSchema(){return ka.encodingSchema}toEncodingData(){return Dt(new Map([["Addr",this.addr]]),this.accountData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BalanceRecord: ${e}`);return new ka({addr:e.get("Addr"),accountData:Ea.fromEncodingData(e)})}}ka.encodingSchema=new At(xt([{key:"Addr",valueSchema:new vt},{key:"",valueSchema:Ea.encodingSchema,embedded:!0}]));class ba{constructor(e){this.accounts=e.accounts,this.appResources=e.appResources,this.assetResources=e.assetResources}getEncodingSchema(){return ba.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.map(e=>e.toEncodingData())],["AppResources",0===this.appResources.length?void 0:this.appResources.map(e=>e.toEncodingData())],["AssetResources",0===this.assetResources.length?void 0:this.assetResources.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountDeltas: ${e}`);return new ba({accounts:(e.get("Accts")??[]).map(ka.fromEncodingData),appResources:(e.get("AppResources")??[]).map(ga.fromEncodingData),assetResources:(e.get("AssetResources")??[]).map(wa.fromEncodingData)})}}ba.encodingSchema=new At(xt([{key:"Accts",valueSchema:new bt(ka.encodingSchema)},{key:"AppResources",valueSchema:new Vt(new bt(ga.encodingSchema))},{key:"AssetResources",valueSchema:new Vt(new bt(wa.encodingSchema))}]));class xa{constructor(e){this.data=e.data,this.oldData=e.oldData}getEncodingSchema(){return xa.encodingSchema}toEncodingData(){return new Map([["Data",this.data],["OldData",this.oldData]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded KvValueDelta: ${e}`);return new xa({data:e.get("Data"),oldData:e.get("OldData")})}}xa.encodingSchema=new At(xt([{key:"Data",valueSchema:new Vt(new St)},{key:"OldData",valueSchema:new Vt(new St)}]));class Aa{constructor(e){this.lastValid=e.lastValid,this.intra=e.intra}getEncodingSchema(){return Aa.encodingSchema}toEncodingData(){return new Map([["LastValid",this.lastValid],["Intra",this.intra]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IncludedTransactions: ${e}`);return new Aa({lastValid:e.get("LastValid"),intra:Number(e.get("Intra"))})}}Aa.encodingSchema=new At(xt([{key:"LastValid",valueSchema:new Be},{key:"Intra",valueSchema:new Be}]));class Da{constructor(e){this.creatableType=e.creatableType,this.created=e.created,this.creator=e.creator,this.ndeltas=e.ndeltas}getEncodingSchema(){return Da.encodingSchema}toEncodingData(){return new Map([["Ctype",this.creatableType],["Created",this.created],["Creator",this.creator],["Ndeltas",this.ndeltas]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ModifiedCreatable: ${e}`);return new Da({creatableType:Number(e.get("Ctype")),created:e.get("Created"),creator:e.get("Creator"),ndeltas:Number(e.get("Ndeltas"))})}}Da.encodingSchema=new At(xt([{key:"Ctype",valueSchema:new Be},{key:"Created",valueSchema:new Ve},{key:"Creator",valueSchema:new vt},{key:"Ndeltas",valueSchema:new Be}]));class Ia{constructor(e){this.money=e.money,this.rewardUnits=e.rewardUnits}getEncodingSchema(){return Ia.encodingSchema}toEncodingData(){return new Map([["mon",this.money],["rwd",this.rewardUnits]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AlgoCount: ${e}`);return new Ia({money:e.get("mon"),rewardUnits:e.get("rwd")})}}Ia.encodingSchema=new At(xt([{key:"mon",valueSchema:new Be},{key:"rwd",valueSchema:new Be}]));class Ta{constructor(e){this.online=e.online,this.offline=e.offline,this.notParticipating=e.notParticipating,this.rewardsLevel=e.rewardsLevel}getEncodingSchema(){return Ta.encodingSchema}toEncodingData(){return new Map([["online",this.online.toEncodingData()],["offline",this.offline.toEncodingData()],["notpart",this.notParticipating.toEncodingData()],["rwdlvl",this.rewardsLevel]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountTotals: ${e}`);return new Ta({online:Ia.fromEncodingData(e.get("online")),offline:Ia.fromEncodingData(e.get("offline")),notParticipating:Ia.fromEncodingData(e.get("notpart")),rewardsLevel:e.get("rwdlvl")})}}Ta.encodingSchema=new At(xt([{key:"online",valueSchema:Ia.encodingSchema},{key:"offline",valueSchema:Ia.encodingSchema},{key:"notpart",valueSchema:Ia.encodingSchema},{key:"rwdlvl",valueSchema:new Be}]));class Pa{constructor(e){this.accounts=e.accounts,this.kvMods=e.kvMods,this.txids=e.txids,this.txleases=e.txleases,this.creatables=e.creatables,this.blockHeader=e.blockHeader,this.stateProofNext=e.stateProofNext,this.prevTimestamp=e.prevTimestamp,this.totals=e.totals}getEncodingSchema(){return Pa.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.toEncodingData()],["KvMods",0===this.kvMods.size?void 0:It(this.kvMods,(e,t)=>[e,t.toEncodingData()])],["Txids",It(this.txids,(e,t)=>[e,t.toEncodingData()])],["Txleases",this.txleases.toEncodingData()],["Creatables",0===this.creatables.size?void 0:It(this.creatables,(e,t)=>[e,t.toEncodingData()])],["Hdr",this.blockHeader.toEncodingData()],["StateProofNext",this.stateProofNext],["PrevTimestamp",this.prevTimestamp],["Totals",this.totals.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDelta: ${e}`);return new Pa({accounts:ba.fromEncodingData(e.get("Accts")),kvMods:It(e.get("KvMods")??new Map,(e,t)=>[e,xa.fromEncodingData(t)]),txids:It(e.get("Txids"),(e,t)=>[e,Aa.fromEncodingData(t)]),txleases:oa.fromEncodingData(e.get("Txleases")),creatables:It(e.get("Creatables")??new Map,(e,t)=>[e,Da.fromEncodingData(t)]),blockHeader:Zn.fromEncodingData(e.get("Hdr")),stateProofNext:e.get("StateProofNext"),prevTimestamp:e.get("PrevTimestamp"),totals:Ta.fromEncodingData(e.get("Totals"))})}}Pa.encodingSchema=new At(xt([{key:"Accts",valueSchema:ba.encodingSchema},{key:"KvMods",valueSchema:new Vt(new Mt(xa.encodingSchema))},{key:"Txids",valueSchema:new class extends De{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(n,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("ByteArrayMapSchema data must be a Map");const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);n.set(a,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);const e=de(a);if(n.has(e))throw new Error(`Duplicate key (base64): ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("ByteArrayMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(he(n),this.valueSchema.fromPreparedJSON(a));return t}}(Aa.encodingSchema)},{key:"Txleases",valueSchema:new Vt(new Rt)},{key:"Creatables",valueSchema:new Vt(new Tt(Da.encodingSchema))},{key:"Hdr",valueSchema:Zn.encodingSchema},{key:"StateProofNext",valueSchema:new Be},{key:"PrevTimestamp",valueSchema:new Be},{key:"Totals",valueSchema:Ta.encodingSchema}]));class Ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"min-balance",valueSchema:new Be,omitEmpty:!0},{key:"pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"rewards",valueSchema:new Be,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"status",valueSchema:new Re,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-created-apps",valueSchema:new Be,omitEmpty:!0},{key:"total-created-assets",valueSchema:new Be,omitEmpty:!0},{key:"apps-local-state",valueSchema:new Vt(new bt(Ka.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(Wa.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"created-apps",valueSchema:new Vt(new bt(_a.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new Vt(new bt(Ja.encodingSchema)),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-proposed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation",valueSchema:new Vt(Oa.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-type",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"total-box-bytes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"total-boxes",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalCreatedApps:d,totalCreatedAssets:u,appsLocalState:l,appsTotalExtraPages:g,appsTotalSchema:m,assets:p,authAddr:f,createdApps:y,createdAssets:w,incentiveEligible:S,lastHeartbeat:k,lastProposed:b,participation:x,rewardBase:A,sigType:D,totalBoxBytes:I,totalBoxes:T}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=E(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalCreatedApps=v(d),this.totalCreatedAssets=v(u),this.appsLocalState=l,this.appsTotalExtraPages=void 0===g?void 0:v(g),this.appsTotalSchema=m,this.assets=p,this.authAddr="string"==typeof f?ut.fromString(f):f,this.createdApps=y,this.createdAssets=w,this.incentiveEligible=S,this.lastHeartbeat=void 0===k?void 0:v(k),this.lastProposed=void 0===b?void 0:v(b),this.participation=x,this.rewardBase=void 0===A?void 0:E(A),this.sigType=D,this.totalBoxBytes=void 0===I?void 0:v(I),this.totalBoxes=void 0===T?void 0:v(T)}getEncodingSchema(){return Ma.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map(e=>e.toEncodingData()):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map(e=>e.toEncodingData()):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["created-apps",void 0!==this.createdApps?this.createdApps.map(e=>e.toEncodingData()):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map(e=>e.toEncodingData()):void 0],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new Ma({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map(e=>Ka.fromEncodingData(e)):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Ga.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map(e=>Wa.fromEncodingData(e)):void 0,authAddr:e.get("auth-addr"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map(e=>_a.fromEncodingData(e)):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map(e=>Ja.fromEncodingData(e)):void 0,incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?Oa.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes")})}}class Va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"app-local-state",valueSchema:new Vt(Ka.encodingSchema),omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"params",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appLocalState:t,createdAtRound:n,deleted:a,params:i}){this.id=v(e),this.appLocalState=t,this.createdAtRound=void 0===n?void 0:v(n),this.deleted=a,this.params=i}getEncodingSchema(){return Va.encodingSchema}toEncodingData(){return new Map([["id",this.id],["app-local-state",void 0!==this.appLocalState?this.appLocalState.toEncodingData():void 0],["created-at-round",this.createdAtRound],["deleted",this.deleted],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationResource: ${e}`);return new Va({id:e.get("id"),appLocalState:void 0!==e.get("app-local-state")?Ka.fromEncodingData(e.get("app-local-state")):void 0,createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),params:void 0!==e.get("params")?Ha.fromEncodingData(e.get("params")):void 0})}}class Ra{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"app-local-state",valueSchema:new Vt(Ka.encodingSchema),omitEmpty:!0},{key:"created-app",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,appLocalState:t,createdApp:n}){this.round=E(e),this.appLocalState=t,this.createdApp=n}getEncodingSchema(){return Ra.encodingSchema}toEncodingData(){return new Map([["round",this.round],["app-local-state",void 0!==this.appLocalState?this.appLocalState.toEncodingData():void 0],["created-app",void 0!==this.createdApp?this.createdApp.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationResponse: ${e}`);return new Ra({round:e.get("round"),appLocalState:void 0!==e.get("app-local-state")?Ka.fromEncodingData(e.get("app-local-state")):void 0,createdApp:void 0!==e.get("created-app")?Ha.fromEncodingData(e.get("created-app")):void 0})}}class Ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"application-resources",valueSchema:new Vt(new bt(Va.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,applicationResources:t,nextToken:n}){this.round=v(e),this.applicationResources=t,this.nextToken=n}getEncodingSchema(){return Ba.encodingSchema}toEncodingData(){return new Map([["round",this.round],["application-resources",void 0!==this.applicationResources?this.applicationResources.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationsInformationResponse: ${e}`);return new Ba({round:e.get("round"),applicationResources:void 0!==e.get("application-resources")?e.get("application-resources").map(e=>Va.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class Ca{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset-holding",valueSchema:Wa.encodingSchema,omitEmpty:!0},{key:"asset-params",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetHolding:e,assetParams:t}){this.assetHolding=e,this.assetParams=t}getEncodingSchema(){return Ca.encodingSchema}toEncodingData(){return new Map([["asset-holding",this.assetHolding.toEncodingData()],["asset-params",void 0!==this.assetParams?this.assetParams.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetHolding: ${e}`);return new Ca({assetHolding:Wa.fromEncodingData(e.get("asset-holding")??new Map),assetParams:void 0!==e.get("asset-params")?Xa.fromEncodingData(e.get("asset-params")):void 0})}}class Ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"asset-holding",valueSchema:new Vt(Wa.encodingSchema),omitEmpty:!0},{key:"created-asset",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHolding:t,createdAsset:n}){this.round=E(e),this.assetHolding=t,this.createdAsset=n}getEncodingSchema(){return Ua.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holding",void 0!==this.assetHolding?this.assetHolding.toEncodingData():void 0],["created-asset",void 0!==this.createdAsset?this.createdAsset.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetResponse: ${e}`);return new Ua({round:e.get("round"),assetHolding:void 0!==e.get("asset-holding")?Wa.fromEncodingData(e.get("asset-holding")):void 0,createdAsset:void 0!==e.get("created-asset")?Xa.fromEncodingData(e.get("created-asset")):void 0})}}class $a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0},{key:"asset-holdings",valueSchema:new Vt(new bt(Ca.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHoldings:t,nextToken:n}){this.round=v(e),this.assetHoldings=t,this.nextToken=n}getEncodingSchema(){return $a.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetsInformationResponse: ${e}`);return new $a({round:e.get("round"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map(e=>Ca.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class Oa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new St,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new St,omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?he(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?he(i):i,this.stateProofKey="string"==typeof r?he(r):r}getEncodingSchema(){return Oa.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new Oa({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class Na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"delta",valueSchema:new bt(gi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return Na.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new Na({address:e.get("address"),delta:(e.get("delta")??[]).map(e=>gi.fromEncodingData(e))})}}class La{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-index",valueSchema:new Be,omitEmpty:!0},{key:"logs",valueSchema:new bt(new St),omitEmpty:!0},{key:"txId",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationIndex:e,logs:t,txid:n}){this.applicationIndex=v(e),this.logs=t,this.txid=n}getEncodingSchema(){return La.encodingSchema}toEncodingData(){return new Map([["application-index",this.applicationIndex],["logs",this.logs],["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppCallLogs: ${e}`);return new La({applicationIndex:e.get("application-index"),logs:e.get("logs"),txid:e.get("txId")})}}class _a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:new Vt(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t}){this.id=E(e),this.params=t}getEncodingSchema(){return _a.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new _a({id:e.get("id"),params:void 0!==e.get("params")?Ha.fromEncodingData(e.get("params")):void 0})}}class qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"app-boxes",valueSchema:new Vt(Fa.encodingSchema),omitEmpty:!0},{key:"app-globals",valueSchema:new Vt(Fa.encodingSchema),omitEmpty:!0},{key:"app-locals",valueSchema:new Vt(new bt(Fa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appBoxes:t,appGlobals:n,appLocals:a}){this.id=E(e),this.appBoxes=t,this.appGlobals=n,this.appLocals=a}getEncodingSchema(){return qa.encodingSchema}toEncodingData(){return new Map([["id",this.id],["app-boxes",void 0!==this.appBoxes?this.appBoxes.toEncodingData():void 0],["app-globals",void 0!==this.appGlobals?this.appGlobals.toEncodingData():void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationInitialStates: ${e}`);return new qa({id:e.get("id"),appBoxes:void 0!==e.get("app-boxes")?Fa.fromEncodingData(e.get("app-boxes")):void 0,appGlobals:void 0!==e.get("app-globals")?Fa.fromEncodingData(e.get("app-globals")):void 0,appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map(e=>Fa.fromEncodingData(e)):void 0})}}class Fa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"kvs",valueSchema:new bt(Qa.encodingSchema),omitEmpty:!0},{key:"account",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({kvs:e,account:t}){this.kvs=e,this.account="string"==typeof t?ut.fromString(t):t}getEncodingSchema(){return Fa.encodingSchema}toEncodingData(){return new Map([["kvs",this.kvs.map(e=>e.toEncodingData())],["account",void 0!==this.account?this.account.toString():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationKVStorage: ${e}`);return new Fa({kvs:(e.get("kvs")??[]).map(e=>Qa.fromEncodingData(e)),account:e.get("account")})}}class za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new Re,omitEmpty:!0},{key:"app",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,app:t}){this.account="string"==typeof e?ut.fromString(e):e,this.app=E(t)}getEncodingSchema(){return za.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["app",this.app]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalReference: ${e}`);return new za({account:e.get("account"),app:e.get("app")})}}class Ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"schema",valueSchema:Ga.encodingSchema,omitEmpty:!0},{key:"key-value",valueSchema:new Vt(new bt(qi.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,keyValue:n}){this.id=E(e),this.schema=t,this.keyValue=n}getEncodingSchema(){return Ka.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["key-value",void 0!==this.keyValue?this.keyValue.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new Ka({id:e.get("id"),schema:Ga.fromEncodingData(e.get("schema")??new Map),keyValue:void 0!==e.get("key-value")?e.get("key-value").map(e=>qi.fromEncodingData(e)):void 0})}}class Ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new St,omitEmpty:!0},{key:"clear-state-program",valueSchema:new St,omitEmpty:!0},{key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"family-box-access",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"foreign-box-reads",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"global-state",valueSchema:new Vt(new bt(qi.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Ga.encodingSchema),omitEmpty:!0},{key:"size-sponsor",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,familyBoxAccess:i,foreignBoxReads:r,globalState:o,globalStateSchema:s,localStateSchema:c,sizeSponsor:h,version:d}){this.approvalProgram="string"==typeof e?he(e):e,this.clearStateProgram="string"==typeof t?he(t):t,this.creator="string"==typeof n?ut.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.familyBoxAccess=i,this.foreignBoxReads=r,this.globalState=o,this.globalStateSchema=s,this.localStateSchema=c,this.sizeSponsor="string"==typeof h?ut.fromString(h):h,this.version=void 0===d?void 0:v(d)}getEncodingSchema(){return Ha.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",this.creator.toString()],["extra-program-pages",this.extraProgramPages],["family-box-access",this.familyBoxAccess],["foreign-box-reads",this.foreignBoxReads],["global-state",void 0!==this.globalState?this.globalState.map(e=>e.toEncodingData()):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["size-sponsor",void 0!==this.sizeSponsor?this.sizeSponsor.toString():void 0],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new Ha({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),familyBoxAccess:e.get("family-box-access"),foreignBoxReads:e.get("foreign-box-reads"),globalState:void 0!==e.get("global-state")?e.get("global-state").map(e=>qi.fromEncodingData(e)):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Ga.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Ga.fromEncodingData(e.get("local-state-schema")):void 0,sizeSponsor:e.get("size-sponsor"),version:e.get("version")})}}class ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app-state-type",valueSchema:new Re,omitEmpty:!0},{key:"key",valueSchema:new St,omitEmpty:!0},{key:"operation",valueSchema:new Re,omitEmpty:!0},{key:"account",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"new-value",valueSchema:new Vt(Za.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({appStateType:e,key:t,operation:n,account:a,newValue:i}){this.appStateType=e,this.key="string"==typeof t?he(t):t,this.operation=n,this.account="string"==typeof a?ut.fromString(a):a,this.newValue=i}getEncodingSchema(){return ja.encodingSchema}toEncodingData(){return new Map([["app-state-type",this.appStateType],["key",this.key],["operation",this.operation],["account",void 0!==this.account?this.account.toString():void 0],["new-value",void 0!==this.newValue?this.newValue.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateOperation: ${e}`);return new ja({appStateType:e.get("app-state-type"),key:e.get("key"),operation:e.get("operation"),account:e.get("account"),newValue:void 0!==e.get("new-value")?Za.fromEncodingData(e.get("new-value")):void 0})}}class Ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Ga.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new Ga({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:new Vt(Xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t}){this.index=E(e),this.params=t}getEncodingSchema(){return Ja.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Ja({index:e.get("index"),params:void 0!==e.get("params")?Xa.fromEncodingData(e.get("params")):void 0})}}class Wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n}getEncodingSchema(){return Wa.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Wa({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen")})}}class Ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new Re,omitEmpty:!0},{key:"asset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,asset:t}){this.account="string"==typeof e?ut.fromString(e):e,this.asset=E(t)}getEncodingSchema(){return Ya.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["asset",this.asset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingReference: ${e}`);return new Ya({account:e.get("account"),asset:e.get("asset")})}}class Xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"decimals",valueSchema:new Be,omitEmpty:!0},{key:"total",valueSchema:new Be,omitEmpty:!0},{key:"clawback",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"default-frozen",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"freeze",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"manager",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"metadata-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"reserve",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"url",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"url-b64",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?he(s):s,this.name=c,this.nameB64="string"==typeof h?he(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?he(l):l,this.url=g,this.urlB64="string"==typeof m?he(m):m}getEncodingSchema(){return Xa.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Xa({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class Qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:Za.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return Qa.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmKeyValue: ${e}`);return new Qa({key:e.get("key"),value:Za.fromEncodingData(e.get("value")??new Map)})}}class Za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"type",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new St),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({type:e,bytes:t,uint:n}){this.type=v(e),this.bytes="string"==typeof t?he(t):t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return Za.encodingSchema}toEncodingData(){return new Map([["type",this.type],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmValue: ${e}`);return new Za({type:e.get("type"),bytes:e.get("bytes"),uint:e.get("uint")})}}class ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blockHash",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockhash:e}){this.blockhash=e}getEncodingSchema(){return ei.encodingSchema}toEncodingData(){return new Map([["blockHash",this.blockhash]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHashResponse: ${e}`);return new ei({blockhash:e.get("blockHash")})}}class ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new bt(La.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e}){this.logs=e}getEncodingSchema(){return ti.encodingSchema}toEncodingData(){return new Map([["logs",this.logs.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockLogsResponse: ${e}`);return new ti({logs:(e.get("logs")??[]).map(e=>La.fromEncodingData(e))})}}class ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"block",valueSchema:ra.encodingSchema,omitEmpty:!0},{key:"cert",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({block:e,cert:t}){this.block=e,this.cert=t}getEncodingSchema(){return ni.encodingSchema}toEncodingData(){return new Map([["block",this.block.toEncodingData()],["cert",void 0!==this.cert?this.cert.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockResponse: ${e}`);return new ni({block:ra.fromEncodingData(e.get("block")??new Map),cert:void 0!==e.get("cert")?oa.fromEncodingData(e.get("cert")):void 0})}}class ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blockTxids",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocktxids:e}){this.blocktxids=e}getEncodingSchema(){return ai.encodingSchema}toEncodingData(){return new Map([["blockTxids",this.blocktxids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockTxidsResponse: ${e}`);return new ai({blocktxids:e.get("blockTxids")})}}class ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"value",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?he(e):e,this.round=E(t),this.value="string"==typeof n?he(n):n}getEncodingSchema(){return ii.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new ii({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,value:t}){this.name="string"==typeof e?he(e):e,this.value="string"==typeof t?he(t):t}getEncodingSchema(){return ri.encodingSchema}toEncodingData(){return new Map([["name",this.name],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new ri({name:e.get("name"),value:e.get("value")})}}class oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new Be,omitEmpty:!0},{key:"name",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=E(e),this.name="string"==typeof t?he(t):t}getEncodingSchema(){return oi.encodingSchema}toEncodingData(){return new Map([["app",this.app],["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxReference: ${e}`);return new oi({app:e.get("app"),name:e.get("name")})}}class si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"boxes",valueSchema:new bt(ri.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({boxes:e,nextToken:t,round:n}){this.boxes=e,this.nextToken=t,this.round=void 0===n?void 0:v(n)}getEncodingSchema(){return si.encodingSchema}toEncodingData(){return new Map([["boxes",this.boxes.map(e=>e.toEncodingData())],["next-token",this.nextToken],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new si({boxes:(e.get("boxes")??[]).map(e=>ri.fromEncodingData(e)),nextToken:e.get("next-token"),round:e.get("round")})}}class ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"branch",valueSchema:new Re,omitEmpty:!0},{key:"build_number",valueSchema:new Be,omitEmpty:!0},{key:"channel",valueSchema:new Re,omitEmpty:!0},{key:"commit_hash",valueSchema:new Re,omitEmpty:!0},{key:"major",valueSchema:new Be,omitEmpty:!0},{key:"minor",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({branch:e,buildNumber:t,channel:n,commitHash:a,major:i,minor:r}){this.branch=e,this.buildNumber=v(t),this.channel=n,this.commitHash=a,this.major=v(i),this.minor=v(r)}getEncodingSchema(){return ci.encodingSchema}toEncodingData(){return new Map([["branch",this.branch],["build_number",this.buildNumber],["channel",this.channel],["commit_hash",this.commitHash],["major",this.major],["minor",this.minor]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BuildVersion: ${e}`);return new ci({branch:e.get("branch"),buildNumber:e.get("build_number"),channel:e.get("channel"),commitHash:e.get("commit_hash"),major:e.get("major"),minor:e.get("minor")})}}class hi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash",valueSchema:new Re,omitEmpty:!0},{key:"result",valueSchema:new Re,omitEmpty:!0},{key:"sourcemap",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({hash:e,result:t,sourcemap:n}){this.hash=e,this.result=t,this.sourcemap=n}getEncodingSchema(){return hi.encodingSchema}toEncodingData(){return new Map([["hash",this.hash],["result",this.result],["sourcemap",void 0!==this.sourcemap?this.sourcemap.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded CompileResponse: ${e}`);return new hi({hash:e.get("hash"),result:e.get("result"),sourcemap:void 0!==e.get("sourcemap")?oa.fromEncodingData(e.get("sourcemap")):void 0})}}class di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"result",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({result:e}){this.result=e}getEncodingSchema(){return di.encodingSchema}toEncodingData(){return new Map([["result",this.result]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DisassembleResponse: ${e}`);return new di({result:e.get("result")})}}class ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return ui.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new ui({message:e.get("message"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0})}}class li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return li.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new li({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class gi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new Re,omitEmpty:!0},{key:"value",valueSchema:li.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return gi.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new gi({key:e.get("key"),value:li.fromEncodingData(e.get("value")??new Map)})}}class mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"alloc",valueSchema:new bt(pi.encodingSchema),omitEmpty:!0},{key:"fees",valueSchema:new Re,omitEmpty:!0},{key:"id",valueSchema:new Re,omitEmpty:!0},{key:"network",valueSchema:new Re,omitEmpty:!0},{key:"proto",valueSchema:new Re,omitEmpty:!0},{key:"rwd",valueSchema:new Re,omitEmpty:!0},{key:"timestamp",valueSchema:new Be,omitEmpty:!0},{key:"comment",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"devmode",valueSchema:new Vt(new Ve),omitEmpty:!0})),this.encodingSchemaValue}constructor({alloc:e,fees:t,id:n,network:a,proto:i,rwd:r,timestamp:o,comment:s,devmode:c}){this.alloc=e,this.fees=t,this.id=n,this.network=a,this.proto=i,this.rwd=r,this.timestamp=v(o),this.comment=s,this.devmode=c}getEncodingSchema(){return mi.encodingSchema}toEncodingData(){return new Map([["alloc",this.alloc.map(e=>e.toEncodingData())],["fees",this.fees],["id",this.id],["network",this.network],["proto",this.proto],["rwd",this.rwd],["timestamp",this.timestamp],["comment",this.comment],["devmode",this.devmode]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Genesis: ${e}`);return new mi({alloc:(e.get("alloc")??[]).map(e=>pi.fromEncodingData(e)),fees:e.get("fees"),id:e.get("id"),network:e.get("network"),proto:e.get("proto"),rwd:e.get("rwd"),timestamp:e.get("timestamp"),comment:e.get("comment"),devmode:e.get("devmode")})}}class pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"addr",valueSchema:new Re,omitEmpty:!0},{key:"comment",valueSchema:new Re,omitEmpty:!0},{key:"state",valueSchema:oa.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({addr:e,comment:t,state:n}){this.addr=e,this.comment=t,this.state=n}getEncodingSchema(){return pi.encodingSchema}toEncodingData(){return new Map([["addr",this.addr],["comment",this.comment],["state",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GenesisAllocation: ${e}`);return new pi({addr:e.get("addr"),comment:e.get("comment"),state:oa.fromEncodingData(e.get("state")??new Map)})}}class fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"offset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({offset:e}){this.offset=v(e)}getEncodingSchema(){return fi.encodingSchema}toEncodingData(){return new Map([["offset",this.offset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetBlockTimeStampOffsetResponse: ${e}`);return new fi({offset:e.get("offset")})}}class yi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Peers",valueSchema:new bt(ki.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({peers:e}){this.peers=e}getEncodingSchema(){return yi.encodingSchema}toEncodingData(){return new Map([["Peers",this.peers.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetPeersResponse: ${e}`);return new yi({peers:(e.get("Peers")??[]).map(e=>ki.fromEncodingData(e))})}}class wi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e}){this.round=E(e)}getEncodingSchema(){return wi.encodingSchema}toEncodingData(){return new Map([["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetSyncRoundResponse: ${e}`);return new wi({round:e.get("round")})}}class vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Delta",valueSchema:Pa.encodingSchema,omitEmpty:!0},{key:"Ids",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({delta:e,ids:t}){this.delta=e,this.ids=t}getEncodingSchema(){return vi.encodingSchema}toEncodingData(){return new Map([["Delta",this.delta.toEncodingData()],["Ids",this.ids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDeltaForTransactionGroup: ${e}`);return new vi({delta:Pa.fromEncodingData(e.get("Delta")??new Map),ids:e.get("Ids")})}}class Si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"proof",valueSchema:new St,omitEmpty:!0},{key:"treedepth",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,proof:t,treedepth:n}){this.index=v(e),this.proof="string"==typeof t?he(t):t,this.treedepth=v(n)}getEncodingSchema(){return Si.encodingSchema}toEncodingData(){return new Map([["index",this.index],["proof",this.proof],["treedepth",this.treedepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LightBlockHeaderProof: ${e}`);return new Si({index:e.get("index"),proof:e.get("proof"),treedepth:e.get("treedepth")})}}class Ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"catchup-time",valueSchema:new Be,omitEmpty:!0},{key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"last-version",valueSchema:new Re,omitEmpty:!0},{key:"next-version",valueSchema:new Re,omitEmpty:!0},{key:"next-version-round",valueSchema:new Be,omitEmpty:!0},{key:"next-version-supported",valueSchema:new Ve,omitEmpty:!0},{key:"stopped-at-unsupported-round",valueSchema:new Ve,omitEmpty:!0},{key:"time-since-last-round",valueSchema:new Be,omitEmpty:!0},{key:"catchpoint",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"catchpoint-acquired-blocks",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-processed-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-processed-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-blocks",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-total-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-verified-accounts",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"catchpoint-verified-kvs",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-catchpoint",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-next-protocol-vote-before",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-no-votes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-node-vote",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"upgrade-vote-rounds",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-votes",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-votes-required",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-yes-votes",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({catchupTime:e,lastRound:t,lastVersion:n,nextVersion:a,nextVersionRound:i,nextVersionSupported:r,stoppedAtUnsupportedRound:o,timeSinceLastRound:s,catchpoint:c,catchpointAcquiredBlocks:h,catchpointProcessedAccounts:d,catchpointProcessedKvs:u,catchpointTotalAccounts:l,catchpointTotalBlocks:g,catchpointTotalKvs:m,catchpointVerifiedAccounts:p,catchpointVerifiedKvs:f,lastCatchpoint:y,upgradeDelay:w,upgradeNextProtocolVoteBefore:S,upgradeNoVotes:k,upgradeNodeVote:b,upgradeVoteRounds:x,upgradeVotes:A,upgradeVotesRequired:D,upgradeYesVotes:I}){this.catchupTime=E(e),this.lastRound=E(t),this.lastVersion=n,this.nextVersion=a,this.nextVersionRound=E(i),this.nextVersionSupported=r,this.stoppedAtUnsupportedRound=o,this.timeSinceLastRound=E(s),this.catchpoint=c,this.catchpointAcquiredBlocks=void 0===h?void 0:v(h),this.catchpointProcessedAccounts=void 0===d?void 0:v(d),this.catchpointProcessedKvs=void 0===u?void 0:v(u),this.catchpointTotalAccounts=void 0===l?void 0:v(l),this.catchpointTotalBlocks=void 0===g?void 0:v(g),this.catchpointTotalKvs=void 0===m?void 0:v(m),this.catchpointVerifiedAccounts=void 0===p?void 0:v(p),this.catchpointVerifiedKvs=void 0===f?void 0:v(f),this.lastCatchpoint=y,this.upgradeDelay=void 0===w?void 0:E(w),this.upgradeNextProtocolVoteBefore=void 0===S?void 0:E(S),this.upgradeNoVotes=void 0===k?void 0:v(k),this.upgradeNodeVote=b,this.upgradeVoteRounds=void 0===x?void 0:v(x),this.upgradeVotes=void 0===A?void 0:v(A),this.upgradeVotesRequired=void 0===D?void 0:v(D),this.upgradeYesVotes=void 0===I?void 0:v(I)}getEncodingSchema(){return Ei.encodingSchema}toEncodingData(){return new Map([["catchup-time",this.catchupTime],["last-round",this.lastRound],["last-version",this.lastVersion],["next-version",this.nextVersion],["next-version-round",this.nextVersionRound],["next-version-supported",this.nextVersionSupported],["stopped-at-unsupported-round",this.stoppedAtUnsupportedRound],["time-since-last-round",this.timeSinceLastRound],["catchpoint",this.catchpoint],["catchpoint-acquired-blocks",this.catchpointAcquiredBlocks],["catchpoint-processed-accounts",this.catchpointProcessedAccounts],["catchpoint-processed-kvs",this.catchpointProcessedKvs],["catchpoint-total-accounts",this.catchpointTotalAccounts],["catchpoint-total-blocks",this.catchpointTotalBlocks],["catchpoint-total-kvs",this.catchpointTotalKvs],["catchpoint-verified-accounts",this.catchpointVerifiedAccounts],["catchpoint-verified-kvs",this.catchpointVerifiedKvs],["last-catchpoint",this.lastCatchpoint],["upgrade-delay",this.upgradeDelay],["upgrade-next-protocol-vote-before",this.upgradeNextProtocolVoteBefore],["upgrade-no-votes",this.upgradeNoVotes],["upgrade-node-vote",this.upgradeNodeVote],["upgrade-vote-rounds",this.upgradeVoteRounds],["upgrade-votes",this.upgradeVotes],["upgrade-votes-required",this.upgradeVotesRequired],["upgrade-yes-votes",this.upgradeYesVotes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded NodeStatusResponse: ${e}`);return new Ei({catchupTime:e.get("catchup-time"),lastRound:e.get("last-round"),lastVersion:e.get("last-version"),nextVersion:e.get("next-version"),nextVersionRound:e.get("next-version-round"),nextVersionSupported:e.get("next-version-supported"),stoppedAtUnsupportedRound:e.get("stopped-at-unsupported-round"),timeSinceLastRound:e.get("time-since-last-round"),catchpoint:e.get("catchpoint"),catchpointAcquiredBlocks:e.get("catchpoint-acquired-blocks"),catchpointProcessedAccounts:e.get("catchpoint-processed-accounts"),catchpointProcessedKvs:e.get("catchpoint-processed-kvs"),catchpointTotalAccounts:e.get("catchpoint-total-accounts"),catchpointTotalBlocks:e.get("catchpoint-total-blocks"),catchpointTotalKvs:e.get("catchpoint-total-kvs"),catchpointVerifiedAccounts:e.get("catchpoint-verified-accounts"),catchpointVerifiedKvs:e.get("catchpoint-verified-kvs"),lastCatchpoint:e.get("last-catchpoint"),upgradeDelay:e.get("upgrade-delay"),upgradeNextProtocolVoteBefore:e.get("upgrade-next-protocol-vote-before"),upgradeNoVotes:e.get("upgrade-no-votes"),upgradeNodeVote:e.get("upgrade-node-vote"),upgradeVoteRounds:e.get("upgrade-vote-rounds"),upgradeVotes:e.get("upgrade-votes"),upgradeVotesRequired:e.get("upgrade-votes-required"),upgradeYesVotes:e.get("upgrade-yes-votes")})}}class ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"network-address",valueSchema:new Re,omitEmpty:!0},{key:"connection-type",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"network-type",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({networkAddress:e,connectionType:t,networkType:n}){this.networkAddress=e,this.connectionType=t,this.networkType=n}getEncodingSchema(){return ki.encodingSchema}toEncodingData(){return new Map([["network-address",this.networkAddress],["connection-type",this.connectionType],["network-type",this.networkType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PeerStatus: ${e}`);return new ki({networkAddress:e.get("network-address"),connectionType:e.get("connection-type"),networkType:e.get("network-type")})}}class bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"pool-error",valueSchema:new Re,omitEmpty:!0},{key:"txn",valueSchema:Kn.encodingSchema,omitEmpty:!0},{key:"application-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"confirmed-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"global-state-delta",valueSchema:new Vt(new bt(gi.encodingSchema)),omitEmpty:!0},{key:"inner-txns",valueSchema:new Vt(new bt(bi.encodingSchema)),omitEmpty:!0},{key:"local-state-delta",valueSchema:new Vt(new bt(Na.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sender-rewards",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({poolError:e,txn:t,applicationIndex:n,assetClosingAmount:a,assetIndex:i,closeRewards:r,closingAmount:o,confirmedRound:s,globalStateDelta:c,innerTxns:h,localStateDelta:d,logs:u,receiverRewards:l,senderRewards:g}){this.poolError=e,this.txn=t,this.applicationIndex=void 0===n?void 0:E(n),this.assetClosingAmount=void 0===a?void 0:E(a),this.assetIndex=void 0===i?void 0:E(i),this.closeRewards=void 0===r?void 0:E(r),this.closingAmount=void 0===o?void 0:E(o),this.confirmedRound=void 0===s?void 0:E(s),this.globalStateDelta=c,this.innerTxns=h,this.localStateDelta=d,this.logs=u,this.receiverRewards=void 0===l?void 0:E(l),this.senderRewards=void 0===g?void 0:E(g)}getEncodingSchema(){return bi.encodingSchema}toEncodingData(){return new Map([["pool-error",this.poolError],["txn",this.txn.toEncodingData()],["application-index",this.applicationIndex],["asset-closing-amount",this.assetClosingAmount],["asset-index",this.assetIndex],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map(e=>e.toEncodingData()):void 0],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map(e=>e.toEncodingData()):void 0],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map(e=>e.toEncodingData()):void 0],["logs",this.logs],["receiver-rewards",this.receiverRewards],["sender-rewards",this.senderRewards]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionResponse: ${e}`);return new bi({poolError:e.get("pool-error"),txn:Kn.fromEncodingData(e.get("txn")??new Map),applicationIndex:e.get("application-index"),assetClosingAmount:e.get("asset-closing-amount"),assetIndex:e.get("asset-index"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map(e=>gi.fromEncodingData(e)):void 0,innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map(e=>bi.fromEncodingData(e)):void 0,localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map(e=>Na.fromEncodingData(e)):void 0,logs:e.get("logs"),receiverRewards:e.get("receiver-rewards"),senderRewards:e.get("sender-rewards")})}}class xi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"top-transactions",valueSchema:new bt(Kn.encodingSchema),omitEmpty:!0},{key:"total-transactions",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({topTransactions:e,totalTransactions:t}){this.topTransactions=e,this.totalTransactions=v(t)}getEncodingSchema(){return xi.encodingSchema}toEncodingData(){return new Map([["top-transactions",this.topTransactions.map(e=>e.toEncodingData())],["total-transactions",this.totalTransactions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionsResponse: ${e}`);return new xi({topTransactions:(e.get("top-transactions")??[]).map(e=>Kn.fromEncodingData(e)),totalTransactions:e.get("total-transactions")})}}class Ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txId",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({txid:e}){this.txid=e}getEncodingSchema(){return Ai.encodingSchema}toEncodingData(){return new Map([["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PostTransactionsResponse: ${e}`);return new Ai({txid:e.get("txId")})}}class Di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"new-value",valueSchema:Za.encodingSchema,omitEmpty:!0},{key:"slot",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({newValue:e,slot:t}){this.newValue=e,this.slot=v(t)}getEncodingSchema(){return Di.encodingSchema}toEncodingData(){return new Map([["new-value",this.newValue.toEncodingData()],["slot",this.slot]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ScratchChange: ${e}`);return new Di({newValue:Za.fromEncodingData(e.get("new-value")??new Map),slot:e.get("slot")})}}class Ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app-initial-states",valueSchema:new Vt(new bt(qa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({appInitialStates:e}){this.appInitialStates=e}getEncodingSchema(){return Ii.encodingSchema}toEncodingData(){return new Map([["app-initial-states",void 0!==this.appInitialStates?this.appInitialStates.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateInitialStates: ${e}`);return new Ii({appInitialStates:void 0!==e.get("app-initial-states")?e.get("app-initial-states").map(e=>qa.fromEncodingData(e)):void 0})}}class Ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-groups",valueSchema:new bt(Pi.encodingSchema),omitEmpty:!0},{key:"allow-empty-signatures",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-more-logging",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new Vt(Vi.encodingSchema),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fix-signers",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:n,allowUnnamedResources:a,execTraceConfig:i,extraOpcodeBudget:r,fixSigners:o,round:s}){this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=n,this.allowUnnamedResources=a,this.execTraceConfig=i,this.extraOpcodeBudget=void 0===r?void 0:v(r),this.fixSigners=o,this.round=void 0===s?void 0:E(s)}getEncodingSchema(){return Ti.encodingSchema}toEncodingData(){return new Map([["txn-groups",this.txnGroups.map(e=>e.toEncodingData())],["allow-empty-signatures",this.allowEmptySignatures],["allow-more-logging",this.allowMoreLogging],["allow-unnamed-resources",this.allowUnnamedResources],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequest: ${e}`);return new Ti({txnGroups:(e.get("txn-groups")??[]).map(e=>Pi.fromEncodingData(e)),allowEmptySignatures:e.get("allow-empty-signatures"),allowMoreLogging:e.get("allow-more-logging"),allowUnnamedResources:e.get("allow-unnamed-resources"),execTraceConfig:void 0!==e.get("exec-trace-config")?Vi.fromEncodingData(e.get("exec-trace-config")):void 0,extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),round:e.get("round")})}}class Pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txns",valueSchema:new bt(Kn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txns:e}){this.txns=e}getEncodingSchema(){return Pi.encodingSchema}toEncodingData(){return new Map([["txns",this.txns.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequestTransactionGroup: ${e}`);return new Pi({txns:(e.get("txns")??[]).map(e=>Kn.fromEncodingData(e))})}}class Mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"txn-groups",valueSchema:new bt(Ri.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new Be,omitEmpty:!0},{key:"eval-overrides",valueSchema:new Vt(Ui.encodingSchema),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new Vt(Vi.encodingSchema),omitEmpty:!0},{key:"initial-states",valueSchema:new Vt(Ii.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lastRound:e,txnGroups:t,version:n,evalOverrides:a,execTraceConfig:i,initialStates:r}){this.lastRound=E(e),this.txnGroups=t,this.version=v(n),this.evalOverrides=a,this.execTraceConfig=i,this.initialStates=r}getEncodingSchema(){return Mi.encodingSchema}toEncodingData(){return new Map([["last-round",this.lastRound],["txn-groups",this.txnGroups.map(e=>e.toEncodingData())],["version",this.version],["eval-overrides",void 0!==this.evalOverrides?this.evalOverrides.toEncodingData():void 0],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["initial-states",void 0!==this.initialStates?this.initialStates.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateResponse: ${e}`);return new Mi({lastRound:e.get("last-round"),txnGroups:(e.get("txn-groups")??[]).map(e=>Ri.fromEncodingData(e)),version:e.get("version"),evalOverrides:void 0!==e.get("eval-overrides")?Ui.fromEncodingData(e.get("eval-overrides")):void 0,execTraceConfig:void 0!==e.get("exec-trace-config")?Vi.fromEncodingData(e.get("exec-trace-config")):void 0,initialStates:void 0!==e.get("initial-states")?Ii.fromEncodingData(e.get("initial-states")):void 0})}}class Vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"enable",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"scratch-change",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"stack-change",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"state-change",valueSchema:new Vt(new Ve),omitEmpty:!0})),this.encodingSchemaValue}constructor({enable:e,scratchChange:t,stackChange:n,stateChange:a}){this.enable=e,this.scratchChange=t,this.stackChange=n,this.stateChange=a}getEncodingSchema(){return Vi.encodingSchema}toEncodingData(){return new Map([["enable",this.enable],["scratch-change",this.scratchChange],["stack-change",this.stackChange],["state-change",this.stateChange]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTraceConfig: ${e}`);return new Vi({enable:e.get("enable"),scratchChange:e.get("scratch-change"),stackChange:e.get("stack-change"),stateChange:e.get("state-change")})}}class Ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-results",valueSchema:new bt(Bi.encodingSchema),omitEmpty:!0},{key:"app-budget-added",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"failed-at",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"failure-message",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"group-fees-paid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"group-usage",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new Vt(Ci.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:n,failedAt:a,failureMessage:i,groupFeesPaid:r,groupUsage:o,unnamedResourcesAccessed:s}){this.txnResults=e,this.appBudgetAdded=void 0===t?void 0:v(t),this.appBudgetConsumed=void 0===n?void 0:v(n),this.failedAt=void 0===a?void 0:a.map(v),this.failureMessage=i,this.groupFeesPaid=void 0===r?void 0:v(r),this.groupUsage=void 0===o?void 0:v(o),this.unnamedResourcesAccessed=s}getEncodingSchema(){return Ri.encodingSchema}toEncodingData(){return new Map([["txn-results",this.txnResults.map(e=>e.toEncodingData())],["app-budget-added",this.appBudgetAdded],["app-budget-consumed",this.appBudgetConsumed],["failed-at",this.failedAt],["failure-message",this.failureMessage],["group-fees-paid",this.groupFeesPaid],["group-usage",this.groupUsage],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionGroupResult: ${e}`);return new Ri({txnResults:(e.get("txn-results")??[]).map(e=>Bi.fromEncodingData(e)),appBudgetAdded:e.get("app-budget-added"),appBudgetConsumed:e.get("app-budget-consumed"),failedAt:e.get("failed-at"),failureMessage:e.get("failure-message"),groupFeesPaid:e.get("group-fees-paid"),groupUsage:e.get("group-usage"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?Ci.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class Bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"txn-result",valueSchema:bi.encodingSchema,omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"exec-trace",valueSchema:new Vt(Oi.encodingSchema),omitEmpty:!0},{key:"fees-paid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fixed-signer",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"logic-sig-budget-consumed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new Vt(Ci.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResult:e,appBudgetConsumed:t,execTrace:n,feesPaid:a,fixedSigner:i,logicSigBudgetConsumed:r,unnamedResourcesAccessed:o}){this.txnResult=e,this.appBudgetConsumed=void 0===t?void 0:v(t),this.execTrace=n,this.feesPaid=void 0===a?void 0:v(a),this.fixedSigner="string"==typeof i?ut.fromString(i):i,this.logicSigBudgetConsumed=void 0===r?void 0:v(r),this.unnamedResourcesAccessed=o}getEncodingSchema(){return Bi.encodingSchema}toEncodingData(){return new Map([["txn-result",this.txnResult.toEncodingData()],["app-budget-consumed",this.appBudgetConsumed],["exec-trace",void 0!==this.execTrace?this.execTrace.toEncodingData():void 0],["fees-paid",this.feesPaid],["fixed-signer",void 0!==this.fixedSigner?this.fixedSigner.toString():void 0],["logic-sig-budget-consumed",this.logicSigBudgetConsumed],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionResult: ${e}`);return new Bi({txnResult:bi.fromEncodingData(e.get("txn-result")??new Map),appBudgetConsumed:e.get("app-budget-consumed"),execTrace:void 0!==e.get("exec-trace")?Oi.fromEncodingData(e.get("exec-trace")):void 0,feesPaid:e.get("fees-paid"),fixedSigner:e.get("fixed-signer"),logicSigBudgetConsumed:e.get("logic-sig-budget-consumed"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?Ci.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class Ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"app-locals",valueSchema:new Vt(new bt(za.encodingSchema)),omitEmpty:!0},{key:"apps",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"asset-holdings",valueSchema:new Vt(new bt(Ya.encodingSchema)),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"boxes",valueSchema:new Vt(new bt(oi.encodingSchema)),omitEmpty:!0},{key:"extra-box-refs",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,appLocals:t,apps:n,assetHoldings:a,assets:i,boxes:r,extraBoxRefs:o}){this.accounts=void 0!==e?e.map(e=>"string"==typeof e?ut.fromString(e):e):void 0,this.appLocals=t,this.apps=void 0===n?void 0:n.map(E),this.assetHoldings=a,this.assets=void 0===i?void 0:i.map(E),this.boxes=r,this.extraBoxRefs=void 0===o?void 0:v(o)}getEncodingSchema(){return Ci.encodingSchema}toEncodingData(){return new Map([["accounts",void 0!==this.accounts?this.accounts.map(e=>e.toString()):void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map(e=>e.toEncodingData()):void 0],["apps",this.apps],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map(e=>e.toEncodingData()):void 0],["assets",this.assets],["boxes",void 0!==this.boxes?this.boxes.map(e=>e.toEncodingData()):void 0],["extra-box-refs",this.extraBoxRefs]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateUnnamedResourcesAccessed: ${e}`);return new Ci({accounts:e.get("accounts"),appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map(e=>za.fromEncodingData(e)):void 0,apps:e.get("apps"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map(e=>Ya.fromEncodingData(e)):void 0,assets:e.get("assets"),boxes:void 0!==e.get("boxes")?e.get("boxes").map(e=>oi.fromEncodingData(e)):void 0,extraBoxRefs:e.get("extra-box-refs")})}}class Ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"allow-empty-signatures",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fix-signers",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"max-log-calls",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"max-log-size",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:n,fixSigners:a,maxLogCalls:i,maxLogSize:r}){this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=void 0===n?void 0:v(n),this.fixSigners=a,this.maxLogCalls=void 0===i?void 0:v(i),this.maxLogSize=void 0===r?void 0:v(r)}getEncodingSchema(){return Ui.encodingSchema}toEncodingData(){return new Map([["allow-empty-signatures",this.allowEmptySignatures],["allow-unnamed-resources",this.allowUnnamedResources],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["max-log-calls",this.maxLogCalls],["max-log-size",this.maxLogSize]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationEvalOverrides: ${e}`);return new Ui({allowEmptySignatures:e.get("allow-empty-signatures"),allowUnnamedResources:e.get("allow-unnamed-resources"),extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),maxLogCalls:e.get("max-log-calls"),maxLogSize:e.get("max-log-size")})}}class $i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"pc",valueSchema:new Be,omitEmpty:!0},{key:"scratch-changes",valueSchema:new Vt(new bt(Di.encodingSchema)),omitEmpty:!0},{key:"spawned-inners",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"stack-additions",valueSchema:new Vt(new bt(Za.encodingSchema)),omitEmpty:!0},{key:"stack-pop-count",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"state-changes",valueSchema:new Vt(new bt(ja.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({pc:e,scratchChanges:t,spawnedInners:n,stackAdditions:a,stackPopCount:i,stateChanges:r}){this.pc=v(e),this.scratchChanges=t,this.spawnedInners=void 0===n?void 0:n.map(v),this.stackAdditions=a,this.stackPopCount=void 0===i?void 0:v(i),this.stateChanges=r}getEncodingSchema(){return $i.encodingSchema}toEncodingData(){return new Map([["pc",this.pc],["scratch-changes",void 0!==this.scratchChanges?this.scratchChanges.map(e=>e.toEncodingData()):void 0],["spawned-inners",this.spawnedInners],["stack-additions",void 0!==this.stackAdditions?this.stackAdditions.map(e=>e.toEncodingData()):void 0],["stack-pop-count",this.stackPopCount],["state-changes",void 0!==this.stateChanges?this.stateChanges.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationOpcodeTraceUnit: ${e}`);return new $i({pc:e.get("pc"),scratchChanges:void 0!==e.get("scratch-changes")?e.get("scratch-changes").map(e=>Di.fromEncodingData(e)):void 0,spawnedInners:e.get("spawned-inners"),stackAdditions:void 0!==e.get("stack-additions")?e.get("stack-additions").map(e=>Za.fromEncodingData(e)):void 0,stackPopCount:e.get("stack-pop-count"),stateChanges:void 0!==e.get("state-changes")?e.get("state-changes").map(e=>ja.fromEncodingData(e)):void 0})}}class Oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"approval-program-trace",valueSchema:new Vt(new bt($i.encodingSchema)),omitEmpty:!0},{key:"clear-state-program-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"clear-state-program-trace",valueSchema:new Vt(new bt($i.encodingSchema)),omitEmpty:!0},{key:"clear-state-rollback",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"clear-state-rollback-error",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"inner-trace",valueSchema:new Vt(new bt(Oi.encodingSchema)),omitEmpty:!0},{key:"logic-sig-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new Vt(new bt($i.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:n,clearStateProgramTrace:a,clearStateRollback:i,clearStateRollbackError:r,innerTrace:o,logicSigHash:s,logicSigTrace:c}){this.approvalProgramHash="string"==typeof e?he(e):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof n?he(n):n,this.clearStateProgramTrace=a,this.clearStateRollback=i,this.clearStateRollbackError=r,this.innerTrace=o,this.logicSigHash="string"==typeof s?he(s):s,this.logicSigTrace=c}getEncodingSchema(){return Oi.encodingSchema}toEncodingData(){return new Map([["approval-program-hash",this.approvalProgramHash],["approval-program-trace",void 0!==this.approvalProgramTrace?this.approvalProgramTrace.map(e=>e.toEncodingData()):void 0],["clear-state-program-hash",this.clearStateProgramHash],["clear-state-program-trace",void 0!==this.clearStateProgramTrace?this.clearStateProgramTrace.map(e=>e.toEncodingData()):void 0],["clear-state-rollback",this.clearStateRollback],["clear-state-rollback-error",this.clearStateRollbackError],["inner-trace",void 0!==this.innerTrace?this.innerTrace.map(e=>e.toEncodingData()):void 0],["logic-sig-hash",this.logicSigHash],["logic-sig-trace",void 0!==this.logicSigTrace?this.logicSigTrace.map(e=>e.toEncodingData()):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationTransactionExecTrace: ${e}`);return new Oi({approvalProgramHash:e.get("approval-program-hash"),approvalProgramTrace:void 0!==e.get("approval-program-trace")?e.get("approval-program-trace").map(e=>$i.fromEncodingData(e)):void 0,clearStateProgramHash:e.get("clear-state-program-hash"),clearStateProgramTrace:void 0!==e.get("clear-state-program-trace")?e.get("clear-state-program-trace").map(e=>$i.fromEncodingData(e)):void 0,clearStateRollback:e.get("clear-state-rollback"),clearStateRollbackError:e.get("clear-state-rollback-error"),innerTrace:void 0!==e.get("inner-trace")?e.get("inner-trace").map(e=>Oi.fromEncodingData(e)):void 0,logicSigHash:e.get("logic-sig-hash"),logicSigTrace:void 0!==e.get("logic-sig-trace")?e.get("logic-sig-trace").map(e=>$i.fromEncodingData(e)):void 0})}}class Ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Message",valueSchema:Li.encodingSchema,omitEmpty:!0},{key:"StateProof",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateproof:t}){this.message=e,this.stateproof="string"==typeof t?he(t):t}getEncodingSchema(){return Ni.encodingSchema}toEncodingData(){return new Map([["Message",this.message.toEncodingData()],["StateProof",this.stateproof]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new Ni({message:Li.fromEncodingData(e.get("Message")??new Map),stateproof:e.get("StateProof")})}}class Li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"BlockHeadersCommitment",valueSchema:new St,omitEmpty:!0},{key:"FirstAttestedRound",valueSchema:new Be,omitEmpty:!0},{key:"LastAttestedRound",valueSchema:new Be,omitEmpty:!0},{key:"LnProvenWeight",valueSchema:new Be,omitEmpty:!0},{key:"VotersCommitment",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:n,lnprovenweight:a,voterscommitment:i}){this.blockheaderscommitment="string"==typeof e?he(e):e,this.firstattestedround=E(t),this.lastattestedround=E(n),this.lnprovenweight=E(a),this.voterscommitment="string"==typeof i?he(i):i}getEncodingSchema(){return Li.encodingSchema}toEncodingData(){return new Map([["BlockHeadersCommitment",this.blockheaderscommitment],["FirstAttestedRound",this.firstattestedround],["LastAttestedRound",this.lastattestedround],["LnProvenWeight",this.lnprovenweight],["VotersCommitment",this.voterscommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new Li({blockheaderscommitment:e.get("BlockHeadersCommitment"),firstattestedround:e.get("FirstAttestedRound"),lastattestedround:e.get("LastAttestedRound"),lnprovenweight:e.get("LnProvenWeight"),voterscommitment:e.get("VotersCommitment")})}}class _i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current_round",valueSchema:new Be,omitEmpty:!0},{key:"online-money",valueSchema:new Be,omitEmpty:!0},{key:"online-stake",valueSchema:new Be,omitEmpty:!0},{key:"total-money",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,onlineMoney:t,onlineStake:n,totalMoney:a}){this.currentRound=E(e),this.onlineMoney=E(t),this.onlineStake=E(n),this.totalMoney=E(a)}getEncodingSchema(){return _i.encodingSchema}toEncodingData(){return new Map([["current_round",this.currentRound],["online-money",this.onlineMoney],["online-stake",this.onlineStake],["total-money",this.totalMoney]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SupplyResponse: ${e}`);return new _i({currentRound:e.get("current_round"),onlineMoney:e.get("online-money"),onlineStake:e.get("online-stake"),totalMoney:e.get("total-money")})}}class qi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:Fi.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return qi.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new qi({key:e.get("key"),value:Fi.fromEncodingData(e.get("value")??new Map)})}}class Fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new St,omitEmpty:!0},{key:"type",valueSchema:new Be,omitEmpty:!0},{key:"uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?he(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return Fi.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new Fi({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class zi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"Deltas",valueSchema:new bt(vi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({deltas:e}){this.deltas=e}getEncodingSchema(){return zi.encodingSchema}toEncodingData(){return new Map([["Deltas",this.deltas.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionGroupLedgerStateDeltasForRoundResponse: ${e}`);return new zi({deltas:(e.get("Deltas")??[]).map(e=>vi.fromEncodingData(e))})}}class Ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"consensus-version",valueSchema:new Re,omitEmpty:!0},{key:"fee",valueSchema:new Be,omitEmpty:!0},{key:"genesis-hash",valueSchema:new St,omitEmpty:!0},{key:"genesis-id",valueSchema:new Re,omitEmpty:!0},{key:"last-round",valueSchema:new Be,omitEmpty:!0},{key:"min-fee",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({consensusVersion:e,fee:t,genesisHash:n,genesisId:a,lastRound:i,minFee:r}){this.consensusVersion=e,this.fee=E(t),this.genesisHash="string"==typeof n?he(n):n,this.genesisId=a,this.lastRound=E(i),this.minFee=E(r)}getEncodingSchema(){return Ki.encodingSchema}toEncodingData(){return new Map([["consensus-version",this.consensusVersion],["fee",this.fee],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["last-round",this.lastRound],["min-fee",this.minFee]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionParametersResponse: ${e}`);return new Ki({consensusVersion:e.get("consensus-version"),fee:e.get("fee"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),lastRound:e.get("last-round"),minFee:e.get("min-fee")})}}class Hi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"idx",valueSchema:new Be,omitEmpty:!0},{key:"proof",valueSchema:new St,omitEmpty:!0},{key:"stibhash",valueSchema:new St,omitEmpty:!0},{key:"treedepth",valueSchema:new Be,omitEmpty:!0},{key:"hashtype",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({idx:e,proof:t,stibhash:n,treedepth:a,hashtype:i}){this.idx=v(e),this.proof="string"==typeof t?he(t):t,this.stibhash="string"==typeof n?he(n):n,this.treedepth=v(a),this.hashtype=i}getEncodingSchema(){return Hi.encodingSchema}toEncodingData(){return new Map([["idx",this.idx],["proof",this.proof],["stibhash",this.stibhash],["treedepth",this.treedepth],["hashtype",this.hashtype]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionProof: ${e}`);return new Hi({idx:e.get("idx"),proof:e.get("proof"),stibhash:e.get("stibhash"),treedepth:e.get("treedepth"),hashtype:e.get("hashtype")})}}class ji{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"build",valueSchema:ci.encodingSchema,omitEmpty:!0},{key:"genesis_hash_b64",valueSchema:new St,omitEmpty:!0},{key:"genesis_id",valueSchema:new Re,omitEmpty:!0},{key:"versions",valueSchema:new bt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({build:e,genesisHashB64:t,genesisId:n,versions:a}){this.build=e,this.genesisHashB64="string"==typeof t?he(t):t,this.genesisId=n,this.versions=a}getEncodingSchema(){return ji.encodingSchema}toEncodingData(){return new Map([["build",this.build.toEncodingData()],["genesis_hash_b64",this.genesisHashB64],["genesis_id",this.genesisId],["versions",this.versions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Version: ${e}`);return new ji({build:ci.fromEncodingData(e.get("build")??new Map),genesisHashB64:e.get("genesis_hash_b64"),genesisId:e.get("genesis_id"),versions:e.get("versions")})}}class Gi{constructor(e){this.c=e,this.query={}}executeRequest(e,t){return this.c.get({relativePath:this.path(),query:this.query,requestHeaders:e,customOptions:t})}async do(e,t){const n=await this.executeRequest(e,t);return this.prepare(n)}async doRaw(e,t){return(await this.executeRequest(e,t)).body}}class Ji extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}prepare(e){return Pe(e.getJSONText(),Ma)}}class Wi extends Gi{constructor(e,t,n){super(e),this.account=t.toString(),this.assetID=BigInt(n)}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}prepare(e){return Pe(e.getJSONText(),Ua)}}class Yi extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}next(e){return this.query.next=e,this}prepare(e){return Pe(e.getJSONText(),$a)}}class Xi extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/applications`}include(e){return this.query.include=e.join(","),this}limit(e){return this.query.limit=e,this}next(e){return this.query.next=e,this}prepare(e){return Pe(e.getJSONText(),Ba)}}class Qi extends Gi{constructor(e,t,n){super(e),this.account=t.toString(),this.applicationID=BigInt(n)}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}prepare(e){return Pe(e.getJSONText(),Ra)}}class Zi extends Gi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return Ie(e.body,ni)}}class er extends Gi{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:le(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),hi)}}class tr extends Gi{path(){return"/genesis"}prepare(e){return e.getJSONText()}}class nr extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}prepare(e){return Pe(e.getJSONText(),Ja)}}class ar extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}prepare(e){return Pe(e.getJSONText(),_a)}}class ir extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/hash`}prepare(e){return Pe(e.getJSONText(),ei)}}class rr extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/txids`}prepare(e){return Pe(e.getJSONText(),ai)}}class or extends Gi{constructor(e,t,n){super(e),this.index=BigInt(t);const a=de(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return Pe(e.getJSONText(),ii)}}class sr extends Gi{constructor(e,t){super(e),this.index=BigInt(t),this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}next(e){return this.query.next=e,this}prefix(e){return this.query.prefix=`b64:${de(e)}`,this}include(...e){return this.query.include=e.join(","),this}limit(e){return this.query.limit=e,this}round(e){return this.query.round=v(e),this}prepare(e){return Pe(e.getJSONText(),si)}}class cr extends Gi{path(){return"/health"}prepare(e){}}class hr extends Gi{constructor(e,t){super(e),this.txid=t,this.query.format="msgpack"}prepare(e){return Ie(e.body,bi)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class dr extends Gi{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){return Ie(e.body,xi)}max(e){return this.query.max=e,this}}class ur extends Gi{constructor(e,t){super(e),this.address=t.toString(),this.query.format="msgpack"}prepare(e){return Ie(e.body,xi)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class lr extends Gi{constructor(e,t,n){super(e),this.txID=n,this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}prepare(e){return Pe(e.getJSONText(),Hi)}}function gr(e){return e&&void 0!==e.byteLength}class mr extends Gi{constructor(e,t){super(e);let n=t;if(Array.isArray(t)){if(!t.every(gr))throw new TypeError("Array elements must be byte arrays");n=y(...t)}else if(!gr(n))throw new TypeError("Argument must be byte array");this.txnBytesToPost=n}path(){return"/v2/transactions"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="application/x-binary"),t}(e);return this.c.post({relativePath:this.path(),data:this.txnBytesToPost,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),Ai)}}class pr extends Gi{path(){return"/v2/status"}prepare(e){return Pe(e.getJSONText(),Ei)}}class fr extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/status/wait-for-block-after/${this.round}`}prepare(e){return Pe(e.getJSONText(),Ei)}}class yr extends Gi{path(){return"/v2/transactions/params"}prepare(e){const t=Pe(e.getJSONText(),Ki);return{flatFee:!1,fee:t.fee,firstValid:t.lastRound,lastValid:t.lastRound+BigInt(1e3),genesisID:t.genesisId,genesisHash:t.genesisHash,minFee:t.minFee,consensusVersion:t.consensusVersion}}}class wr extends Gi{path(){return"/v2/ledger/supply"}prepare(e){return Pe(e.getJSONText(),_i)}}class vr extends Gi{path(){return"/versions"}prepare(e){return Pe(e.getJSONText(),ji)}}class Sr extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/lightheader/proof`}prepare(e){return Pe(e.getJSONText(),Si)}}class Er extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/stateproofs/${this.round}`}prepare(e){return Pe(e.getJSONText(),Ni)}}class kr extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/ledger/sync/${this.round}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class br extends Gi{path(){return"/v2/ledger/sync"}prepare(e){return Pe(e.getJSONText(),wi)}}class xr extends Gi{constructor(e,t){super(e),this.offset=BigInt(t)}path(){return`/v2/devmode/blocks/offset/${this.offset}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class Ar extends Gi{path(){return"/v2/devmode/blocks/offset"}prepare(e){return Pe(e.getJSONText(),fi)}}class Dr extends Gi{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/disassemble"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:le(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Pe(e.getJSONText(),di)}}class Ir extends Gi{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=Te(t)}path(){return"/v2/transactions/simulate"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&(t={...e},t["Content-Type"]="application/msgpack"),t}(e);return this.c.post({relativePath:this.path(),data:this.requestBytes,query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return Ie(e.body,Mi)}}class Tr extends Gi{path(){return"/ready"}prepare(e){}}class Pr extends Gi{path(){return"/v2/ledger/sync"}executeRequest(e,t){return this.c.delete({relativePath:this.path(),data:void 0,requestHeaders:e,customOptions:t})}prepare(e){}}class Mr extends Gi{constructor(e,t){super(e),this.id=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/txn/group/${this.id}`}prepare(e){return Ie(e.body,Pa)}}class Vr extends Gi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}`}prepare(e){return Ie(e.body,Pa)}}class Rr extends Gi{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return Ie(e.body,zi)}}class Br extends T{constructor(e,t,n,a={}){super("X-Algo-API-Token",e,t,n,a)}healthCheck(){return new cr(this.c)}versionsCheck(){return new vr(this.c)}sendRawTransaction(e){return new mr(this.c,e)}accountInformation(e){return new Ji(this.c,e)}accountAssetInformation(e,t){return new Wi(this.c,e,t)}accountAssetsInformation(e){return new Yi(this.c,e)}accountApplicationsInformation(e){return new Xi(this.c,e)}accountApplicationInformation(e,t){return new Qi(this.c,e,t)}block(e){return new Zi(this.c,e)}getBlockHash(e){return new ir(this.c,e)}getBlockTxids(e){return new rr(this.c,e)}pendingTransactionInformation(e){return new hr(this.c,e)}pendingTransactionsInformation(){return new dr(this.c)}pendingTransactionByAddress(e){return new ur(this.c,e)}status(){return new pr(this.c)}statusAfterBlock(e){return new fr(this.c,e)}getTransactionParams(){return new yr(this.c)}supply(){return new wr(this.c)}compile(e){return new er(this.c,e)}disassemble(e){return new Dr(this.c,e)}getAssetByID(e){return new nr(this.c,e)}getApplicationByID(e){return new ar(this.c,e)}getApplicationBoxByName(e,t){return new or(this.c,e,t)}getApplicationBoxes(e){return new sr(this.c,e)}genesis(){return new tr(this.c)}getTransactionProof(e,t){return new lr(this.c,e,t)}getLightBlockHeaderProof(e){return new Sr(this.c,e)}getStateProof(e){return new Er(this.c,e)}simulateRawTransactions(e){const t=[];if(Array.isArray(e))for(const n of e)t.push(Ie(n,Kn));else t.push(Ie(e,Kn));const n=new Ti({txnGroups:[new Pi({txns:t})]});return this.simulateTransactions(n)}simulateTransactions(e){return new Ir(this.c,e)}setBlockOffsetTimestamp(e){return new xr(this.c,e)}getBlockOffsetTimestamp(){return new Ar(this.c)}setSyncRound(e){return new kr(this.c,e)}unsetSyncRound(){return new Pr(this.c)}getSyncRound(){return new br(this.c)}ready(){return new Tr(this.c)}getLedgerStateDeltaForTransactionGroup(e){return new Mr(this.c,e)}getLedgerStateDelta(e){return new Vr(this.c,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new Rr(this.c,e)}}class Cr extends T{constructor(e,t="http://127.0.0.1",n=7833,a={}){super("X-KMD-API-Token",e,t,n,a)}async get(e){return(await this.c.get({relativePath:e})).parseBodyAsJSON({intDecoding:l.SAFE})}async delete(e,t){return(await this.c.delete({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async post(e,t){return(await this.c.post({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async versions(){return this.get("/versions")}async listWallets(){return this.get("/v1/wallets")}async createWallet(e,t,n=new Uint8Array,a="sqlite"){const i={wallet_name:e,wallet_driver_name:a,wallet_password:t,master_derivation_key:de(n)};return this.post("/v1/wallet",i)}async initWalletHandle(e,t){const n={wallet_id:e,wallet_password:t};return this.post("/v1/wallet/init",n)}async releaseWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/release",t)}async renewWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/renew",t)}async renameWallet(e,t,n){const a={wallet_id:e,wallet_password:t,wallet_name:n};return this.post("/v1/wallet/rename",a)}async getWallet(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/info",t)}async exportMasterDerivationKey(e,t){const n={wallet_handle_token:e,wallet_password:t};return{master_derivation_key:he((await this.post("/v1/master-key/export",n)).master_derivation_key)}}async importKey(e,t){const n={wallet_handle_token:e,private_key:de(t)};return this.post("/v1/key/import",n)}async exportKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return{private_key:he((await this.post("/v1/key/export",a)).private_key)}}async generateKey(e){const t={wallet_handle_token:e,display_mnemonic:!1};return this.post("/v1/key",t)}async deleteKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/key",a)}async listKeys(e){const t={wallet_handle_token:e};return this.post("/v1/key/list",t)}async signTransaction(e,t,n){const a={wallet_handle_token:e,wallet_password:t,transaction:de(n.toByte())};return he((await this.post("/v1/transaction/sign",a)).signed_transaction)}async signTransactionWithSpecificPublicKey(e,t,n,a){const i=le(a),r={wallet_handle_token:e,wallet_password:t,transaction:de(n.toByte()),public_key:de(i)};return he((await this.post("/v1/transaction/sign",r)).signed_transaction)}async listMultisig(e){const t={wallet_handle_token:e};return this.post("/v1/multisig/list",t)}async importMultisig(e,t,n,a){const i={wallet_handle_token:e,multisig_version:t,threshold:n,pks:a};return this.post("/v1/multisig/import",i)}async exportMultisig(e,t){const n={wallet_handle_token:e,address:t};return this.post("/v1/multisig/export",n)}async signMultisigTransaction(e,t,n,a,i){const r=le(a),o={wallet_handle_token:e,transaction:de(n.toByte()),public_key:de(r),partial_multisig:i,wallet_password:t};return this.post("/v1/multisig/sign",o)}async deleteMultisig(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/multisig",a)}}class Ur{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"min-balance",valueSchema:new Be,omitEmpty:!0},{key:"pending-rewards",valueSchema:new Be,omitEmpty:!0},{key:"rewards",valueSchema:new Be,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"status",valueSchema:new Re,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new Be,omitEmpty:!0},{key:"total-box-bytes",valueSchema:new Be,omitEmpty:!0},{key:"total-boxes",valueSchema:new Be,omitEmpty:!0},{key:"total-created-apps",valueSchema:new Be,omitEmpty:!0},{key:"total-created-assets",valueSchema:new Be,omitEmpty:!0},{key:"apps-local-state",valueSchema:new Vt(new bt(qr.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new Vt(Gr.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new Vt(new bt(Xr.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"closed-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-apps",valueSchema:new Vt(new bt(_r.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new Vt(new bt(Wr.encodingSchema)),omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"last-proposed",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation",valueSchema:new Vt($r.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-type",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalBoxBytes:d,totalBoxes:u,totalCreatedApps:l,totalCreatedAssets:g,appsLocalState:m,appsTotalExtraPages:p,appsTotalSchema:f,assets:y,authAddr:w,closedAtRound:S,createdApps:k,createdAssets:b,createdAtRound:x,deleted:A,incentiveEligible:D,lastHeartbeat:I,lastProposed:T,participation:P,rewardBase:M,sigType:V}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=v(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalBoxBytes=v(d),this.totalBoxes=v(u),this.totalCreatedApps=v(l),this.totalCreatedAssets=v(g),this.appsLocalState=m,this.appsTotalExtraPages=void 0===p?void 0:v(p),this.appsTotalSchema=f,this.assets=y,this.authAddr="string"==typeof w?ut.fromString(w):w,this.closedAtRound=void 0===S?void 0:E(S),this.createdApps=k,this.createdAssets=b,this.createdAtRound=void 0===x?void 0:E(x),this.deleted=A,this.incentiveEligible=D,this.lastHeartbeat=void 0===I?void 0:v(I),this.lastProposed=void 0===T?void 0:v(T),this.participation=P,this.rewardBase=void 0===M?void 0:E(M),this.sigType=V}getEncodingSchema(){return Ur.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map(e=>e.toEncodingData()):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map(e=>e.toEncodingData()):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["closed-at-round",this.closedAtRound],["created-apps",void 0!==this.createdApps?this.createdApps.map(e=>e.toEncodingData()):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map(e=>e.toEncodingData()):void 0],["created-at-round",this.createdAtRound],["deleted",this.deleted],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new Ur({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map(e=>qr.fromEncodingData(e)):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Gr.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map(e=>Xr.fromEncodingData(e)):void 0,authAddr:e.get("auth-addr"),closedAtRound:e.get("closed-at-round"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map(e=>_r.fromEncodingData(e)):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map(e=>Wr.fromEncodingData(e)):void 0,createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?$r.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type")})}}class $r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new St,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Be,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new St,omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?he(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?he(i):i,this.stateProofKey="string"==typeof r?he(r):r}getEncodingSchema(){return $r.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new $r({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class Or{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:Ur.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,currentRound:t}){this.account=e,this.currentRound=E(t)}getEncodingSchema(){return Or.encodingSchema}toEncodingData(){return new Map([["account",this.account.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountResponse: ${e}`);return new Or({account:Ur.fromEncodingData(e.get("account")??new Map),currentRound:e.get("current-round")})}}class Nr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"delta",valueSchema:new bt(mo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return Nr.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map(e=>e.toEncodingData())]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new Nr({address:e.get("address"),delta:(e.get("delta")??[]).map(e=>mo.fromEncodingData(e))})}}class Lr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new bt(Ur.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,currentRound:t,nextToken:n}){this.accounts=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Lr.encodingSchema}toEncodingData(){return new Map([["accounts",this.accounts.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountsResponse: ${e}`);return new Lr({accounts:(e.get("accounts")??[]).map(e=>Ur.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class _r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:Hr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"deleted-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t,createdAtRound:n,deleted:a,deletedAtRound:i}){this.id=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.deletedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return _r.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["deleted-at-round",this.deletedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new _r({id:e.get("id"),params:Hr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),deletedAtRound:e.get("deleted-at-round")})}}class qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new Be,omitEmpty:!0},{key:"schema",valueSchema:Gr.encodingSchema,omitEmpty:!0},{key:"closed-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"key-value",valueSchema:new Vt(new bt(Bo.encodingSchema)),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,closedOutAtRound:n,deleted:a,keyValue:i,optedInAtRound:r}){this.id=E(e),this.schema=t,this.closedOutAtRound=void 0===n?void 0:E(n),this.deleted=a,this.keyValue=i,this.optedInAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return qr.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["closed-out-at-round",this.closedOutAtRound],["deleted",this.deleted],["key-value",void 0!==this.keyValue?this.keyValue.map(e=>e.toEncodingData()):void 0],["opted-in-at-round",this.optedInAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new qr({id:e.get("id"),schema:Gr.fromEncodingData(e.get("schema")??new Map),closedOutAtRound:e.get("closed-out-at-round"),deleted:e.get("deleted"),keyValue:void 0!==e.get("key-value")?e.get("key-value").map(e=>Bo.fromEncodingData(e)):void 0,optedInAtRound:e.get("opted-in-at-round")})}}class Fr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"apps-local-states",valueSchema:new bt(qr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({appsLocalStates:e,currentRound:t,nextToken:n}){this.appsLocalStates=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Fr.encodingSchema}toEncodingData(){return new Map([["apps-local-states",this.appsLocalStates.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalStatesResponse: ${e}`);return new Fr({appsLocalStates:(e.get("apps-local-states")??[]).map(e=>qr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new bt(new St),omitEmpty:!0},{key:"txid",valueSchema:new Re,omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e,txid:t}){this.logs=e,this.txid=t}getEncodingSchema(){return zr.encodingSchema}toEncodingData(){return new Map([["logs",this.logs],["txid",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogData: ${e}`);return new zr({logs:e.get("logs"),txid:e.get("txid")})}}class Kr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"log-data",valueSchema:new Vt(new bt(zr.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,currentRound:t,logData:n,nextToken:a}){this.applicationId=E(e),this.currentRound=E(t),this.logData=n,this.nextToken=a}getEncodingSchema(){return Kr.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["current-round",this.currentRound],["log-data",void 0!==this.logData?this.logData.map(e=>e.toEncodingData()):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogsResponse: ${e}`);return new Kr({applicationId:e.get("application-id"),currentRound:e.get("current-round"),logData:void 0!==e.get("log-data")?e.get("log-data").map(e=>zr.fromEncodingData(e)):void 0,nextToken:e.get("next-token")})}}class Hr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new St,omitEmpty:!0},{key:"clear-state-program",valueSchema:new St,omitEmpty:!0},{key:"creator",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"global-state",valueSchema:new Vt(new bt(Bo.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Gr.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Gr.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:i,globalStateSchema:r,localStateSchema:o,version:s}){this.approvalProgram="string"==typeof e?he(e):e,this.clearStateProgram="string"==typeof t?he(t):t,this.creator="string"==typeof n?ut.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.globalState=i,this.globalStateSchema=r,this.localStateSchema=o,this.version=void 0===s?void 0:v(s)}getEncodingSchema(){return Hr.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",void 0!==this.creator?this.creator.toString():void 0],["extra-program-pages",this.extraProgramPages],["global-state",void 0!==this.globalState?this.globalState.map(e=>e.toEncodingData()):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new Hr({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),globalState:void 0!==e.get("global-state")?e.get("global-state").map(e=>Bo.fromEncodingData(e)):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Gr.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Gr.fromEncodingData(e.get("local-state-schema")):void 0,version:e.get("version")})}}class jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"application",valueSchema:new Vt(_r.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,application:t}){this.currentRound=E(e),this.application=t}getEncodingSchema(){return jr.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["application",void 0!==this.application?this.application.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationResponse: ${e}`);return new jr({currentRound:e.get("current-round"),application:void 0!==e.get("application")?_r.fromEncodingData(e.get("application")):void 0})}}class Gr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Gr.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new Gr({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"applications",valueSchema:new bt(_r.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({applications:e,currentRound:t,nextToken:n}){this.applications=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Jr.encodingSchema}toEncodingData(){return new Map([["applications",this.applications.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationsResponse: ${e}`);return new Jr({applications:(e.get("applications")??[]).map(e=>_r.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Wr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new Be,omitEmpty:!0},{key:"params",valueSchema:Zr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"destroyed-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t,createdAtRound:n,deleted:a,destroyedAtRound:i}){this.index=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.destroyedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return Wr.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["destroyed-at-round",this.destroyedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Wr({index:e.get("index"),params:Zr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),destroyedAtRound:e.get("destroyed-at-round")})}}class Yr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"balances",valueSchema:new bt(ko.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({balances:e,currentRound:t,nextToken:n}){this.balances=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Yr.encodingSchema}toEncodingData(){return new Map([["balances",this.balances.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetBalancesResponse: ${e}`);return new Yr({balances:(e.get("balances")??[]).map(e=>ko.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Xr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Xr.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Xr({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class Qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new bt(Xr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Qr.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingsResponse: ${e}`);return new Qr({assets:(e.get("assets")??[]).map(e=>Xr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new Re,omitEmpty:!0},{key:"decimals",valueSchema:new Be,omitEmpty:!0},{key:"total",valueSchema:new Be,omitEmpty:!0},{key:"clawback",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"default-frozen",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"freeze",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"manager",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"metadata-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"reserve",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new Vt(new St),omitEmpty:!0},{key:"url",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"url-b64",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?he(s):s,this.name=c,this.nameB64="string"==typeof h?he(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?he(l):l,this.url=g,this.urlB64="string"==typeof m?he(m):m}getEncodingSchema(){return Zr.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Zr({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset",valueSchema:Wr.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({asset:e,currentRound:t}){this.asset=e,this.currentRound=E(t)}getEncodingSchema(){return eo.encodingSchema}toEncodingData(){return new Map([["asset",this.asset.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResponse: ${e}`);return new eo({asset:Wr.fromEncodingData(e.get("asset")??new Map),currentRound:e.get("current-round")})}}class to{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new bt(Wr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return to.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetsResponse: ${e}`);return new to({assets:(e.get("assets")??[]).map(e=>Wr.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class no{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"genesis-hash",valueSchema:new St,omitEmpty:!0},{key:"genesis-id",valueSchema:new Re,omitEmpty:!0},{key:"previous-block-hash",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"seed",valueSchema:new St,omitEmpty:!0},{key:"timestamp",valueSchema:new Be,omitEmpty:!0},{key:"transactions-root",valueSchema:new St,omitEmpty:!0},{key:"transactions-root-sha256",valueSchema:new St,omitEmpty:!0},{key:"bonus",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"congestion-tax",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"fees-collected",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"load",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"participation-updates",valueSchema:new Vt(bo.encodingSchema),omitEmpty:!0},{key:"previous-block-hash-512",valueSchema:new Vt(new St),omitEmpty:!0},{key:"proposer",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"proposer-payout",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"rewards",valueSchema:new Vt(io.encodingSchema),omitEmpty:!0},{key:"state-proof-tracking",valueSchema:new Vt(new bt(Mo.encodingSchema)),omitEmpty:!0},{key:"transactions",valueSchema:new Vt(new bt(Uo.encodingSchema)),omitEmpty:!0},{key:"transactions-root-sha512",valueSchema:new Vt(new St),omitEmpty:!0},{key:"txn-counter",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-state",valueSchema:new Vt(ro.encodingSchema),omitEmpty:!0},{key:"upgrade-vote",valueSchema:new Vt(oo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({genesisHash:e,genesisId:t,previousBlockHash:n,round:a,seed:i,timestamp:r,transactionsRoot:o,transactionsRootSha256:s,bonus:c,congestionTax:h,feesCollected:d,load:u,participationUpdates:l,previousBlockHash512:g,proposer:m,proposerPayout:p,rewards:f,stateProofTracking:y,transactions:w,transactionsRootSha512:S,txnCounter:k,upgradeState:b,upgradeVote:x}){this.genesisHash="string"==typeof e?he(e):e,this.genesisId=t,this.previousBlockHash="string"==typeof n?he(n):n,this.round=E(a),this.seed="string"==typeof i?he(i):i,this.timestamp=v(r),this.transactionsRoot="string"==typeof o?he(o):o,this.transactionsRootSha256="string"==typeof s?he(s):s,this.bonus=void 0===c?void 0:v(c),this.congestionTax=void 0===h?void 0:v(h),this.feesCollected=void 0===d?void 0:v(d),this.load=void 0===u?void 0:v(u),this.participationUpdates=l,this.previousBlockHash512="string"==typeof g?he(g):g,this.proposer="string"==typeof m?ut.fromString(m):m,this.proposerPayout=void 0===p?void 0:v(p),this.rewards=f,this.stateProofTracking=y,this.transactions=w,this.transactionsRootSha512="string"==typeof S?he(S):S,this.txnCounter=void 0===k?void 0:v(k),this.upgradeState=b,this.upgradeVote=x}getEncodingSchema(){return no.encodingSchema}toEncodingData(){return new Map([["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["previous-block-hash",this.previousBlockHash],["round",this.round],["seed",this.seed],["timestamp",this.timestamp],["transactions-root",this.transactionsRoot],["transactions-root-sha256",this.transactionsRootSha256],["bonus",this.bonus],["congestion-tax",this.congestionTax],["fees-collected",this.feesCollected],["load",this.load],["participation-updates",void 0!==this.participationUpdates?this.participationUpdates.toEncodingData():void 0],["previous-block-hash-512",this.previousBlockHash512],["proposer",void 0!==this.proposer?this.proposer.toString():void 0],["proposer-payout",this.proposerPayout],["rewards",void 0!==this.rewards?this.rewards.toEncodingData():void 0],["state-proof-tracking",void 0!==this.stateProofTracking?this.stateProofTracking.map(e=>e.toEncodingData()):void 0],["transactions",void 0!==this.transactions?this.transactions.map(e=>e.toEncodingData()):void 0],["transactions-root-sha512",this.transactionsRootSha512],["txn-counter",this.txnCounter],["upgrade-state",void 0!==this.upgradeState?this.upgradeState.toEncodingData():void 0],["upgrade-vote",void 0!==this.upgradeVote?this.upgradeVote.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Block: ${e}`);return new no({genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),previousBlockHash:e.get("previous-block-hash"),round:e.get("round"),seed:e.get("seed"),timestamp:e.get("timestamp"),transactionsRoot:e.get("transactions-root"),transactionsRootSha256:e.get("transactions-root-sha256"),bonus:e.get("bonus"),congestionTax:e.get("congestion-tax"),feesCollected:e.get("fees-collected"),load:e.get("load"),participationUpdates:void 0!==e.get("participation-updates")?bo.fromEncodingData(e.get("participation-updates")):void 0,previousBlockHash512:e.get("previous-block-hash-512"),proposer:e.get("proposer"),proposerPayout:e.get("proposer-payout"),rewards:void 0!==e.get("rewards")?io.fromEncodingData(e.get("rewards")):void 0,stateProofTracking:void 0!==e.get("state-proof-tracking")?e.get("state-proof-tracking").map(e=>Mo.fromEncodingData(e)):void 0,transactions:void 0!==e.get("transactions")?e.get("transactions").map(e=>Uo.fromEncodingData(e)):void 0,transactionsRootSha512:e.get("transactions-root-sha512"),txnCounter:e.get("txn-counter"),upgradeState:void 0!==e.get("upgrade-state")?ro.fromEncodingData(e.get("upgrade-state")):void 0,upgradeVote:void 0!==e.get("upgrade-vote")?oo.fromEncodingData(e.get("upgrade-vote")):void 0})}}class ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"blocks",valueSchema:new bt(no.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocks:e,currentRound:t,nextToken:n}){this.blocks=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return ao.encodingSchema}toEncodingData(){return new Map([["blocks",this.blocks.map(e=>e.toEncodingData())],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeadersResponse: ${e}`);return new ao({blocks:(e.get("blocks")??[]).map(e=>no.fromEncodingData(e)),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"fee-sink",valueSchema:new Re,omitEmpty:!0},{key:"rewards-calculation-round",valueSchema:new Be,omitEmpty:!0},{key:"rewards-level",valueSchema:new Be,omitEmpty:!0},{key:"rewards-pool",valueSchema:new Re,omitEmpty:!0},{key:"rewards-rate",valueSchema:new Be,omitEmpty:!0},{key:"rewards-residue",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:n,rewardsPool:a,rewardsRate:i,rewardsResidue:r}){this.feeSink=e,this.rewardsCalculationRound=E(t),this.rewardsLevel=E(n),this.rewardsPool=a,this.rewardsRate=E(i),this.rewardsResidue=E(r)}getEncodingSchema(){return io.encodingSchema}toEncodingData(){return new Map([["fee-sink",this.feeSink],["rewards-calculation-round",this.rewardsCalculationRound],["rewards-level",this.rewardsLevel],["rewards-pool",this.rewardsPool],["rewards-rate",this.rewardsRate],["rewards-residue",this.rewardsResidue]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockRewards: ${e}`);return new io({feeSink:e.get("fee-sink"),rewardsCalculationRound:e.get("rewards-calculation-round"),rewardsLevel:e.get("rewards-level"),rewardsPool:e.get("rewards-pool"),rewardsRate:e.get("rewards-rate"),rewardsResidue:e.get("rewards-residue")})}}class ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-protocol",valueSchema:new Re,omitEmpty:!0},{key:"next-protocol",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"next-protocol-approvals",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"next-protocol-switch-on",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"next-protocol-vote-before",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:n,nextProtocolSwitchOn:a,nextProtocolVoteBefore:i}){this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=void 0===n?void 0:v(n),this.nextProtocolSwitchOn=void 0===a?void 0:E(a),this.nextProtocolVoteBefore=void 0===i?void 0:E(i)}getEncodingSchema(){return ro.encodingSchema}toEncodingData(){return new Map([["current-protocol",this.currentProtocol],["next-protocol",this.nextProtocol],["next-protocol-approvals",this.nextProtocolApprovals],["next-protocol-switch-on",this.nextProtocolSwitchOn],["next-protocol-vote-before",this.nextProtocolVoteBefore]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeState: ${e}`);return new ro({currentProtocol:e.get("current-protocol"),nextProtocol:e.get("next-protocol"),nextProtocolApprovals:e.get("next-protocol-approvals"),nextProtocolSwitchOn:e.get("next-protocol-switch-on"),nextProtocolVoteBefore:e.get("next-protocol-vote-before")})}}class oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"upgrade-approve",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"upgrade-propose",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:n}){this.upgradeApprove=e,this.upgradeDelay=void 0===t?void 0:E(t),this.upgradePropose=n}getEncodingSchema(){return oo.encodingSchema}toEncodingData(){return new Map([["upgrade-approve",this.upgradeApprove],["upgrade-delay",this.upgradeDelay],["upgrade-propose",this.upgradePropose]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeVote: ${e}`);return new oo({upgradeApprove:e.get("upgrade-approve"),upgradeDelay:e.get("upgrade-delay"),upgradePropose:e.get("upgrade-propose")})}}class so{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"value",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?he(e):e,this.round=E(t),this.value="string"==typeof n?he(n):n}getEncodingSchema(){return so.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new so({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,value:t}){this.name="string"==typeof e?he(e):e,this.value="string"==typeof t?he(t):t}getEncodingSchema(){return co.encodingSchema}toEncodingData(){return new Map([["name",this.name],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new co({name:e.get("name"),value:e.get("value")})}}class ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new Be,omitEmpty:!0},{key:"name",valueSchema:new St,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=v(e),this.name="string"==typeof t?he(t):t}getEncodingSchema(){return ho.encodingSchema}toEncodingData(){return new Map([["app",this.app],["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxReference: ${e}`);return new ho({app:e.get("app"),name:e.get("name")})}}class uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"boxes",valueSchema:new bt(co.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,boxes:t,nextToken:n,round:a}){this.applicationId=E(e),this.boxes=t,this.nextToken=n,this.round=void 0===a?void 0:v(a)}getEncodingSchema(){return uo.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["boxes",this.boxes.map(e=>e.toEncodingData())],["next-token",this.nextToken],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new uo({applicationId:e.get("application-id"),boxes:(e.get("boxes")??[]).map(e=>co.fromEncodingData(e)),nextToken:e.get("next-token"),round:e.get("round")})}}class lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return lo.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new lo({message:e.get("message"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0})}}class go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new Be,omitEmpty:!0},{key:"bytes",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"uint",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return go.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new go({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new Re,omitEmpty:!0},{key:"value",valueSchema:go.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return mo.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new mo({key:e.get("key"),value:go.fromEncodingData(e.get("value")??new Map)})}}class po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash-type",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashType:e}){this.hashType=void 0===e?void 0:v(e)}getEncodingSchema(){return po.encodingSchema}toEncodingData(){return new Map([["hash-type",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new po({hashType:e.get("hash-type")})}}class fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hb-pk",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk1sig",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk2",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-pk2sig",valueSchema:new Vt(new St),omitEmpty:!0},{key:"hb-sig",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({hbPk:e,hbPk1sig:t,hbPk2:n,hbPk2sig:a,hbSig:i}){this.hbPk="string"==typeof e?he(e):e,this.hbPk1sig="string"==typeof t?he(t):t,this.hbPk2="string"==typeof n?he(n):n,this.hbPk2sig="string"==typeof a?he(a):a,this.hbSig="string"==typeof i?he(i):i}getEncodingSchema(){return fo.encodingSchema}toEncodingData(){return new Map([["hb-pk",this.hbPk],["hb-pk1sig",this.hbPk1sig],["hb-pk2",this.hbPk2],["hb-pk2sig",this.hbPk2sig],["hb-sig",this.hbSig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HbProofFields: ${e}`);return new fo({hbPk:e.get("hb-pk"),hbPk1sig:e.get("hb-pk1sig"),hbPk2:e.get("hb-pk2"),hbPk2sig:e.get("hb-pk2sig"),hbSig:e.get("hb-sig")})}}class yo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"db-available",valueSchema:new Ve,omitEmpty:!0},{key:"is-migrating",valueSchema:new Ve,omitEmpty:!0},{key:"message",valueSchema:new Re,omitEmpty:!0},{key:"round",valueSchema:new Be,omitEmpty:!0},{key:"version",valueSchema:new Re,omitEmpty:!0},{key:"data",valueSchema:new Vt(oa.encodingSchema),omitEmpty:!0},{key:"errors",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0})),this.encodingSchemaValue}constructor({dbAvailable:e,isMigrating:t,message:n,round:a,version:i,data:r,errors:o}){this.dbAvailable=e,this.isMigrating=t,this.message=n,this.round=E(a),this.version=i,this.data=r,this.errors=o}getEncodingSchema(){return yo.encodingSchema}toEncodingData(){return new Map([["db-available",this.dbAvailable],["is-migrating",this.isMigrating],["message",this.message],["round",this.round],["version",this.version],["data",void 0!==this.data?this.data.toEncodingData():void 0],["errors",this.errors]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HealthCheck: ${e}`);return new yo({dbAvailable:e.get("db-available"),isMigrating:e.get("is-migrating"),message:e.get("message"),round:e.get("round"),version:e.get("version"),data:void 0!==e.get("data")?oa.fromEncodingData(e.get("data")):void 0,errors:e.get("errors")})}}class wo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"asset",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,asset:t}){this.address="string"==typeof e?ut.fromString(e):e,this.asset=v(t)}getEncodingSchema(){return wo.encodingSchema}toEncodingData(){return new Map([["address",this.address.toString()],["asset",this.asset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HoldingRef: ${e}`);return new wo({address:e.get("address"),asset:e.get("asset")})}}class vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"block-headers-commitment",valueSchema:new Vt(new St),omitEmpty:!0},{key:"first-attested-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"latest-attested-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"ln-proven-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"voters-commitment",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:n,lnProvenWeight:a,votersCommitment:i}){this.blockHeadersCommitment="string"==typeof e?he(e):e,this.firstAttestedRound=void 0===t?void 0:E(t),this.latestAttestedRound=void 0===n?void 0:E(n),this.lnProvenWeight=void 0===a?void 0:E(a),this.votersCommitment="string"==typeof i?he(i):i}getEncodingSchema(){return vo.encodingSchema}toEncodingData(){return new Map([["block-headers-commitment",this.blockHeadersCommitment],["first-attested-round",this.firstAttestedRound],["latest-attested-round",this.latestAttestedRound],["ln-proven-weight",this.lnProvenWeight],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IndexerStateProofMessage: ${e}`);return new vo({blockHeadersCommitment:e.get("block-headers-commitment"),firstAttestedRound:e.get("first-attested-round"),latestAttestedRound:e.get("latest-attested-round"),lnProvenWeight:e.get("ln-proven-weight"),votersCommitment:e.get("voters-commitment")})}}class So{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"app",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,app:t}){this.address="string"==typeof e?ut.fromString(e):e,this.app=v(t)}getEncodingSchema(){return So.encodingSchema}toEncodingData(){return new Map([["address",this.address.toString()],["app",this.app]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LocalsRef: ${e}`);return new So({address:e.get("address"),app:e.get("app")})}}class Eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hash-factory",valueSchema:new Vt(po.encodingSchema),omitEmpty:!0},{key:"path",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"tree-depth",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashFactory:e,path:t,treeDepth:n}){this.hashFactory=e,this.path=t,this.treeDepth=void 0===n?void 0:v(n)}getEncodingSchema(){return Eo.encodingSchema}toEncodingData(){return new Map([["hash-factory",void 0!==this.hashFactory?this.hashFactory.toEncodingData():void 0],["path",this.path],["tree-depth",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new Eo({hashFactory:void 0!==e.get("hash-factory")?po.fromEncodingData(e.get("hash-factory")):void 0,path:e.get("path"),treeDepth:e.get("tree-depth")})}}class ko{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"is-frozen",valueSchema:new Ve,omitEmpty:!0},{key:"deleted",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.address=e,this.amount=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return ko.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MiniAssetHolding: ${e}`);return new ko({address:e.get("address"),amount:e.get("amount"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class bo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"absent-participation-accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"expired-participation-accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0})),this.encodingSchemaValue}constructor({absentParticipationAccounts:e,expiredParticipationAccounts:t}){this.absentParticipationAccounts=e,this.expiredParticipationAccounts=t}getEncodingSchema(){return bo.encodingSchema}toEncodingData(){return new Map([["absent-participation-accounts",this.absentParticipationAccounts],["expired-participation-accounts",this.expiredParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new bo({absentParticipationAccounts:e.get("absent-participation-accounts"),expiredParticipationAccounts:e.get("expired-participation-accounts")})}}class xo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"application-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"asset-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"box",valueSchema:new Vt(ho.encodingSchema),omitEmpty:!0},{key:"holding",valueSchema:new Vt(wo.encodingSchema),omitEmpty:!0},{key:"local",valueSchema:new Vt(So.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,applicationId:t,assetId:n,box:a,holding:i,local:r}){this.address="string"==typeof e?ut.fromString(e):e,this.applicationId=void 0===t?void 0:v(t),this.assetId=void 0===n?void 0:v(n),this.box=a,this.holding=i,this.local=r}getEncodingSchema(){return xo.encodingSchema}toEncodingData(){return new Map([["address",void 0!==this.address?this.address.toString():void 0],["application-id",this.applicationId],["asset-id",this.assetId],["box",void 0!==this.box?this.box.toEncodingData():void 0],["holding",void 0!==this.holding?this.holding.toEncodingData():void 0],["local",void 0!==this.local?this.local.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ResourceRef: ${e}`);return new xo({address:e.get("address"),applicationId:e.get("application-id"),assetId:e.get("asset-id"),box:void 0!==e.get("box")?ho.fromEncodingData(e.get("box")):void 0,holding:void 0!==e.get("holding")?wo.fromEncodingData(e.get("holding")):void 0,local:void 0!==e.get("local")?So.fromEncodingData(e.get("local")):void 0})}}class Ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"part-proofs",valueSchema:new Vt(Eo.encodingSchema),omitEmpty:!0},{key:"positions-to-reveal",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"reveals",valueSchema:new Vt(new bt(Io.encodingSchema)),omitEmpty:!0},{key:"salt-version",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-commit",valueSchema:new Vt(new St),omitEmpty:!0},{key:"sig-proofs",valueSchema:new Vt(Eo.encodingSchema),omitEmpty:!0},{key:"signed-weight",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({partProofs:e,positionsToReveal:t,reveals:n,saltVersion:a,sigCommit:i,sigProofs:r,signedWeight:o}){this.partProofs=e,this.positionsToReveal=void 0===t?void 0:t.map(E),this.reveals=n,this.saltVersion=void 0===a?void 0:v(a),this.sigCommit="string"==typeof i?he(i):i,this.sigProofs=r,this.signedWeight=void 0===o?void 0:E(o)}getEncodingSchema(){return Ao.encodingSchema}toEncodingData(){return new Map([["part-proofs",void 0!==this.partProofs?this.partProofs.toEncodingData():void 0],["positions-to-reveal",this.positionsToReveal],["reveals",void 0!==this.reveals?this.reveals.map(e=>e.toEncodingData()):void 0],["salt-version",this.saltVersion],["sig-commit",this.sigCommit],["sig-proofs",void 0!==this.sigProofs?this.sigProofs.toEncodingData():void 0],["signed-weight",this.signedWeight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofFields: ${e}`);return new Ao({partProofs:void 0!==e.get("part-proofs")?Eo.fromEncodingData(e.get("part-proofs")):void 0,positionsToReveal:e.get("positions-to-reveal"),reveals:void 0!==e.get("reveals")?e.get("reveals").map(e=>Io.fromEncodingData(e)):void 0,saltVersion:e.get("salt-version"),sigCommit:e.get("sig-commit"),sigProofs:void 0!==e.get("sig-proofs")?Eo.fromEncodingData(e.get("sig-proofs")):void 0,signedWeight:e.get("signed-weight")})}}class Do{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"verifier",valueSchema:new Vt(Vo.encodingSchema),omitEmpty:!0},{key:"weight",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({verifier:e,weight:t}){this.verifier=e,this.weight=void 0===t?void 0:E(t)}getEncodingSchema(){return Do.encodingSchema}toEncodingData(){return new Map([["verifier",void 0!==this.verifier?this.verifier.toEncodingData():void 0],["weight",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofParticipant: ${e}`);return new Do({verifier:void 0!==e.get("verifier")?Vo.fromEncodingData(e.get("verifier")):void 0,weight:e.get("weight")})}}class Io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"participant",valueSchema:new Vt(Do.encodingSchema),omitEmpty:!0},{key:"position",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sig-slot",valueSchema:new Vt(To.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({participant:e,position:t,sigSlot:n}){this.participant=e,this.position=void 0===t?void 0:E(t),this.sigSlot=n}getEncodingSchema(){return Io.encodingSchema}toEncodingData(){return new Map([["participant",void 0!==this.participant?this.participant.toEncodingData():void 0],["position",this.position],["sig-slot",void 0!==this.sigSlot?this.sigSlot.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofReveal: ${e}`);return new Io({participant:void 0!==e.get("participant")?Do.fromEncodingData(e.get("participant")):void 0,position:e.get("position"),sigSlot:void 0!==e.get("sig-slot")?To.fromEncodingData(e.get("sig-slot")):void 0})}}class To{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"lower-sig-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"signature",valueSchema:new Vt(Po.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lowerSigWeight:e,signature:t}){this.lowerSigWeight=void 0===e?void 0:E(e),this.signature=t}getEncodingSchema(){return To.encodingSchema}toEncodingData(){return new Map([["lower-sig-weight",this.lowerSigWeight],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSigSlot: ${e}`);return new To({lowerSigWeight:e.get("lower-sig-weight"),signature:void 0!==e.get("signature")?Po.fromEncodingData(e.get("signature")):void 0})}}class Po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"falcon-signature",valueSchema:new Vt(new St),omitEmpty:!0},{key:"merkle-array-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"proof",valueSchema:new Vt(Eo.encodingSchema),omitEmpty:!0},{key:"verifying-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({falconSignature:e,merkleArrayIndex:t,proof:n,verifyingKey:a}){this.falconSignature="string"==typeof e?he(e):e,this.merkleArrayIndex=void 0===t?void 0:v(t),this.proof=n,this.verifyingKey="string"==typeof a?he(a):a}getEncodingSchema(){return Po.encodingSchema}toEncodingData(){return new Map([["falcon-signature",this.falconSignature],["merkle-array-index",this.merkleArrayIndex],["proof",void 0!==this.proof?this.proof.toEncodingData():void 0],["verifying-key",this.verifyingKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSignature: ${e}`);return new Po({falconSignature:e.get("falcon-signature"),merkleArrayIndex:e.get("merkle-array-index"),proof:void 0!==e.get("proof")?Eo.fromEncodingData(e.get("proof")):void 0,verifyingKey:e.get("verifying-key")})}}class Mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"next-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"online-total-weight",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"type",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"voters-commitment",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({nextRound:e,onlineTotalWeight:t,type:n,votersCommitment:a}){this.nextRound=void 0===e?void 0:E(e),this.onlineTotalWeight=void 0===t?void 0:E(t),this.type=void 0===n?void 0:v(n),this.votersCommitment="string"==typeof a?he(a):a}getEncodingSchema(){return Mo.encodingSchema}toEncodingData(){return new Map([["next-round",this.nextRound],["online-total-weight",this.onlineTotalWeight],["type",this.type],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTracking: ${e}`);return new Mo({nextRound:e.get("next-round"),onlineTotalWeight:e.get("online-total-weight"),type:e.get("type"),votersCommitment:e.get("voters-commitment")})}}class Vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"commitment",valueSchema:new Vt(new St),omitEmpty:!0},{key:"key-lifetime",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({commitment:e,keyLifetime:t}){this.commitment="string"==typeof e?he(e):e,this.keyLifetime=void 0===t?void 0:E(t)}getEncodingSchema(){return Vo.encodingSchema}toEncodingData(){return new Map([["commitment",this.commitment],["key-lifetime",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofVerifier: ${e}`);return new Vo({commitment:e.get("commitment"),keyLifetime:e.get("key-lifetime")})}}class Ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new Be,omitEmpty:!0},{key:"num-uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Ro.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new Ro({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Bo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new St,omitEmpty:!0},{key:"value",valueSchema:Co.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?he(e):e,this.value=t}getEncodingSchema(){return Bo.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new Bo({key:e.get("key"),value:Co.fromEncodingData(e.get("value")??new Map)})}}class Co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new St,omitEmpty:!0},{key:"type",valueSchema:new Be,omitEmpty:!0},{key:"uint",valueSchema:new Be,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?he(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return Co.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new Co({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class Uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"fee",valueSchema:new Be,omitEmpty:!0},{key:"first-valid",valueSchema:new Be,omitEmpty:!0},{key:"last-valid",valueSchema:new Be,omitEmpty:!0},{key:"sender",valueSchema:new Re,omitEmpty:!0},{key:"application-transaction",valueSchema:new Vt($o.encodingSchema),omitEmpty:!0},{key:"asset-config-transaction",valueSchema:new Vt(Oo.encodingSchema),omitEmpty:!0},{key:"asset-freeze-transaction",valueSchema:new Vt(No.encodingSchema),omitEmpty:!0},{key:"asset-transfer-transaction",valueSchema:new Vt(Lo.encodingSchema),omitEmpty:!0},{key:"auth-addr",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"close-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"closing-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"confirmed-round",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-application-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"created-asset-index",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"genesis-hash",valueSchema:new Vt(new St),omitEmpty:!0},{key:"genesis-id",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"global-state-delta",valueSchema:new Vt(new bt(mo.encodingSchema)),omitEmpty:!0},{key:"group",valueSchema:new Vt(new St),omitEmpty:!0},{key:"heartbeat-transaction",valueSchema:new Vt(_o.encodingSchema),omitEmpty:!0},{key:"id",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"inner-txns",valueSchema:new Vt(new bt(Uo.encodingSchema)),omitEmpty:!0},{key:"intra-round-offset",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"keyreg-transaction",valueSchema:new Vt(qo.encodingSchema),omitEmpty:!0},{key:"lease",valueSchema:new Vt(new St),omitEmpty:!0},{key:"local-state-delta",valueSchema:new Vt(new bt(Nr.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"note",valueSchema:new Vt(new St),omitEmpty:!0},{key:"payment-transaction",valueSchema:new Vt(Fo.encodingSchema),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"rekey-to",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"round-time",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"sender-rewards",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"signature",valueSchema:new Vt(Ko.encodingSchema),omitEmpty:!0},{key:"state-proof-transaction",valueSchema:new Vt(Wo.encodingSchema),omitEmpty:!0},{key:"tx-type",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({fee:e,firstValid:t,lastValid:n,sender:a,applicationTransaction:i,assetConfigTransaction:r,assetFreezeTransaction:o,assetTransferTransaction:s,authAddr:c,closeRewards:h,closingAmount:d,confirmedRound:u,createdApplicationIndex:l,createdAssetIndex:g,genesisHash:m,genesisId:p,globalStateDelta:f,group:y,heartbeatTransaction:w,id:S,innerTxns:k,intraRoundOffset:b,keyregTransaction:x,lease:A,localStateDelta:D,logs:I,note:T,paymentTransaction:P,receiverRewards:M,rekeyTo:V,roundTime:R,senderRewards:B,signature:C,stateProofTransaction:U,txType:$}){this.fee=E(e),this.firstValid=E(t),this.lastValid=E(n),this.sender=a,this.applicationTransaction=i,this.assetConfigTransaction=r,this.assetFreezeTransaction=o,this.assetTransferTransaction=s,this.authAddr="string"==typeof c?ut.fromString(c):c,this.closeRewards=void 0===h?void 0:E(h),this.closingAmount=void 0===d?void 0:E(d),this.confirmedRound=void 0===u?void 0:E(u),this.createdApplicationIndex=void 0===l?void 0:E(l),this.createdAssetIndex=void 0===g?void 0:E(g),this.genesisHash="string"==typeof m?he(m):m,this.genesisId=p,this.globalStateDelta=f,this.group="string"==typeof y?he(y):y,this.heartbeatTransaction=w,this.id=S,this.innerTxns=k,this.intraRoundOffset=void 0===b?void 0:v(b),this.keyregTransaction=x,this.lease="string"==typeof A?he(A):A,this.localStateDelta=D,this.logs=I,this.note="string"==typeof T?he(T):T,this.paymentTransaction=P,this.receiverRewards=void 0===M?void 0:E(M),this.rekeyTo="string"==typeof V?ut.fromString(V):V,this.roundTime=void 0===R?void 0:v(R),this.senderRewards=void 0===B?void 0:E(B),this.signature=C,this.stateProofTransaction=U,this.txType=$}getEncodingSchema(){return Uo.encodingSchema}toEncodingData(){return new Map([["fee",this.fee],["first-valid",this.firstValid],["last-valid",this.lastValid],["sender",this.sender],["application-transaction",void 0!==this.applicationTransaction?this.applicationTransaction.toEncodingData():void 0],["asset-config-transaction",void 0!==this.assetConfigTransaction?this.assetConfigTransaction.toEncodingData():void 0],["asset-freeze-transaction",void 0!==this.assetFreezeTransaction?this.assetFreezeTransaction.toEncodingData():void 0],["asset-transfer-transaction",void 0!==this.assetTransferTransaction?this.assetTransferTransaction.toEncodingData():void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["created-application-index",this.createdApplicationIndex],["created-asset-index",this.createdAssetIndex],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map(e=>e.toEncodingData()):void 0],["group",this.group],["heartbeat-transaction",void 0!==this.heartbeatTransaction?this.heartbeatTransaction.toEncodingData():void 0],["id",this.id],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map(e=>e.toEncodingData()):void 0],["intra-round-offset",this.intraRoundOffset],["keyreg-transaction",void 0!==this.keyregTransaction?this.keyregTransaction.toEncodingData():void 0],["lease",this.lease],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map(e=>e.toEncodingData()):void 0],["logs",this.logs],["note",this.note],["payment-transaction",void 0!==this.paymentTransaction?this.paymentTransaction.toEncodingData():void 0],["receiver-rewards",this.receiverRewards],["rekey-to",void 0!==this.rekeyTo?this.rekeyTo.toString():void 0],["round-time",this.roundTime],["sender-rewards",this.senderRewards],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0],["state-proof-transaction",void 0!==this.stateProofTransaction?this.stateProofTransaction.toEncodingData():void 0],["tx-type",this.txType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Transaction: ${e}`);return new Uo({fee:e.get("fee"),firstValid:e.get("first-valid"),lastValid:e.get("last-valid"),sender:e.get("sender"),applicationTransaction:void 0!==e.get("application-transaction")?$o.fromEncodingData(e.get("application-transaction")):void 0,assetConfigTransaction:void 0!==e.get("asset-config-transaction")?Oo.fromEncodingData(e.get("asset-config-transaction")):void 0,assetFreezeTransaction:void 0!==e.get("asset-freeze-transaction")?No.fromEncodingData(e.get("asset-freeze-transaction")):void 0,assetTransferTransaction:void 0!==e.get("asset-transfer-transaction")?Lo.fromEncodingData(e.get("asset-transfer-transaction")):void 0,authAddr:e.get("auth-addr"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),createdApplicationIndex:e.get("created-application-index"),createdAssetIndex:e.get("created-asset-index"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map(e=>mo.fromEncodingData(e)):void 0,group:e.get("group"),heartbeatTransaction:void 0!==e.get("heartbeat-transaction")?_o.fromEncodingData(e.get("heartbeat-transaction")):void 0,id:e.get("id"),innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map(e=>Uo.fromEncodingData(e)):void 0,intraRoundOffset:e.get("intra-round-offset"),keyregTransaction:void 0!==e.get("keyreg-transaction")?qo.fromEncodingData(e.get("keyreg-transaction")):void 0,lease:e.get("lease"),localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map(e=>Nr.fromEncodingData(e)):void 0,logs:e.get("logs"),note:e.get("note"),paymentTransaction:void 0!==e.get("payment-transaction")?Fo.fromEncodingData(e.get("payment-transaction")):void 0,receiverRewards:e.get("receiver-rewards"),rekeyTo:e.get("rekey-to"),roundTime:e.get("round-time"),senderRewards:e.get("sender-rewards"),signature:void 0!==e.get("signature")?Ko.fromEncodingData(e.get("signature")):void 0,stateProofTransaction:void 0!==e.get("state-proof-transaction")?Wo.fromEncodingData(e.get("state-proof-transaction")):void 0,txType:e.get("tx-type")})}}class $o{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new Be,omitEmpty:!0},{key:"access",valueSchema:new Vt(new bt(xo.encodingSchema)),omitEmpty:!0},{key:"accounts",valueSchema:new Vt(new bt(new Re)),omitEmpty:!0},{key:"application-args",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"approval-program",valueSchema:new Vt(new St),omitEmpty:!0},{key:"box-references",valueSchema:new Vt(new bt(ho.encodingSchema)),omitEmpty:!0},{key:"clear-state-program",valueSchema:new Vt(new St),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"foreign-apps",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"foreign-assets",valueSchema:new Vt(new bt(new Be)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new Vt(Ro.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new Vt(Ro.encodingSchema),omitEmpty:!0},{key:"on-completion",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"reject-version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,access:t,accounts:n,applicationArgs:a,approvalProgram:i,boxReferences:r,clearStateProgram:o,extraProgramPages:s,foreignApps:c,foreignAssets:h,globalStateSchema:d,localStateSchema:u,onCompletion:l,rejectVersion:g}){this.applicationId=E(e),this.access=t,this.accounts=void 0!==n?n.map(e=>"string"==typeof e?ut.fromString(e):e):void 0,this.applicationArgs=a,this.approvalProgram="string"==typeof i?he(i):i,this.boxReferences=r,this.clearStateProgram="string"==typeof o?he(o):o,this.extraProgramPages=void 0===s?void 0:v(s),this.foreignApps=void 0===c?void 0:c.map(E),this.foreignAssets=void 0===h?void 0:h.map(E),this.globalStateSchema=d,this.localStateSchema=u,this.onCompletion=l,this.rejectVersion=void 0===g?void 0:v(g)}getEncodingSchema(){return $o.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["access",void 0!==this.access?this.access.map(e=>e.toEncodingData()):void 0],["accounts",void 0!==this.accounts?this.accounts.map(e=>e.toString()):void 0],["application-args",this.applicationArgs],["approval-program",this.approvalProgram],["box-references",void 0!==this.boxReferences?this.boxReferences.map(e=>e.toEncodingData()):void 0],["clear-state-program",this.clearStateProgram],["extra-program-pages",this.extraProgramPages],["foreign-apps",this.foreignApps],["foreign-assets",this.foreignAssets],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["on-completion",this.onCompletion],["reject-version",this.rejectVersion]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionApplication: ${e}`);return new $o({applicationId:e.get("application-id"),access:void 0!==e.get("access")?e.get("access").map(e=>xo.fromEncodingData(e)):void 0,accounts:e.get("accounts"),applicationArgs:e.get("application-args"),approvalProgram:e.get("approval-program"),boxReferences:void 0!==e.get("box-references")?e.get("box-references").map(e=>ho.fromEncodingData(e)):void 0,clearStateProgram:e.get("clear-state-program"),extraProgramPages:e.get("extra-program-pages"),foreignApps:e.get("foreign-apps"),foreignAssets:e.get("foreign-assets"),globalStateSchema:void 0!==e.get("global-state-schema")?Ro.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Ro.fromEncodingData(e.get("local-state-schema")):void 0,onCompletion:e.get("on-completion"),rejectVersion:e.get("reject-version")})}}class Oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"asset-id",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"params",valueSchema:new Vt(Zr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetId:e,params:t}){this.assetId=void 0===e?void 0:E(e),this.params=t}getEncodingSchema(){return Oo.encodingSchema}toEncodingData(){return new Map([["asset-id",this.assetId],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetConfig: ${e}`);return new Oo({assetId:e.get("asset-id"),params:void 0!==e.get("params")?Zr.fromEncodingData(e.get("params")):void 0})}}class No{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new Re,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"new-freeze-status",valueSchema:new Ve,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,assetId:t,newFreezeStatus:n}){this.address=e,this.assetId=E(t),this.newFreezeStatus=n}getEncodingSchema(){return No.encodingSchema}toEncodingData(){return new Map([["address",this.address],["asset-id",this.assetId],["new-freeze-status",this.newFreezeStatus]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetFreeze: ${e}`);return new No({address:e.get("address"),assetId:e.get("asset-id"),newFreezeStatus:e.get("new-freeze-status")})}}class Lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"asset-id",valueSchema:new Be,omitEmpty:!0},{key:"receiver",valueSchema:new Re,omitEmpty:!0},{key:"close-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-to",valueSchema:new Vt(new Re),omitEmpty:!0},{key:"sender",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,receiver:n,closeAmount:a,closeTo:i,sender:r}){this.amount=E(e),this.assetId=E(t),this.receiver=n,this.closeAmount=void 0===a?void 0:E(a),this.closeTo=i,this.sender=r}getEncodingSchema(){return Lo.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["receiver",this.receiver],["close-amount",this.closeAmount],["close-to",this.closeTo],["sender",this.sender]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetTransfer: ${e}`);return new Lo({amount:e.get("amount"),assetId:e.get("asset-id"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeTo:e.get("close-to"),sender:e.get("sender")})}}class _o{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"hb-address",valueSchema:new Re,omitEmpty:!0},{key:"hb-key-dilution",valueSchema:new Be,omitEmpty:!0},{key:"hb-proof",valueSchema:fo.encodingSchema,omitEmpty:!0},{key:"hb-seed",valueSchema:new St,omitEmpty:!0},{key:"hb-vote-id",valueSchema:new St,omitEmpty:!0},{key:"hb-challenge-discount",valueSchema:new Vt(new Ve),omitEmpty:!0})),this.encodingSchemaValue}constructor({hbAddress:e,hbKeyDilution:t,hbProof:n,hbSeed:a,hbVoteId:i,hbChallengeDiscount:r}){this.hbAddress=e,this.hbKeyDilution=E(t),this.hbProof=n,this.hbSeed="string"==typeof a?he(a):a,this.hbVoteId="string"==typeof i?he(i):i,this.hbChallengeDiscount=r}getEncodingSchema(){return _o.encodingSchema}toEncodingData(){return new Map([["hb-address",this.hbAddress],["hb-key-dilution",this.hbKeyDilution],["hb-proof",this.hbProof.toEncodingData()],["hb-seed",this.hbSeed],["hb-vote-id",this.hbVoteId],["hb-challenge-discount",this.hbChallengeDiscount]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionHeartbeat: ${e}`);return new _o({hbAddress:e.get("hb-address"),hbKeyDilution:e.get("hb-key-dilution"),hbProof:fo.fromEncodingData(e.get("hb-proof")??new Map),hbSeed:e.get("hb-seed"),hbVoteId:e.get("hb-vote-id"),hbChallengeDiscount:e.get("hb-challenge-discount")})}}class qo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"non-participation",valueSchema:new Vt(new Ve),omitEmpty:!0},{key:"selection-participation-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"state-proof-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"vote-first-valid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-last-valid",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"vote-participation-key",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({nonParticipation:e,selectionParticipationKey:t,stateProofKey:n,voteFirstValid:a,voteKeyDilution:i,voteLastValid:r,voteParticipationKey:o}){this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?he(t):t,this.stateProofKey="string"==typeof n?he(n):n,this.voteFirstValid=void 0===a?void 0:E(a),this.voteKeyDilution=void 0===i?void 0:E(i),this.voteLastValid=void 0===r?void 0:E(r),this.voteParticipationKey="string"==typeof o?he(o):o}getEncodingSchema(){return qo.encodingSchema}toEncodingData(){return new Map([["non-participation",this.nonParticipation],["selection-participation-key",this.selectionParticipationKey],["state-proof-key",this.stateProofKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionKeyreg: ${e}`);return new qo({nonParticipation:e.get("non-participation"),selectionParticipationKey:e.get("selection-participation-key"),stateProofKey:e.get("state-proof-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key")})}}class Fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new Be,omitEmpty:!0},{key:"receiver",valueSchema:new Re,omitEmpty:!0},{key:"close-amount",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"close-remainder-to",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,receiver:t,closeAmount:n,closeRemainderTo:a}){this.amount=E(e),this.receiver=t,this.closeAmount=void 0===n?void 0:E(n),this.closeRemainderTo=a}getEncodingSchema(){return Fo.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["receiver",this.receiver],["close-amount",this.closeAmount],["close-remainder-to",this.closeRemainderTo]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionPayment: ${e}`);return new Fo({amount:e.get("amount"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeRemainderTo:e.get("close-remainder-to")})}}class zo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"transaction",valueSchema:Uo.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transaction:t}){this.currentRound=E(e),this.transaction=t}getEncodingSchema(){return zo.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transaction",this.transaction.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionResponse: ${e}`);return new zo({currentRound:e.get("current-round"),transaction:Uo.fromEncodingData(e.get("transaction")??new Map)})}}class Ko{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logicsig",valueSchema:new Vt(Ho.encodingSchema),omitEmpty:!0},{key:"multisig",valueSchema:new Vt(jo.encodingSchema),omitEmpty:!0},{key:"pqsig",valueSchema:new Vt(Jo.encodingSchema),omitEmpty:!0},{key:"sig",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({logicsig:e,multisig:t,pqsig:n,sig:a}){this.logicsig=e,this.multisig=t,this.pqsig=n,this.sig="string"==typeof a?he(a):a}getEncodingSchema(){return Ko.encodingSchema}toEncodingData(){return new Map([["logicsig",void 0!==this.logicsig?this.logicsig.toEncodingData():void 0],["multisig",void 0!==this.multisig?this.multisig.toEncodingData():void 0],["pqsig",void 0!==this.pqsig?this.pqsig.toEncodingData():void 0],["sig",this.sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignature: ${e}`);return new Ko({logicsig:void 0!==e.get("logicsig")?Ho.fromEncodingData(e.get("logicsig")):void 0,multisig:void 0!==e.get("multisig")?jo.fromEncodingData(e.get("multisig")):void 0,pqsig:void 0!==e.get("pqsig")?Jo.fromEncodingData(e.get("pqsig")):void 0,sig:e.get("sig")})}}class Ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"logic",valueSchema:new St,omitEmpty:!0},{key:"args",valueSchema:new Vt(new bt(new St)),omitEmpty:!0},{key:"logic-multisig-signature",valueSchema:new Vt(jo.encodingSchema),omitEmpty:!0},{key:"multisig-signature",valueSchema:new Vt(jo.encodingSchema),omitEmpty:!0},{key:"pqsig",valueSchema:new Vt(Jo.encodingSchema),omitEmpty:!0},{key:"signature",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({logic:e,args:t,logicMultisigSignature:n,multisigSignature:a,pqsig:i,signature:r}){this.logic="string"==typeof e?he(e):e,this.args=t,this.logicMultisigSignature=n,this.multisigSignature=a,this.pqsig=i,this.signature="string"==typeof r?he(r):r}getEncodingSchema(){return Ho.encodingSchema}toEncodingData(){return new Map([["logic",this.logic],["args",this.args],["logic-multisig-signature",void 0!==this.logicMultisigSignature?this.logicMultisigSignature.toEncodingData():void 0],["multisig-signature",void 0!==this.multisigSignature?this.multisigSignature.toEncodingData():void 0],["pqsig",void 0!==this.pqsig?this.pqsig.toEncodingData():void 0],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureLogicsig: ${e}`);return new Ho({logic:e.get("logic"),args:e.get("args"),logicMultisigSignature:void 0!==e.get("logic-multisig-signature")?jo.fromEncodingData(e.get("logic-multisig-signature")):void 0,multisigSignature:void 0!==e.get("multisig-signature")?jo.fromEncodingData(e.get("multisig-signature")):void 0,pqsig:void 0!==e.get("pqsig")?Jo.fromEncodingData(e.get("pqsig")):void 0,signature:e.get("signature")})}}class jo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"subsignature",valueSchema:new Vt(new bt(Go.encodingSchema)),omitEmpty:!0},{key:"threshold",valueSchema:new Vt(new Be),omitEmpty:!0},{key:"version",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({subsignature:e,threshold:t,version:n}){this.subsignature=e,this.threshold=void 0===t?void 0:v(t),this.version=void 0===n?void 0:v(n)}getEncodingSchema(){return jo.encodingSchema}toEncodingData(){return new Map([["subsignature",void 0!==this.subsignature?this.subsignature.map(e=>e.toEncodingData()):void 0],["threshold",this.threshold],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisig: ${e}`);return new jo({subsignature:void 0!==e.get("subsignature")?e.get("subsignature").map(e=>Go.fromEncodingData(e)):void 0,threshold:e.get("threshold"),version:e.get("version")})}}class Go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"public-key",valueSchema:new Vt(new St),omitEmpty:!0},{key:"signature",valueSchema:new Vt(new St),omitEmpty:!0})),this.encodingSchemaValue}constructor({publicKey:e,signature:t}){this.publicKey="string"==typeof e?he(e):e,this.signature="string"==typeof t?he(t):t}getEncodingSchema(){return Go.encodingSchema}toEncodingData(){return new Map([["public-key",this.publicKey],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisigSubsignature: ${e}`);return new Go({publicKey:e.get("public-key"),signature:e.get("signature")})}}class Jo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"public-key",valueSchema:new St,omitEmpty:!0},{key:"scheme",valueSchema:new Re,omitEmpty:!0},{key:"signature",valueSchema:new St,omitEmpty:!0},{key:"salt",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({publicKey:e,scheme:t,signature:n,salt:a}){this.publicKey="string"==typeof e?he(e):e,this.scheme=t,this.signature="string"==typeof n?he(n):n,this.salt=void 0===a?void 0:v(a)}getEncodingSchema(){return Jo.encodingSchema}toEncodingData(){return new Map([["public-key",this.publicKey],["scheme",this.scheme],["signature",this.signature],["salt",this.salt]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignaturePQsig: ${e}`);return new Jo({publicKey:e.get("public-key"),scheme:e.get("scheme"),signature:e.get("signature"),salt:e.get("salt")})}}class Wo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new Vt(vo.encodingSchema),omitEmpty:!0},{key:"state-proof",valueSchema:new Vt(Ao.encodingSchema),omitEmpty:!0},{key:"state-proof-type",valueSchema:new Vt(new Be),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateProof:t,stateProofType:n}){this.message=e,this.stateProof=t,this.stateProofType=void 0===n?void 0:v(n)}getEncodingSchema(){return Wo.encodingSchema}toEncodingData(){return new Map([["message",void 0!==this.message?this.message.toEncodingData():void 0],["state-proof",void 0!==this.stateProof?this.stateProof.toEncodingData():void 0],["state-proof-type",this.stateProofType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionStateProof: ${e}`);return new Wo({message:void 0!==e.get("message")?vo.fromEncodingData(e.get("message")):void 0,stateProof:void 0!==e.get("state-proof")?Ao.fromEncodingData(e.get("state-proof")):void 0,stateProofType:e.get("state-proof-type")})}}class Yo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new At([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new Be,omitEmpty:!0},{key:"transactions",valueSchema:new bt(Uo.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new Vt(new Re),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transactions:t,nextToken:n}){this.currentRound=E(e),this.transactions=t,this.nextToken=n}getEncodingSchema(){return Yo.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transactions",this.transactions.map(e=>e.toEncodingData())],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionsResponse: ${e}`);return new Yo({currentRound:e.get("current-round"),transactions:(e.get("transactions")??[]).map(e=>Uo.fromEncodingData(e)),nextToken:e.get("next-token")})}}class Xo extends Gi{path(){return"/health"}prepare(e){return Pe(e.getJSONText(),yo)}}class Qo extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Yr)}}function Zo(e){return"string"==typeof e?e:de(e)}class es extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=Zo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return Pe(e.getJSONText(),Yo)}}class ts extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=Zo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return Pe(e.getJSONText(),Yo)}}class ns extends Gi{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return Pe(e.getJSONText(),no)}}class as extends Gi{constructor(e,t){super(e),this.txID=t}path(){return`/v2/transactions/${this.txID}`}prepare(e){return Pe(e.getJSONText(),zo)}}class is extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}prepare(e){return Pe(e.getJSONText(),Or)}}class rs extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}prepare(e){return Pe(e.getJSONText(),Qr)}}class os extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}prepare(e){return Pe(e.getJSONText(),to)}}class ss extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return Pe(e.getJSONText(),Fr)}}class cs extends Gi{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return Pe(e.getJSONText(),Jr)}}class hs extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),eo)}}class ds extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),jr)}}class us extends Gi{constructor(e,t){super(e),this.appID=BigInt(t)}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}prepare(e){return Pe(e.getJSONText(),Kr)}}class ls extends Gi{constructor(e,t,n){super(e),this.index=BigInt(t);const a=de(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return Pe(e.getJSONText(),so)}}class gs extends Gi{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e.toString(),this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}onlineOnly(e){return this.query["online-only"]=e,this}prepare(e){return Pe(e.getJSONText(),Lr)}}class ms extends Gi{path(){return"/v2/block-headers"}absent(e){return this.query.absent=e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}expired(e){return this.query.expired=e,this}limit(e){return this.query.limit=e,this}maxRound(e){return this.query["max-round"]=e,this}minRound(e){return this.query["min-round"]=e,this}nextToken(e){return this.query.next=e,this}proposers(e){return this.query.proposers=e,this}prepare(e){return Pe(e.getJSONText(),ao)}}class ps extends Gi{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=Zo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}groupid(e){return this.query["group-id"]=Zo(e),this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}prepare(e){return Pe(e.getJSONText(),Yo)}}class fs extends Gi{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e.toString(),this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),to)}}class ys extends Gi{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e.toString(),this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return Pe(e.getJSONText(),Jr)}}class ws extends Gi{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return Pe(e.getJSONText(),uo)}}class vs extends T{constructor(e,t="http://127.0.0.1",n=8080,a={}){super("X-Indexer-API-Token",e,t,n,a)}makeHealthCheck(){return new Xo(this.c)}lookupAssetBalances(e){return new Qo(this.c,e)}lookupAssetTransactions(e){return new ts(this.c,e)}lookupAccountTransactions(e){return new es(this.c,e)}lookupBlock(e){return new ns(this.c,e)}lookupTransactionByID(e){return new as(this.c,e)}lookupAccountByID(e){return new is(this.c,e)}lookupAccountAssets(e){return new rs(this.c,e)}lookupAccountCreatedAssets(e){return new os(this.c,e)}lookupAccountAppLocalStates(e){return new ss(this.c,e)}lookupAccountCreatedApplications(e){return new cs(this.c,e)}lookupAssetByID(e){return new hs(this.c,e)}lookupApplications(e){return new ds(this.c,e)}lookupApplicationLogs(e){return new us(this.c,e)}searchAccounts(){return new gs(this.c)}searchForBlockHeaders(){return new ms(this.c)}searchForTransactions(){return new ps(this.c)}searchForAssets(){return new fs(this.c)}searchForApplications(){return new ys(this.c)}searchForApplicationBoxes(e){return new ws(this.c,e)}lookupApplicationBoxByIDandName(e,t){return new ls(this.c,e,t)}}async function Ss(e,t,n){const a=await e.status().do();if(void 0===a)throw new Error("Unable to get node status");const i=a.lastRound+BigInt(1),r=i+BigInt(n);let o=i;for(;o<r;){let n=!1;try{const a=await e.pendingTransactionInformation(t).do();if(a.confirmedRound)return a;if(a.poolError)throw n=!0,new Error(`Transaction Rejected: ${a.poolError}`)}catch(e){if(n)throw e}await e.statusAfterBlock(o).do(),o+=BigInt(1)}throw new Error(`Transaction not confirmed after ${n} rounds`)}function Es(e,t){let n=e.toString(16);n.length!==2*t&&(n=n.padStart(2*t,"0"));const a=new Uint8Array(n.length/2);for(let e=0,t=0;e<n.length/2;e++,t+=2)a[e]=parseInt(n.slice(t,t+2),16);return a}function ks(e){let t=BigInt(0);const n=new DataView(e.buffer,e.byteOffset);for(let a=0;a<e.length;a++)t=BigInt(Number(n.getUint8(a)))+t*BigInt(256);return t}function bs(){const e=qe((t=Oe().box.secretKeyLength,function(){const{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),Oe().randomBytes(t)));var t;return{addr:new ut(e.publicKey),sk:e.secretKey}}const xs=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],As="failed to decode mnemonic",Ds="the mnemonic contains a word that is not in the wordlist";function Is(e){const t=[];let n=0,a=0;return e.forEach(function(e){n|=e<<a,a+=8,a>=11&&(t.push(2047&n),n>>=11,a-=11)}),a&&t.push(n),t}function Ts(e){return e.map(e=>xs[e])}function Ps(e){return Ts(Is(_e(e)))[0]}function Ms(e){if(e.length!==Je)throw new RangeError(`Seed length must be ${Je}`);const t=Ts(Is(e)),n=Ps(e);return`${t.join(" ")} ${n}`}function Vs(e){const t=e.split(" "),n=t.slice(0,24);for(const e of n)if(-1===xs.indexOf(e))throw new Error(Ds);const a=t[t.length-1];let i=function(e){const t=[];let n=0,a=0;return e.forEach(function(e){for(n|=e<<a,a+=11;a>=8;)t.push(255&n),n>>=8,a-=8}),a&&t.push(n),new Uint8Array(t)}(n.map(e=>xs.indexOf(e)));if(33!==i.length)throw new Error(As);if(0!==i[i.length-1])throw new Error(As);if(i=i.slice(0,i.length-1),Ps(i)===a)return i;throw new Error(As)}function Rs(e){const t=qe(Vs(e));return{addr:new ut(t.publicKey),sk:t.secretKey}}function Bs(e){return Ms(e.slice(0,Je))}function Cs(e){return Vs(e)}function Us(e){return Ms(e)}const $s=(new TextEncoder).encode("PQK");function Os(e,t){if(t.length!==ct)throw new Error(`invalid PQ scheme length: expected ${ct} bytes, got ${t.length}`);return new Uint8Array(_e(y($s,t,Vs(e))))}const Ns=16,Ls=(new TextEncoder).encode("TG");function _s(e){const t=[];for(const n of e)t.push(n.rawTxID());const n=_e(function(e){if(e.length>Ns)throw new Error(`${e.length} transactions grouped together but max group size is ${Ns}`);if(0===e.length)throw new Error("Cannot compute group ID of zero transactions");const t=fe({txlist:e});return y(Ls,t)}(t));return Uint8Array.from(n)}function qs(e){const t=_s(e);for(const n of e)n.group=t;return e}const Fs=Uint8Array.from([77,88]);function zs(e,t){return{txID:e.txID(),blob:e.signTxn(t)}}async function Ks(e,t){const[n]=await t([e],[0]);return{blob:n,txID:e.txID(),stxn:Ie(n,Kn)}}function Hs(e,t){return Ke(y(Fs,e),t)}function js(e,t,n){return je(y(Fs,e),t,("string"==typeof n?ut.fromString(n):n).publicKey)}function Gs(e,t){let n,a;return t instanceof Nn?(n=t.lsig,a=t.address()):(n=t,a=n.pqsig?wt(n.pqsig):n.sig?new ut(e.sender.publicKey):n.lmsig?Sn({version:n.lmsig.v,threshold:n.lmsig.thr,pks:n.lmsig.subsig.map(e=>e.pk)}):n.address()),function(e,t,n){if([t.sig,t.msig,t.lmsig,t.pqsig].filter(Boolean).length>1)throw new Error("LogicSig has too many signatures. At most one of sig, msig, lmsig, or pqsig may be present");if(t.pqsig)try{Bn(t.logic)}catch(e){throw new Error(`Logic signature verification failed. Ensure the program is valid: ${e.message}`)}else if(!t.verify(n.publicKey))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");let a;He(n.publicKey,e.sender.publicKey)||(a=n);const i=new Kn({lsig:t,txn:e,sgnr:a});return{txID:e.txID(),blob:Te(i)}}(e,n,a)}function Js(e,t){return Gs(e,t)}const Ws="Not enough multisig transactions to merge. Need at least two",Ys="Cannot merge txs. txIDs differ",Xs="Cannot merge txs. Auth addrs differ",Qs="Cannot merge txs. Multisig preimages differ",Zs="Cannot merge txs. subsigs are mismatched.",ec="Cannot add multisig signature. Signature is not of the correct length.",tc="Key does not exist";function nc(e,{version:t,threshold:n,addrs:a}){const i=vn(a),r={v:t,thr:n,subsig:i.map(e=>({pk:e}))},o=Sn({version:t,threshold:n,pks:i});let s;return e.sender.equals(o)||(s=o),Te(new Kn({txn:e,msig:r,sgnr:s}))}function ac(e,{rawSig:t,myPk:n},{version:a,threshold:i,pks:r}){const o=Ie(nc(e,{version:a,threshold:i,addrs:r.map(e=>new ut(e))}),Kn);let s=!1;if(o.msig.subsig.forEach((e,a)=>{He(e.pk,n)&&(s=!0,o.msig.subsig[a].s=t)}),!s)throw new Error(tc);return Te(o)}function ic(e,{version:t,threshold:n,pks:a},i){const r=ze(i).publicKey;return ac(e,{rawSig:e.rawSignTxn(i),myPk:r},{version:t,threshold:n,pks:a})}async function rc(e,{version:t,threshold:n,pks:a},i){const{stxn:r}=await Ks(e,i),o=r.sig;if(void 0===o)throw Error("Expected TransactionSigner to return a signed transaction with a sig, but sig was empty");return ac(e,{rawSig:o,myPk:(r.sgnr??e.sender).publicKey},{version:t,threshold:n,pks:a})}function oc(e){if(e.length<2)throw new Error(Ws);const t=Ie(e[0],Kn);if(!t.msig)throw new Error("Invalid multisig transaction, multisig structure missing at index 0");const n=t.txn.txID(),a=t.sgnr?t.sgnr.toString():void 0,i=Sn({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map(e=>e.pk)}),r=t.msig.subsig.map(e=>({...e}));for(let o=1;o<e.length;o++){const s=Ie(e[o],Kn);if(!s.msig)throw new Error(`Invalid multisig transaction, multisig structure missing at index ${o}`);if(s.txn.txID()!==n)throw new Error(Ys);if(a!==(s.sgnr?s.sgnr.toString():void 0))throw new Error(Xs);if(s.msig.subsig.length!==t.msig.subsig.length)throw new Error(Qs);const c=Sn({version:s.msig.v,threshold:s.msig.thr,pks:s.msig.subsig.map(e=>e.pk)});if(!i.equals(c))throw new Error(Qs);s.msig.subsig.forEach((e,t)=>{if(!e.s)return;const n=r[t];if(n.s&&!f(e.s,n.s))throw new Error(Zs);n.s=e.s})}const o={v:t.msig.v,thr:t.msig.thr,subsig:r},s=void 0!==a?t.sgnr:void 0;return Te(new Kn({msig:o,txn:t.txn,sgnr:s}))}function sc(e,{version:t,threshold:n,addrs:a},i){const r=ic(e,{version:t,threshold:n,pks:vn(a)},i);return{txID:e.txID(),blob:r}}async function cc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=await rc(e,{version:t,threshold:n,pks:r},i);return{txID:e.txID(),blob:o}}function hc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=Ie(e,Kn),s=ic(o.txn,{version:t,threshold:n,pks:r},i);return{txID:o.txn.txID(),blob:oc([e,s])}}async function dc(e,{version:t,threshold:n,addrs:a},i){const r=vn(a),o=Ie(e,Kn),s=await rc(o.txn,{version:t,threshold:n,pks:r},i);return{txID:o.txn.txID(),blob:oc([e,s])}}function uc(e,{version:t,threshold:n,addrs:a},i,r){const o=vn(a),s=Ie(e,Kn),c=function(e,t,n,a){if(!Fe(a.length))throw new Error(ec);return ac(e,{rawSig:a,myPk:("string"==typeof n?ut.fromString(n):n).publicKey},t)}(s.txn,{version:t,threshold:n,pks:o},i,r);return{txID:s.txn.txID(),blob:oc([e,c])}}let lc={},gc={};function mc(e){let t=[],n=0,a=0;for(let i=0;i<e.length;i+=1){let r=lc[e[i]];if(void 0===r)throw new Error("Invalid character ("+e[i]+")");const o=32&r;if(r&=31,a+=r<<n,o)n+=5;else{const e=1&a;a>>>=1,e?t.push(0===a?-2147483648:-a):t.push(a),a=n=0}}return t}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach(function(e,t){lc[e]=t,gc[t]=e});class pc{constructor({version:e,sources:t,names:n,mappings:a}){if(this.version=e,this.sources=t,this.names=n,this.mappings=a,3!==this.version)throw new Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw new Error("mapping undefined, cannot build source map without `mapping`");const i=this.mappings.split(";").map(mc);this.pcToLocation=new Map,this.sourceAndLineToPc=new Map;const r={line:0,column:0,sourceIndex:0,nameIndex:0};for(const[e,t]of i.entries()){if(t.length<4)continue;const n=t.length>4?t[4]:void 0,[,a,i,o]=t;r.sourceIndex+=a,r.line+=i,r.column+=o,void 0!==n&&(r.nameIndex+=n);const s=`${r.sourceIndex}:${r.line}`;let c=this.sourceAndLineToPc.get(s);void 0===c&&(c=[],this.sourceAndLineToPc.set(s,c));const h={pc:e,column:r.column},d={line:r.line,column:r.column,sourceIndex:r.sourceIndex};void 0!==n&&(h.nameIndex=r.nameIndex,d.nameIndex=r.nameIndex),c.push(h),this.pcToLocation.set(e,d)}}getPcs(){return Array.from(this.pcToLocation.keys())}getLocationForPc(e){return this.pcToLocation.get(e)}getPcsOnSourceLine(e,t){const n=this.sourceAndLineToPc.get(`${e}:${t}`);return void 0===n?[]:n}}function fc(e,t=new ut(e.ed25519PublicKey)){const n=new ut(e.ed25519PublicKey),{ed25519Signer:a}=e;return{address:t,programDataSigner:async(e,t)=>{const n=y(t.address().publicKey,e),i=y(_n,n);return a(i)},txnSigner:async(e,t)=>{const i=[];for(const r of t){const t=e[r],o=await a(t.bytesToSign()),s=new Kn({txn:t,sig:o,sgnr:t.sender.equals(n)?void 0:n});i.push(s)}return i.map(e=>Te(e))},delegatedLsigSigner:async(e,t)=>{if(t){const i=vn(t.addrs),r=Sn({version:t.version,threshold:t.threshold,pks:i}),o=y($n,r.publicKey,e.logic),s=i.map(e=>({pk:e})),c=s.find(e=>f(e.pk,n.publicKey));if(void 0===c)throw Error(`DelegatedLsigSigner could not find ${n} as a signer in the multisig`);const h=await a(o);return c.s=h,{address:n,lmsig:{v:t.version,thr:t.threshold,subsig:s}}}const i=y(Cn,e.logic),r=await a(i);return{address:n,sig:r}},mxBytesSigner:async e=>{const t=y(Fs,e);return a(t)}}}function yc(e,t){const{pqPublicKey:n,pqSigner:a,pqScheme:i}=e,{address:r,salt:o}=yt(i,n);return{address:t??r,txnSigner:async(e,t)=>{const s=[];for(const c of t){const t=e[c],h=await a(t.bytesToSign()),d=new Kn({txn:t,pqsig:{sch:i,slt:o,pk:n,sig:h},sgnr:t.sender.equals(r)?void 0:r});s.push(d)}return s.map(e=>Te(e))},emptyTxnSigner:(e,t)=>{const a=[];for(const s of t){const t=e[s],c={sch:i,slt:o,pk:n,sig:new Uint8Array},h=new Kn({txn:t,pqsig:c,sgnr:t.sender.equals(r)?void 0:r});a.push(Te(h))}return Promise.resolve(a)},delegatedLsigSigner:async(e,t)=>{if(t)throw Error(`post-quantum scheme ${(new TextDecoder).decode(i)} does not support multisig signing`);const s=new Uint8Array(y(Un,r.publicKey,e.logic)),c=await a(s);return{address:r,pqsig:{sch:i,slt:o,pk:n,sig:c}}}}}const wc=(new TextEncoder).encode("f1");function vc(e,t){return yc({pqScheme:wc,pqPublicKey:e.falcon1024PublicKey,pqSigner:e.falcon1024Signer},t)}function Sc({sender:e,receiver:t,amount:n,closeRemainderTo:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new un({type:Bt.pay,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,paymentParams:{receiver:t,amount:n,closeRemainderTo:a}})}function Ec({sender:e,voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s,suggestedParams:c,note:h,lease:d,rekeyTo:u}){return new un({type:Bt.keyreg,sender:e,note:h,lease:d,rekeyTo:u,suggestedParams:c,keyregParams:{voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s}})}function kc({sender:e,assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l,note:g,lease:m,rekeyTo:p,suggestedParams:f}){return new un({type:Bt.acfg,sender:e,note:g,lease:m,rekeyTo:p,suggestedParams:f,assetConfigParams:{assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l}})}function bc({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p}){return kc({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p})}function xc({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,strictEmptyAddressChecking:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("assetIndex must be provided");if((o??1)&&(null==n||null==a||null==i||null==r))throw Error("strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.");return kc({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function Ac({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r}){if(!t)throw Error("assetIndex must be provided");return kc({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r})}function Dc({sender:e,assetIndex:t,freezeTarget:n,frozen:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new un({type:Bt.afrz,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,assetFreezeParams:{assetIndex:t,freezeTarget:n,frozen:a}})}function Ic({sender:e,receiver:t,amount:n,closeRemainderTo:a,assetSender:i,note:r,assetIndex:o,suggestedParams:s,rekeyTo:c,lease:h}){if(!o)throw Error("assetIndex must be provided");return new un({type:Bt.axfer,sender:e,note:r,lease:h,rekeyTo:c,suggestedParams:s,assetTransferParams:{assetIndex:o,receiver:t,amount:n,assetSender:i,closeRemainderTo:a}})}function Tc({sender:e,appIndex:t,onComplete:n,appArgs:a,accounts:i,foreignApps:r,foreignAssets:o,boxes:s,convertToAccess:c,holdings:h,locals:d,access:u,approvalProgram:l,clearProgram:g,numLocalInts:m,numLocalByteSlices:p,numGlobalInts:f,numGlobalByteSlices:y,extraPages:w,rejectVersion:v,note:S,lease:E,rekeyTo:k,suggestedParams:b}){if(null==n)throw Error("onComplete must be provided");if(u&&(i||r||o||s||h||d))throw Error("cannot specify both access and other access fields");let x=u;return c&&(x=function({appIndex:e,accounts:t,foreignAssets:n,foreignApps:a,holdings:i,locals:r,boxes:o}){const s=[];function c(e){let t;if("string"==typeof e){if(""===e)return;t=ut.fromString(e)}else t=e;if(t.equals(ut.zeroAddress()))return;let n=!1;for(const e of s){if(!e.address)continue;let a=e.address;if("string"==typeof e.address&&(a=ut.fromString(e.address)),a.equals(t)){n=!0;break}}n||s.push({address:e})}function h(e){let t=!1;for(const n of s)if(n.assetIndex===e){t=!0;break}t||s.push({assetIndex:e})}function d(e){let t=!1;for(const n of s)if(n.appIndex===e){t=!0;break}t||s.push({appIndex:e})}for(const e of t??[])c(e);for(const e of n??[])h(e);for(const e of a??[])d(e);for(const e of i??[])e.address&&c(e.address),h(e.assetIndex),s.push({holding:e});for(const t of r??[])t.address&&c(t.address),t.appIndex&&BigInt(t.appIndex)!==e&&d(t.appIndex),s.push({locals:t});for(const t of o??[])t.appIndex&&BigInt(t.appIndex)!==e&&d(t.appIndex),s.push({box:t});return s}({appIndex:t,accounts:i,foreignApps:r,foreignAssets:o,holdings:h,locals:d,boxes:s})),new un({type:Bt.appl,sender:e,note:S,lease:E,rekeyTo:k,suggestedParams:b,appCallParams:{appIndex:t,onComplete:n,appArgs:a,accounts:x?void 0:i,foreignAssets:x?void 0:o,foreignApps:x?void 0:r,boxes:x?void 0:s,access:x,approvalProgram:l,clearProgram:g,numLocalInts:m,numLocalByteSlices:p,numGlobalInts:f,numGlobalByteSlices:y,extraPages:w,rejectVersion:v}})}function Pc({sender:e,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numLocalInts:g,numLocalByteSlices:m,numGlobalInts:p,numGlobalByteSlices:f,extraPages:y,note:w,lease:v,rekeyTo:S,suggestedParams:E}){if(!u||!l)throw Error("approvalProgram and clearProgram must be provided");if(null==t)throw Error("onComplete must be provided");return Tc({sender:e,appIndex:0,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numLocalInts:g,numLocalByteSlices:m,numGlobalInts:p,numGlobalByteSlices:f,extraPages:y,note:w,lease:v,rekeyTo:S,suggestedParams:E})}function Mc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numGlobalInts:g,numGlobalByteSlices:m,extraPages:p,note:f,lease:y,rekeyTo:w,suggestedParams:v}){if(!t)throw Error("appIndex must be provided");if(!u||!l)throw Error("approvalProgram and clearProgram must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.UpdateApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,approvalProgram:u,clearProgram:l,numGlobalInts:g,numGlobalByteSlices:m,extraPages:p,note:f,lease:y,rekeyTo:w,suggestedParams:v})}function Vc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.DeleteApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Rc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.OptInOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:u,convertToAccess:s,holdings:c,locals:h,access:d,lease:l,rekeyTo:g,suggestedParams:m})}function Bc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.CloseOutOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Cc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.ClearStateOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function Uc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m}){if(!t)throw Error("appIndex must be provided");return Tc({sender:e,appIndex:t,onComplete:Ct.NoOpOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,convertToAccess:s,holdings:c,locals:h,access:d,note:u,lease:l,rekeyTo:g,suggestedParams:m})}function $c(e){return(t,n)=>{const a=[];for(const i of n)a.push(t[i].signTxn(e.sk));return Promise.resolve(a)}}function Oc(e){return(t,n)=>{const a=[];for(const i of n){const{blob:n}=Gs(t[i],e);a.push(n)}return Promise.resolve(a)}}function Nc(e,t){return(n,a)=>{const i=[];for(const r of a){const a=n[r],o=[];for(const n of t){const{blob:t}=sc(a,e,n);o.push(t)}o.length>1?i.push(oc(o)):i.push(o[0])}return Promise.resolve(i)}}function Lc(){return(e,t)=>{const n=[];for(const a of t)n.push(jn(e[a]));return Promise.resolve(n)}}function _c(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}const qc=65535,Fc=32,zc=1,Kc=1,Hc=2,jc=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,Gc=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class Jc{static from(e){if(e.endsWith("[]")){const t=Jc.from(e.slice(0,e.length-2));return new nh(t)}if(e.endsWith("]")){const t=e.match(jc);if(!t||3!==t.length)throw new Error(`malformed static array string: ${e}`);const n=t[2],a=parseInt(n,10);if(a>qc)throw new Error(`array length exceeds limit ${qc}`);const i=Jc.from(t[1]);return new th(i,a)}if(e.startsWith("uint")){const t=e=>[...e].every(e=>"0123456789".includes(e)),n=e.slice(4,e.length);if(!t(n))throw new Error(`malformed uint string: ${n}`);const a=parseInt(n,10);if(a>qc)throw new Error(`malformed uint string: ${a}`);return new Wc(a)}if("byte"===e)return new Zc;if(e.startsWith("ufixed")){const t=e.match(Gc);if(!t||3!==t.length)throw new Error(`malformed ufixed type: ${e}`);const n=parseInt(t[1],10),a=parseInt(t[2],10);return new Yc(n,a)}if("bool"===e)return new Qc;if("address"===e)return new Xc;if("string"===e)return new eh;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){const t=ah.parseTupleContent(e.slice(1,e.length-1)),n=[];for(let e=0;e<t.length;e++){const a=Jc.from(t[e]);n.push(a)}return new ah(n)}throw new Error(`cannot convert a string ${e} to an ABI type`)}}class Wc extends Jc{constructor(e){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof Wc&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return Es(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a uint${this.bitSize}`);return ks(e)}}class Yc extends Jc{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw new Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof Yc&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return Es(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return ks(e)}}class Xc extends Jc{toString(){return"address"}equals(e){return e instanceof Xc}isDynamic(){return!1}byteLen(){return Fc}encode(e){if("string"==typeof e)return lt(e).publicKey;if(e instanceof ut)return e.publicKey;if(e instanceof Uint8Array){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return e}throw new Error(`Cannot encode value as ${this.toString()}: ${e}`)}decode(e){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return mt(e)}}class Qc extends Jc{toString(){return"bool"}equals(e){return e instanceof Qc}isDynamic(){return!1}byteLen(){return Kc}encode(e){if("boolean"!=typeof e)throw new Error(`Cannot encode value as bool: ${e}`);return e?new Uint8Array([128]):new Uint8Array([0])}decode(e){if(1!==e.byteLength)throw new Error("bool string must be 1 byte long");const t=e[0];if(128===t)return!0;if(0===t)return!1;throw new Error("boolean could not be decoded from the byte string")}}class Zc extends Jc{toString(){return"byte"}equals(e){return e instanceof Zc}isDynamic(){return!1}byteLen(){return zc}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw new Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw new Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw new Error("byte string must be 1 byte long");return e[0]}}class eh extends Jc{toString(){return"string"}equals(e){return e instanceof eh}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as string: ${e}`);let t;t="string"==typeof e?(new TextEncoder).encode(e):e;const n=Es(t.length,Hc),a=new Uint8Array(t.length+Hc);return a.set(n),a.set(t,Hc),a}decode(e){if(e.length<Hc)throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${Hc}`);const t=new DataView(e.buffer,e.byteOffset,Hc).getUint16(0),n=e.slice(Hc,e.length);if(t!==n.length)throw new Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${n.length}`);return new TextDecoder("utf-8").decode(n)}}class th extends Jc{constructor(e,t){if(super(),t<0)throw new Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof th&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===Qc?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new ah(Array(this.staticLength).fill(this.childType))}}class nh extends Jc{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof nh&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=this.toABITupleType(e.length),n=t.encode(e);return y(Es(t.childTypes.length,Hc),n)}decode(e){const t=new DataView(e.buffer,0,Hc).getUint16(0);return this.toABITupleType(t).decode(e.slice(Hc,e.length))}toABITupleType(e){return new ah(Array(e).fill(this.childType))}}class ah extends Jc{constructor(e){if(super(),e.length>=qc)throw new Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){const e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof ah&&this.childTypes.length===e.childTypes.length&&this.childTypes.every((t,n)=>t.equals(e.childTypes[n]))}isDynamic(){return this.childTypes.some(e=>e.isDynamic())}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===Qc){const n=rh(this.childTypes,t,1),a=n+1;t+=n,e+=Math.trunc((a+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=Array.from(e);if(e.length>qc)throw new Error("length of tuple array should not exceed a uint16");const n=this.childTypes,a=[],i=[],r=new Map;let o=0;for(;o<n.length;){const e=n[o];if(e.isDynamic())r.set(a.length,!0),a.push(new Uint8Array([0,0])),i.push(e.encode(t[o]));else{if(e.constructor===Qc){const e=rh(n,o,-1);let i=rh(n,o,1);if(e%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");i=Math.min(7,i);const r=ih(t.slice(o,o+i+1));a.push(Es(r,1)),o+=i}else{const n=e.encode(t[o]);a.push(n)}r.set(o,!1),i.push(new Uint8Array)}o+=1}let s=0;for(const e of a)s+=e.length;let c=0;for(let e=0;e<a.length;e++){if(r.get(e)){const t=s+c;if(t>qc)throw new Error(`byte length of ${t} should not exceed a uint16`);a[e]=Es(t,Hc)}c+=i[e].length}return y(...a,...i)}decode(e){const t=this.childTypes,n=[],a=[];let i=0,r=0;const o=new DataView(e.buffer);for(;i<t.length;){const s=t[i];if(s.isDynamic()){if(e.slice(r,e.length).length<Hc)throw new Error("dynamic type in tuple is too short to be decoded");const t=o.getUint16(r);if(n.length>0&&(n[n.length-1].right=t,t<n[n.length-1].left))throw new Error("dynamic index segment miscalculation: left is greater than right index");const i={left:t,right:-1};n.push(i),a.push(null),r+=Hc}else if(s.constructor===Qc){const t=rh(this.childTypes,i,-1);let n=rh(this.childTypes,i,1);if(t%8!=0)throw new Error("expected before bool number mod 8 === 0");n=Math.min(7,n);for(let t=0;t<=n;t++){const n=128>>t;(e[r]&n)>0?a.push(new Uint8Array([128])):a.push(new Uint8Array([0]))}i+=n,r+=1}else{const t=s.byteLen();a.push(e.slice(r,r+t)),r+=t}if(i!==t.length-1&&r>=e.length)throw new Error("input byte not enough to decode");i+=1}if(n.length>0&&(n[n.length-1].right=e.length,r=e.length),r<e.length)throw new Error("input byte not fully consumed");for(let e=0;e<n.length;e++){const t=n[e];if(t.left>t.right)throw new Error("dynamic segment should display a [l, r] space with l <= r");if(e!==n.length-1&&t.right!==n[e+1].left)throw new Error("dynamic segment should be consecutive")}let s=0;for(let i=0;i<t.length;i++)t[i].isDynamic()&&(a[i]=e.slice(n[s].left,n[s].right),s+=1);const c=[];for(let e=0;e<t.length;e++){const n=t[e].decode(a[e]);c.push(n)}return c}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw new Error("tuple string should not start with comma");if(e.includes(",,"))throw new Error("tuple string should not have consecutive commas");const t=[];let n=0,a="";for(const i of e)a+=i,"("===i?n+=1:")"===i?n-=1:","===i&&0===n&&(t.push(a.slice(0,a.length-1)),a="");if(0!==a.length&&t.push(a),0!==n)throw new Error("tuple string has mismatched parentheses");return t}}function ih(e){let t=0;if(e.length>8)throw new Error("value list passed in should be no greater than length 8");for(let n=0;n<e.length;n++){const a=e[n];if("boolean"!=typeof a)throw new Error("non-boolean values cannot be compressed into a byte");a&&(t|=1<<7-n)}return t}function rh(e,t,n){let a=0;for(;;){const i=t+n*a;if(e[i].constructor!==Qc){a-=1;break}if(i!==e.length-1&&1===n)a+=1;else{if(!(i>0&&-1===n))break;a+=1}}return a}var oh,sh;function ch(e){return e===oh.any||e===oh.pay||e===oh.keyreg||e===oh.acfg||e===oh.axfer||e===oh.afrz||e===oh.appl}function hh(e,t){return e===oh.any||!!t.type&&t.type.toString()===e.toString()}function dh(e){return e===sh.account||e===sh.application||e===sh.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(oh||(oh={})),function(e){e.account="account",e.application="application",e.asset="asset"}(sh||(sh={}));class uh{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw new Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map(({type:e,name:t,desc:n})=>ch(e)||dh(e)?{type:e,name:t,description:n}:{type:Jc.from(e),name:t,description:n}),this.returns={type:"void"===e.returns.type?e.returns.type:Jc.from(e.returns.type),description:e.returns.desc},this.events=e.events,this.readonly=e.readonly}getSignature(){const e=this.args.map(e=>e.type.toString()).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){const e=_e(this.getSignature());return new Uint8Array(e.slice(0,4))}txnCount(){let e=1;for(const t of this.args)"string"==typeof t.type&&ch(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map(({type:e,name:t,description:n})=>({type:e.toString(),name:t,desc:n})),returns:{type:this.returns.type.toString(),desc:this.returns.description},events:this.events,readonly:this.readonly}}static fromSignature(e){const{name:t,args:n,returns:a}=function(e){const t=e.indexOf("(");if(-1===t)throw new Error(`Invalid method signature: ${e}`);let n=-1,a=0;for(let i=t;i<e.length;i++){const t=e[i];if("("===t)a+=1;else if(")"===t){if(0===a)break;if(a-=1,0===a){n=i;break}}}if(-1===n)throw new Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:ah.parseTupleContent(e.slice(t+1,n)),returns:e.slice(n+1)}}(e);return new uh({name:t,args:n.map(e=>({type:e})),returns:{type:a}})}}function lh(e,t){if(null===e||!Array.isArray(e)||!e.every(e=>e instanceof uh))throw new Error("Methods list provided is null or not the correct type");const n=e.filter(e=>e.name===t);if(n.length>1)throw new Error(`found ${n.length} methods with the same name ${n.map(e=>e.getSignature()).join(",")}`);if(0===n.length)throw new Error(`found 0 methods with the name ${t}`);return n[0]}class gh{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw new Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map(e=>new uh(e)),this.events=e.events}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map(e=>e.toJSON()),events:this.events}}getMethodByName(e){return lh(this.methods,e)}}class mh{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw new Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map(e=>new uh(e))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map(e=>e.toJSON())}}getMethodByName(e){return lh(this.methods,e)}}const ph=new Uint8Array([21,31,124,117]);var fh;function yh(e,t,n){if(null!=n&&e===n)return 0;const a=null==n?0:1;for(let n=0;n<t.length;n++)if(e===t[n])return n+a;return t.push(e),t.length-1+a}!function(e){e[e.BUILDING=0]="BUILDING",e[e.BUILT=1]="BUILT",e[e.SIGNED=2]="SIGNED",e[e.SUBMITTED=3]="SUBMITTED",e[e.COMMITTED=4]="COMMITTED"}(fh||(fh={}));class wh{constructor(){this.status=fh.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const e=new wh;return e.transactions=this.transactions.map(({txn:e,signer:t})=>{const n=e.toEncodingData();return n.delete("grp"),{txn:un.fromEncodingData(n),signer:t}}),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==fh.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===wh.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${wh.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some(e=>0!==e))throw new Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:n,sender:a,suggestedParams:i,onComplete:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,appAccounts:g,appForeignApps:m,appForeignAssets:p,boxes:f,access:y,note:w,lease:v,rekeyTo:S,rejectVersion:E,signer:b}){if(this.status!==fh.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>wh.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${wh.MAX_GROUP_SIZE}`);if(BigInt(e)===BigInt(0)){if(null==o||null==s||null==c||null==h||null==d||null==u)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(r===Ct.UpdateApplicationOC){if(null==o||null==s)throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=d||null!=u)throw new Error("The local state schema cannot be changed on an update call: numLocalInts, numLocalByteSlices")}else if(null!=o||null!=s||null!=c||null!=h||null!=d||null!=u||null!=l)throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(y&&(g||m||p||f))throw new Error("Cannot specify both access and legacy foreign arrays (appAccounts, appForeignApps, appForeignAssets, boxes)");if(null==n&&(n=[]),n.length!==t.args.length)throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${n.length}`);let x=[],A=[];const D=[],I=[],T=[],P=new Map,M=f||[];for(let e=0;e<n.length;e++){let a=t.args[e].type;const i=n[e];if(ch(a)){if(!_c(i)||!hh(a,i.txn))throw new Error(`Expected ${a} TransactionWithSigner for argument at index ${e}`);if(i.txn.group&&i.txn.group.some(e=>0!==e))throw new Error("Cannot add a transaction with nonzero group ID");D.push(i)}else{if(_c(i))throw new Error(`Expected non-transaction value for argument at index ${e}`);if(dh(a)&&(P.set(I.length,x.length),I.push(a),T.push(i),a=new Wc(8)),"string"==typeof a)throw new Error(`Unknown ABI type: ${a}`);x.push(a),A.push(i)}}const V=[],R=null==g?[]:g.map(e=>e.toString()),B=null==m?[]:m.map(k),C=null==p?[]:p.map(k);for(let t=0;t<I.length;t++){const n=I[t],i=T[t];let r=0;switch(n){case sh.account:{const e=new Xc;r=yh(e.decode(e.encode(i)),R,a.toString());break}case sh.application:{const t=new Wc(64),n=t.decode(t.encode(i));if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${n}`);r=yh(n,B,k(e));break}case sh.asset:{const e=new Wc(64),t=e.decode(e.encode(i));if(t>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${t}`);r=yh(t,C);break}default:throw new Error(`Unknown reference type: ${n}`)}V.push(r)}for(let e=0;e<V.length;e++)A[P.get(e)]=V[e];if(x.length>15){const e=x.slice(14),t=A.slice(14);x=x.slice(0,14),A=A.slice(0,14),x.push(new ah(e)),A.push(t)}const U=[t.getSelector()];for(let e=0;e<x.length;e++)U.push(x[e].encode(A[e]));const $={txn:Tc({sender:a,appIndex:e,appArgs:U,accounts:y?void 0:R,foreignApps:y?void 0:B,foreignAssets:y?void 0:C,boxes:y?void 0:M,access:y,onComplete:null==r?Ct.NoOpOC:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,rejectVersion:E,lease:v,note:w,rekeyTo:S,suggestedParams:i}),signer:b};this.transactions.push(...D,$),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===fh.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&qs(this.transactions.map(e=>e.txn)),this.status=fh.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=fh.SIGNED)return this.signedTxns;const e=this.buildGroup(),t=e.map(e=>e.txn),n=new Map;for(let t=0;t<e.length;t++){const{signer:a}=e[t];n.has(a)||n.set(a,[]),n.get(a).push(t)}const a=Array.from(n),i=await Promise.all(a.map(([e,n])=>e(t,n))),r=e.map(()=>null);for(let e=0;e<a.length;e++){const t=a[e][1],n=i[e];for(let e=0;e<t.length;e++)r[t[e]]=n[e]}if(!r.every(e=>null!=e))throw new Error(`Missing signatures. Got ${r}`);const o=r.map((e,t)=>{try{return Ie(e,Kn).txn.txID()}catch(e){throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`)}});return this.signedTxns=r,this.txIDs=o,this.status=fh.SIGNED,r}async submit(e){if(this.status>fh.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=fh.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>fh.SUBMITTED)throw new Error("Simulated Transaction group has already been submitted to the network");const n=(await this.gatherSignatures()).map(e=>Ie(e,Kn)),a=null==t?new Ti({txnGroups:[]}):t;a.txnGroups=[new Pi({txns:n})];const i=await e.simulateTransactions(a).do(),r=[];for(const[e,t]of this.methodCalls){const n=this.txIDs[e],a=i.txnGroups[0].txnResults[e].txnResult,o={txID:n,rawReturnValue:new Uint8Array,method:t};r.push(wh.parseMethodResponse(t,o,a))}return{methodResults:r,simulateResponse:i}}async execute(e,t){if(this.status===fh.COMMITTED)throw new Error("Transaction group has already been executed successfully");const n=await this.submit(e);this.status=fh.SUBMITTED;const a=this.transactions.findIndex((e,t)=>this.methodCalls.has(t)),i=-1===a?0:a,r=await Ss(e,n[i],t);this.status=fh.COMMITTED;const o=r.confirmedRound,s=[];for(const[t,i]of this.methodCalls){const o=n[t];let c={txID:o,rawReturnValue:new Uint8Array,method:i};try{const n=t===a?r:await e.pendingTransactionInformation(o).do();c=wh.parseMethodResponse(i,c,n)}catch(e){c.decodeError=e}s.push(c)}return{confirmedRound:o,txIDs:n,methodResults:s}}static parseMethodResponse(e,t,n){const a=t;try{if(a.txInfo=n,"void"!==e.returns.type){const i=n.logs||[];if(0===i.length)throw new Error(`App call transaction did not log a return value ${p(n)}`);const r=i[i.length-1];if(r.byteLength<4||!f(r.slice(0,4),ph))throw new Error(`App call transaction did not log a ABI return value ${p(n)}`);a.rawReturnValue=new Uint8Array(r.slice(4)),a.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){a.decodeError=e}return a}}wh.MAX_GROUP_SIZE=16;const vh="The transaction sender address and multisig preimage do not match.",Sh=new Error(vh),Eh=new Error(o),kh=i})(),a})());
|
|
3
3
|
//# sourceMappingURL=algosdk.min.js.map
|