algomintx 2.0.3 → 2.0.5

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.
@@ -1,2 +0,0 @@
1
- /*! For license information please see algomintx.esm.js.LICENSE.txt */
2
- var e,t,n={540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},1013:(e,t,n)=>{var a=n(7372).stringify,r=n(8146);e.exports=function(e){return{parse:r(e),stringify:a}},e.exports.parse=r(),e.exports.stringify=a},1113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1281:()=>{},1594:function(e,t,n){var a;!function(){var r,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,s=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",h=1e14,d=14,u=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function f(e){for(var t,n,a=1,r=e.length,i=e[0]+"";a<r;){for(t=e[a++]+"",n=d-t.length;n--;t="0"+t);i+=t}for(r=i.length;48===i.charCodeAt(--r););return i.slice(0,r+1||1)}function v(e,t){var n,a,r=e.c,i=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=r&&!r[0],a=i&&!i[0],n||a)return n?a?0:-s:o;if(o!=s)return o;if(n=o<0,a=c==l,!r||!i)return a?0:!r^n?1:-1;if(!a)return c>l^n?1:-1;for(s=(c=r.length)<(l=i.length)?c:l,o=0;o<s;o++)if(r[o]!=i[o])return r[o]>i[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function w(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 b(e){var t=e.c.length-1;return y(e.e/d)==t&&e.c[t]%2!=0}function I(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function S(e,t,n){var a,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(++t>(a=e.length)){for(r=n,t-=a;--t;r+=n);e+=r}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}r=function e(t){var n,a,r,A,C,E,x,k,B,D,N=H.prototype={constructor:H,toString:null,valueOf:null},R=new H(1),M=20,T=4,L=-7,V=21,W=-1e7,G=1e7,F=!1,Y=1,Z=0,z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},P="0123456789abcdefghijklmnopqrstuvwxyz",X=!0;function H(e,t){var n,o,c,h,g,m,p,y,f=this;if(!(f instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>G?f.c=f.e=null:e.e<W?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((m="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(h=0,g=e;g>=10;g/=10,h++);return void(h>G?f.c=f.e=null:(f.e=h,f.c=[e]))}y=String(e)}else{if(!i.test(y=String(e)))return r(f,y,m);f.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(h=y.indexOf("."))>-1&&(y=y.replace(".","")),(g=y.search(/e/i))>0?(h<0&&(h=g),h+=+y.slice(g+1),y=y.substring(0,g)):h<0&&(h=y.length)}else{if(w(t,2,P.length,"Base"),10==t&&X)return U(f=new H(e),M+f.e+1,T);if(y=String(e),m="number"==typeof e){if(0*e!=0)return r(f,y,m,t);if(f.s=1/e<0?(y=y.slice(1),-1):1,H.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else f.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(n=P.slice(0,t),h=g=0,p=y.length;g<p;g++)if(n.indexOf(o=y.charAt(g))<0){if("."==o){if(g>h){h=p;continue}}else if(!c&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){c=!0,g=-1,h=0;continue}return r(f,String(e),m,t)}m=!1,(h=(y=a(y,t,10,f.s)).indexOf("."))>-1?y=y.replace(".",""):h=y.length}for(g=0;48===y.charCodeAt(g);g++);for(p=y.length;48===y.charCodeAt(--p););if(y=y.slice(g,++p)){if(p-=g,m&&H.DEBUG&&p>15&&(e>u||e!==s(e)))throw Error(l+f.s*e);if((h=h-g-1)>G)f.c=f.e=null;else if(h<W)f.c=[f.e=0];else{if(f.e=h,f.c=[],g=(h+1)%d,h<0&&(g+=d),g<p){for(g&&f.c.push(+y.slice(0,g)),p-=d;g<p;)f.c.push(+y.slice(g,g+=d));g=d-(y=y.slice(g)).length}else g-=p;for(;g--;y+="0");f.c.push(+y)}}else f.c=[f.e=0]}function K(e,t,n,a){var r,i,o,s,c;if(null==n?n=T:w(n,0,8),!e.c)return e.toString();if(r=e.c[0],o=e.e,null==t)c=f(e.c),c=1==a||2==a&&(o<=L||o>=V)?I(c,o):S(c,o,"0");else if(i=(e=U(new H(e),t,n)).e,s=(c=f(e.c)).length,1==a||2==a&&(t<=i||i<=L)){for(;s<t;c+="0",s++);c=I(c,i)}else if(t-=o,c=S(c,i,"0"),i+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-s)>0)for(i+1==s&&(c+=".");t--;c+="0");return e.s<0&&r?"-"+c:c}function j(e,t){for(var n,a,r=1,i=new H(e[0]);r<e.length;r++)(!(a=new H(e[r])).s||(n=v(i,a))===t||0===n&&i.s===t)&&(i=a);return i}function O(e,t,n){for(var a=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,a++);return(n=a+n*d-1)>G?e.c=e.e=null:n<W?e.c=[e.e=0]:(e.e=n,e.c=t),e}function U(e,t,n,a){var r,i,c,l,u,m,p,y=e.c,f=g;if(y){e:{for(r=1,l=y[0];l>=10;l/=10,r++);if((i=t-r)<0)i+=d,c=t,u=y[m=0],p=s(u/f[r-c-1]%10);else if((m=o((i+1)/d))>=y.length){if(!a)break e;for(;y.length<=m;y.push(0));u=p=0,r=1,c=(i%=d)-d+1}else{for(u=l=y[m],r=1;l>=10;l/=10,r++);p=(c=(i%=d)-d+r)<0?0:s(u/f[r-c-1]%10)}if(a=a||t<0||null!=y[m+1]||(c<0?u:u%f[r-c-1]),a=n<4?(p||a)&&(0==n||n==(e.s<0?3:2)):p>5||5==p&&(4==n||a||6==n&&(i>0?c>0?u/f[r-c]:0:y[m-1])%10&1||n==(e.s<0?8:7)),t<1||!y[0])return y.length=0,a?(t-=e.e+1,y[0]=f[(d-t%d)%d],e.e=-t||0):y[0]=e.e=0,e;if(0==i?(y.length=m,l=1,m--):(y.length=m+1,l=f[d-i],y[m]=c>0?s(u/f[r-c]%f[c])*l:0),a)for(;;){if(0==m){for(i=1,c=y[0];c>=10;c/=10,i++);for(c=y[0]+=l,l=1;c>=10;c/=10,l++);i!=l&&(e.e++,y[0]==h&&(y[0]=1));break}if(y[m]+=l,y[m]!=h)break;y[m--]=0,l=1}for(i=y.length;0===y[--i];y.pop());}e.e>G?e.c=e.e=null:e.e<W&&(e.c=[e.e=0])}return e}function J(e){var t,n=e.e;return null===n?e.toString():(t=f(e.c),t=n<=L||n>=V?I(t,n):S(t,n,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(n=e[t],0,p,t),M=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(n=e[t],0,8,t),T=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(w(n[0],-p,0,t),w(n[1],0,p,t),L=n[0],V=n[1]):(w(n,-p,p,t),L=-(V=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)w(n[0],-p,-1,t),w(n[1],1,p,t),W=n[0],G=n[1];else{if(w(n,-p,p,t),!n)throw Error(c+t+" cannot be zero: "+n);W=-(G=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 F=!n,Error(c+"crypto unavailable");F=n}else F=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(n=e[t],0,9,t),Y=n),e.hasOwnProperty(t="POW_PRECISION")&&(w(n=e[t],0,p,t),Z=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(c+t+" not an object: "+n);z=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);X="0123456789"==n.slice(0,10),P=n}}return{DECIMAL_PLACES:M,ROUNDING_MODE:T,EXPONENTIAL_AT:[L,V],RANGE:[W,G],CRYPTO:F,MODULO_MODE:Y,POW_PRECISION:Z,FORMAT:z,ALPHABET:P}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,n,a=e.c,r=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===i||-1===i)&&r>=-p&&r<=p&&r===s(r)){if(0===a[0]){if(0===r&&1===a.length)return!0;break e}if((t=(r+1)%d)<1&&(t+=d),String(a[0]).length==t){for(t=0;t<a.length;t++)if((n=a[t])<0||n>=h||n!==s(n))break e;if(0!==n)return!0}}}else if(null===a&&null===r&&(null===i||1===i||-1===i))return!0;throw Error(c+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return j(arguments,-1)},H.minimum=H.min=function(){return j(arguments,1)},H.random=(A=9007199254740992,C=Math.random()*A&2097151?function(){return s(Math.random()*A)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,a,r,i,l=0,h=[],u=new H(R);if(null==e?e=M:w(e,0,p),r=o(e/d),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(r*=2));l<r;)(i=131072*t[l]+(t[l+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[l]=n[0],t[l+1]=n[1]):(h.push(i%1e14),l+=2);l=r/2}else{if(!crypto.randomBytes)throw F=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(r*=7);l<r;)(i=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(h.push(i%1e14),l+=7);l=r/7}if(!F)for(;l<r;)(i=C())<9e15&&(h[l++]=i%1e14);for(r=h[--l],e%=d,r&&e&&(i=g[d-e],h[l]=s(r/i)*i);0===h[l];h.pop(),l--);if(l<0)h=[a=0];else{for(a=-1;0===h[0];h.splice(0,1),a-=d);for(l=1,i=h[0];i>=10;i/=10,l++);l<d&&(a-=d-l)}return u.e=a,u.c=h,u}),H.sum=function(){for(var e=1,t=arguments,n=new H(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 r,i,o=[0],s=0,c=e.length;s<c;){for(i=o.length;i--;o[i]*=t);for(o[0]+=a.indexOf(e.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}return function(a,r,i,o,s){var c,l,h,d,u,g,m,p,y=a.indexOf("."),v=M,w=T;for(y>=0&&(d=Z,Z=0,a=a.replace(".",""),g=(p=new H(r)).pow(a.length-y),Z=d,p.c=t(S(f(g.c),g.e,"0"),10,i,e),p.e=p.c.length),h=d=(m=t(a,r,i,s?(c=P,e):(c=e,P))).length;0==m[--d];m.pop());if(!m[0])return c.charAt(0);if(y<0?--h:(g.c=m,g.e=h,g.s=o,m=(g=n(g,p,v,w,i)).c,u=g.r,h=g.e),y=m[l=h+v+1],d=i/2,u=u||l<0||null!=m[l+1],u=w<4?(null!=y||u)&&(0==w||w==(g.s<0?3:2)):y>d||y==d&&(4==w||u||6==w&&1&m[l-1]||w==(g.s<0?8:7)),l<1||!m[0])a=u?S(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,u)for(--i;++m[--l]>i;)m[l]=0,l||(++h,m=[1].concat(m));for(d=m.length;!m[--d];);for(y=0,a="";y<=d;a+=c.charAt(m[y++]));a=S(a,h,c.charAt(0))}return a}}(),n=function(){function e(e,t,n){var a,r,i,o,s=0,c=e.length,l=t%m,h=t/m|0;for(e=e.slice();c--;)s=((r=l*(i=e[c]%m)+(a=h*i+(o=e[c]/m|0)*l)%m*m+s)/n|0)+(a/m|0)+h*o,e[c]=r%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,a){var r,i;if(n!=a)i=n>a?1:-1;else for(r=i=0;r<n;r++)if(e[r]!=t[r]){i=e[r]>t[r]?1:-1;break}return i}function n(e,t,n,a){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*a+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,r,i,o,c){var l,u,g,m,p,f,v,w,b,I,S,A,C,E,x,k,B,D=a.s==r.s?1:-1,N=a.c,R=r.c;if(!(N&&N[0]&&R&&R[0]))return new H(a.s&&r.s&&(N?!R||N[0]!=R[0]:R)?N&&0==N[0]||!R?0*D:D/0:NaN);for(b=(w=new H(D)).c=[],D=i+(u=a.e-r.e)+1,c||(c=h,u=y(a.e/d)-y(r.e/d),D=D/d|0),g=0;R[g]==(N[g]||0);g++);if(R[g]>(N[g]||0)&&u--,D<0)b.push(1),m=!0;else{for(E=N.length,k=R.length,g=0,D+=2,(p=s(c/(R[0]+1)))>1&&(R=e(R,p,c),N=e(N,p,c),k=R.length,E=N.length),C=k,S=(I=N.slice(0,k)).length;S<k;I[S++]=0);B=R.slice(),B=[0].concat(B),x=R[0],R[1]>=c/2&&x++;do{if(p=0,(l=t(R,I,k,S))<0){if(A=I[0],k!=S&&(A=A*c+(I[1]||0)),(p=s(A/x))>1)for(p>=c&&(p=c-1),v=(f=e(R,p,c)).length,S=I.length;1==t(f,I,v,S);)p--,n(f,k<v?B:R,v,c),v=f.length,l=1;else 0==p&&(l=p=1),v=(f=R.slice()).length;if(v<S&&(f=[0].concat(f)),n(I,f,S,c),S=I.length,-1==l)for(;t(R,I,k,S)<1;)p++,n(I,k<S?B:R,S,c),S=I.length}else 0===l&&(p++,I=[0]);b[g++]=p,I[0]?I[S++]=N[C]||0:(I=[N[C]],S=1)}while((C++<E||null!=I[0])&&D--);m=null!=I[0],b[0]||b.splice(0,1)}if(c==h){for(g=1,D=b[0];D>=10;D/=10,g++);U(w,i+(w.e=g+u*d-1)+1,o,m)}else w.e=u,w.r=+m;return w}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,k=/^\.([^.]+)$/,B=/^-?(Infinity|NaN)$/,D=/^\s*\+(?=[\w.])|^\s+|\s+$/g,r=function(e,t,n,a){var r,i=n?t:t.replace(D,"");if(B.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(E,(function(e,t,n){return r="x"==(n=n.toLowerCase())?16:"b"==n?2:8,a&&a!=r?e:t})),a&&(r=a,i=i.replace(x,"$1").replace(k,"0.$1")),t!=i))return new H(i,r);if(H.DEBUG)throw Error(c+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},N.absoluteValue=N.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},N.comparedTo=function(e,t){return v(this,new H(e,t))},N.decimalPlaces=N.dp=function(e,t){var n,a,r,i=this;if(null!=e)return w(e,0,p),null==t?t=T:w(t,0,8),U(new H(i),e+i.e+1,t);if(!(n=i.c))return null;if(a=((r=n.length-1)-y(this.e/d))*d,r=n[r])for(;r%10==0;r/=10,a--);return a<0&&(a=0),a},N.dividedBy=N.div=function(e,t){return n(this,new H(e,t),M,T)},N.dividedToIntegerBy=N.idiv=function(e,t){return n(this,new H(e,t),0,1)},N.exponentiatedBy=N.pow=function(e,t){var n,a,r,i,l,h,u,g,m=this;if((e=new H(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+J(e));if(null!=t&&(t=new H(t)),l=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 H(Math.pow(+J(m),l?e.s*(2-b(e)):+J(e))),t?g.mod(t):g;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(a=!h&&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||l&&m.c[1]>=24e7:m.c[0]<8e13||l&&m.c[0]<=9999975e7)))return i=m.s<0&&b(e)?-0:0,m.e>-1&&(i=1/i),new H(h?1/i:i);Z&&(i=o(Z/d+2))}for(l?(n=new H(.5),h&&(e.s=1),u=b(e)):u=(r=Math.abs(+J(e)))%2,g=new H(R);;){if(u){if(!(g=g.times(m)).c)break;i?g.c.length>i&&(g.c.length=i):a&&(g=g.mod(t))}if(r){if(0===(r=s(r/2)))break;u=r%2}else if(U(e=e.times(n),e.e+1,1),e.e>14)u=b(e);else{if(0==(r=+J(e)))break;u=r%2}m=m.times(m),i?m.c&&m.c.length>i&&(m.c.length=i):a&&(m=m.mod(t))}return a?g:(h&&(g=R.div(g)),t?g.mod(t):i?U(g,Z,T,void 0):g)},N.integerValue=function(e){var t=new H(this);return null==e?e=T:w(e,0,8),U(t,t.e+1,e)},N.isEqualTo=N.eq=function(e,t){return 0===v(this,new H(e,t))},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(e,t){return v(this,new H(e,t))>0},N.isGreaterThanOrEqualTo=N.gte=function(e,t){return 1===(t=v(this,new H(e,t)))||0===t},N.isInteger=function(){return!!this.c&&y(this.e/d)>this.c.length-2},N.isLessThan=N.lt=function(e,t){return v(this,new H(e,t))<0},N.isLessThanOrEqualTo=N.lte=function(e,t){return-1===(t=v(this,new H(e,t)))||0===t},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.minus=function(e,t){var n,a,r,i,o=this,s=o.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/d,l=e.e/d,u=o.c,g=e.c;if(!c||!l){if(!u||!g)return u?(e.s=-t,e):new H(g?o:NaN);if(!u[0]||!g[0])return g[0]?(e.s=-t,e):new H(u[0]?o:3==T?-0:0)}if(c=y(c),l=y(l),u=u.slice(),s=c-l){for((i=s<0)?(s=-s,r=u):(l=c,r=g),r.reverse(),t=s;t--;r.push(0));r.reverse()}else for(a=(i=(s=u.length)<(t=g.length))?s:t,s=t=0;t<a;t++)if(u[t]!=g[t]){i=u[t]<g[t];break}if(i&&(r=u,u=g,g=r,e.s=-e.s),(t=(a=g.length)-(n=u.length))>0)for(;t--;u[n++]=0);for(t=h-1;a>s;){if(u[--a]<g[a]){for(n=a;n&&!u[--n];u[n]=t);--u[n],u[a]+=h}u[a]-=g[a]}for(;0==u[0];u.splice(0,1),--l);return u[0]?O(e,u,l):(e.s=3==T?-1:1,e.c=[e.e=0],e)},N.modulo=N.mod=function(e,t){var a,r,i=this;return e=new H(e,t),!i.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||i.c&&!i.c[0]?new H(i):(9==Y?(r=e.s,e.s=1,a=n(i,e,0,3),e.s=r,a.s*=r):a=n(i,e,0,Y),(e=i.minus(a.times(e))).c[0]||1!=Y||(e.s=i.s),e)},N.multipliedBy=N.times=function(e,t){var n,a,r,i,o,s,c,l,u,g,p,f,v,w,b,I=this,S=I.c,A=(e=new H(e,t)).c;if(!(S&&A&&S[0]&&A[0]))return!I.s||!e.s||S&&!S[0]&&!A||A&&!A[0]&&!S?e.c=e.e=e.s=null:(e.s*=I.s,S&&A?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=y(I.e/d)+y(e.e/d),e.s*=I.s,(c=S.length)<(g=A.length)&&(v=S,S=A,A=v,r=c,c=g,g=r),r=c+g,v=[];r--;v.push(0));for(w=h,b=m,r=g;--r>=0;){for(n=0,p=A[r]%b,f=A[r]/b|0,i=r+(o=c);i>r;)n=((l=p*(l=S[--o]%b)+(s=f*l+(u=S[o]/b|0)*p)%b*b+v[i]+n)/w|0)+(s/b|0)+f*u,v[i--]=l%w;v[i]=n}return n?++a:v.splice(0,1),O(e,v,a)},N.negated=function(){var e=new H(this);return e.s=-e.s||null,e},N.plus=function(e,t){var n,a=this,r=a.s;if(t=(e=new H(e,t)).s,!r||!t)return new H(NaN);if(r!=t)return e.s=-t,a.minus(e);var i=a.e/d,o=e.e/d,s=a.c,c=e.c;if(!i||!o){if(!s||!c)return new H(r/0);if(!s[0]||!c[0])return c[0]?e:new H(s[0]?a:0*r)}if(i=y(i),o=y(o),s=s.slice(),r=i-o){for(r>0?(o=i,n=c):(r=-r,n=s),n.reverse();r--;n.push(0));n.reverse()}for((r=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=r),r=0;t;)r=(s[--t]=s[t]+c[t]+r)/h|0,s[t]=h===s[t]?0:s[t]%h;return r&&(s=[r].concat(s),++o),O(e,s,o)},N.precision=N.sd=function(e,t){var n,a,r,i=this;if(null!=e&&e!==!!e)return w(e,1,p),null==t?t=T:w(t,0,8),U(new H(i),e,t);if(!(n=i.c))return null;if(a=(r=n.length-1)*d+1,r=n[r]){for(;r%10==0;r/=10,a--);for(r=n[0];r>=10;r/=10,a++);}return e&&i.e+1>a&&(a=i.e+1),a},N.shiftedBy=function(e){return w(e,-9007199254740991,u),this.times("1e"+e)},N.squareRoot=N.sqrt=function(){var e,t,a,r,i,o=this,s=o.c,c=o.s,l=o.e,h=M+4,d=new H("0.5");if(1!==c||!s||!s[0])return new H(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+J(o)))||c==1/0?(((t=f(s)).length+l)%2==0&&(t+="0"),c=Math.sqrt(+t),l=y((l+1)/2)-(l<0||l%2),a=new H(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):a=new H(c+""),a.c[0])for((c=(l=a.e)+h)<3&&(c=0);;)if(i=a,a=d.times(i.plus(n(o,i,h,1))),f(i.c).slice(0,c)===(t=f(a.c)).slice(0,c)){if(a.e<l&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(U(a,a.e+M+2,1),e=!a.times(a).eq(o));break}if(!r&&(U(i,i.e+M+2,0),i.times(i).eq(o))){a=i;break}h+=4,c+=4,r=1}return U(a,a.e+M+1,T,e)},N.toExponential=function(e,t){return null!=e&&(w(e,0,p),e++),K(this,e,t,1)},N.toFixed=function(e,t){return null!=e&&(w(e,0,p),e=e+this.e+1),K(this,e,t)},N.toFormat=function(e,t,n){var a,r=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=z;else if("object"!=typeof n)throw Error(c+"Argument not an object: "+n);if(a=r.toFixed(e,t),r.c){var i,o=a.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,h=n.groupSeparator||"",d=o[0],u=o[1],g=r.s<0,m=g?d.slice(1):d,p=m.length;if(l&&(i=s,s=l,l=i,p-=i),s>0&&p>0){for(i=p%s||s,d=m.substr(0,i);i<p;i+=s)d+=h+m.substr(i,s);l>0&&(d+=h+m.slice(i)),g&&(d="-"+d)}a=u?d+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?u.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):u):d}return(n.prefix||"")+a+(n.suffix||"")},N.toFraction=function(e){var t,a,r,i,o,s,l,h,u,m,p,y,v=this,w=v.c;if(null!=e&&(!(l=new H(e)).isInteger()&&(l.c||1!==l.s)||l.lt(R)))throw Error(c+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+J(l));if(!w)return new H(v);for(t=new H(R),u=a=new H(R),r=h=new H(R),y=f(w),o=t.e=y.length-v.e-1,t.c[0]=g[(s=o%d)<0?d+s:s],e=!e||l.comparedTo(t)>0?o>0?t:u:l,s=G,G=1/0,l=new H(y),h.c[0]=0;m=n(l,t,0,1),1!=(i=a.plus(m.times(r))).comparedTo(e);)a=r,r=i,u=h.plus(m.times(i=u)),h=i,t=l.minus(m.times(i=t)),l=i;return i=n(e.minus(a),r,0,1),h=h.plus(i.times(u)),a=a.plus(i.times(r)),h.s=u.s=v.s,p=n(u,r,o*=2,T).minus(v).abs().comparedTo(n(h,a,o,T).minus(v).abs())<1?[u,r]:[h,a],G=s,p},N.toNumber=function(){return+J(this)},N.toPrecision=function(e,t){return null!=e&&w(e,1,p),K(this,e,t,2)},N.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=L||i>=V?I(f(n.c),i):S(f(n.c),i,"0"):10===e&&X?t=S(f((n=U(new H(n),M+i+1,T)).c),n.e,"0"):(w(e,2,P.length,"Base"),t=a(S(f(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},N.valueOf=N.toJSON=function(){return J(this)},N._isBigNumber=!0,null!=t&&H.set(t),H}(),r.default=r.BigNumber=r,void 0===(a=function(){return r}.call(t,n,t,e))||(e.exports=a)}()},1601:e=>{e.exports=function(e){return e[1]}},3899:(e,t,n)=>{n.d(t,{Ay$:()=>Oc});var a={};n.r(a),n.d(a,{Account:()=>sa,AccountApplicationResponse:()=>ca,AccountAssetHolding:()=>la,AccountAssetResponse:()=>ha,AccountAssetsInformationResponse:()=>da,AccountParticipation:()=>ua,AccountStateDelta:()=>ga,AppCallLogs:()=>ma,Application:()=>pa,ApplicationInitialStates:()=>ya,ApplicationKVStorage:()=>fa,ApplicationLocalReference:()=>va,ApplicationLocalState:()=>wa,ApplicationParams:()=>ba,ApplicationStateOperation:()=>Ia,ApplicationStateSchema:()=>Sa,Asset:()=>Aa,AssetHolding:()=>Ca,AssetHoldingReference:()=>Ea,AssetParams:()=>xa,AvmKeyValue:()=>ka,AvmValue:()=>Ba,BlockHashResponse:()=>Da,BlockLogsResponse:()=>Na,BlockResponse:()=>Ra,BlockTxidsResponse:()=>Ma,Box:()=>Ta,BoxDescriptor:()=>La,BoxReference:()=>Va,BoxesResponse:()=>Wa,BuildVersion:()=>Ga,CompileResponse:()=>Fa,DisassembleResponse:()=>Ya,DryrunRequest:()=>Za,DryrunResponse:()=>za,DryrunSource:()=>Pa,DryrunState:()=>Xa,DryrunTxnResult:()=>Ha,ErrorResponse:()=>Ka,EvalDelta:()=>ja,EvalDeltaKeyValue:()=>Oa,GetBlockTimeStampOffsetResponse:()=>Ua,GetSyncRoundResponse:()=>Ja,KvDelta:()=>Qa,LedgerStateDeltaForTransactionGroup:()=>$a,LightBlockHeaderProof:()=>_a,NodeStatusResponse:()=>qa,PendingTransactionResponse:()=>er,PendingTransactionsResponse:()=>tr,PostTransactionsResponse:()=>nr,ScratchChange:()=>ar,SimulateInitialStates:()=>rr,SimulateRequest:()=>ir,SimulateRequestTransactionGroup:()=>or,SimulateResponse:()=>sr,SimulateTraceConfig:()=>cr,SimulateTransactionGroupResult:()=>lr,SimulateTransactionResult:()=>hr,SimulateUnnamedResourcesAccessed:()=>dr,SimulationEvalOverrides:()=>ur,SimulationOpcodeTraceUnit:()=>gr,SimulationTransactionExecTrace:()=>mr,StateProof:()=>pr,StateProofMessage:()=>yr,SupplyResponse:()=>fr,TealKeyValue:()=>vr,TealValue:()=>wr,TransactionGroupLedgerStateDeltasForRoundResponse:()=>br,TransactionParametersResponse:()=>Ir,TransactionProofResponse:()=>Sr,Version:()=>Ar});var r={};n.r(r),n.d(r,{Account:()=>ui,AccountParticipation:()=>gi,AccountResponse:()=>mi,AccountStateDelta:()=>pi,AccountsResponse:()=>yi,Application:()=>fi,ApplicationLocalState:()=>vi,ApplicationLocalStatesResponse:()=>wi,ApplicationLogData:()=>bi,ApplicationLogsResponse:()=>Ii,ApplicationParams:()=>Si,ApplicationResponse:()=>Ai,ApplicationStateSchema:()=>Ci,ApplicationsResponse:()=>Ei,Asset:()=>xi,AssetBalancesResponse:()=>ki,AssetHolding:()=>Bi,AssetHoldingsResponse:()=>Di,AssetParams:()=>Ni,AssetResponse:()=>Ri,AssetsResponse:()=>Mi,Block:()=>Ti,BlockHeadersResponse:()=>Li,BlockRewards:()=>Vi,BlockUpgradeState:()=>Wi,BlockUpgradeVote:()=>Gi,Box:()=>Fi,BoxDescriptor:()=>Yi,BoxesResponse:()=>Zi,ErrorResponse:()=>zi,EvalDelta:()=>Pi,EvalDeltaKeyValue:()=>Xi,HashFactory:()=>Hi,HbProofFields:()=>Ki,HealthCheck:()=>ji,IndexerStateProofMessage:()=>Oi,MerkleArrayProof:()=>Ui,MiniAssetHolding:()=>Ji,ParticipationUpdates:()=>Qi,StateProofFields:()=>$i,StateProofParticipant:()=>_i,StateProofReveal:()=>qi,StateProofSigSlot:()=>eo,StateProofSignature:()=>to,StateProofTracking:()=>no,StateProofVerifier:()=>ao,StateSchema:()=>ro,TealKeyValue:()=>io,TealValue:()=>oo,Transaction:()=>so,TransactionApplication:()=>co,TransactionAssetConfig:()=>lo,TransactionAssetFreeze:()=>ho,TransactionAssetTransfer:()=>uo,TransactionHeartbeat:()=>go,TransactionKeyreg:()=>mo,TransactionPayment:()=>po,TransactionResponse:()=>yo,TransactionSignature:()=>fo,TransactionSignatureLogicsig:()=>vo,TransactionSignatureMultisig:()=>wo,TransactionSignatureMultisigSubsignature:()=>bo,TransactionStateProof:()=>Io,TransactionsResponse:()=>So});var i={};n.r(i),n.d(i,{ABIAddressType:()=>vc,ABIArrayDynamicType:()=>Ac,ABIArrayStaticType:()=>Sc,ABIBoolType:()=>wc,ABIByteType:()=>bc,ABIContract:()=>Lc,ABIInterface:()=>Vc,ABIMethod:()=>Mc,ABIReferenceType:()=>Bc,ABIStringType:()=>Ic,ABITransactionType:()=>kc,ABITupleType:()=>Cc,ABIType:()=>pc,ABIUfixedType:()=>fc,ABIUintType:()=>yc,ADDR_BYTE_SIZE:()=>lc,ALGORAND_ZERO_ADDRESS_STRING:()=>z,AccountBaseData:()=>$n,AccountData:()=>_n,AccountDeltas:()=>ea,AccountTotals:()=>ia,Address:()=>H,AlgoCount:()=>ra,Algodv2:()=>hi,AppLocalState:()=>zn,AppLocalStateDelta:()=>Pn,AppParams:()=>Zn,AppParamsDelta:()=>Xn,AppResourceRecord:()=>Hn,ApplyData:()=>Tn,AssetHolding:()=>Kn,AssetHoldingDelta:()=>jn,AssetParams:()=>On,AssetParamsDelta:()=>Un,AssetResourceRecord:()=>Jn,AtomicTransactionComposer:()=>Yc,AtomicTransactionComposerStatus:()=>Gc,BalanceRecord:()=>qn,Block:()=>Wn,BlockHeader:()=>Nn,ENCODED_MULTISIG_SCHEMA:()=>cn,ENCODED_SUBSIG_SCHEMA:()=>rn,ERROR_INVALID_MICROALGOS:()=>jc,ERROR_MULTISIG_BAD_SENDER:()=>Kc,EvalDelta:()=>Mn,FalconSignatureStruct:()=>kt,FalconVerifier:()=>xt,HashFactory:()=>St,INVALID_MICROALGOS_ERROR_MSG:()=>$,IncludedTransactions:()=>na,Indexer:()=>Ko,IntDecoding:()=>h,Kmd:()=>di,KvValueDelta:()=>ta,LENGTH_ENCODE_BYTE_SIZE:()=>uc,LedgerStateDelta:()=>oa,LogicSig:()=>mn,LogicSigAccount:()=>pn,MAX_LEN:()=>cc,MULTISIG_BAD_SENDER_ERROR_MSG:()=>zc,MerkleArrayProof:()=>At,MerkleSignatureVerifier:()=>Ct,ModifiedCreatable:()=>aa,OnApplicationComplete:()=>Qe,Participant:()=>Et,ParticipationUpdates:()=>Dn,ProgramSourceMap:()=>Rs,Reveal:()=>Dt,RewardState:()=>xn,SINGLE_BOOL_SIZE:()=>dc,SINGLE_BYTE_SIZE:()=>hc,SignedTransaction:()=>In,SignedTxnInBlock:()=>Vn,SignedTxnWithAD:()=>Ln,SigslotCommit:()=>Bt,StateProof:()=>Nt,StateProofMessage:()=>Rt,StateProofTrackingData:()=>Cn,StateSchema:()=>Yn,TealValue:()=>Fn,Transaction:()=>jt,TransactionType:()=>Je,TxnCommitments:()=>En,UntypedValue:()=>Gn,UpgradeState:()=>kn,UpgradeVote:()=>Bn,ValueDelta:()=>Rn,VotingData:()=>Qn,abiCheckTransactionType:()=>Nc,abiTypeIsReference:()=>Rc,abiTypeIsTransaction:()=>Dc,algosToMicroalgos:()=>q,appendSignMultisigTransaction:()=>xs,appendSignRawMultisigSignature:()=>ks,assignGroupID:()=>ds,base64ToBytes:()=>T,bigIntToBytes:()=>Oo,bytesToBase64:()=>L,bytesToBigInt:()=>Uo,bytesToHex:()=>G,bytesToString:()=>V,coerceToBytes:()=>W,computeGroupID:()=>hs,createDryrun:()=>Ls,createMultisigTransaction:()=>Is,decodeAddress:()=>K,decodeJSON:()=>tt,decodeMsgpack:()=>qe,decodeObj:()=>He,decodeSignedTransaction:()=>Sn,decodeUint64:()=>M,decodeUnsignedTransaction:()=>Ut,dryrunTxnResultAppTrace:()=>Ys,dryrunTxnResultLogicSigTrace:()=>Zs,encodeAddress:()=>O,encodeJSON:()=>nt,encodeMsgpack:()=>et,encodeObj:()=>ze,encodeUint64:()=>R,encodeUnsignedSimulateTransaction:()=>An,encodeUnsignedTransaction:()=>Ot,encodedMultiSigFromEncodingData:()=>ln,encodedMultiSigToEncodingData:()=>hn,encodedSubsigFromEncodingData:()=>on,encodedSubsigToEncodingData:()=>sn,generateAccount:()=>Jo,getApplicationAddress:()=>J,getMethodByName:()=>Tc,hexToBytes:()=>F,indexerModels:()=>r,isOnApplicationComplete:()=>It,isTransactionType:()=>bt,isTransactionWithSigner:()=>sc,isValidAddress:()=>j,logicSigFromByte:()=>yn,makeApplicationCallTxnFromObject:()=>Js,makeApplicationClearStateTxnFromObject:()=>tc,makeApplicationCloseOutTxnFromObject:()=>ec,makeApplicationCreateTxnFromObject:()=>Qs,makeApplicationDeleteTxnFromObject:()=>_s,makeApplicationNoOpTxnFromObject:()=>nc,makeApplicationOptInTxnFromObject:()=>qs,makeApplicationUpdateTxnFromObject:()=>$s,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>Ks,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>Hs,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>js,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>Os,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>Us,makeBaseAssetConfigTxn:()=>Xs,makeBasicAccountTransactionSigner:()=>ac,makeEmptyTransactionSigner:()=>oc,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>Ps,makeLogicSigAccountTransactionSigner:()=>rc,makeMultiSigAccountTransactionSigner:()=>ic,makePaymentTxnWithSuggestedParamsFromObject:()=>zs,masterDerivationKeyToMnemonic:()=>ss,mergeMultisigTransactions:()=>Cs,microalgosToAlgos:()=>_,mnemonicFromSeed:()=>ns,mnemonicToMasterDerivationKey:()=>os,mnemonicToSecretKey:()=>rs,modelsv2:()=>a,msgpackRawDecode:()=>Xe,msgpackRawDecodeAsMap:()=>Ke,msgpackRawEncode:()=>Ze,multisigAddress:()=>an,parseJSON:()=>u,secretKeyToMnemonic:()=>is,seedFromMnemonic:()=>as,signBytes:()=>Xc,signLogicSigTransaction:()=>gs,signLogicSigTransactionObject:()=>us,signMultisigTransaction:()=>Es,signTransaction:()=>Pc,stringifyJSON:()=>g,tealSign:()=>vn,tealSignFromProgram:()=>bn,verifyBytes:()=>Hc,verifyMultisig:()=>nn,verifyTealSign:()=>wn,waitForConfirmation:()=>jo});var o,s=n(8947),c=n(4462),l=n(1013);!function(e){e.UNSAFE="unsafe",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(o||(o={}));const h=o,d=l({useNativeBigInt:!0,strict:!0});function u(e,{intDecoding:t}){if(t!==h.SAFE&&t!==h.UNSAFE&&t!==h.BIGINT&&t!==h.MIXED)throw new Error(`Invalid intDecoding option: ${t}`);return d.parse(e,((e,n)=>{if(null!=n&&"object"==typeof n&&null==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,Object.prototype),"bigint"==typeof n){if(t===h.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===h.BIGINT||t===h.MIXED&&n>Number.MAX_SAFE_INTEGER?n:Number(n)}return"number"==typeof n&&t===h.BIGINT&&Number.isInteger(n)?BigInt(n):n}))}function g(e,t,n){return d.stringify(e,t,n)}function m(e,t){return e.length===t.length&&Array.from(e).every(((e,n)=>e===t[n]))}function p(...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 y(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function f(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 v(e){const t=f(e);if(t<0)throw new Error(`Value ${t} is negative`);return t}function w(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 b(e){const t=w(e);if(t<0||t>BigInt("0xffffffffffffffff"))throw new Error(`Value ${t} is not a uint64`);return t}function I(e){return c.sha512_256.array(e)}function S(e){return s.sign.keyPair.fromSeed(e)}function A(e){return e===s.sign.signatureLength}function C(e){return s.sign.keyPair.fromSecretKey(e)}function E(e,t){return s.sign.detached(e,t)}function x(e,t){return s.verify(e,t)}function k(e,t,n){return s.sign.detached.verify(e,t,n)}const B=s.sign.publicKeyLength,D=(s.sign.secretKeyLength,32);var N=n(5818);function R(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 M(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=p(new Uint8Array(8-e.byteLength),e),a=new DataView(n.buffer).getBigUint64(0),r=a>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(r)throw new Error(`Integer exceeds maximum safe integer: ${a.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(a)}return"mixed"!==t||r?a:Number(a)}function T(e){if(y())return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e);return Uint8Array.from(t,(e=>e.codePointAt(0)))}function L(e){if(y())return Buffer.from(e).toString("base64");const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)}function V(e){return(new TextDecoder).decode(e)}function W(e){return"string"==typeof e?(new TextEncoder).encode(e):e}function G(e){return y()?Buffer.from(e).toString("hex"):Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function F(e){if(y())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 Y=36,Z=4,z="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",P="address seems to be malformed";function X(e){return Uint8Array.from(I(e).slice(32-Z,32))}class H{constructor(e){if(!(e instanceof Uint8Array))throw new Error(`${P}: ${e} is not Uint8Array, type ${typeof e}`);if(e.length!==Y-Z)throw new Error(`${P}: 0x${G(e)}, length ${e.length}`);this.publicKey=e}equals(e){return e instanceof H&&m(this.publicKey,e.publicKey)}checksum(){return X(this.publicKey)}toString(){return N.encode(p(this.publicKey,this.checksum())).slice(0,58)}static fromString(e){if("string"!=typeof e)throw new Error(`${P}: expected string, got ${typeof e}, ${e}`);if(58!==e.length)throw new Error(`${P}: expected length 58, got ${e.length}: ${e}`);const t=N.decode.asBytes(e);if(t.length!==Y)throw new Error(`${P}: expected byte length ${Y}, got ${t.length}`);const n=new Uint8Array(t.slice(0,Y-Z)),a=new Uint8Array(t.slice(B,Y));if(!m(X(n),a))throw new Error("wrong checksum for address");return new H(n)}static zeroAddress(){return new H(new Uint8Array(Y-Z))}}function K(e){return H.fromString(e)}function j(e){try{H.fromString(e)}catch(e){return!1}return!0}function O(e){return new H(e).toString()}const U=(new TextEncoder).encode("appID");function J(e){const t=I(p(U,R(e)));return new H(Uint8Array.from(t))}const Q=1e6,$="Microalgos should be positive and less than 2^53 - 1.";function _(e){if(e<0||!Number.isSafeInteger(e))throw new Error($);return e/Q}function q(e){const t=e*Q;return Math.round(t)}class ee extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class te{constructor(e,t,n,a={}){this.defaultHeaders=a;const r=t.endsWith("/")?t:`${t}/`,i=new URL(r);if(void 0!==n&&(i.port=n.toString()),0===i.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=i,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 ee(a,{body:t??new Uint8Array,status:e.status,headers:te.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:te.formatFetchResponseHeaders(e.headers)}}async get(e,t,n,a){const r={...this.tokenHeader,...this.defaultHeaders,...n??{}},i=await fetch(this.getURL(e,t),{headers:r,...a??{}});return te.formatFetchResponse(i)}async post(e,t,n,a,r){const i={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"POST",body:t,headers:i,...r??{}});return te.formatFetchResponse(o)}async delete(e,t,n,a,r){const i={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"DELETE",body:t,headers:i,...r??{}});return te.formatFetchResponse(o)}}class ne{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 re.parseJSON(this.text,this.status,e)}}function ae(e){return Object.keys(e).reduce(((t,n)=>(t[n.toLowerCase()]=e[n],t)),{})}class re{constructor(e,t,n,a={}){this.bc=void 0!==t?new te(e,t,n,a):e}static parseJSON(e,t,n){try{return e?u(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(g(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 ne({...e,format:t,text:a,ok:2===Math.trunc(e.status/100)})}static prepareResponseError(e){return e.response&&(e.response=re.prepareResponse(e.response,"application/json"),e.status=e.response.status),e}async get({relativePath:e,query:t,requestHeaders:n,customOptions:a}){const r=function(e){return void 0!==e&&Object.prototype.hasOwnProperty.call(e,"format")&&"msgpack"===e.format?"application/msgpack":"application/json"}(t),i={...n??{},accept:r};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,i,a);return re.prepareResponse(n,r)}catch(e){throw re.prepareResponseError(e)}}async post({relativePath:e,data:t,query:n,requestHeaders:a,customOptions:r}){const i={"content-type":"application/json",...ae(a??{})};try{const a=await this.bc.post(e,re.serializeData(t,i),n,i,r);return re.prepareResponse(a,"application/json")}catch(e){throw re.prepareResponseError(e)}}async delete({relativePath:e,data:t,requestHeaders:n,customOptions:a}){const r={"content-type":"application/json",...ae(n??{})};try{const n=await this.bc.delete(e,void 0!==t?re.serializeData(t,r):void 0,void 0,r,a);return re.prepareResponse(n,"application/json")}catch(e){throw re.prepareResponseError(e)}}}class ie{constructor(e,t,n,a,r={}){if("function"==typeof t.get)this.c=new re(t);else{let i;i="string"==typeof t?function(e,t=""){const n={};return""===t||(n[e]=t),n}(e,t):t,this.c=new re(i,n,a,r)}}}var oe=new TextEncoder;function se(e,t,n){for(var a=t,r=a+n,i=[],o="";a<r;){var s=e[a++];if(128&s)if(192==(224&s)){var c=63&e[a++];i.push((31&s)<<6|c)}else if(224==(240&s)){c=63&e[a++];var l=63&e[a++];i.push((31&s)<<12|c<<6|l)}else if(240==(248&s)){var h=(7&s)<<18|(c=63&e[a++])<<12|(l=63&e[a++])<<6|63&e[a++];h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h)}else i.push(s);else i.push(s);i.length>=4096&&(o+=String.fromCharCode.apply(String,i),i.length=0)}return i.length>0&&(o+=String.fromCharCode.apply(String,i)),o}var ce=new TextDecoder;var le,he,de=function(e,t){this.type=e,this.data=t},ue=(le=function(e,t){return le=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])},le(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}le(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ge=function(e){function t(n){var a=e.call(this,n)||this,r=Object.create(t.prototype);return Object.setPrototypeOf(a,r),Object.defineProperty(a,"name",{configurable:!0,enumerable:!1,value:t.name}),a}return ue(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"}(he||(he={}));var me=4294967295;function pe(e,t,n){var a=Math.floor(n/4294967296),r=n;e.setUint32(t,a),e.setUint32(t+4,r)}function ye(e,t,n){if(n===he.UNSAFE_NUMBER||n===he.SAFE_NUMBER){var a=e.getInt32(t),r=e.getUint32(t+4);if(n===he.SAFE_NUMBER&&(a<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||a===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===r||a>(Number.MAX_SAFE_INTEGER-r)/4294967296)){var i="".concat(a<0?"-":"","0x").concat(Math.abs(a).toString(16)).concat(r.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(i))}return 4294967296*a+r}var o=e.getBigInt64(t);return n===he.MIXED&&o>=Number.MIN_SAFE_INTEGER&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}var fe={type:-1,encode:function(e){var t,n,a,r;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 r=new Uint8Array(4);return(t=new DataView(r.buffer)).setUint32(0,n),r}var i=n/4294967296,o=4294967295&n;return r=new Uint8Array(8),(t=new DataView(r.buffer)).setUint32(0,a<<2|3&i),t.setUint32(4,o),r}return r=new Uint8Array(12),(t=new DataView(r.buffer)).setUint32(0,a),pe(t,4,n),r}((a=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(r=Math.floor(a/1e9)),nsec:a-1e9*r})):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:ye(t,4,he.UNSAFE_NUMBER),nsec:t.getUint32(0)};default:throw new ge("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},ve=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(fe)}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 r=1+t;this.builtInEncoders[r]=n,this.builtInDecoders[r]=a}},e.prototype.tryToEncode=function(e,t){for(var n=0;n<this.builtInEncoders.length;n++)if(null!=(a=this.builtInEncoders[n])&&null!=(r=a(e,t)))return new de(-1-n,r);for(n=0;n<this.encoders.length;n++){var a,r;if(null!=(a=this.encoders[n])&&null!=(r=a(e,t)))return new de(n,r)}return e instanceof de?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 de(t,e)},e.defaultCodec=new e,e}();function we(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 be(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++){var r=e[a]-t[a];if(0!==r)return r}return e.length-t.length}var Ie=function(e){if(this.rawBinaryValue=e,!ArrayBuffer.isView(e))throw new TypeError("RawBinaryString: rawBinaryValue must be an ArrayBufferView")},Se=function(){function e(e){var t,n,a,r,i,o,s,c;this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:ve.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!==(r=null==e?void 0:e.initialBufferSize)&&void 0!==r?r:2048,this.sortKeys=null!==(i=null==e?void 0:e.sortKeys)&&void 0!==i&&i,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,r=function(e){for(var t=e.length,n=0,a=0;a<t;){var r=e.charCodeAt(a++);if(4294967168&r)if(4294965248&r){if(r>=55296&&r<=56319&&a<t){var i=e.charCodeAt(a);56320==(64512&i)&&(++a,r=((1023&r)<<10)+(1023&i)+65536)}n+=4294901760&r?4:3}else n+=2;else n++}return n}(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),t=e,n=this.bytes,a=this.pos,t.length>50?function(e,t,n){oe.encodeInto(e,t.subarray(n))}(t,n,a):function(e,t,n){for(var a=e.length,r=n,i=0;i<a;){var o=e.charCodeAt(i++);if(4294967168&o){if(4294965248&o){if(o>=55296&&o<=56319&&i<a){var s=e.charCodeAt(i);56320==(64512&s)&&(++i,o=((1023&o)<<10)+(1023&s)+65536)}4294901760&o?(t[r++]=o>>18&7|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128):(t[r++]=o>>12&15|224,t[r++]=o>>6&63|128)}else t[r++]=o>>6&31|192;t[r++]=63&o|128}else t[r++]=o}}(t,n,a),this.pos+=r},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 Ie)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=we(e);this.writeU8a(n)},e.prototype.encodeBinaryAsString=function(e){var t=e.rawBinaryValue;this.writeStringHeader(t.byteLength);var n=we(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,r=e;a<r.length;a++){var i=r[a];this.doEncode(i,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var n=0,a=0,r=t;a<r.length;a++){var i=r[a];void 0!==e.get(i)&&n++}return n},e.prototype.sortMapKeys=function(e){for(var t=[],n=[],a=[],r=[],i=0,o=e;i<o.length;i++){var s=o[i];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))r.push(we(s));else{if(!(s instanceof Ie))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 be(we(e.rawBinaryValue),we(t.rawBinaryValue))})),r.sort(be),[].concat(t,n,a,r)},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 r=0,i=n;r<i.length;r++){var o=i[r],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 Ie))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,r=n;e.setUint32(t,a),e.setUint32(t+4,r)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),pe(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 Ae(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var Ce=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,r=this.caches[n-1];a<r.length;a++){for(var i=r[a],o=i.bytes,s=0;s<n;s++)if(o[s]!==e[t+s])continue e;return i.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 r=se(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,r),r},e}(),Ee=function(e,t){var n,a,r,i,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(n=1,a&&(r=2&s[0]?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=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(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],a=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},xe=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,r){!function(e,t,n,a){Promise.resolve(a).then((function(t){e({value:t,done:n})}),t)}(a,r,(t=e[n](t)).done,t.value)}))}}},ke=function(e){return this instanceof ke?(this.v=e,this):new ke(e)},Be="array",De="map_key",Ne="map_value",Re=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=Be,t.position=0,t.size=e,t.array=new Array(e)},e.prototype.pushMapState=function(e){var t=this.getUninitializedStateFromPool();t.type=De,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===Be&&((t=e).size=0,t.array=void 0,t.position=0,t.type=void 0),e.type!==De&&e.type!==Ne||((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}(),Me=new DataView(new ArrayBuffer(0)),Te=new Uint8Array(Me.buffer);try{Me.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 Le=RangeError,Ve=new Le("Insufficient data"),We=new Ce,Ge=function(){function e(e){var t,n,a,r,i,o,s,c,l,h,d,u;if(this.totalPos=0,this.pos=0,this.view=Me,this.bytes=Te,this.headByte=-1,this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:ve.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)?he.AS_ENCODED:he.UNSAFE_NUMBER,this.rawBinaryStringValues=null!==(a=null==e?void 0:e.rawBinaryStringValues)&&void 0!==a&&a,this.rawBinaryStringKeys=null!==(r=null==e?void 0:e.rawBinaryStringKeys)&&void 0!==r&&r,this.useRawBinaryStringClass=null!==(i=null==e?void 0:e.useRawBinaryStringClass)&&void 0!==i&&i,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:me,this.maxBinLength=null!==(l=null==e?void 0:e.maxBinLength)&&void 0!==l?l:me,this.maxArrayLength=null!==(h=null==e?void 0:e.maxArrayLength)&&void 0!==h?h:me,this.maxMapLength=null!==(d=null==e?void 0:e.maxMapLength)&&void 0!==d?d:me,this.maxExtLength=null!==(u=null==e?void 0:e.maxExtLength)&&void 0!==u?u:me,this.keyDecoder=void 0!==(null==e?void 0:e.keyDecoder)?e.keyDecoder:We,this.rawBinaryStringKeys&&!this.useMap)throw new Error("rawBinaryStringKeys is only supported when useMap is true");this.stack=new Re(this.useMap)}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.reset()},e.prototype.setBuffer=function(e){this.bytes=we(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=we(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=we(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 Ee(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,r,i,o,s,c,l,h,d;return c=this,l=void 0,d=function(){var c,l,h,d,u,g,m,p;return Ee(this,(function(y){switch(y.label){case 0:c=!1,y.label=1;case 1:y.trys.push([1,6,7,12]),t=!0,n=xe(e),y.label=2;case 2:return[4,n.next()];case 3:if(a=y.sent(),r=a.done)return[3,5];if(s=a.value,t=!1,h=s,c)throw this.createExtraByteError(this.totalPos);this.appendBuffer(h);try{l=this.doDecodeSync(),c=!0}catch(e){if(!(e instanceof Le))throw e}this.totalPos+=this.pos,y.label=4;case 4:return t=!0,[3,2];case 5:return[3,12];case 6:return d=y.sent(),i={error:d},[3,12];case 7:return y.trys.push([7,,10,11]),t||r||!(o=n.return)?[3,9]:[4,o.call(n)];case 8:y.sent(),y.label=9;case 9:return[3,11];case 10:if(i)throw i.error;return[7];case 11:return[7];case 12:if(c){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,l]}throw g=(u=this).headByte,m=u.pos,p=u.totalPos,new RangeError("Insufficient data in parsing ".concat(Ae(g)," at ").concat(p," (").concat(m," in the current buffer)"))}}))},new((h=void 0)||(h=Promise))((function(e,t){function n(e){try{r(d.next(e))}catch(e){t(e)}}function a(e){try{r(d.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof h?r:new h((function(e){e(r)}))).then(n,a)}r((d=d.apply(c,l||[])).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,r=n.apply(e,t||[]),i=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(e){r[e]&&(a[e]=function(t){return new Promise((function(n,a){i.push([e,t,n,a])>1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof ke?Promise.resolve(n.value.v).then(c,l):h(i[0][2],n)}catch(e){h(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function h(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}(this,arguments,(function(){var n,a,r,i,o,s,c,l,h,d,u,g;return Ee(this,(function(m){switch(m.label){case 0:n=t,a=-1,m.label=1;case 1:m.trys.push([1,13,14,19]),r=!0,i=xe(e),m.label=2;case 2:return[4,ke(i.next())];case 3:if(o=m.sent(),h=o.done)return[3,12];if(g=o.value,r=!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,ke(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 Le))throw c;return[3,10];case 10:this.totalPos+=this.pos,m.label=11;case 11:return r=!0,[3,2];case 12:return[3,19];case 13:return l=m.sent(),d={error:l},[3,19];case 14:return m.trys.push([14,,17,18]),r||h||!(u=i.return)?[3,16]:[4,ke(u.call(i))];case 15:m.sent(),m.label=16;case 16:return[3,18];case 17:if(d)throw d.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 ge("Unrecognized type byte: ".concat(Ae(e)));a=this.lookU32(),t=this.decodeExtension(a,4)}this.complete();for(var r=this.stack;r.length>0;){var i=r.top();if(i.type===Be){if(i.array[i.position]=t,i.position++,i.position!==i.size)continue e;t=i.array,r.release(i)}else{if(i.type===De){if(s=t,c=this.useMap,l=this.supportObjectNumberKeys,!(c?"string"==typeof s||"number"==typeof s||"bigint"==typeof s||s instanceof Uint8Array||s instanceof Ie:"string"==typeof s||l&&"number"==typeof s)){var o=this.useMap?"string, number, bigint, or Uint8Array":this.supportObjectNumberKeys?"string or number":"string";throw new ge("The type of key must be ".concat(o," but got ").concat(typeof t))}if(!this.useMap&&"__proto__"===t)throw new ge("The key __proto__ is not allowed");i.key=t,i.type=Ne;continue e}if(this.useMap?i.map.set(i.key,t):i.map[i.key]=t,i.readCount++,i.readCount!==i.size){i.key=null,i.type=De;continue e}t=i.map,r.release(i)}}return t}var s,c,l},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 ge("Unrecognized array type byte: ".concat(Ae(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new ge("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 ge("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 Ie(n):n}return this.decodeUtf8String(e,t)},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new ge("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw Ve;var a,r=this.pos+t;return a=this.stateIsMapKey()&&(null===(n=this.keyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,r,e):function(e,t,n){return n>200?function(e,t,n){var a=e.subarray(t,t+n);return ce.decode(a)}(e,t,n):se(e,t,n)}(this.bytes,r,e),this.pos+=t+e,a},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&this.stack.top().type===De},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new ge("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Ve;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 ge("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===he.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===he.UNSAFE_NUMBER||n===he.SAFE_NUMBER){var a=e.getUint32(t),r=e.getUint32(t+4);if(n===he.SAFE_NUMBER&&a>(Number.MAX_SAFE_INTEGER-r)/4294967296){var i="0x".concat(a.toString(16)).concat(r.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(i))}return 4294967296*a+r}var o=e.getBigUint64(t);return n===he.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=ye(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 Fe(e,t){return new Ge(t).decode(e)}const Ye="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function Ze(e){return t=e,new Se({sortKeys:!0}).encodeSharedRef(t);var t}function ze(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(Ye+t.firstEmptyKey);return Ze(e)}function Pe(e){switch(e){case h.UNSAFE:return he.UNSAFE_NUMBER;case h.SAFE:return he.SAFE_NUMBER;case h.MIXED:return he.MIXED;case h.BIGINT:return he.BIGINT;default:throw new Error(`Invalid intDecoding: ${e}`)}}function Xe(e,t){return Fe(e,{intMode:t?.intDecoding?Pe(t?.intDecoding):he.BIGINT})}function He(e){return Xe(e,{intDecoding:h.MIXED})}function Ke(e,t){return Fe(e,{intMode:t?.intDecoding?Pe(t?.intDecoding):he.BIGINT,useMap:!0})}function je(e){if(null==e)return e;if(e instanceof Uint8Array)return L(e);if(Array.isArray(e))return e.map(je);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]=je(a)}return t}return e}function Oe(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(Oe);if("object"==typeof e){const t=new Map;for(const[n,a]of Object.entries(e))t.set(n,Oe(a));return t}throw new Error(`Invalid JSON encoding data: ${e}`)}var Ue,Je,Qe;!function(e){e[e.MAP_VALUE=0]="MAP_VALUE",e[e.ARRAY_ELEMENT=1]="ARRAY_ELEMENT"}(Ue||(Ue={}));class $e{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 $e({parent:this,segment:{kind:Ue.MAP_VALUE,key:e}})}withArrayElement(e){return new $e({parent:this,segment:{kind:Ue.ARRAY_ELEMENT,key:e}})}getRawStringAtCurrentLocation(){const e=this.resolve();if(e instanceof Ie)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 Ie))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():Fe(this.baseObjectBytes,{intMode:he.BIGINT,useMap:!0,rawBinaryStringKeys:!0,rawBinaryStringValues:!0,useRawBinaryStringClass:!0}),!this.segment)return this.resolvedCache=e,this.resolvedCachePresent=!0,e;if(this.segment.kind===Ue.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 Ie){const t=this.segment.key instanceof Ie?this.segment.key.rawBinaryValue:W(this.segment.key),n="string"==typeof this.segment.key||this.segment.key instanceof Ie;for(const[a,r]of e){let e;if(n?a instanceof Ie&&(e=a.rawBinaryValue):a instanceof Uint8Array&&(e=a),e&&m(t,e)){this.resolvedCache=r;break}}}else this.resolvedCache=e.get(this.segment.key);return this.resolvedCachePresent=!0,this.resolvedCache}if(this.segment.kind===Ue.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===Ue.MAP_VALUE?`${e} -> map key "${this.segment.key}" (${typeof this.segment.key})`:this.segment.kind===Ue.ARRAY_ELEMENT?`${e} -> array index ${this.segment.key} (${typeof this.segment.key})`:`${e} -> unknown segment kind ${this.segment.kind}`:e}}class _e{}function qe(e,t){const n=Ke(e),a=new $e({baseObjectBytes:e});return t.fromEncodingData(t.encodingSchema.fromPreparedMsgpack(n,a))}function et(e){return Ze(e.getEncodingSchema().prepareMsgpack(e.toEncodingData()))}function tt(e,t){const n=u(e,{intDecoding:h.BIGINT});return t.fromEncodingData(t.encodingSchema.fromPreparedJSON(n))}function nt(e,t){const{space:n,...a}=t??{};return g(e.getEncodingSchema().prepareJSON(e.toEncodingData(),a),void 0,n)}class at extends _e{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 rt extends _e{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 it extends _e{defaultValue(){return BigInt(0)}isDefaultValue(e){return"bigint"==typeof e?e===BigInt(0):"number"==typeof e&&0===e}prepareMsgpack(e){return b(e)}fromPreparedMsgpack(e,t){return b(e)}prepareJSON(e,t){return b(e)}fromPreparedJSON(e){return b(e)}}class ot extends _e{defaultValue(){return H.zeroAddress()}isDefaultValue(e){return H.zeroAddress().equals(e)}prepareMsgpack(e){if(e instanceof H)return e.publicKey;throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return new H(e)}prepareJSON(e,t){if(e instanceof H)return e.toString();throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedJSON(e){return H.fromString(e)}}class st extends _e{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 L(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return T(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class ct extends _e{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 L(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=T(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 lt extends _e{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return new Ie(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=V(e);if(!t.lossyBinaryStringConversion&&!m(W(n),e))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${L(e)}`);return n}throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return W(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class ht extends _e{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 dt(e){return e.map((e=>({...e,omitEmpty:!0})))}class ut extends _e{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 ut))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 r=e.get(a.key);a.omitEmpty&&a.valueSchema.isDefaultValue(r)||(n[a.key]=a.valueSchema.prepareJSON(r,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 gt(...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 mt(e,t){const n=new Map;for(const[a,r]of e){const[e,i]=t(a,r);n.set(e,i)}return n}class pt extends _e{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=b(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,r]of e){const e=b(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.fromPreparedMsgpack(r,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,r]of e){const e=b(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.prepareJSON(r,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 yt(e){if(e instanceof Ie)return V(e.rawBinaryValue);if(e instanceof Map){const t=new Map;for(const[n,a]of e)t.set(yt(n),yt(a));return t}return Array.isArray(e)?e.map(yt):e}class ft extends _e{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 Ie(n),this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){const n=new Map,a=t.getRawStringKeysAndValuesAtCurrentLocation();for(const[e,r]of a)n.set(e,this.valueSchema.fromPreparedMsgpack(yt(r),t.withMapValue(new Ie(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,r]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a}`);const e=V(a);if(!t.lossyBinaryStringConversion&&!m(W(e),a))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${L(a)}`);n.set(e,this.valueSchema.prepareJSON(r,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(W(n),this.valueSchema.fromPreparedJSON(a));return t}}class vt extends _e{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 wt extends _e{defaultValue(){}isDefaultValue(e){return void 0===e}prepareMsgpack(e){return e}fromPreparedMsgpack(e,t){return e}prepareJSON(e,t){return je(e)}fromPreparedJSON(e){return Oe(e)}}function bt(e){return e===Je.pay||e===Je.keyreg||e===Je.acfg||e===Je.axfer||e===Je.afrz||e===Je.appl||e===Je.stpf||e===Je.hb}function It(e){return e===Qe.NoOpOC||e===Qe.OptInOC||e===Qe.CloseOutOC||e===Qe.ClearStateOC||e===Qe.UpdateApplicationOC||e===Qe.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"}(Je||(Je={})),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"}(Qe||(Qe={}));class St{constructor(e){this.hashType=e.hashType}getEncodingSchema(){return St.encodingSchema}toEncodingData(){return new Map([["t",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new St({hashType:Number(e.get("t"))})}}St.encodingSchema=new ut(dt([{key:"t",valueSchema:new it}]));class At{constructor(e){this.path=e.path,this.hashFactory=e.hashFactory,this.treeDepth=e.treeDepth}getEncodingSchema(){return At.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 At({path:e.get("pth"),hashFactory:St.fromEncodingData(e.get("hsh")),treeDepth:Number(e.get("td"))})}}At.encodingSchema=new ut(dt([{key:"pth",valueSchema:new ht(new st)},{key:"hsh",valueSchema:St.encodingSchema},{key:"td",valueSchema:new it}]));class Ct{constructor(e){this.commitment=e.commitment,this.keyLifetime=e.keyLifetime}getEncodingSchema(){return Ct.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 Ct({commitment:e.get("cmt"),keyLifetime:e.get("lf")})}}Ct.encodingSchema=new ut(dt([{key:"cmt",valueSchema:new ct(64)},{key:"lf",valueSchema:new it}]));class Et{constructor(e){this.pk=e.pk,this.weight=e.weight}getEncodingSchema(){return Et.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 Et({pk:Ct.fromEncodingData(e.get("p")),weight:e.get("w")})}}Et.encodingSchema=new ut(dt([{key:"p",valueSchema:Ct.encodingSchema},{key:"w",valueSchema:new it}]));class xt{constructor(e){this.publicKey=e.publicKey}getEncodingSchema(){return xt.encodingSchema}toEncodingData(){return new Map([["k",this.publicKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconVerifier: ${e}`);return new xt({publicKey:e.get("k")})}}xt.encodingSchema=new ut(dt([{key:"k",valueSchema:new ct(1793)}]));class kt{constructor(e){this.signature=e.signature,this.vectorCommitmentIndex=e.index,this.proof=e.proof,this.verifyingKey=e.verifyingKey}getEncodingSchema(){return kt.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 kt({signature:e.get("sig"),index:e.get("idx"),proof:At.fromEncodingData(e.get("prf")),verifyingKey:xt.fromEncodingData(e.get("vkey"))})}}kt.encodingSchema=new ut(dt([{key:"sig",valueSchema:new st},{key:"idx",valueSchema:new it},{key:"prf",valueSchema:At.encodingSchema},{key:"vkey",valueSchema:xt.encodingSchema}]));class Bt{constructor(e){this.sig=e.sig,this.l=e.l}getEncodingSchema(){return Bt.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 Bt({sig:kt.fromEncodingData(e.get("s")),l:e.get("l")})}}Bt.encodingSchema=new ut(dt([{key:"s",valueSchema:kt.encodingSchema},{key:"l",valueSchema:new it}]));class Dt{constructor(e){this.sigslot=e.sigslot,this.participant=e.participant}getEncodingSchema(){return Dt.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 Dt({sigslot:Bt.fromEncodingData(e.get("s")),participant:Et.fromEncodingData(e.get("p"))})}}Dt.encodingSchema=new ut(dt([{key:"s",valueSchema:Bt.encodingSchema},{key:"p",valueSchema:Et.encodingSchema}]));class Nt{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 Nt.encodingSchema}toEncodingData(){return new Map([["c",this.sigCommit],["w",this.signedWeight],["S",this.sigProofs.toEncodingData()],["P",this.partProofs.toEncodingData()],["v",this.merkleSignatureSaltVersion],["r",mt(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 Nt({sigCommit:e.get("c"),signedWeight:e.get("w"),sigProofs:At.fromEncodingData(e.get("S")),partProofs:At.fromEncodingData(e.get("P")),merkleSignatureSaltVersion:Number(e.get("v")),reveals:mt(e.get("r"),((e,t)=>[e,Dt.fromEncodingData(t)])),positionsToReveal:e.get("pr")})}}Nt.encodingSchema=new ut(dt([{key:"c",valueSchema:new st},{key:"w",valueSchema:new it},{key:"S",valueSchema:At.encodingSchema},{key:"P",valueSchema:At.encodingSchema},{key:"v",valueSchema:new it},{key:"r",valueSchema:new pt(Dt.encodingSchema)},{key:"pr",valueSchema:new ht(new it)}]));class Rt{constructor(e){this.blockHeadersCommitment=e.blockHeadersCommitment,this.votersCommitment=e.votersCommitment,this.lnProvenWeight=e.lnProvenWeight,this.firstAttestedRound=e.firstAttestedRound,this.lastAttestedRound=e.lastAttestedRound}getEncodingSchema(){return Rt.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 Rt({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 Rt({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}}Rt.encodingSchema=new ut(dt([{key:"b",valueSchema:new st},{key:"v",valueSchema:new st},{key:"P",valueSchema:new it},{key:"f",valueSchema:new it},{key:"l",valueSchema:new it}]));class Mt{constructor(e){this.sig=e.sig,this.pk=e.pk,this.pk2=e.pk2,this.pk1Sig=e.pk1Sig,this.pk2Sig=e.pk2Sig}getEncodingSchema(){return Mt.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 Mt({sig:e.get("s"),pk:e.get("p"),pk2:e.get("p2"),pk1Sig:e.get("p1s"),pk2Sig:e.get("p2s")})}}Mt.encodingSchema=new ut(dt([{key:"s",valueSchema:new ct(64)},{key:"p",valueSchema:new ct(32)},{key:"p2",valueSchema:new ct(32)},{key:"p1s",valueSchema:new ct(64)},{key:"p2s",valueSchema:new ct(64)}]));class Tt{constructor(e){this.address=e.address,this.proof=e.proof,this.seed=e.seed,this.voteID=e.voteID,this.keyDilution=e.keyDilution}getEncodingSchema(){return Tt.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 Tt({address:e.get("a"),proof:Mt.fromEncodingData(e.get("prf")),seed:e.get("sd"),voteID:e.get("vid"),keyDilution:e.get("kd")})}}function Lt(e){return e.every((e=>0===e))}function Vt(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 Wt(e){if(null==e)throw new Error("Address must not be null or undefined");if("string"==typeof e)return H.fromString(e);if(e instanceof H)return e;throw new Error(`Not an address: ${e}`)}function Gt(e){if(null==e)return;let t;if(e instanceof H)t=e;else{if("string"!=typeof e)throw new Error(`Not an address: ${e}`);t=H.fromString(e)}if(Lt(t.publicKey))throw new Error("Invalid use of the zero address. To omit this value, pass in undefined");return t}function Ft(e){if(void 0!==e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}}function Yt(e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}function Zt(e){if(void 0!==e)return b(e)}function zt(e){if(!0===e||!1===e)return e;throw new Error(`Not a boolean: ${e}`)}function Pt(e){if(Array.isArray(e))return e.slice();throw new Error(`Not an array: ${e}`)}function Xt(e,t,n){const a=Ft(e);if(void 0!==a){if(a.byteLength!==t)throw new Error(`${n} must be ${t} bytes long, was ${a.byteLength}`);if(!Lt(a))return a}}function Ht(e){if(null!=e&&"object"==typeof e){const{appIndex:t,name:n}=e;return{appIndex:b(t),name:Yt(n)}}throw new Error(`Not a box reference: ${e}`)}Tt.encodingSchema=new ut(dt([{key:"a",valueSchema:new ot},{key:"prf",valueSchema:Mt.encodingSchema},{key:"sd",valueSchema:new st},{key:"vid",valueSchema:new ct(32)},{key:"kd",valueSchema:new it}]));const Kt=(new TextEncoder).encode("TX");class jt{constructor(e){if(!bt(e.type))throw new Error(`Invalid transaction type: ${e.type}`);if(this.type=e.type,this.sender=Wt(e.sender),this.note=Yt(e.note??new Uint8Array),this.lease=Xt(e.lease,32,"lease"),this.rekeyTo=Gt(e.rekeyTo),this.group=void 0,this.firstValid=b(e.suggestedParams.firstValid),this.lastValid=b(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=Ft(e.suggestedParams.genesisHash);const t=[];if(e.paymentParams&&t.push(Je.pay),e.keyregParams&&t.push(Je.keyreg),e.assetConfigParams&&t.push(Je.acfg),e.assetTransferParams&&t.push(Je.axfer),e.assetFreezeParams&&t.push(Je.afrz),e.appCallParams&&t.push(Je.appl),e.stateProofParams&&t.push(Je.stpf),e.heartbeatParams&&t.push(Je.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:Wt(e.paymentParams.receiver),amount:b(e.paymentParams.amount),closeRemainderTo:Gt(e.paymentParams.closeRemainderTo)}),e.keyregParams){if(this.keyreg={voteKey:Vt(e.keyregParams.voteKey,"voteKey",32),selectionKey:Vt(e.keyregParams.selectionKey,"selectionKey",32),stateProofKey:Vt(e.keyregParams.stateProofKey,"stateProofKey",64),voteFirst:Zt(e.keyregParams.voteFirst),voteLast:Zt(e.keyregParams.voteLast),voteKeyDilution:Zt(e.keyregParams.voteKeyDilution),nonParticipation:zt(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:b(e.assetConfigParams.assetIndex??0),total:b(e.assetConfigParams.total??0),decimals:v(e.assetConfigParams.decimals??0),defaultFrozen:zt(e.assetConfigParams.defaultFrozen??!1),manager:Gt(e.assetConfigParams.manager),reserve:Gt(e.assetConfigParams.reserve),freeze:Gt(e.assetConfigParams.freeze),clawback:Gt(e.assetConfigParams.clawback),unitName:e.assetConfigParams.unitName,assetName:e.assetConfigParams.assetName,assetURL:e.assetConfigParams.assetURL,assetMetadataHash:Xt(e.assetConfigParams.assetMetadataHash,32,"assetMetadataHash")}),e.assetTransferParams&&(this.assetTransfer={assetIndex:b(e.assetTransferParams.assetIndex),amount:b(e.assetTransferParams.amount),assetSender:Gt(e.assetTransferParams.assetSender),receiver:Wt(e.assetTransferParams.receiver),closeRemainderTo:Gt(e.assetTransferParams.closeRemainderTo)}),e.assetFreezeParams&&(this.assetFreeze={assetIndex:b(e.assetFreezeParams.assetIndex),freezeAccount:Wt(e.assetFreezeParams.freezeTarget),frozen:zt(e.assetFreezeParams.frozen)}),e.appCallParams){const{onComplete:t}=e.appCallParams;if(!It(t))throw new Error(`Invalid onCompletion value: ${t}`);this.applicationCall={appIndex:b(e.appCallParams.appIndex),onComplete:t,numLocalInts:v(e.appCallParams.numLocalInts??0),numLocalByteSlices:v(e.appCallParams.numLocalByteSlices??0),numGlobalInts:v(e.appCallParams.numGlobalInts??0),numGlobalByteSlices:v(e.appCallParams.numGlobalByteSlices??0),extraPages:v(e.appCallParams.extraPages??0),approvalProgram:Yt(e.appCallParams.approvalProgram??new Uint8Array),clearProgram:Yt(e.appCallParams.clearProgram??new Uint8Array),appArgs:Pt(e.appCallParams.appArgs??[]).map(Yt),accounts:Pt(e.appCallParams.accounts??[]).map(Wt),foreignApps:Pt(e.appCallParams.foreignApps??[]).map(b),foreignAssets:Pt(e.appCallParams.foreignAssets??[]).map(b),boxes:Pt(e.appCallParams.boxes??[]).map(Ht)}}if(e.stateProofParams&&(this.stateProof={stateProofType:v(e.stateProofParams.stateProofType??0),stateProof:e.stateProofParams.stateProof,message:e.stateProofParams.message}),e.heartbeatParams&&(this.heartbeat=new Tt({address:e.heartbeatParams.address,proof:e.heartbeatParams.proof,seed:e.heartbeatParams.seed,voteID:e.heartbeatParams.voteID,keyDilution:e.heartbeatParams.keyDilution})),this.fee=b(e.suggestedParams.fee),!zt(e.suggestedParams.flatFee??!1)){const t=b(e.suggestedParams.minFee);this.fee*=BigInt(this.estimateSize()),this.fee<t&&(this.fee=t)}}getEncodingSchema(){return jt.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),r=t.map(BigInt);return e.map((e=>function(e,t,n){const a=BigInt(e.appIndex),r=e.name,i=a===BigInt(0)||a===n,o=t.indexOf(a)+1;if(0===o&&!i)throw new Error(`Box ref with appId ${a} not in foreign-apps`);return new Map([["i",o],["n",r]])}(e,r,a)))}(this.applicationCall.boxes,this.applicationCall.foreignApps,this.applicationCall.appIndex)),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;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 Tt({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(!bt(n))throw new Error(`Unrecognized transaction type: ${n}`);const a={type:n,sender:e.get("snd")??H.zeroAddress(),note:e.get("note"),lease:e.get("lx"),suggestedParams:t};if(e.get("rekey")&&(a.rekeyTo=e.get("rekey")),a.type===Je.pay){const t={amount:e.get("amt")??0,receiver:e.get("rcv")??H.zeroAddress()};e.get("close")&&(t.closeRemainderTo=e.get("close")),a.paymentParams=t}else if(a.type===Je.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===Je.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===Je.axfer){const t={assetIndex:e.get("xaid")??0,amount:e.get("aamt")??0,receiver:e.get("arcv")??H.zeroAddress()};e.get("aclose")&&(t.closeRemainderTo=e.get("aclose")),e.get("asnd")&&(t.assetSender=e.get("asnd")),a.assetTransferParams=t}else if(a.type===Je.afrz){const t={assetIndex:e.get("faid")??0,freezeTarget:e.get("fadd")??H.zeroAddress(),frozen:e.get("afrz")??!1};a.assetFreezeParams=t}else if(a.type===Je.appl){const t={appIndex:e.get("apid")??0,onComplete:v(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")},n=e.get("apls");n&&(t.numLocalInts=n.get("nui"),t.numLocalByteSlices=n.get("nbs"));const r=e.get("apgs");r&&(t.numGlobalInts=r.get("nui"),t.numGlobalByteSlices=r.get("nbs"));const i=e.get("apbx");i&&(t.boxes=i.map((e=>{const n=v(e.get("i")??0),a=Yt(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}}))),a.appCallParams=t}else if(a.type===Je.stpf){const t={stateProofType:e.get("sptype"),stateProof:e.get("sp")?Nt.fromEncodingData(e.get("sp")):void 0,message:e.get("spmsg")?Rt.fromEncodingData(e.get("spmsg")):void 0};a.stateProofParams=t}else{if(a.type!==Je.hb){const e=a.type;throw new Error(`Unexpected transaction type: ${e}`)}{const t=Tt.fromEncodingData(e.get("hb")),n={address:t.address,proof:t.proof,seed:t.seed,voteID:t.voteID,keyDilution:t.keyDilution};a.heartbeatParams=n}}const r=new jt(a);if(e.get("grp")){const t=Yt(e.get("grp"));if(32!==t.byteLength)throw new Error(`Invalid group length: ${t.byteLength}`);r.group=t}return r}estimateSize(){return this.toByte().length+75}bytesToSign(){const e=this.toByte();return p(Kt,e)}toByte(){return et(this)}rawSignTxn(e){return E(this.bytesToSign(),e)}signTxn(e){const t=C(e),n=new H(t.publicKey),a=this.rawSignTxn(e);return this.attachSignature(n,a)}attachSignature(e,t){if(!A(t.length))throw new Error("Invalid signature length");const n=new Map([["sig",t],["txn",this.toEncodingData()]]),a=Wt(e);return this.sender.equals(a)||n.set("sgnr",a),Ze(new ut(dt([{key:"txn",valueSchema:jt.encodingSchema},{key:"sig",valueSchema:new ct(64)},{key:"sgnr",valueSchema:new vt(new ot)}])).prepareMsgpack(n))}rawTxID(){const e=this.toByte(),t=p(Kt,e);return Uint8Array.from(I(t))}txID(){const e=this.rawTxID();return N.encode(e).slice(0,52)}}function Ot(e){return et(e)}function Ut(e){return qe(e,jt)}jt.encodingSchema=new ut(dt([{key:"type",valueSchema:new rt},{key:"snd",valueSchema:new ot},{key:"lv",valueSchema:new it},{key:"gen",valueSchema:new vt(new rt)},{key:"gh",valueSchema:new vt(new ct(32))},{key:"fee",valueSchema:new it},{key:"fv",valueSchema:new it},{key:"note",valueSchema:new st},{key:"lx",valueSchema:new vt(new ct(32))},{key:"rekey",valueSchema:new vt(new ot)},{key:"grp",valueSchema:new vt(new ct(32))},{key:"amt",valueSchema:new vt(new it)},{key:"rcv",valueSchema:new vt(new ot)},{key:"close",valueSchema:new vt(new ot)},{key:"votekey",valueSchema:new vt(new ct(32))},{key:"selkey",valueSchema:new vt(new ct(32))},{key:"sprfkey",valueSchema:new vt(new ct(64))},{key:"votefst",valueSchema:new vt(new it)},{key:"votelst",valueSchema:new vt(new it)},{key:"votekd",valueSchema:new vt(new it)},{key:"nonpart",valueSchema:new vt(new at)},{key:"caid",valueSchema:new vt(new it)},{key:"apar",valueSchema:new vt(new ut(dt([{key:"t",valueSchema:new it},{key:"dc",valueSchema:new it},{key:"df",valueSchema:new at},{key:"m",valueSchema:new vt(new ot)},{key:"r",valueSchema:new vt(new ot)},{key:"f",valueSchema:new vt(new ot)},{key:"c",valueSchema:new vt(new ot)},{key:"un",valueSchema:new vt(new rt)},{key:"an",valueSchema:new vt(new rt)},{key:"au",valueSchema:new vt(new rt)},{key:"am",valueSchema:new vt(new ct(32))}])))},{key:"xaid",valueSchema:new vt(new it)},{key:"aamt",valueSchema:new vt(new it)},{key:"arcv",valueSchema:new vt(new ot)},{key:"aclose",valueSchema:new vt(new ot)},{key:"asnd",valueSchema:new vt(new ot)},{key:"faid",valueSchema:new vt(new it)},{key:"afrz",valueSchema:new vt(new at)},{key:"fadd",valueSchema:new vt(new ot)},{key:"apid",valueSchema:new vt(new it)},{key:"apan",valueSchema:new vt(new it)},{key:"apaa",valueSchema:new vt(new ht(new st))},{key:"apat",valueSchema:new vt(new ht(new ot))},{key:"apas",valueSchema:new vt(new ht(new it))},{key:"apfa",valueSchema:new vt(new ht(new it))},{key:"apbx",valueSchema:new vt(new ht(new ut(dt([{key:"i",valueSchema:new it},{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 ut(dt([{key:"nui",valueSchema:new it},{key:"nbs",valueSchema:new it}])))},{key:"apgs",valueSchema:new vt(new ut(dt([{key:"nui",valueSchema:new it},{key:"nbs",valueSchema:new it}])))},{key:"apep",valueSchema:new vt(new it)},{key:"sptype",valueSchema:new vt(new it)},{key:"sp",valueSchema:new vt(Nt.encodingSchema)},{key:"spmsg",valueSchema:new vt(Rt.encodingSchema)},{key:"hb",valueSchema:new vt(Tt.encodingSchema)}]));const Jt=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),Qt="invalid multisig version",$t="bad multisig threshold",_t="bad multisig public key - wrong length",qt="nacl public key length is not 32 bytes";function en(e){return e.map((e=>"string"==typeof e?H.fromString(e).publicKey:e.publicKey))}function tn({version:e,threshold:t,pks:n}){if(1!==e||e>255||e<0)throw new Error(Qt);if(0===t||0===n.length||t>n.length||t>255)throw new Error($t);const a=Y-Z;if(a!==B)throw new Error(qt);const r=new Uint8Array(Jt.length+2+a*n.length);r.set(Jt,0),r.set([e],Jt.length),r.set([t],Jt.length+1);for(let e=0;e<n.length;e++){if(n[e].length!==a)throw new Error(_t);r.set(n[e],Jt.length+2+e*a)}return new H(Uint8Array.from(I(r)))}function nn(e,t,n){const a=t.v,r=t.thr,i=t.subsig,o=i.map((e=>e.pk));if(t.subsig.length<r)return!1;let s;try{s=tn({version:a,threshold:r,pks:o}).publicKey}catch(e){return!1}if(!m(s,n))return!1;let c=0;for(const e of i)void 0!==e.s&&(c+=1);if(c<r)return!1;let l=0;for(const t of i)void 0!==t.s&&k(e,t.s,t.pk)&&(l+=1);return!(l<r)}function an({version:e,threshold:t,addrs:n}){return function({version:e,threshold:t,addrs:n}){return tn({version:e,threshold:t,pks:en(n)})}({version:e,threshold:t,addrs:n})}const rn=new ut(dt([{key:"pk",valueSchema:new ct(32)},{key:"s",valueSchema:new vt(new ct(64))}]));function on(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 sn(e){const t=new Map([["pk",e.pk]]);return e.s&&t.set("s",e.s),t}const cn=new ut(dt([{key:"v",valueSchema:new it},{key:"thr",valueSchema:new it},{key:"subsig",valueSchema:new ht(rn)}]));function ln(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedMultiSig: ${e}`);return{v:v(e.get("v")),thr:v(e.get("thr")),subsig:e.get("subsig").map(on)}}function hn(e){return new Map([["v",e.v],["thr",e.thr],["subsig",e.subsig.map(sn)]])}const dn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;function un(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(j(t))throw new Error("requesting program bytes, get Algorand address");if(dn.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 gn=(new TextEncoder).encode("Program");class mn{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)))),un(e),this.logic=e,this.args=n,this.sig=void 0,this.msig=void 0}getEncodingSchema(){return mn.encodingSchema}toEncodingData(){const e=new Map([["l",this.logic],["arg",this.args],["sig",this.sig]]);return this.msig&&e.set("msig",hn(this.msig)),e}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig: ${e}`);const t=new mn(e.get("l"),e.get("arg"));return t.sig=e.get("sig"),e.get("msig")&&(t.msig=ln(e.get("msig"))),t}verify(e){if(this.sig&&this.msig)return!1;try{un(this.logic)}catch(e){return!1}const t=p(gn,this.logic);return this.sig||this.msig?this.sig?k(t,this.sig,e):nn(t,this.msig,e):m(I(t),e)}address(){const e=I(p(gn,this.logic));return new H(Uint8Array.from(e))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{const n=en(t.addrs).map((e=>({pk:e})));this.msig={v:t.version,thr:t.threshold,subsig:n};const[a,r]=this.singleSignMultisig(e,this.msig);this.msig.subsig[r].s=a}}appendToMultisig(e){if(void 0===this.msig)throw new Error("no multisig present");const[t,n]=this.singleSignMultisig(e,this.msig);this.msig.subsig[n].s=t}signProgram(e){return E(p(gn,this.logic),e)}singleSignMultisig(e,t){let n=-1;const a=C(e).publicKey;for(let e=0;e<t.subsig.length;e++){const{pk:r}=t.subsig[e];if(m(r,a)){n=e;break}}if(-1===n)throw new Error("invalid secret key");return[this.signProgram(e),n]}toByte(){return et(this)}static fromByte(e){return qe(e,mn)}}mn.encodingSchema=new ut(dt([{key:"l",valueSchema:new st},{key:"arg",valueSchema:new ht(new st)},{key:"sig",valueSchema:new vt(new ct(64))},{key:"msig",valueSchema:new vt(cn)}]));class pn{constructor(e,t){this.lsig=new mn(e,t),this.sigkey=void 0}getEncodingSchema(){return pn.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=mn.fromEncodingData(t.get("lsig")),a=new pn(n.logic,n.args);return a.lsig=n,a.sigkey=t.get("sigkey"),a}toByte(){return et(this)}static fromByte(e){return qe(e,pn)}isDelegated(){return!(!this.lsig.sig&&!this.lsig.msig)}verify(){const e=this.address();return this.lsig.verify(e.publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw new Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return new H(this.sigkey)}return this.lsig.msig?tn({version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map((e=>e.pk))}):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}sign(e){this.lsig.sign(e),this.sigkey=C(e).publicKey}}function yn(e){return qe(e,mn)}pn.encodingSchema=new ut(dt([{key:"lsig",valueSchema:mn.encodingSchema},{key:"sigkey",valueSchema:new vt(new ct(32))}]));const fn=(new TextEncoder).encode("ProgData");function vn(e,t,n){const a=p(("string"==typeof n?H.fromString(n):n).publicKey,t);return E(p(fn,a),e)}function wn(e,t,n,a){const r=p(("string"==typeof t?H.fromString(t):t).publicKey,e);return k(p(fn,r),n,a)}function bn(e,t,n){return vn(e,t,new mn(n).address())}class In{constructor({txn:e,sig:t,msig:n,lsig:a,sgnr:r}){this.txn=e,this.sig=t,this.msig=n,this.lsig=a,this.sgnr=r;let i=0;if(t&&(i+=1),n&&(i+=1),a&&(i+=1),i>1)throw new Error(`SignedTransaction must not have more than 1 signature. Got ${i}`)}getEncodingSchema(){return In.encodingSchema}toEncodingData(){return new Map([["txn",this.txn.toEncodingData()],["sig",this.sig],["msig",this.msig?hn(this.msig):void 0],["lsig",this.lsig?this.lsig.toEncodingData():void 0],["sgnr",this.sgnr]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTransaction: ${e}`);return new In({txn:jt.fromEncodingData(e.get("txn")),sig:e.get("sig"),msig:e.get("msig")?ln(e.get("msig")):void 0,lsig:e.get("lsig")?mn.fromEncodingData(e.get("lsig")):void 0,sgnr:e.get("sgnr")})}}function Sn(e){return qe(e,In)}function An(e){return et(new In({txn:e}))}In.encodingSchema=new ut(dt([{key:"txn",valueSchema:jt.encodingSchema},{key:"sig",valueSchema:new vt(new ct(64))},{key:"msig",valueSchema:new vt(cn)},{key:"lsig",valueSchema:new vt(mn.encodingSchema)},{key:"sgnr",valueSchema:new vt(new ot)}]));class Cn{constructor(e){this.stateProofVotersCommitment=e.stateProofVotersCommitment,this.stateProofOnlineTotalWeight=e.stateProofOnlineTotalWeight,this.stateProofNextRound=e.stateProofNextRound}getEncodingSchema(){return Cn.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 Cn({stateProofVotersCommitment:e.get("v"),stateProofOnlineTotalWeight:e.get("t"),stateProofNextRound:e.get("n")})}}Cn.encodingSchema=new ut(dt([{key:"v",valueSchema:new st},{key:"t",valueSchema:new it},{key:"n",valueSchema:new it}]));class En{constructor(e){this.nativeSha512_256Commitment=e.nativeSha512_256Commitment,this.sha256Commitment=e.sha256Commitment}getEncodingSchema(){return En.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 En({nativeSha512_256Commitment:e.get("txn"),sha256Commitment:e.get("txn256")})}}En.encodingSchema=new ut(dt([{key:"txn",valueSchema:new ct(32)},{key:"txn256",valueSchema:new ct(32)}]));class xn{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 xn.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 xn({feeSink:e.get("fees"),rewardsPool:e.get("rwd"),rewardsLevel:e.get("earn"),rewardsRate:e.get("rate"),rewardsResidue:e.get("frac"),rewardsRecalculationRound:e.get("rwcalr")})}}xn.encodingSchema=new ut(dt([{key:"fees",valueSchema:new ot},{key:"rwd",valueSchema:new ot},{key:"earn",valueSchema:new it},{key:"rate",valueSchema:new it},{key:"frac",valueSchema:new it},{key:"rwcalr",valueSchema:new it}]));class kn{constructor(e){this.currentProtocol=e.currentProtocol,this.nextProtocol=e.nextProtocol,this.nextProtocolApprovals=e.nextProtocolApprovals,this.nextProtocolVoteBefore=e.nextProtocolVoteBefore,this.nextProtocolSwitchOn=e.nextProtocolSwitchOn}getEncodingSchema(){return kn.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 kn({currentProtocol:e.get("proto"),nextProtocol:e.get("nextproto"),nextProtocolApprovals:e.get("nextyes"),nextProtocolVoteBefore:e.get("nextbefore"),nextProtocolSwitchOn:e.get("nextswitch")})}}kn.encodingSchema=new ut(dt([{key:"proto",valueSchema:new rt},{key:"nextproto",valueSchema:new rt},{key:"nextyes",valueSchema:new it},{key:"nextbefore",valueSchema:new it},{key:"nextswitch",valueSchema:new it}]));class Bn{constructor(e){this.upgradePropose=e.upgradePropose,this.upgradeDelay=e.upgradeDelay,this.upgradeApprove=e.upgradeApprove}getEncodingSchema(){return Bn.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 Bn({upgradePropose:e.get("upgradeprop"),upgradeDelay:e.get("upgradedelay"),upgradeApprove:e.get("upgradeyes")})}}Bn.encodingSchema=new ut(dt([{key:"upgradeprop",valueSchema:new rt},{key:"upgradedelay",valueSchema:new it},{key:"upgradeyes",valueSchema:new at}]));class Dn{constructor(e){this.expiredParticipationAccounts=e.expiredParticipationAccounts,this.absentParticipationAccounts=e.absentParticipationAccounts}getEncodingSchema(){return Dn.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 Dn({expiredParticipationAccounts:e.get("partupdrmv"),absentParticipationAccounts:e.get("partupdabs")})}}Dn.encodingSchema=new ut(dt([{key:"partupdrmv",valueSchema:new ht(new ot)},{key:"partupdabs",valueSchema:new ht(new ot)}]));class Nn{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 Nn.encodingSchema}toEncodingData(){return gt(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",mt(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 Nn({round:e.get("rnd"),branch:e.get("prev"),seed:e.get("seed"),txnCommitments:En.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:xn.fromEncodingData(e),upgradeState:kn.fromEncodingData(e),upgradeVote:Bn.fromEncodingData(e),txnCounter:e.get("tc"),stateproofTracking:mt(e.get("spt"),((e,t)=>[Number(e),Cn.fromEncodingData(t)])),participationUpdates:Dn.fromEncodingData(e)})}}Nn.encodingSchema=new ut(dt([{key:"rnd",valueSchema:new it},{key:"prev",valueSchema:new class extends _e{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-${N.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(N.decode.asBytes(e.slice(4)));throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}}},{key:"seed",valueSchema:new st},{key:"",valueSchema:En.encodingSchema,embedded:!0},{key:"ts",valueSchema:new it},{key:"gen",valueSchema:new rt},{key:"gh",valueSchema:new ct(32)},{key:"prp",valueSchema:new ot},{key:"fc",valueSchema:new it},{key:"bi",valueSchema:new it},{key:"pp",valueSchema:new it},{key:"",valueSchema:xn.encodingSchema,embedded:!0},{key:"",valueSchema:kn.encodingSchema,embedded:!0},{key:"",valueSchema:Bn.encodingSchema,embedded:!0},{key:"tc",valueSchema:new it},{key:"spt",valueSchema:new pt(Cn.encodingSchema)},{key:"",valueSchema:Dn.encodingSchema,embedded:!0}]));class Rn{constructor(e){this.action=e.action,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return Rn.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 Rn({action:Number(e.get("at")),bytes:e.get("bs"),uint:e.get("ui")})}}Rn.encodingSchema=new ut(dt([{key:"at",valueSchema:new it},{key:"bs",valueSchema:new lt},{key:"ui",valueSchema:new it}]));class Mn{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries(...dt([{key:"gd",valueSchema:new vt(new ft(Rn.encodingSchema))},{key:"ld",valueSchema:new vt(new pt(new ft(Rn.encodingSchema)))},{key:"sa",valueSchema:new vt(new ht(new ot))},{key:"lg",valueSchema:new vt(new ht(new lt))},{key:"itx",valueSchema:new vt(new ht(Ln.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 Mn.encodingSchema}toEncodingData(){return new Map([["gd",mt(this.globalDelta,((e,t)=>[e,t.toEncodingData()]))],["ld",mt(this.localDeltas,((e,t)=>[e,mt(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 Mn({globalDelta:e.get("gd")?mt(e.get("gd"),((e,t)=>[e,Rn.fromEncodingData(t)])):void 0,localDeltas:e.get("ld")?mt(e.get("ld"),((e,t)=>[Number(e),mt(t,((e,t)=>[e,Rn.fromEncodingData(t)]))])):void 0,sharedAccts:e.get("sa"),logs:e.get("lg"),innerTxns:(e.get("itx")??[]).map(Ln.fromEncodingData)})}}class Tn{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries(...dt([{key:"ca",valueSchema:new vt(new it)},{key:"aca",valueSchema:new vt(new it)},{key:"rs",valueSchema:new vt(new it)},{key:"rr",valueSchema:new vt(new it)},{key:"rc",valueSchema:new vt(new it)},{key:"dt",valueSchema:new vt(Mn.encodingSchema)},{key:"caid",valueSchema:new vt(new it)},{key:"apid",valueSchema:new vt(new it)}]))),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 Tn.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 Tn({closingAmount:e.get("ca"),assetClosingAmount:e.get("aca"),senderRewards:e.get("rs"),receiverRewards:e.get("rr"),closeRewards:e.get("rc"),evalDelta:e.get("dt")?Mn.fromEncodingData(e.get("dt")):void 0,configAsset:e.get("caid"),applicationID:e.get("apid")})}}class Ln{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries(...dt([{key:"",valueSchema:In.encodingSchema,embedded:!0},{key:"",valueSchema:Tn.encodingSchema,embedded:!0}]))),this.encodingSchemaValue}constructor(e){this.signedTxn=e.signedTxn,this.applyData=e.applyData}getEncodingSchema(){return Ln.encodingSchema}toEncodingData(){return gt(this.signedTxn.toEncodingData(),this.applyData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnWithAD: ${e}`);return new Ln({signedTxn:In.fromEncodingData(e),applyData:Tn.fromEncodingData(e)})}}class Vn{constructor(e){this.signedTxn=e.signedTxn,this.hasGenesisID=e.hasGenesisID,this.hasGenesisHash=e.hasGenesisHash}getEncodingSchema(){return Vn.encodingSchema}toEncodingData(){return gt(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 Vn({signedTxn:Ln.fromEncodingData(e),hasGenesisID:e.get("hgi"),hasGenesisHash:e.get("hgh")})}}Vn.encodingSchema=new ut(dt([{key:"",valueSchema:Ln.encodingSchema,embedded:!0},{key:"hgi",valueSchema:new at},{key:"hgh",valueSchema:new at}]));class Wn{constructor(e){this.header=e.header,this.payset=e.payset}getEncodingSchema(){return Wn.encodingSchema}toEncodingData(){return gt(new Map([["txns",this.payset.map((e=>e.toEncodingData()))]]),this.header.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new Wn({header:Nn.fromEncodingData(e),payset:e.get("txns").map(Vn.fromEncodingData)})}}Wn.encodingSchema=new ut(dt([{key:"",valueSchema:Nn.encodingSchema,embedded:!0},{key:"txns",valueSchema:new ht(Vn.encodingSchema)}]));class Gn{constructor(e){this.data=e}getEncodingSchema(){return Gn.encodingSchema}toEncodingData(){return this.data}static fromEncodingData(e){return new Gn(e)}}Gn.encodingSchema=new wt;class Fn{constructor(e){this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return Fn.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 Fn({type:Number(e.get("tt")),bytes:e.get("tb"),uint:e.get("ui")})}}Fn.encodingSchema=new ut(dt([{key:"tt",valueSchema:new it},{key:"tb",valueSchema:new vt(new lt)},{key:"ui",valueSchema:new vt(new it)}]));class Yn{constructor(e){this.numUints=e.numUints,this.numByteSlices=e.numByteSlices}getEncodingSchema(){return Yn.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 Yn({numUints:Number(e.get("nui")),numByteSlices:Number(e.get("nbs"))})}}Yn.encodingSchema=new ut(dt([{key:"nui",valueSchema:new it},{key:"nbs",valueSchema:new it}]));class Zn{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 Zn.encodingSchema}toEncodingData(){return new Map([["approv",this.approvalProgram],["clearp",this.clearStateProgram],["gs",mt(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 Zn({approvalProgram:e.get("approv"),clearStateProgram:e.get("clearp"),globalState:mt(e.get("gs"),((e,t)=>[e,Fn.fromEncodingData(t)])),localStateSchema:Yn.fromEncodingData(e.get("lsch")),globalStateSchema:Yn.fromEncodingData(e.get("gsch")),extraProgramPages:Number(e.get("epp"))})}}Zn.encodingSchema=new ut(dt([{key:"approv",valueSchema:new st},{key:"clearp",valueSchema:new st},{key:"gs",valueSchema:new ft(Fn.encodingSchema)},{key:"lsch",valueSchema:Yn.encodingSchema},{key:"gsch",valueSchema:Yn.encodingSchema},{key:"epp",valueSchema:new it}]));class zn{constructor(e){this.schema=e.schema,this.keyValue=e.keyValue}getEncodingSchema(){return zn.encodingSchema}toEncodingData(){return new Map([["hsch",this.schema.toEncodingData()],["tkv",mt(this.keyValue,((e,t)=>[e,t.toEncodingData()]))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalState: ${e}`);return new zn({schema:Yn.fromEncodingData(e.get("hsch")),keyValue:mt(e.get("tkv"),((e,t)=>[e,Fn.fromEncodingData(t)]))})}}zn.encodingSchema=new ut(dt([{key:"hsch",valueSchema:Yn.encodingSchema},{key:"tkv",valueSchema:new ft(Fn.encodingSchema)}]));class Pn{constructor(e){this.localState=e.localState,this.deleted=e.deleted}getEncodingSchema(){return Pn.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 Pn({localState:e.get("LocalState")?zn.fromEncodingData(e.get("LocalState")):void 0,deleted:e.get("Deleted")})}}Pn.encodingSchema=new ut(dt([{key:"LocalState",valueSchema:new vt(zn.encodingSchema)},{key:"Deleted",valueSchema:new at}]));class Xn{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return Xn.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 Xn({params:e.get("Params")?Zn.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}Xn.encodingSchema=new ut(dt([{key:"Params",valueSchema:new vt(Zn.encodingSchema)},{key:"Deleted",valueSchema:new at}]));class Hn{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.state=e.state}getEncodingSchema(){return Hn.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 Hn({id:e.get("Aidx"),address:e.get("Addr"),params:Xn.fromEncodingData(e.get("Params")),state:Pn.fromEncodingData(e.get("State"))})}}Hn.encodingSchema=new ut(dt([{key:"Aidx",valueSchema:new it},{key:"Addr",valueSchema:new ot},{key:"Params",valueSchema:Xn.encodingSchema},{key:"State",valueSchema:Pn.encodingSchema}]));class Kn{constructor(e){this.amount=e.amount,this.frozen=e.frozen}getEncodingSchema(){return Kn.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 Kn({amount:e.get("a"),frozen:e.get("f")})}}Kn.encodingSchema=new ut(dt([{key:"a",valueSchema:new it},{key:"f",valueSchema:new at}]));class jn{constructor(e){this.holding=e.holding,this.deleted=e.deleted}getEncodingSchema(){return jn.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 jn({holding:e.get("Holding")?Kn.fromEncodingData(e.get("Holding")):void 0,deleted:e.get("Deleted")})}}jn.encodingSchema=new ut(dt([{key:"Holding",valueSchema:new vt(Kn.encodingSchema)},{key:"Deleted",valueSchema:new at}]));class On{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 On.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 On({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")})}}On.encodingSchema=new ut(dt([{key:"t",valueSchema:new it},{key:"dc",valueSchema:new it},{key:"df",valueSchema:new at},{key:"un",valueSchema:new vt(new lt)},{key:"an",valueSchema:new vt(new lt)},{key:"au",valueSchema:new vt(new lt)},{key:"am",valueSchema:new ct(32)},{key:"m",valueSchema:new vt(new ot)},{key:"r",valueSchema:new vt(new ot)},{key:"f",valueSchema:new vt(new ot)},{key:"c",valueSchema:new vt(new ot)}]));class Un{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return Un.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 Un({params:e.get("Params")?On.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}Un.encodingSchema=new ut(dt([{key:"Params",valueSchema:new vt(On.encodingSchema)},{key:"Deleted",valueSchema:new at}]));class Jn{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.holding=e.holding}getEncodingSchema(){return Jn.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 Jn({id:e.get("Aidx"),address:e.get("Addr"),params:Un.fromEncodingData(e.get("Params")),holding:jn.fromEncodingData(e.get("Holding"))})}}Jn.encodingSchema=new ut(dt([{key:"Aidx",valueSchema:new it},{key:"Addr",valueSchema:new ot},{key:"Params",valueSchema:Un.encodingSchema},{key:"Holding",valueSchema:jn.encodingSchema}]));class Qn{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 Qn.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 Qn({voteID:e.get("VoteID"),selectionID:e.get("SelectionID"),stateProofID:e.get("StateProofID"),voteFirstValid:e.get("VoteFirstValid"),voteLastValid:e.get("VoteLastValid"),voteKeyDilution:e.get("VoteKeyDilution")})}}Qn.encodingSchema=new ut(dt([{key:"VoteID",valueSchema:new ct(32)},{key:"SelectionID",valueSchema:new ct(32)},{key:"StateProofID",valueSchema:new ct(64)},{key:"VoteFirstValid",valueSchema:new it},{key:"VoteLastValid",valueSchema:new it},{key:"VoteKeyDilution",valueSchema:new it}]));class $n{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 $n.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 $n({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:Yn.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")})}}$n.encodingSchema=new ut(dt([{key:"Status",valueSchema:new it},{key:"MicroAlgos",valueSchema:new it},{key:"RewardsBase",valueSchema:new it},{key:"RewardedMicroAlgos",valueSchema:new it},{key:"AuthAddr",valueSchema:new ot},{key:"IncentiveEligible",valueSchema:new at},{key:"TotalAppSchema",valueSchema:Yn.encodingSchema},{key:"TotalExtraAppPages",valueSchema:new it},{key:"TotalAppParams",valueSchema:new it},{key:"TotalAppLocalStates",valueSchema:new it},{key:"TotalAssetParams",valueSchema:new it},{key:"TotalAssets",valueSchema:new it},{key:"TotalBoxes",valueSchema:new it},{key:"TotalBoxBytes",valueSchema:new it},{key:"LastProposed",valueSchema:new it},{key:"LastHeartbeat",valueSchema:new it}]));class _n{constructor(e){this.accountBaseData=e.accountBaseData,this.votingData=e.votingData}getEncodingSchema(){return _n.encodingSchema}toEncodingData(){return gt(this.accountBaseData.toEncodingData(),this.votingData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountData: ${e}`);return new _n({accountBaseData:$n.fromEncodingData(e),votingData:Qn.fromEncodingData(e)})}}_n.encodingSchema=new ut(dt([{key:"",valueSchema:$n.encodingSchema,embedded:!0},{key:"",valueSchema:Qn.encodingSchema,embedded:!0}]));class qn{constructor(e){this.addr=e.addr,this.accountData=e.accountData}getEncodingSchema(){return qn.encodingSchema}toEncodingData(){return gt(new Map([["Addr",this.addr]]),this.accountData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BalanceRecord: ${e}`);return new qn({addr:e.get("Addr"),accountData:_n.fromEncodingData(e)})}}qn.encodingSchema=new ut(dt([{key:"Addr",valueSchema:new ot},{key:"",valueSchema:_n.encodingSchema,embedded:!0}]));class ea{constructor(e){this.accounts=e.accounts,this.appResources=e.appResources,this.assetResources=e.assetResources}getEncodingSchema(){return ea.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 ea({accounts:(e.get("Accts")??[]).map(qn.fromEncodingData),appResources:(e.get("AppResources")??[]).map(Hn.fromEncodingData),assetResources:(e.get("AssetResources")??[]).map(Jn.fromEncodingData)})}}ea.encodingSchema=new ut(dt([{key:"Accts",valueSchema:new ht(qn.encodingSchema)},{key:"AppResources",valueSchema:new vt(new ht(Hn.encodingSchema))},{key:"AssetResources",valueSchema:new vt(new ht(Jn.encodingSchema))}]));class ta{constructor(e){this.data=e.data,this.oldData=e.oldData}getEncodingSchema(){return ta.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 ta({data:e.get("Data"),oldData:e.get("OldData")})}}ta.encodingSchema=new ut(dt([{key:"Data",valueSchema:new vt(new st)},{key:"OldData",valueSchema:new vt(new st)}]));class na{constructor(e){this.lastValid=e.lastValid,this.intra=e.intra}getEncodingSchema(){return na.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 na({lastValid:e.get("LastValid"),intra:Number(e.get("Intra"))})}}na.encodingSchema=new ut(dt([{key:"LastValid",valueSchema:new it},{key:"Intra",valueSchema:new it}]));class aa{constructor(e){this.creatableType=e.creatableType,this.created=e.created,this.creator=e.creator,this.ndeltas=e.ndeltas}getEncodingSchema(){return aa.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 aa({creatableType:Number(e.get("Ctype")),created:e.get("Created"),creator:e.get("Creator"),ndeltas:Number(e.get("Ndeltas"))})}}aa.encodingSchema=new ut(dt([{key:"Ctype",valueSchema:new it},{key:"Created",valueSchema:new at},{key:"Creator",valueSchema:new ot},{key:"Ndeltas",valueSchema:new it}]));class ra{constructor(e){this.money=e.money,this.rewardUnits=e.rewardUnits}getEncodingSchema(){return ra.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 ra({money:e.get("mon"),rewardUnits:e.get("rwd")})}}ra.encodingSchema=new ut(dt([{key:"mon",valueSchema:new it},{key:"rwd",valueSchema:new it}]));class ia{constructor(e){this.online=e.online,this.offline=e.offline,this.notParticipating=e.notParticipating,this.rewardsLevel=e.rewardsLevel}getEncodingSchema(){return ia.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 ia({online:ra.fromEncodingData(e.get("online")),offline:ra.fromEncodingData(e.get("offline")),notParticipating:ra.fromEncodingData(e.get("notpart")),rewardsLevel:e.get("rwdlvl")})}}ia.encodingSchema=new ut(dt([{key:"online",valueSchema:ra.encodingSchema},{key:"offline",valueSchema:ra.encodingSchema},{key:"notpart",valueSchema:ra.encodingSchema},{key:"rwdlvl",valueSchema:new it}]));class oa{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 oa.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.toEncodingData()],["KvMods",0===this.kvMods.size?void 0:mt(this.kvMods,((e,t)=>[e,t.toEncodingData()]))],["Txids",mt(this.txids,((e,t)=>[e,t.toEncodingData()]))],["Txleases",this.txleases.toEncodingData()],["Creatables",0===this.creatables.size?void 0:mt(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 oa({accounts:ea.fromEncodingData(e.get("Accts")),kvMods:mt(e.get("KvMods")??new Map,((e,t)=>[e,ta.fromEncodingData(t)])),txids:mt(e.get("Txids"),((e,t)=>[e,na.fromEncodingData(t)])),txleases:Gn.fromEncodingData(e.get("Txleases")),creatables:mt(e.get("Creatables")??new Map,((e,t)=>[e,aa.fromEncodingData(t)])),blockHeader:Nn.fromEncodingData(e.get("Hdr")),stateProofNext:e.get("StateProofNext"),prevTimestamp:e.get("PrevTimestamp"),totals:ia.fromEncodingData(e.get("Totals"))})}}oa.encodingSchema=new ut(dt([{key:"Accts",valueSchema:ea.encodingSchema},{key:"KvMods",valueSchema:new vt(new ft(ta.encodingSchema))},{key:"Txids",valueSchema:new class extends _e{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,r]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);n.set(a,this.valueSchema.fromPreparedMsgpack(r,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,r]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);const e=L(a);if(n.has(e))throw new Error(`Duplicate key (base64): ${e}`);n.set(e,this.valueSchema.prepareJSON(r,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(T(n),this.valueSchema.fromPreparedJSON(a));return t}}(na.encodingSchema)},{key:"Txleases",valueSchema:new vt(new wt)},{key:"Creatables",valueSchema:new vt(new pt(aa.encodingSchema))},{key:"Hdr",valueSchema:Nn.encodingSchema},{key:"StateProofNext",valueSchema:new it},{key:"PrevTimestamp",valueSchema:new it},{key:"Totals",valueSchema:ia.encodingSchema}]));class sa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"amount",valueSchema:new it,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new it,omitEmpty:!0},{key:"min-balance",valueSchema:new it,omitEmpty:!0},{key:"pending-rewards",valueSchema:new it,omitEmpty:!0},{key:"rewards",valueSchema:new it,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"status",valueSchema:new rt,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new it,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new it,omitEmpty:!0},{key:"total-created-apps",valueSchema:new it,omitEmpty:!0},{key:"total-created-assets",valueSchema:new it,omitEmpty:!0},{key:"apps-local-state",valueSchema:new vt(new ht(wa.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new vt(new it),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new vt(Sa.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new vt(new ht(Ca.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new vt(new rt),omitEmpty:!0},{key:"created-apps",valueSchema:new vt(new ht(pa.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new vt(new ht(Aa.encodingSchema)),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new vt(new at),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new vt(new it),omitEmpty:!0},{key:"last-proposed",valueSchema:new vt(new it),omitEmpty:!0},{key:"participation",valueSchema:new vt(ua.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new vt(new it),omitEmpty:!0},{key:"sig-type",valueSchema:new vt(new rt),omitEmpty:!0},{key:"total-box-bytes",valueSchema:new vt(new it),omitEmpty:!0},{key:"total-boxes",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:r,rewards:i,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:l,totalCreatedApps:h,totalCreatedAssets:d,appsLocalState:u,appsTotalExtraPages:g,appsTotalSchema:m,assets:p,authAddr:y,createdApps:v,createdAssets:b,incentiveEligible:I,lastHeartbeat:S,lastProposed:A,participation:C,rewardBase:E,sigType:x,totalBoxBytes:k,totalBoxes:B}){this.address=e,this.amount=w(t),this.amountWithoutPendingRewards=w(n),this.minBalance=w(a),this.pendingRewards=w(r),this.rewards=w(i),this.round=w(o),this.status=s,this.totalAppsOptedIn=f(c),this.totalAssetsOptedIn=f(l),this.totalCreatedApps=f(h),this.totalCreatedAssets=f(d),this.appsLocalState=u,this.appsTotalExtraPages=void 0===g?void 0:f(g),this.appsTotalSchema=m,this.assets=p,this.authAddr="string"==typeof y?H.fromString(y):y,this.createdApps=v,this.createdAssets=b,this.incentiveEligible=I,this.lastHeartbeat=void 0===S?void 0:f(S),this.lastProposed=void 0===A?void 0:f(A),this.participation=C,this.rewardBase=void 0===E?void 0:w(E),this.sigType=x,this.totalBoxBytes=void 0===k?void 0:f(k),this.totalBoxes=void 0===B?void 0:f(B)}getEncodingSchema(){return sa.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 sa({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=>wa.fromEncodingData(e))):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Sa.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map((e=>Ca.fromEncodingData(e))):void 0,authAddr:e.get("auth-addr"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map((e=>pa.fromEncodingData(e))):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map((e=>Aa.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")?ua.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 ca{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new it,omitEmpty:!0},{key:"app-local-state",valueSchema:new vt(wa.encodingSchema),omitEmpty:!0},{key:"created-app",valueSchema:new vt(ba.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,appLocalState:t,createdApp:n}){this.round=w(e),this.appLocalState=t,this.createdApp=n}getEncodingSchema(){return ca.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 ca({round:e.get("round"),appLocalState:void 0!==e.get("app-local-state")?wa.fromEncodingData(e.get("app-local-state")):void 0,createdApp:void 0!==e.get("created-app")?ba.fromEncodingData(e.get("created-app")):void 0})}}class la{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"asset-holding",valueSchema:Ca.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 la.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 la({assetHolding:Ca.fromEncodingData(e.get("asset-holding")??new Map),assetParams:void 0!==e.get("asset-params")?xa.fromEncodingData(e.get("asset-params")):void 0})}}class ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new it,omitEmpty:!0},{key:"asset-holding",valueSchema:new vt(Ca.encodingSchema),omitEmpty:!0},{key:"created-asset",valueSchema:new vt(xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHolding:t,createdAsset:n}){this.round=w(e),this.assetHolding=t,this.createdAsset=n}getEncodingSchema(){return ha.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 ha({round:e.get("round"),assetHolding:void 0!==e.get("asset-holding")?Ca.fromEncodingData(e.get("asset-holding")):void 0,createdAsset:void 0!==e.get("created-asset")?xa.fromEncodingData(e.get("created-asset")):void 0})}}class da{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new it,omitEmpty:!0},{key:"asset-holdings",valueSchema:new vt(new ht(la.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHoldings:t,nextToken:n}){this.round=f(e),this.assetHoldings=t,this.nextToken=n}getEncodingSchema(){return da.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 da({round:e.get("round"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map((e=>la.fromEncodingData(e))):void 0,nextToken:e.get("next-token")})}}class ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new st,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new it,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new it,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new it,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:r,stateProofKey:i}){this.selectionParticipationKey="string"==typeof e?T(e):e,this.voteFirstValid=w(t),this.voteKeyDilution=w(n),this.voteLastValid=w(a),this.voteParticipationKey="string"==typeof r?T(r):r,this.stateProofKey="string"==typeof i?T(i):i}getEncodingSchema(){return ua.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 ua({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 ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"delta",valueSchema:new ht(Oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return ga.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 ga({address:e.get("address"),delta:(e.get("delta")??[]).map((e=>Oa.fromEncodingData(e)))})}}class ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"application-index",valueSchema:new it,omitEmpty:!0},{key:"logs",valueSchema:new ht(new st),omitEmpty:!0},{key:"txId",valueSchema:new rt,omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationIndex:e,logs:t,txid:n}){this.applicationIndex=f(e),this.logs=t,this.txid=n}getEncodingSchema(){return ma.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 ma({applicationIndex:e.get("application-index"),logs:e.get("logs"),txid:e.get("txId")})}}class pa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new it,omitEmpty:!0},{key:"params",valueSchema:ba.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t}){this.id=w(e),this.params=t}getEncodingSchema(){return pa.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",this.params.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new pa({id:e.get("id"),params:ba.fromEncodingData(e.get("params")??new Map)})}}class ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new it,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 ht(fa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appBoxes:t,appGlobals:n,appLocals:a}){this.id=w(e),this.appBoxes=t,this.appGlobals=n,this.appLocals=a}getEncodingSchema(){return ya.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 ya({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 ut([]),this.encodingSchemaValue.pushEntries({key:"kvs",valueSchema:new ht(ka.encodingSchema),omitEmpty:!0},{key:"account",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({kvs:e,account:t}){this.kvs=e,this.account="string"==typeof t?H.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=>ka.fromEncodingData(e))),account:e.get("account")})}}class va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new rt,omitEmpty:!0},{key:"app",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,app:t}){this.account="string"==typeof e?H.fromString(e):e,this.app=w(t)}getEncodingSchema(){return va.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 va({account:e.get("account"),app:e.get("app")})}}class wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new it,omitEmpty:!0},{key:"schema",valueSchema:Sa.encodingSchema,omitEmpty:!0},{key:"key-value",valueSchema:new vt(new ht(vr.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,keyValue:n}){this.id=w(e),this.schema=t,this.keyValue=n}getEncodingSchema(){return wa.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 wa({id:e.get("id"),schema:Sa.fromEncodingData(e.get("schema")??new Map),keyValue:void 0!==e.get("key-value")?e.get("key-value").map((e=>vr.fromEncodingData(e))):void 0})}}class ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new st,omitEmpty:!0},{key:"clear-state-program",valueSchema:new st,omitEmpty:!0},{key:"creator",valueSchema:new rt,omitEmpty:!0},{key:"extra-program-pages",valueSchema:new vt(new it),omitEmpty:!0},{key:"global-state",valueSchema:new vt(new ht(vr.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new vt(Sa.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new vt(Sa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:r,globalStateSchema:i,localStateSchema:o}){this.approvalProgram="string"==typeof e?T(e):e,this.clearStateProgram="string"==typeof t?T(t):t,this.creator="string"==typeof n?H.fromString(n):n,this.extraProgramPages=void 0===a?void 0:f(a),this.globalState=r,this.globalStateSchema=i,this.localStateSchema=o}getEncodingSchema(){return ba.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]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new ba({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=>vr.fromEncodingData(e))):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Sa.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Sa.fromEncodingData(e.get("local-state-schema")):void 0})}}class Ia{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"app-state-type",valueSchema:new rt,omitEmpty:!0},{key:"key",valueSchema:new st,omitEmpty:!0},{key:"operation",valueSchema:new rt,omitEmpty:!0},{key:"account",valueSchema:new vt(new rt),omitEmpty:!0},{key:"new-value",valueSchema:new vt(Ba.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({appStateType:e,key:t,operation:n,account:a,newValue:r}){this.appStateType=e,this.key="string"==typeof t?T(t):t,this.operation=n,this.account="string"==typeof a?H.fromString(a):a,this.newValue=r}getEncodingSchema(){return Ia.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 Ia({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")?Ba.fromEncodingData(e.get("new-value")):void 0})}}class Sa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new it,omitEmpty:!0},{key:"num-uint",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=f(e),this.numUint=f(t)}getEncodingSchema(){return Sa.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 Sa({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Aa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new it,omitEmpty:!0},{key:"params",valueSchema:xa.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t}){this.index=w(e),this.params=t}getEncodingSchema(){return Aa.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",this.params.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Aa({index:e.get("index"),params:xa.fromEncodingData(e.get("params")??new Map)})}}class Ca{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new it,omitEmpty:!0},{key:"asset-id",valueSchema:new it,omitEmpty:!0},{key:"is-frozen",valueSchema:new at,omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n}){this.amount=w(e),this.assetId=w(t),this.isFrozen=n}getEncodingSchema(){return Ca.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 Ca({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen")})}}class Ea{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new rt,omitEmpty:!0},{key:"asset",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,asset:t}){this.account="string"==typeof e?H.fromString(e):e,this.asset=w(t)}getEncodingSchema(){return Ea.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 Ea({account:e.get("account"),asset:e.get("asset")})}}class xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new rt,omitEmpty:!0},{key:"decimals",valueSchema:new it,omitEmpty:!0},{key:"total",valueSchema:new it,omitEmpty:!0},{key:"clawback",valueSchema:new vt(new rt),omitEmpty:!0},{key:"default-frozen",valueSchema:new vt(new at),omitEmpty:!0},{key:"freeze",valueSchema:new vt(new rt),omitEmpty:!0},{key:"manager",valueSchema:new vt(new rt),omitEmpty:!0},{key:"metadata-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"name",valueSchema:new vt(new rt),omitEmpty:!0},{key:"name-b64",valueSchema:new vt(new st),omitEmpty:!0},{key:"reserve",valueSchema:new vt(new rt),omitEmpty:!0},{key:"unit-name",valueSchema:new vt(new rt),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new vt(new st),omitEmpty:!0},{key:"url",valueSchema:new vt(new rt),omitEmpty:!0},{key:"url-b64",valueSchema:new vt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:r,freeze:i,manager:o,metadataHash:s,name:c,nameB64:l,reserve:h,unitName:d,unitNameB64:u,url:g,urlB64:m}){this.creator=e,this.decimals=f(t),this.total=w(n),this.clawback=a,this.defaultFrozen=r,this.freeze=i,this.manager=o,this.metadataHash="string"==typeof s?T(s):s,this.name=c,this.nameB64="string"==typeof l?T(l):l,this.reserve=h,this.unitName=d,this.unitNameB64="string"==typeof u?T(u):u,this.url=g,this.urlB64="string"==typeof m?T(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 ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new st,omitEmpty:!0},{key:"value",valueSchema:Ba.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?T(e):e,this.value=t}getEncodingSchema(){return ka.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 ka({key:e.get("key"),value:Ba.fromEncodingData(e.get("value")??new Map)})}}class Ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"type",valueSchema:new it,omitEmpty:!0},{key:"bytes",valueSchema:new vt(new st),omitEmpty:!0},{key:"uint",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({type:e,bytes:t,uint:n}){this.type=f(e),this.bytes="string"==typeof t?T(t):t,this.uint=void 0===n?void 0:w(n)}getEncodingSchema(){return Ba.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 Ba({type:e.get("type"),bytes:e.get("bytes"),uint:e.get("uint")})}}class Da{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"blockHash",valueSchema:new rt,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockhash:e}){this.blockhash=e}getEncodingSchema(){return Da.encodingSchema}toEncodingData(){return new Map([["blockHash",this.blockhash]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHashResponse: ${e}`);return new Da({blockhash:e.get("blockHash")})}}class Na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new ht(ma.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e}){this.logs=e}getEncodingSchema(){return Na.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 Na({logs:(e.get("logs")??[]).map((e=>ma.fromEncodingData(e)))})}}class Ra{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"block",valueSchema:Wn.encodingSchema,omitEmpty:!0},{key:"cert",valueSchema:new vt(Gn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({block:e,cert:t}){this.block=e,this.cert=t}getEncodingSchema(){return Ra.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 Ra({block:Wn.fromEncodingData(e.get("block")??new Map),cert:void 0!==e.get("cert")?Gn.fromEncodingData(e.get("cert")):void 0})}}class Ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"blockTxids",valueSchema:new ht(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocktxids:e}){this.blocktxids=e}getEncodingSchema(){return Ma.encodingSchema}toEncodingData(){return new Map([["blockTxids",this.blocktxids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockTxidsResponse: ${e}`);return new Ma({blocktxids:e.get("blockTxids")})}}class Ta{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new st,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"value",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?T(e):e,this.round=w(t),this.value="string"==typeof n?T(n):n}getEncodingSchema(){return Ta.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 Ta({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class La{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e}){this.name="string"==typeof e?T(e):e}getEncodingSchema(){return La.encodingSchema}toEncodingData(){return new Map([["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new La({name:e.get("name")})}}class Va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new it,omitEmpty:!0},{key:"name",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=w(e),this.name="string"==typeof t?T(t):t}getEncodingSchema(){return Va.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 Va({app:e.get("app"),name:e.get("name")})}}class Wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"boxes",valueSchema:new ht(La.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({boxes:e}){this.boxes=e}getEncodingSchema(){return Wa.encodingSchema}toEncodingData(){return new Map([["boxes",this.boxes.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new Wa({boxes:(e.get("boxes")??[]).map((e=>La.fromEncodingData(e)))})}}class Ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"branch",valueSchema:new rt,omitEmpty:!0},{key:"build_number",valueSchema:new it,omitEmpty:!0},{key:"channel",valueSchema:new rt,omitEmpty:!0},{key:"commit_hash",valueSchema:new rt,omitEmpty:!0},{key:"major",valueSchema:new it,omitEmpty:!0},{key:"minor",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({branch:e,buildNumber:t,channel:n,commitHash:a,major:r,minor:i}){this.branch=e,this.buildNumber=f(t),this.channel=n,this.commitHash=a,this.major=f(r),this.minor=f(i)}getEncodingSchema(){return Ga.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 Ga({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 Fa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"hash",valueSchema:new rt,omitEmpty:!0},{key:"result",valueSchema:new rt,omitEmpty:!0},{key:"sourcemap",valueSchema:new vt(Gn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({hash:e,result:t,sourcemap:n}){this.hash=e,this.result=t,this.sourcemap=n}getEncodingSchema(){return Fa.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 Fa({hash:e.get("hash"),result:e.get("result"),sourcemap:void 0!==e.get("sourcemap")?Gn.fromEncodingData(e.get("sourcemap")):void 0})}}class Ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"result",valueSchema:new rt,omitEmpty:!0})),this.encodingSchemaValue}constructor({result:e}){this.result=e}getEncodingSchema(){return Ya.encodingSchema}toEncodingData(){return new Map([["result",this.result]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DisassembleResponse: ${e}`);return new Ya({result:e.get("result")})}}class Za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new ht(sa.encodingSchema),omitEmpty:!0},{key:"apps",valueSchema:new ht(pa.encodingSchema),omitEmpty:!0},{key:"latest-timestamp",valueSchema:new it,omitEmpty:!0},{key:"protocol-version",valueSchema:new rt,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"sources",valueSchema:new ht(Pa.encodingSchema),omitEmpty:!0},{key:"txns",valueSchema:new ht(In.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,apps:t,latestTimestamp:n,protocolVersion:a,round:r,sources:i,txns:o}){this.accounts=e,this.apps=t,this.latestTimestamp=f(n),this.protocolVersion=a,this.round=w(r),this.sources=i,this.txns=o}getEncodingSchema(){return Za.encodingSchema}toEncodingData(){return new Map([["accounts",this.accounts.map((e=>e.toEncodingData()))],["apps",this.apps.map((e=>e.toEncodingData()))],["latest-timestamp",this.latestTimestamp],["protocol-version",this.protocolVersion],["round",this.round],["sources",this.sources.map((e=>e.toEncodingData()))],["txns",this.txns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunRequest: ${e}`);return new Za({accounts:(e.get("accounts")??[]).map((e=>sa.fromEncodingData(e))),apps:(e.get("apps")??[]).map((e=>pa.fromEncodingData(e))),latestTimestamp:e.get("latest-timestamp"),protocolVersion:e.get("protocol-version"),round:e.get("round"),sources:(e.get("sources")??[]).map((e=>Pa.fromEncodingData(e))),txns:(e.get("txns")??[]).map((e=>In.fromEncodingData(e)))})}}class za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"error",valueSchema:new rt,omitEmpty:!0},{key:"protocol-version",valueSchema:new rt,omitEmpty:!0},{key:"txns",valueSchema:new ht(Ha.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({error:e,protocolVersion:t,txns:n}){this.error=e,this.protocolVersion=t,this.txns=n}getEncodingSchema(){return za.encodingSchema}toEncodingData(){return new Map([["error",this.error],["protocol-version",this.protocolVersion],["txns",this.txns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunResponse: ${e}`);return new za({error:e.get("error"),protocolVersion:e.get("protocol-version"),txns:(e.get("txns")??[]).map((e=>Ha.fromEncodingData(e)))})}}class Pa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"app-index",valueSchema:new it,omitEmpty:!0},{key:"field-name",valueSchema:new rt,omitEmpty:!0},{key:"source",valueSchema:new rt,omitEmpty:!0},{key:"txn-index",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({appIndex:e,fieldName:t,source:n,txnIndex:a}){this.appIndex=w(e),this.fieldName=t,this.source=n,this.txnIndex=f(a)}getEncodingSchema(){return Pa.encodingSchema}toEncodingData(){return new Map([["app-index",this.appIndex],["field-name",this.fieldName],["source",this.source],["txn-index",this.txnIndex]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunSource: ${e}`);return new Pa({appIndex:e.get("app-index"),fieldName:e.get("field-name"),source:e.get("source"),txnIndex:e.get("txn-index")})}}class Xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"line",valueSchema:new it,omitEmpty:!0},{key:"pc",valueSchema:new it,omitEmpty:!0},{key:"stack",valueSchema:new ht(wr.encodingSchema),omitEmpty:!0},{key:"error",valueSchema:new vt(new rt),omitEmpty:!0},{key:"scratch",valueSchema:new vt(new ht(wr.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({line:e,pc:t,stack:n,error:a,scratch:r}){this.line=f(e),this.pc=f(t),this.stack=n,this.error=a,this.scratch=r}getEncodingSchema(){return Xa.encodingSchema}toEncodingData(){return new Map([["line",this.line],["pc",this.pc],["stack",this.stack.map((e=>e.toEncodingData()))],["error",this.error],["scratch",void 0!==this.scratch?this.scratch.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunState: ${e}`);return new Xa({line:e.get("line"),pc:e.get("pc"),stack:(e.get("stack")??[]).map((e=>wr.fromEncodingData(e))),error:e.get("error"),scratch:void 0!==e.get("scratch")?e.get("scratch").map((e=>wr.fromEncodingData(e))):void 0})}}class Ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"disassembly",valueSchema:new ht(new rt),omitEmpty:!0},{key:"app-call-messages",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"app-call-trace",valueSchema:new vt(new ht(Xa.encodingSchema)),omitEmpty:!0},{key:"budget-added",valueSchema:new vt(new it),omitEmpty:!0},{key:"budget-consumed",valueSchema:new vt(new it),omitEmpty:!0},{key:"global-delta",valueSchema:new vt(new ht(Oa.encodingSchema)),omitEmpty:!0},{key:"local-deltas",valueSchema:new vt(new ht(ga.encodingSchema)),omitEmpty:!0},{key:"logic-sig-disassembly",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"logic-sig-messages",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new vt(new ht(Xa.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new vt(new ht(new st)),omitEmpty:!0})),this.encodingSchemaValue}constructor({disassembly:e,appCallMessages:t,appCallTrace:n,budgetAdded:a,budgetConsumed:r,globalDelta:i,localDeltas:o,logicSigDisassembly:s,logicSigMessages:c,logicSigTrace:l,logs:h}){this.disassembly=e,this.appCallMessages=t,this.appCallTrace=n,this.budgetAdded=void 0===a?void 0:f(a),this.budgetConsumed=void 0===r?void 0:f(r),this.globalDelta=i,this.localDeltas=o,this.logicSigDisassembly=s,this.logicSigMessages=c,this.logicSigTrace=l,this.logs=h}getEncodingSchema(){return Ha.encodingSchema}toEncodingData(){return new Map([["disassembly",this.disassembly],["app-call-messages",this.appCallMessages],["app-call-trace",void 0!==this.appCallTrace?this.appCallTrace.map((e=>e.toEncodingData())):void 0],["budget-added",this.budgetAdded],["budget-consumed",this.budgetConsumed],["global-delta",void 0!==this.globalDelta?this.globalDelta.map((e=>e.toEncodingData())):void 0],["local-deltas",void 0!==this.localDeltas?this.localDeltas.map((e=>e.toEncodingData())):void 0],["logic-sig-disassembly",this.logicSigDisassembly],["logic-sig-messages",this.logicSigMessages],["logic-sig-trace",void 0!==this.logicSigTrace?this.logicSigTrace.map((e=>e.toEncodingData())):void 0],["logs",this.logs]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunTxnResult: ${e}`);return new Ha({disassembly:e.get("disassembly"),appCallMessages:e.get("app-call-messages"),appCallTrace:void 0!==e.get("app-call-trace")?e.get("app-call-trace").map((e=>Xa.fromEncodingData(e))):void 0,budgetAdded:e.get("budget-added"),budgetConsumed:e.get("budget-consumed"),globalDelta:void 0!==e.get("global-delta")?e.get("global-delta").map((e=>Oa.fromEncodingData(e))):void 0,localDeltas:void 0!==e.get("local-deltas")?e.get("local-deltas").map((e=>ga.fromEncodingData(e))):void 0,logicSigDisassembly:e.get("logic-sig-disassembly"),logicSigMessages:e.get("logic-sig-messages"),logicSigTrace:void 0!==e.get("logic-sig-trace")?e.get("logic-sig-trace").map((e=>Xa.fromEncodingData(e))):void 0,logs:e.get("logs")})}}class Ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new rt,omitEmpty:!0},{key:"data",valueSchema:new vt(Gn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return Ka.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 Ka({message:e.get("message"),data:void 0!==e.get("data")?Gn.fromEncodingData(e.get("data")):void 0})}}class ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new it,omitEmpty:!0},{key:"bytes",valueSchema:new vt(new rt),omitEmpty:!0},{key:"uint",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=f(e),this.bytes=t,this.uint=void 0===n?void 0:w(n)}getEncodingSchema(){return ja.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 ja({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class Oa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new rt,omitEmpty:!0},{key:"value",valueSchema:ja.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return Oa.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 Oa({key:e.get("key"),value:ja.fromEncodingData(e.get("value")??new Map)})}}class Ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"offset",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({offset:e}){this.offset=f(e)}getEncodingSchema(){return Ua.encodingSchema}toEncodingData(){return new Map([["offset",this.offset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetBlockTimeStampOffsetResponse: ${e}`);return new Ua({offset:e.get("offset")})}}class Ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e}){this.round=w(e)}getEncodingSchema(){return Ja.encodingSchema}toEncodingData(){return new Map([["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetSyncRoundResponse: ${e}`);return new Ja({round:e.get("round")})}}class Qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new vt(new st),omitEmpty:!0},{key:"value",valueSchema:new vt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?T(e):e,this.value="string"==typeof t?T(t):t}getEncodingSchema(){return Qa.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded KvDelta: ${e}`);return new Qa({key:e.get("key"),value:e.get("value")})}}class $a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"Delta",valueSchema:oa.encodingSchema,omitEmpty:!0},{key:"Ids",valueSchema:new ht(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({delta:e,ids:t}){this.delta=e,this.ids=t}getEncodingSchema(){return $a.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 $a({delta:oa.fromEncodingData(e.get("Delta")??new Map),ids:e.get("Ids")})}}class _a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new it,omitEmpty:!0},{key:"proof",valueSchema:new st,omitEmpty:!0},{key:"treedepth",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,proof:t,treedepth:n}){this.index=f(e),this.proof="string"==typeof t?T(t):t,this.treedepth=f(n)}getEncodingSchema(){return _a.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 _a({index:e.get("index"),proof:e.get("proof"),treedepth:e.get("treedepth")})}}class qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"catchup-time",valueSchema:new it,omitEmpty:!0},{key:"last-round",valueSchema:new it,omitEmpty:!0},{key:"last-version",valueSchema:new rt,omitEmpty:!0},{key:"next-version",valueSchema:new rt,omitEmpty:!0},{key:"next-version-round",valueSchema:new it,omitEmpty:!0},{key:"next-version-supported",valueSchema:new at,omitEmpty:!0},{key:"stopped-at-unsupported-round",valueSchema:new at,omitEmpty:!0},{key:"time-since-last-round",valueSchema:new it,omitEmpty:!0},{key:"catchpoint",valueSchema:new vt(new rt),omitEmpty:!0},{key:"catchpoint-acquired-blocks",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-processed-accounts",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-processed-kvs",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-total-accounts",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-total-blocks",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-total-kvs",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-verified-accounts",valueSchema:new vt(new it),omitEmpty:!0},{key:"catchpoint-verified-kvs",valueSchema:new vt(new it),omitEmpty:!0},{key:"last-catchpoint",valueSchema:new vt(new rt),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-next-protocol-vote-before",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-no-votes",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-node-vote",valueSchema:new vt(new at),omitEmpty:!0},{key:"upgrade-vote-rounds",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-votes",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-votes-required",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-yes-votes",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({catchupTime:e,lastRound:t,lastVersion:n,nextVersion:a,nextVersionRound:r,nextVersionSupported:i,stoppedAtUnsupportedRound:o,timeSinceLastRound:s,catchpoint:c,catchpointAcquiredBlocks:l,catchpointProcessedAccounts:h,catchpointProcessedKvs:d,catchpointTotalAccounts:u,catchpointTotalBlocks:g,catchpointTotalKvs:m,catchpointVerifiedAccounts:p,catchpointVerifiedKvs:y,lastCatchpoint:v,upgradeDelay:b,upgradeNextProtocolVoteBefore:I,upgradeNoVotes:S,upgradeNodeVote:A,upgradeVoteRounds:C,upgradeVotes:E,upgradeVotesRequired:x,upgradeYesVotes:k}){this.catchupTime=w(e),this.lastRound=w(t),this.lastVersion=n,this.nextVersion=a,this.nextVersionRound=w(r),this.nextVersionSupported=i,this.stoppedAtUnsupportedRound=o,this.timeSinceLastRound=w(s),this.catchpoint=c,this.catchpointAcquiredBlocks=void 0===l?void 0:f(l),this.catchpointProcessedAccounts=void 0===h?void 0:f(h),this.catchpointProcessedKvs=void 0===d?void 0:f(d),this.catchpointTotalAccounts=void 0===u?void 0:f(u),this.catchpointTotalBlocks=void 0===g?void 0:f(g),this.catchpointTotalKvs=void 0===m?void 0:f(m),this.catchpointVerifiedAccounts=void 0===p?void 0:f(p),this.catchpointVerifiedKvs=void 0===y?void 0:f(y),this.lastCatchpoint=v,this.upgradeDelay=void 0===b?void 0:w(b),this.upgradeNextProtocolVoteBefore=void 0===I?void 0:w(I),this.upgradeNoVotes=void 0===S?void 0:f(S),this.upgradeNodeVote=A,this.upgradeVoteRounds=void 0===C?void 0:f(C),this.upgradeVotes=void 0===E?void 0:f(E),this.upgradeVotesRequired=void 0===x?void 0:f(x),this.upgradeYesVotes=void 0===k?void 0:f(k)}getEncodingSchema(){return qa.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 qa({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 er{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"pool-error",valueSchema:new rt,omitEmpty:!0},{key:"txn",valueSchema:In.encodingSchema,omitEmpty:!0},{key:"application-index",valueSchema:new vt(new it),omitEmpty:!0},{key:"asset-closing-amount",valueSchema:new vt(new it),omitEmpty:!0},{key:"asset-index",valueSchema:new vt(new it),omitEmpty:!0},{key:"close-rewards",valueSchema:new vt(new it),omitEmpty:!0},{key:"closing-amount",valueSchema:new vt(new it),omitEmpty:!0},{key:"confirmed-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"global-state-delta",valueSchema:new vt(new ht(Oa.encodingSchema)),omitEmpty:!0},{key:"inner-txns",valueSchema:new vt(new ht(er.encodingSchema)),omitEmpty:!0},{key:"local-state-delta",valueSchema:new vt(new ht(ga.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new vt(new ht(new st)),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new vt(new it),omitEmpty:!0},{key:"sender-rewards",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({poolError:e,txn:t,applicationIndex:n,assetClosingAmount:a,assetIndex:r,closeRewards:i,closingAmount:o,confirmedRound:s,globalStateDelta:c,innerTxns:l,localStateDelta:h,logs:d,receiverRewards:u,senderRewards:g}){this.poolError=e,this.txn=t,this.applicationIndex=void 0===n?void 0:w(n),this.assetClosingAmount=void 0===a?void 0:w(a),this.assetIndex=void 0===r?void 0:w(r),this.closeRewards=void 0===i?void 0:w(i),this.closingAmount=void 0===o?void 0:w(o),this.confirmedRound=void 0===s?void 0:w(s),this.globalStateDelta=c,this.innerTxns=l,this.localStateDelta=h,this.logs=d,this.receiverRewards=void 0===u?void 0:w(u),this.senderRewards=void 0===g?void 0:w(g)}getEncodingSchema(){return er.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 er({poolError:e.get("pool-error"),txn:In.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=>Oa.fromEncodingData(e))):void 0,innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map((e=>er.fromEncodingData(e))):void 0,localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map((e=>ga.fromEncodingData(e))):void 0,logs:e.get("logs"),receiverRewards:e.get("receiver-rewards"),senderRewards:e.get("sender-rewards")})}}class tr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"top-transactions",valueSchema:new ht(In.encodingSchema),omitEmpty:!0},{key:"total-transactions",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({topTransactions:e,totalTransactions:t}){this.topTransactions=e,this.totalTransactions=f(t)}getEncodingSchema(){return tr.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 tr({topTransactions:(e.get("top-transactions")??[]).map((e=>In.fromEncodingData(e))),totalTransactions:e.get("total-transactions")})}}class nr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"txId",valueSchema:new rt,omitEmpty:!0})),this.encodingSchemaValue}constructor({txid:e}){this.txid=e}getEncodingSchema(){return nr.encodingSchema}toEncodingData(){return new Map([["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PostTransactionsResponse: ${e}`);return new nr({txid:e.get("txId")})}}class ar{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"new-value",valueSchema:Ba.encodingSchema,omitEmpty:!0},{key:"slot",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({newValue:e,slot:t}){this.newValue=e,this.slot=f(t)}getEncodingSchema(){return ar.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 ar({newValue:Ba.fromEncodingData(e.get("new-value")??new Map),slot:e.get("slot")})}}class rr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"app-initial-states",valueSchema:new vt(new ht(ya.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({appInitialStates:e}){this.appInitialStates=e}getEncodingSchema(){return rr.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 rr({appInitialStates:void 0!==e.get("app-initial-states")?e.get("app-initial-states").map((e=>ya.fromEncodingData(e))):void 0})}}class ir{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"txn-groups",valueSchema:new ht(or.encodingSchema),omitEmpty:!0},{key:"allow-empty-signatures",valueSchema:new vt(new at),omitEmpty:!0},{key:"allow-more-logging",valueSchema:new vt(new at),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new vt(new at),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new vt(cr.encodingSchema),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new vt(new it),omitEmpty:!0},{key:"fix-signers",valueSchema:new vt(new at),omitEmpty:!0},{key:"round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:n,allowUnnamedResources:a,execTraceConfig:r,extraOpcodeBudget:i,fixSigners:o,round:s}){this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=n,this.allowUnnamedResources=a,this.execTraceConfig=r,this.extraOpcodeBudget=void 0===i?void 0:f(i),this.fixSigners=o,this.round=void 0===s?void 0:w(s)}getEncodingSchema(){return ir.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 ir({txnGroups:(e.get("txn-groups")??[]).map((e=>or.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")?cr.fromEncodingData(e.get("exec-trace-config")):void 0,extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),round:e.get("round")})}}class or{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"txns",valueSchema:new ht(In.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txns:e}){this.txns=e}getEncodingSchema(){return or.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 or({txns:(e.get("txns")??[]).map((e=>In.fromEncodingData(e)))})}}class sr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"last-round",valueSchema:new it,omitEmpty:!0},{key:"txn-groups",valueSchema:new ht(lr.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new it,omitEmpty:!0},{key:"eval-overrides",valueSchema:new vt(ur.encodingSchema),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new vt(cr.encodingSchema),omitEmpty:!0},{key:"initial-states",valueSchema:new vt(rr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lastRound:e,txnGroups:t,version:n,evalOverrides:a,execTraceConfig:r,initialStates:i}){this.lastRound=w(e),this.txnGroups=t,this.version=f(n),this.evalOverrides=a,this.execTraceConfig=r,this.initialStates=i}getEncodingSchema(){return sr.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 sr({lastRound:e.get("last-round"),txnGroups:(e.get("txn-groups")??[]).map((e=>lr.fromEncodingData(e))),version:e.get("version"),evalOverrides:void 0!==e.get("eval-overrides")?ur.fromEncodingData(e.get("eval-overrides")):void 0,execTraceConfig:void 0!==e.get("exec-trace-config")?cr.fromEncodingData(e.get("exec-trace-config")):void 0,initialStates:void 0!==e.get("initial-states")?rr.fromEncodingData(e.get("initial-states")):void 0})}}class cr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"enable",valueSchema:new vt(new at),omitEmpty:!0},{key:"scratch-change",valueSchema:new vt(new at),omitEmpty:!0},{key:"stack-change",valueSchema:new vt(new at),omitEmpty:!0},{key:"state-change",valueSchema:new vt(new at),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 cr.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 cr({enable:e.get("enable"),scratchChange:e.get("scratch-change"),stackChange:e.get("stack-change"),stateChange:e.get("state-change")})}}class lr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"txn-results",valueSchema:new ht(hr.encodingSchema),omitEmpty:!0},{key:"app-budget-added",valueSchema:new vt(new it),omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new vt(new it),omitEmpty:!0},{key:"failed-at",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"failure-message",valueSchema:new vt(new rt),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new vt(dr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:n,failedAt:a,failureMessage:r,unnamedResourcesAccessed:i}){this.txnResults=e,this.appBudgetAdded=void 0===t?void 0:f(t),this.appBudgetConsumed=void 0===n?void 0:f(n),this.failedAt=void 0===a?void 0:a.map(f),this.failureMessage=r,this.unnamedResourcesAccessed=i}getEncodingSchema(){return lr.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 lr({txnResults:(e.get("txn-results")??[]).map((e=>hr.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")?dr.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class hr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"txn-result",valueSchema:er.encodingSchema,omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new vt(new it),omitEmpty:!0},{key:"exec-trace",valueSchema:new vt(mr.encodingSchema),omitEmpty:!0},{key:"fixed-signer",valueSchema:new vt(new rt),omitEmpty:!0},{key:"logic-sig-budget-consumed",valueSchema:new vt(new it),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new vt(dr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResult:e,appBudgetConsumed:t,execTrace:n,fixedSigner:a,logicSigBudgetConsumed:r,unnamedResourcesAccessed:i}){this.txnResult=e,this.appBudgetConsumed=void 0===t?void 0:f(t),this.execTrace=n,this.fixedSigner="string"==typeof a?H.fromString(a):a,this.logicSigBudgetConsumed=void 0===r?void 0:f(r),this.unnamedResourcesAccessed=i}getEncodingSchema(){return hr.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 hr({txnResult:er.fromEncodingData(e.get("txn-result")??new Map),appBudgetConsumed:e.get("app-budget-consumed"),execTrace:void 0!==e.get("exec-trace")?mr.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")?dr.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class dr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"app-locals",valueSchema:new vt(new ht(va.encodingSchema)),omitEmpty:!0},{key:"apps",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"asset-holdings",valueSchema:new vt(new ht(Ea.encodingSchema)),omitEmpty:!0},{key:"assets",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"boxes",valueSchema:new vt(new ht(Va.encodingSchema)),omitEmpty:!0},{key:"extra-box-refs",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,appLocals:t,apps:n,assetHoldings:a,assets:r,boxes:i,extraBoxRefs:o}){this.accounts=void 0!==e?e.map((e=>"string"==typeof e?H.fromString(e):e)):void 0,this.appLocals=t,this.apps=void 0===n?void 0:n.map(w),this.assetHoldings=a,this.assets=void 0===r?void 0:r.map(w),this.boxes=i,this.extraBoxRefs=void 0===o?void 0:f(o)}getEncodingSchema(){return dr.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 dr({accounts:e.get("accounts"),appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map((e=>va.fromEncodingData(e))):void 0,apps:e.get("apps"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map((e=>Ea.fromEncodingData(e))):void 0,assets:e.get("assets"),boxes:void 0!==e.get("boxes")?e.get("boxes").map((e=>Va.fromEncodingData(e))):void 0,extraBoxRefs:e.get("extra-box-refs")})}}class ur{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"allow-empty-signatures",valueSchema:new vt(new at),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new vt(new at),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new vt(new it),omitEmpty:!0},{key:"fix-signers",valueSchema:new vt(new at),omitEmpty:!0},{key:"max-log-calls",valueSchema:new vt(new it),omitEmpty:!0},{key:"max-log-size",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:n,fixSigners:a,maxLogCalls:r,maxLogSize:i}){this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=void 0===n?void 0:f(n),this.fixSigners=a,this.maxLogCalls=void 0===r?void 0:f(r),this.maxLogSize=void 0===i?void 0:f(i)}getEncodingSchema(){return ur.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 ur({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 gr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"pc",valueSchema:new it,omitEmpty:!0},{key:"scratch-changes",valueSchema:new vt(new ht(ar.encodingSchema)),omitEmpty:!0},{key:"spawned-inners",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"stack-additions",valueSchema:new vt(new ht(Ba.encodingSchema)),omitEmpty:!0},{key:"stack-pop-count",valueSchema:new vt(new it),omitEmpty:!0},{key:"state-changes",valueSchema:new vt(new ht(Ia.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({pc:e,scratchChanges:t,spawnedInners:n,stackAdditions:a,stackPopCount:r,stateChanges:i}){this.pc=f(e),this.scratchChanges=t,this.spawnedInners=void 0===n?void 0:n.map(f),this.stackAdditions=a,this.stackPopCount=void 0===r?void 0:f(r),this.stateChanges=i}getEncodingSchema(){return gr.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 gr({pc:e.get("pc"),scratchChanges:void 0!==e.get("scratch-changes")?e.get("scratch-changes").map((e=>ar.fromEncodingData(e))):void 0,spawnedInners:e.get("spawned-inners"),stackAdditions:void 0!==e.get("stack-additions")?e.get("stack-additions").map((e=>Ba.fromEncodingData(e))):void 0,stackPopCount:e.get("stack-pop-count"),stateChanges:void 0!==e.get("state-changes")?e.get("state-changes").map((e=>Ia.fromEncodingData(e))):void 0})}}class mr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"approval-program-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"approval-program-trace",valueSchema:new vt(new ht(gr.encodingSchema)),omitEmpty:!0},{key:"clear-state-program-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"clear-state-program-trace",valueSchema:new vt(new ht(gr.encodingSchema)),omitEmpty:!0},{key:"clear-state-rollback",valueSchema:new vt(new at),omitEmpty:!0},{key:"clear-state-rollback-error",valueSchema:new vt(new rt),omitEmpty:!0},{key:"inner-trace",valueSchema:new vt(new ht(mr.encodingSchema)),omitEmpty:!0},{key:"logic-sig-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new vt(new ht(gr.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:n,clearStateProgramTrace:a,clearStateRollback:r,clearStateRollbackError:i,innerTrace:o,logicSigHash:s,logicSigTrace:c}){this.approvalProgramHash="string"==typeof e?T(e):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof n?T(n):n,this.clearStateProgramTrace=a,this.clearStateRollback=r,this.clearStateRollbackError=i,this.innerTrace=o,this.logicSigHash="string"==typeof s?T(s):s,this.logicSigTrace=c}getEncodingSchema(){return mr.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 mr({approvalProgramHash:e.get("approval-program-hash"),approvalProgramTrace:void 0!==e.get("approval-program-trace")?e.get("approval-program-trace").map((e=>gr.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=>gr.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=>mr.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=>gr.fromEncodingData(e))):void 0})}}class pr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"Message",valueSchema:yr.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?T(t):t}getEncodingSchema(){return pr.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 pr({message:yr.fromEncodingData(e.get("Message")??new Map),stateproof:e.get("StateProof")})}}class yr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"BlockHeadersCommitment",valueSchema:new st,omitEmpty:!0},{key:"FirstAttestedRound",valueSchema:new it,omitEmpty:!0},{key:"LastAttestedRound",valueSchema:new it,omitEmpty:!0},{key:"LnProvenWeight",valueSchema:new it,omitEmpty:!0},{key:"VotersCommitment",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:n,lnprovenweight:a,voterscommitment:r}){this.blockheaderscommitment="string"==typeof e?T(e):e,this.firstattestedround=w(t),this.lastattestedround=w(n),this.lnprovenweight=w(a),this.voterscommitment="string"==typeof r?T(r):r}getEncodingSchema(){return yr.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 yr({blockheaderscommitment:e.get("BlockHeadersCommitment"),firstattestedround:e.get("FirstAttestedRound"),lastattestedround:e.get("LastAttestedRound"),lnprovenweight:e.get("LnProvenWeight"),voterscommitment:e.get("VotersCommitment")})}}class fr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"current_round",valueSchema:new it,omitEmpty:!0},{key:"online-money",valueSchema:new it,omitEmpty:!0},{key:"total-money",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,onlineMoney:t,totalMoney:n}){this.currentRound=w(e),this.onlineMoney=w(t),this.totalMoney=w(n)}getEncodingSchema(){return fr.encodingSchema}toEncodingData(){return new Map([["current_round",this.currentRound],["online-money",this.onlineMoney],["total-money",this.totalMoney]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SupplyResponse: ${e}`);return new fr({currentRound:e.get("current_round"),onlineMoney:e.get("online-money"),totalMoney:e.get("total-money")})}}class vr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new st,omitEmpty:!0},{key:"value",valueSchema:wr.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?T(e):e,this.value=t}getEncodingSchema(){return vr.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 vr({key:e.get("key"),value:wr.fromEncodingData(e.get("value")??new Map)})}}class wr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new st,omitEmpty:!0},{key:"type",valueSchema:new it,omitEmpty:!0},{key:"uint",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?T(e):e,this.type=f(t),this.uint=w(n)}getEncodingSchema(){return wr.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 wr({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class br{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"Deltas",valueSchema:new ht($a.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({deltas:e}){this.deltas=e}getEncodingSchema(){return br.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 br({deltas:(e.get("Deltas")??[]).map((e=>$a.fromEncodingData(e)))})}}class Ir{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"consensus-version",valueSchema:new rt,omitEmpty:!0},{key:"fee",valueSchema:new it,omitEmpty:!0},{key:"genesis-hash",valueSchema:new st,omitEmpty:!0},{key:"genesis-id",valueSchema:new rt,omitEmpty:!0},{key:"last-round",valueSchema:new it,omitEmpty:!0},{key:"min-fee",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({consensusVersion:e,fee:t,genesisHash:n,genesisId:a,lastRound:r,minFee:i}){this.consensusVersion=e,this.fee=w(t),this.genesisHash="string"==typeof n?T(n):n,this.genesisId=a,this.lastRound=w(r),this.minFee=w(i)}getEncodingSchema(){return Ir.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 Ir({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 Sr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"idx",valueSchema:new it,omitEmpty:!0},{key:"proof",valueSchema:new st,omitEmpty:!0},{key:"stibhash",valueSchema:new st,omitEmpty:!0},{key:"treedepth",valueSchema:new it,omitEmpty:!0},{key:"hashtype",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({idx:e,proof:t,stibhash:n,treedepth:a,hashtype:r}){this.idx=f(e),this.proof="string"==typeof t?T(t):t,this.stibhash="string"==typeof n?T(n):n,this.treedepth=f(a),this.hashtype=r}getEncodingSchema(){return Sr.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 TransactionProofResponse: ${e}`);return new Sr({idx:e.get("idx"),proof:e.get("proof"),stibhash:e.get("stibhash"),treedepth:e.get("treedepth"),hashtype:e.get("hashtype")})}}class Ar{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"build",valueSchema:Ga.encodingSchema,omitEmpty:!0},{key:"genesis_hash_b64",valueSchema:new st,omitEmpty:!0},{key:"genesis_id",valueSchema:new rt,omitEmpty:!0},{key:"versions",valueSchema:new ht(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({build:e,genesisHashB64:t,genesisId:n,versions:a}){this.build=e,this.genesisHashB64="string"==typeof t?T(t):t,this.genesisId=n,this.versions=a}getEncodingSchema(){return Ar.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 Ar({build:Ga.fromEncodingData(e.get("build")??new Map),genesisHashB64:e.get("genesis_hash_b64"),genesisId:e.get("genesis_id"),versions:e.get("versions")})}}class Cr{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 Er extends Cr{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 tt(e.getJSONText(),sa)}}class xr extends Cr{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 tt(e.getJSONText(),ha)}}class kr extends Cr{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 tt(e.getJSONText(),ca)}}class Br extends Cr{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 qe(e.body,Ra)}}function Dr(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="text/plain"),t}class Nr extends Cr{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=Dr(e);return this.c.post({relativePath:this.path(),data:W(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return tt(e.getJSONText(),Fa)}}class Rr extends Cr{constructor(e,t){super(e),this.blob=et(t)}path(){return"/v2/teal/dryrun"}executeRequest(e,t){const n=Dr(e);return this.c.post({relativePath:this.path(),data:this.blob,requestHeaders:n,customOptions:t})}prepare(e){return tt(e.getJSONText(),za)}}class Mr extends Cr{path(){return"/genesis"}prepare(e){return e.getJSONText()}}class Tr extends Cr{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}`}prepare(e){return tt(e.getJSONText(),Aa)}}class Lr extends Cr{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/applications/${this.index}`}prepare(e){return tt(e.getJSONText(),pa)}}class Vr extends Cr{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/hash`}prepare(e){return tt(e.getJSONText(),Da)}}class Wr extends Cr{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/txids`}prepare(e){return tt(e.getJSONText(),Ma)}}class Gr extends Cr{constructor(e,t,n){super(e),this.index=BigInt(t);const a=L(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return tt(e.getJSONText(),Ta)}}class Fr extends Cr{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}prepare(e){return tt(e.getJSONText(),Wa)}}class Yr extends Cr{path(){return"/health"}prepare(e){}}class Zr extends Cr{constructor(e,t){super(e),this.txid=t,this.query.format="msgpack"}prepare(e){return qe(e.body,er)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class zr extends Cr{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){return qe(e.body,tr)}max(e){return this.query.max=e,this}}class Pr extends Cr{constructor(e,t){super(e),this.address=t.toString(),this.query.format="msgpack"}prepare(e){return qe(e.body,tr)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class Xr extends Cr{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 tt(e.getJSONText(),Sr)}}function Hr(e){return e&&void 0!==e.byteLength}class Kr extends Cr{constructor(e,t){super(e);let n=t;if(Array.isArray(t)){if(!t.every(Hr))throw new TypeError("Array elements must be byte arrays");n=p(...t)}else if(!Hr(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 tt(e.getJSONText(),nr)}}class jr extends Cr{path(){return"/v2/status"}prepare(e){return tt(e.getJSONText(),qa)}}class Or extends Cr{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/status/wait-for-block-after/${this.round}`}prepare(e){return tt(e.getJSONText(),qa)}}class Ur extends Cr{path(){return"/v2/transactions/params"}prepare(e){const t=tt(e.getJSONText(),Ir);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 Jr extends Cr{path(){return"/v2/ledger/supply"}prepare(e){return tt(e.getJSONText(),fr)}}class Qr extends Cr{path(){return"/versions"}prepare(e){return tt(e.getJSONText(),Ar)}}class $r extends Cr{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/blocks/${this.round}/lightheader/proof`}prepare(e){return tt(e.getJSONText(),_a)}}class _r extends Cr{constructor(e,t){super(e),this.round=BigInt(t)}path(){return`/v2/stateproofs/${this.round}`}prepare(e){return tt(e.getJSONText(),pr)}}class qr extends Cr{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 ei extends Cr{path(){return"/v2/ledger/sync"}prepare(e){return tt(e.getJSONText(),Ja)}}class ti extends Cr{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 ni extends Cr{path(){return"/v2/devmode/blocks/offset"}prepare(e){return tt(e.getJSONText(),Ua)}}class ai extends Cr{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:W(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return tt(e.getJSONText(),Ya)}}class ri extends Cr{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=et(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 qe(e.body,sr)}}class ii extends Cr{path(){return"/ready"}prepare(e){}}class oi extends Cr{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 si extends Cr{constructor(e,t){super(e),this.id=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/txn/group/${this.id}`}prepare(e){return qe(e.body,oa)}}class ci extends Cr{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}`}prepare(e){return qe(e.body,oa)}}class li extends Cr{constructor(e,t){super(e),this.round=BigInt(t),this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return qe(e.body,br)}}class hi extends ie{constructor(e,t,n,a={}){super("X-Algo-API-Token",e,t,n,a)}healthCheck(){return new Yr(this.c)}versionsCheck(){return new Qr(this.c)}sendRawTransaction(e){return new Kr(this.c,e)}accountInformation(e){return new Er(this.c,e)}accountAssetInformation(e,t){return new xr(this.c,e,t)}accountApplicationInformation(e,t){return new kr(this.c,e,t)}block(e){return new Br(this.c,e)}getBlockHash(e){return new Vr(this.c,e)}getBlockTxids(e){return new Wr(this.c,e)}pendingTransactionInformation(e){return new Zr(this.c,e)}pendingTransactionsInformation(){return new zr(this.c)}pendingTransactionByAddress(e){return new Pr(this.c,e)}status(){return new jr(this.c)}statusAfterBlock(e){return new Or(this.c,e)}getTransactionParams(){return new Ur(this.c)}supply(){return new Jr(this.c)}compile(e){return new Nr(this.c,e)}disassemble(e){return new ai(this.c,e)}dryrun(e){return new Rr(this.c,e)}getAssetByID(e){return new Tr(this.c,e)}getApplicationByID(e){return new Lr(this.c,e)}getApplicationBoxByName(e,t){return new Gr(this.c,e,t)}getApplicationBoxes(e){return new Fr(this.c,e)}genesis(){return new Mr(this.c)}getTransactionProof(e,t){return new Xr(this.c,e,t)}getLightBlockHeaderProof(e){return new $r(this.c,e)}getStateProof(e){return new _r(this.c,e)}simulateRawTransactions(e){const t=[];if(Array.isArray(e))for(const n of e)t.push(qe(n,In));else t.push(qe(e,In));const n=new ir({txnGroups:[new or({txns:t})]});return this.simulateTransactions(n)}simulateTransactions(e){return new ri(this.c,e)}setBlockOffsetTimestamp(e){return new ti(this.c,e)}getBlockOffsetTimestamp(){return new ni(this.c)}setSyncRound(e){return new qr(this.c,e)}unsetSyncRound(){return new oi(this.c)}getSyncRound(){return new ei(this.c)}ready(){return new ii(this.c)}getLedgerStateDeltaForTransactionGroup(e){return new si(this.c,e)}getLedgerStateDelta(e){return new ci(this.c,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new li(this.c,e)}}class di extends ie{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:h.SAFE})}async delete(e,t){return(await this.c.delete({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:h.SAFE})}async post(e,t){return(await this.c.post({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:h.SAFE})}async versions(){return this.get("/versions")}async listWallets(){return this.get("/v1/wallets")}async createWallet(e,t,n=new Uint8Array,a="sqlite"){const r={wallet_name:e,wallet_driver_name:a,wallet_password:t,master_derivation_key:L(n)};return this.post("/v1/wallet",r)}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:T((await this.post("/v1/master-key/export",n)).master_derivation_key)}}async importKey(e,t){const n={wallet_handle_token:e,private_key:L(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:T((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:L(n.toByte())};return T((await this.post("/v1/transaction/sign",a)).signed_transaction)}async signTransactionWithSpecificPublicKey(e,t,n,a){const r=W(a),i={wallet_handle_token:e,wallet_password:t,transaction:L(n.toByte()),public_key:L(r)};return T((await this.post("/v1/transaction/sign",i)).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 r={wallet_handle_token:e,multisig_version:t,threshold:n,pks:a};return this.post("/v1/multisig/import",r)}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,r){const i=W(a),o={wallet_handle_token:e,transaction:L(n.toByte()),public_key:L(i),partial_multisig:r,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 ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"amount",valueSchema:new it,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new it,omitEmpty:!0},{key:"min-balance",valueSchema:new it,omitEmpty:!0},{key:"pending-rewards",valueSchema:new it,omitEmpty:!0},{key:"rewards",valueSchema:new it,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"status",valueSchema:new rt,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new it,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new it,omitEmpty:!0},{key:"total-box-bytes",valueSchema:new it,omitEmpty:!0},{key:"total-boxes",valueSchema:new it,omitEmpty:!0},{key:"total-created-apps",valueSchema:new it,omitEmpty:!0},{key:"total-created-assets",valueSchema:new it,omitEmpty:!0},{key:"apps-local-state",valueSchema:new vt(new ht(vi.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new vt(new it),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new vt(Ci.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new vt(new ht(Bi.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new vt(new rt),omitEmpty:!0},{key:"closed-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"created-apps",valueSchema:new vt(new ht(fi.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new vt(new ht(xi.encodingSchema)),omitEmpty:!0},{key:"created-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new vt(new at),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new vt(new it),omitEmpty:!0},{key:"last-proposed",valueSchema:new vt(new it),omitEmpty:!0},{key:"participation",valueSchema:new vt(gi.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new vt(new it),omitEmpty:!0},{key:"sig-type",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:r,rewards:i,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:l,totalBoxBytes:h,totalBoxes:d,totalCreatedApps:u,totalCreatedAssets:g,appsLocalState:m,appsTotalExtraPages:p,appsTotalSchema:y,assets:v,authAddr:b,closedAtRound:I,createdApps:S,createdAssets:A,createdAtRound:C,deleted:E,incentiveEligible:x,lastHeartbeat:k,lastProposed:B,participation:D,rewardBase:N,sigType:R}){this.address=e,this.amount=w(t),this.amountWithoutPendingRewards=w(n),this.minBalance=f(a),this.pendingRewards=w(r),this.rewards=w(i),this.round=w(o),this.status=s,this.totalAppsOptedIn=f(c),this.totalAssetsOptedIn=f(l),this.totalBoxBytes=f(h),this.totalBoxes=f(d),this.totalCreatedApps=f(u),this.totalCreatedAssets=f(g),this.appsLocalState=m,this.appsTotalExtraPages=void 0===p?void 0:f(p),this.appsTotalSchema=y,this.assets=v,this.authAddr="string"==typeof b?H.fromString(b):b,this.closedAtRound=void 0===I?void 0:w(I),this.createdApps=S,this.createdAssets=A,this.createdAtRound=void 0===C?void 0:w(C),this.deleted=E,this.incentiveEligible=x,this.lastHeartbeat=void 0===k?void 0:f(k),this.lastProposed=void 0===B?void 0:f(B),this.participation=D,this.rewardBase=void 0===N?void 0:w(N),this.sigType=R}getEncodingSchema(){return ui.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 ui({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=>vi.fromEncodingData(e))):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Ci.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map((e=>Bi.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=>fi.fromEncodingData(e))):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map((e=>xi.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")?gi.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type")})}}class gi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new st,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new it,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new it,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new it,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:r,stateProofKey:i}){this.selectionParticipationKey="string"==typeof e?T(e):e,this.voteFirstValid=w(t),this.voteKeyDilution=w(n),this.voteLastValid=w(a),this.voteParticipationKey="string"==typeof r?T(r):r,this.stateProofKey="string"==typeof i?T(i):i}getEncodingSchema(){return gi.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 gi({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 mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:ui.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,currentRound:t}){this.account=e,this.currentRound=w(t)}getEncodingSchema(){return mi.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 mi({account:ui.fromEncodingData(e.get("account")??new Map),currentRound:e.get("current-round")})}}class pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"delta",valueSchema:new ht(Xi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return pi.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 pi({address:e.get("address"),delta:(e.get("delta")??[]).map((e=>Xi.fromEncodingData(e)))})}}class yi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new ht(ui.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,currentRound:t,nextToken:n}){this.accounts=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return yi.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 yi({accounts:(e.get("accounts")??[]).map((e=>ui.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new it,omitEmpty:!0},{key:"params",valueSchema:Si.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"deleted-at-round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t,createdAtRound:n,deleted:a,deletedAtRound:r}){this.id=w(e),this.params=t,this.createdAtRound=void 0===n?void 0:w(n),this.deleted=a,this.deletedAtRound=void 0===r?void 0:w(r)}getEncodingSchema(){return fi.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 fi({id:e.get("id"),params:Si.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),deletedAtRound:e.get("deleted-at-round")})}}class vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new it,omitEmpty:!0},{key:"schema",valueSchema:Ci.encodingSchema,omitEmpty:!0},{key:"closed-out-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"key-value",valueSchema:new vt(new ht(io.encodingSchema)),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,closedOutAtRound:n,deleted:a,keyValue:r,optedInAtRound:i}){this.id=w(e),this.schema=t,this.closedOutAtRound=void 0===n?void 0:w(n),this.deleted=a,this.keyValue=r,this.optedInAtRound=void 0===i?void 0:w(i)}getEncodingSchema(){return vi.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 vi({id:e.get("id"),schema:Ci.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=>io.fromEncodingData(e))):void 0,optedInAtRound:e.get("opted-in-at-round")})}}class wi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"apps-local-states",valueSchema:new ht(vi.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({appsLocalStates:e,currentRound:t,nextToken:n}){this.appsLocalStates=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return wi.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 wi({appsLocalStates:(e.get("apps-local-states")??[]).map((e=>vi.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new ht(new st),omitEmpty:!0},{key:"txid",valueSchema:new rt,omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e,txid:t}){this.logs=e,this.txid=t}getEncodingSchema(){return bi.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 bi({logs:e.get("logs"),txid:e.get("txid")})}}class Ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new it,omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"log-data",valueSchema:new vt(new ht(bi.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,currentRound:t,logData:n,nextToken:a}){this.applicationId=w(e),this.currentRound=w(t),this.logData=n,this.nextToken=a}getEncodingSchema(){return Ii.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 Ii({applicationId:e.get("application-id"),currentRound:e.get("current-round"),logData:void 0!==e.get("log-data")?e.get("log-data").map((e=>bi.fromEncodingData(e))):void 0,nextToken:e.get("next-token")})}}class Si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),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 rt),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new vt(new it),omitEmpty:!0},{key:"global-state",valueSchema:new vt(new ht(io.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new vt(Ci.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new vt(Ci.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:r,globalStateSchema:i,localStateSchema:o}){this.approvalProgram="string"==typeof e?T(e):e,this.clearStateProgram="string"==typeof t?T(t):t,this.creator="string"==typeof n?H.fromString(n):n,this.extraProgramPages=void 0===a?void 0:f(a),this.globalState=r,this.globalStateSchema=i,this.localStateSchema=o}getEncodingSchema(){return Si.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]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new Si({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=>io.fromEncodingData(e))):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Ci.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Ci.fromEncodingData(e.get("local-state-schema")):void 0})}}class Ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"application",valueSchema:new vt(fi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,application:t}){this.currentRound=w(e),this.application=t}getEncodingSchema(){return Ai.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 Ai({currentRound:e.get("current-round"),application:void 0!==e.get("application")?fi.fromEncodingData(e.get("application")):void 0})}}class Ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new it,omitEmpty:!0},{key:"num-uint",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=f(e),this.numUint=f(t)}getEncodingSchema(){return Ci.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 Ci({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"applications",valueSchema:new ht(fi.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({applications:e,currentRound:t,nextToken:n}){this.applications=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return Ei.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 Ei({applications:(e.get("applications")??[]).map((e=>fi.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class xi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new it,omitEmpty:!0},{key:"params",valueSchema:Ni.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"destroyed-at-round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t,createdAtRound:n,deleted:a,destroyedAtRound:r}){this.index=w(e),this.params=t,this.createdAtRound=void 0===n?void 0:w(n),this.deleted=a,this.destroyedAtRound=void 0===r?void 0:w(r)}getEncodingSchema(){return xi.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 xi({index:e.get("index"),params:Ni.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),destroyedAtRound:e.get("destroyed-at-round")})}}class ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"balances",valueSchema:new ht(Ji.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({balances:e,currentRound:t,nextToken:n}){this.balances=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return ki.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 ki({balances:(e.get("balances")??[]).map((e=>Ji.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new it,omitEmpty:!0},{key:"asset-id",valueSchema:new it,omitEmpty:!0},{key:"is-frozen",valueSchema:new at,omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n,deleted:a,optedInAtRound:r,optedOutAtRound:i}){this.amount=w(e),this.assetId=w(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===r?void 0:w(r),this.optedOutAtRound=void 0===i?void 0:w(i)}getEncodingSchema(){return Bi.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 Bi({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 Di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new ht(Bi.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return Di.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 Di({assets:(e.get("assets")??[]).map((e=>Bi.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new rt,omitEmpty:!0},{key:"decimals",valueSchema:new it,omitEmpty:!0},{key:"total",valueSchema:new it,omitEmpty:!0},{key:"clawback",valueSchema:new vt(new rt),omitEmpty:!0},{key:"default-frozen",valueSchema:new vt(new at),omitEmpty:!0},{key:"freeze",valueSchema:new vt(new rt),omitEmpty:!0},{key:"manager",valueSchema:new vt(new rt),omitEmpty:!0},{key:"metadata-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"name",valueSchema:new vt(new rt),omitEmpty:!0},{key:"name-b64",valueSchema:new vt(new st),omitEmpty:!0},{key:"reserve",valueSchema:new vt(new rt),omitEmpty:!0},{key:"unit-name",valueSchema:new vt(new rt),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new vt(new st),omitEmpty:!0},{key:"url",valueSchema:new vt(new rt),omitEmpty:!0},{key:"url-b64",valueSchema:new vt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:r,freeze:i,manager:o,metadataHash:s,name:c,nameB64:l,reserve:h,unitName:d,unitNameB64:u,url:g,urlB64:m}){this.creator=e,this.decimals=f(t),this.total=w(n),this.clawback=a,this.defaultFrozen=r,this.freeze=i,this.manager=o,this.metadataHash="string"==typeof s?T(s):s,this.name=c,this.nameB64="string"==typeof l?T(l):l,this.reserve=h,this.unitName=d,this.unitNameB64="string"==typeof u?T(u):u,this.url=g,this.urlB64="string"==typeof m?T(m):m}getEncodingSchema(){return Ni.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 Ni({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 Ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"asset",valueSchema:xi.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({asset:e,currentRound:t}){this.asset=e,this.currentRound=w(t)}getEncodingSchema(){return Ri.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 Ri({asset:xi.fromEncodingData(e.get("asset")??new Map),currentRound:e.get("current-round")})}}class Mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new ht(xi.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return Mi.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 Mi({assets:(e.get("assets")??[]).map((e=>xi.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"genesis-hash",valueSchema:new st,omitEmpty:!0},{key:"genesis-id",valueSchema:new rt,omitEmpty:!0},{key:"previous-block-hash",valueSchema:new st,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"seed",valueSchema:new st,omitEmpty:!0},{key:"timestamp",valueSchema:new it,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 it),omitEmpty:!0},{key:"fees-collected",valueSchema:new vt(new it),omitEmpty:!0},{key:"participation-updates",valueSchema:new vt(Qi.encodingSchema),omitEmpty:!0},{key:"proposer",valueSchema:new vt(new rt),omitEmpty:!0},{key:"proposer-payout",valueSchema:new vt(new it),omitEmpty:!0},{key:"rewards",valueSchema:new vt(Vi.encodingSchema),omitEmpty:!0},{key:"state-proof-tracking",valueSchema:new vt(new ht(no.encodingSchema)),omitEmpty:!0},{key:"transactions",valueSchema:new vt(new ht(so.encodingSchema)),omitEmpty:!0},{key:"txn-counter",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-state",valueSchema:new vt(Wi.encodingSchema),omitEmpty:!0},{key:"upgrade-vote",valueSchema:new vt(Gi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({genesisHash:e,genesisId:t,previousBlockHash:n,round:a,seed:r,timestamp:i,transactionsRoot:o,transactionsRootSha256:s,bonus:c,feesCollected:l,participationUpdates:h,proposer:d,proposerPayout:u,rewards:g,stateProofTracking:m,transactions:p,txnCounter:y,upgradeState:v,upgradeVote:b}){this.genesisHash="string"==typeof e?T(e):e,this.genesisId=t,this.previousBlockHash="string"==typeof n?T(n):n,this.round=w(a),this.seed="string"==typeof r?T(r):r,this.timestamp=f(i),this.transactionsRoot="string"==typeof o?T(o):o,this.transactionsRootSha256="string"==typeof s?T(s):s,this.bonus=void 0===c?void 0:f(c),this.feesCollected=void 0===l?void 0:f(l),this.participationUpdates=h,this.proposer="string"==typeof d?H.fromString(d):d,this.proposerPayout=void 0===u?void 0:f(u),this.rewards=g,this.stateProofTracking=m,this.transactions=p,this.txnCounter=void 0===y?void 0:f(y),this.upgradeState=v,this.upgradeVote=b}getEncodingSchema(){return Ti.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],["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],["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 Ti({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")?Qi.fromEncodingData(e.get("participation-updates")):void 0,proposer:e.get("proposer"),proposerPayout:e.get("proposer-payout"),rewards:void 0!==e.get("rewards")?Vi.fromEncodingData(e.get("rewards")):void 0,stateProofTracking:void 0!==e.get("state-proof-tracking")?e.get("state-proof-tracking").map((e=>no.fromEncodingData(e))):void 0,transactions:void 0!==e.get("transactions")?e.get("transactions").map((e=>so.fromEncodingData(e))):void 0,txnCounter:e.get("txn-counter"),upgradeState:void 0!==e.get("upgrade-state")?Wi.fromEncodingData(e.get("upgrade-state")):void 0,upgradeVote:void 0!==e.get("upgrade-vote")?Gi.fromEncodingData(e.get("upgrade-vote")):void 0})}}class Li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"blocks",valueSchema:new ht(Ti.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocks:e,currentRound:t,nextToken:n}){this.blocks=e,this.currentRound=w(t),this.nextToken=n}getEncodingSchema(){return Li.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 Li({blocks:(e.get("blocks")??[]).map((e=>Ti.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"fee-sink",valueSchema:new rt,omitEmpty:!0},{key:"rewards-calculation-round",valueSchema:new it,omitEmpty:!0},{key:"rewards-level",valueSchema:new it,omitEmpty:!0},{key:"rewards-pool",valueSchema:new rt,omitEmpty:!0},{key:"rewards-rate",valueSchema:new it,omitEmpty:!0},{key:"rewards-residue",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:n,rewardsPool:a,rewardsRate:r,rewardsResidue:i}){this.feeSink=e,this.rewardsCalculationRound=w(t),this.rewardsLevel=w(n),this.rewardsPool=a,this.rewardsRate=w(r),this.rewardsResidue=w(i)}getEncodingSchema(){return Vi.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 Vi({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 Wi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"current-protocol",valueSchema:new rt,omitEmpty:!0},{key:"next-protocol",valueSchema:new vt(new rt),omitEmpty:!0},{key:"next-protocol-approvals",valueSchema:new vt(new it),omitEmpty:!0},{key:"next-protocol-switch-on",valueSchema:new vt(new it),omitEmpty:!0},{key:"next-protocol-vote-before",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:n,nextProtocolSwitchOn:a,nextProtocolVoteBefore:r}){this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=void 0===n?void 0:f(n),this.nextProtocolSwitchOn=void 0===a?void 0:w(a),this.nextProtocolVoteBefore=void 0===r?void 0:w(r)}getEncodingSchema(){return Wi.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 Wi({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 Gi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"upgrade-approve",valueSchema:new vt(new at),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new vt(new it),omitEmpty:!0},{key:"upgrade-propose",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:n}){this.upgradeApprove=e,this.upgradeDelay=void 0===t?void 0:w(t),this.upgradePropose=n}getEncodingSchema(){return Gi.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 Gi({upgradeApprove:e.get("upgrade-approve"),upgradeDelay:e.get("upgrade-delay"),upgradePropose:e.get("upgrade-propose")})}}class Fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new st,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"value",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?T(e):e,this.round=w(t),this.value="string"==typeof n?T(n):n}getEncodingSchema(){return Fi.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 Fi({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class Yi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e}){this.name="string"==typeof e?T(e):e}getEncodingSchema(){return Yi.encodingSchema}toEncodingData(){return new Map([["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new Yi({name:e.get("name")})}}class Zi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new it,omitEmpty:!0},{key:"boxes",valueSchema:new ht(Yi.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,boxes:t,nextToken:n}){this.applicationId=w(e),this.boxes=t,this.nextToken=n}getEncodingSchema(){return Zi.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 Zi({applicationId:e.get("application-id"),boxes:(e.get("boxes")??[]).map((e=>Yi.fromEncodingData(e))),nextToken:e.get("next-token")})}}class zi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new rt,omitEmpty:!0},{key:"data",valueSchema:new vt(Gn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return zi.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 zi({message:e.get("message"),data:void 0!==e.get("data")?Gn.fromEncodingData(e.get("data")):void 0})}}class Pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new it,omitEmpty:!0},{key:"bytes",valueSchema:new vt(new rt),omitEmpty:!0},{key:"uint",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=f(e),this.bytes=t,this.uint=void 0===n?void 0:w(n)}getEncodingSchema(){return Pi.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 Pi({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class Xi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new rt,omitEmpty:!0},{key:"value",valueSchema:Pi.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return Xi.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 Xi({key:e.get("key"),value:Pi.fromEncodingData(e.get("value")??new Map)})}}class Hi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"hash-type",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashType:e}){this.hashType=void 0===e?void 0:f(e)}getEncodingSchema(){return Hi.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 Hi({hashType:e.get("hash-type")})}}class Ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),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:r}){this.hbPk="string"==typeof e?T(e):e,this.hbPk1sig="string"==typeof t?T(t):t,this.hbPk2="string"==typeof n?T(n):n,this.hbPk2sig="string"==typeof a?T(a):a,this.hbSig="string"==typeof r?T(r):r}getEncodingSchema(){return Ki.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 Ki({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 ji{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"db-available",valueSchema:new at,omitEmpty:!0},{key:"is-migrating",valueSchema:new at,omitEmpty:!0},{key:"message",valueSchema:new rt,omitEmpty:!0},{key:"round",valueSchema:new it,omitEmpty:!0},{key:"version",valueSchema:new rt,omitEmpty:!0},{key:"data",valueSchema:new vt(Gn.encodingSchema),omitEmpty:!0},{key:"errors",valueSchema:new vt(new ht(new rt)),omitEmpty:!0})),this.encodingSchemaValue}constructor({dbAvailable:e,isMigrating:t,message:n,round:a,version:r,data:i,errors:o}){this.dbAvailable=e,this.isMigrating=t,this.message=n,this.round=w(a),this.version=r,this.data=i,this.errors=o}getEncodingSchema(){return ji.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 ji({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")?Gn.fromEncodingData(e.get("data")):void 0,errors:e.get("errors")})}}class Oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"block-headers-commitment",valueSchema:new vt(new st),omitEmpty:!0},{key:"first-attested-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"latest-attested-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"ln-proven-weight",valueSchema:new vt(new it),omitEmpty:!0},{key:"voters-commitment",valueSchema:new vt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:n,lnProvenWeight:a,votersCommitment:r}){this.blockHeadersCommitment="string"==typeof e?T(e):e,this.firstAttestedRound=void 0===t?void 0:w(t),this.latestAttestedRound=void 0===n?void 0:w(n),this.lnProvenWeight=void 0===a?void 0:w(a),this.votersCommitment="string"==typeof r?T(r):r}getEncodingSchema(){return Oi.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 Oi({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 Ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"hash-factory",valueSchema:new vt(Hi.encodingSchema),omitEmpty:!0},{key:"path",valueSchema:new vt(new ht(new st)),omitEmpty:!0},{key:"tree-depth",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashFactory:e,path:t,treeDepth:n}){this.hashFactory=e,this.path=t,this.treeDepth=void 0===n?void 0:f(n)}getEncodingSchema(){return Ui.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 Ui({hashFactory:void 0!==e.get("hash-factory")?Hi.fromEncodingData(e.get("hash-factory")):void 0,path:e.get("path"),treeDepth:e.get("tree-depth")})}}class Ji{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"amount",valueSchema:new it,omitEmpty:!0},{key:"is-frozen",valueSchema:new at,omitEmpty:!0},{key:"deleted",valueSchema:new vt(new at),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,isFrozen:n,deleted:a,optedInAtRound:r,optedOutAtRound:i}){this.address=e,this.amount=w(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===r?void 0:w(r),this.optedOutAtRound=void 0===i?void 0:w(i)}getEncodingSchema(){return Ji.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 Ji({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 Qi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"absent-participation-accounts",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"expired-participation-accounts",valueSchema:new vt(new ht(new rt)),omitEmpty:!0})),this.encodingSchemaValue}constructor({absentParticipationAccounts:e,expiredParticipationAccounts:t}){this.absentParticipationAccounts=e,this.expiredParticipationAccounts=t}getEncodingSchema(){return Qi.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 Qi({absentParticipationAccounts:e.get("absent-participation-accounts"),expiredParticipationAccounts:e.get("expired-participation-accounts")})}}class $i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"part-proofs",valueSchema:new vt(Ui.encodingSchema),omitEmpty:!0},{key:"positions-to-reveal",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"reveals",valueSchema:new vt(new ht(qi.encodingSchema)),omitEmpty:!0},{key:"salt-version",valueSchema:new vt(new it),omitEmpty:!0},{key:"sig-commit",valueSchema:new vt(new st),omitEmpty:!0},{key:"sig-proofs",valueSchema:new vt(Ui.encodingSchema),omitEmpty:!0},{key:"signed-weight",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({partProofs:e,positionsToReveal:t,reveals:n,saltVersion:a,sigCommit:r,sigProofs:i,signedWeight:o}){this.partProofs=e,this.positionsToReveal=void 0===t?void 0:t.map(w),this.reveals=n,this.saltVersion=void 0===a?void 0:f(a),this.sigCommit="string"==typeof r?T(r):r,this.sigProofs=i,this.signedWeight=void 0===o?void 0:w(o)}getEncodingSchema(){return $i.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 $i({partProofs:void 0!==e.get("part-proofs")?Ui.fromEncodingData(e.get("part-proofs")):void 0,positionsToReveal:e.get("positions-to-reveal"),reveals:void 0!==e.get("reveals")?e.get("reveals").map((e=>qi.fromEncodingData(e))):void 0,saltVersion:e.get("salt-version"),sigCommit:e.get("sig-commit"),sigProofs:void 0!==e.get("sig-proofs")?Ui.fromEncodingData(e.get("sig-proofs")):void 0,signedWeight:e.get("signed-weight")})}}class _i{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"verifier",valueSchema:new vt(ao.encodingSchema),omitEmpty:!0},{key:"weight",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({verifier:e,weight:t}){this.verifier=e,this.weight=void 0===t?void 0:w(t)}getEncodingSchema(){return _i.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 _i({verifier:void 0!==e.get("verifier")?ao.fromEncodingData(e.get("verifier")):void 0,weight:e.get("weight")})}}class qi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"participant",valueSchema:new vt(_i.encodingSchema),omitEmpty:!0},{key:"position",valueSchema:new vt(new it),omitEmpty:!0},{key:"sig-slot",valueSchema:new vt(eo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({participant:e,position:t,sigSlot:n}){this.participant=e,this.position=void 0===t?void 0:w(t),this.sigSlot=n}getEncodingSchema(){return qi.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 qi({participant:void 0!==e.get("participant")?_i.fromEncodingData(e.get("participant")):void 0,position:e.get("position"),sigSlot:void 0!==e.get("sig-slot")?eo.fromEncodingData(e.get("sig-slot")):void 0})}}class eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"lower-sig-weight",valueSchema:new vt(new it),omitEmpty:!0},{key:"signature",valueSchema:new vt(to.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lowerSigWeight:e,signature:t}){this.lowerSigWeight=void 0===e?void 0:w(e),this.signature=t}getEncodingSchema(){return eo.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 eo({lowerSigWeight:e.get("lower-sig-weight"),signature:void 0!==e.get("signature")?to.fromEncodingData(e.get("signature")):void 0})}}class to{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"falcon-signature",valueSchema:new vt(new st),omitEmpty:!0},{key:"merkle-array-index",valueSchema:new vt(new it),omitEmpty:!0},{key:"proof",valueSchema:new vt(Ui.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?T(e):e,this.merkleArrayIndex=void 0===t?void 0:f(t),this.proof=n,this.verifyingKey="string"==typeof a?T(a):a}getEncodingSchema(){return to.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 to({falconSignature:e.get("falcon-signature"),merkleArrayIndex:e.get("merkle-array-index"),proof:void 0!==e.get("proof")?Ui.fromEncodingData(e.get("proof")):void 0,verifyingKey:e.get("verifying-key")})}}class no{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"next-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"online-total-weight",valueSchema:new vt(new it),omitEmpty:!0},{key:"type",valueSchema:new vt(new it),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:w(e),this.onlineTotalWeight=void 0===t?void 0:w(t),this.type=void 0===n?void 0:f(n),this.votersCommitment="string"==typeof a?T(a):a}getEncodingSchema(){return no.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 no({nextRound:e.get("next-round"),onlineTotalWeight:e.get("online-total-weight"),type:e.get("type"),votersCommitment:e.get("voters-commitment")})}}class ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"commitment",valueSchema:new vt(new st),omitEmpty:!0},{key:"key-lifetime",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({commitment:e,keyLifetime:t}){this.commitment="string"==typeof e?T(e):e,this.keyLifetime=void 0===t?void 0:w(t)}getEncodingSchema(){return ao.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 ao({commitment:e.get("commitment"),keyLifetime:e.get("key-lifetime")})}}class ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new it,omitEmpty:!0},{key:"num-uint",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=f(e),this.numUint=f(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 io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new st,omitEmpty:!0},{key:"value",valueSchema:oo.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?T(e):e,this.value=t}getEncodingSchema(){return io.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 io({key:e.get("key"),value:oo.fromEncodingData(e.get("value")??new Map)})}}class oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new st,omitEmpty:!0},{key:"type",valueSchema:new it,omitEmpty:!0},{key:"uint",valueSchema:new it,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?T(e):e,this.type=f(t),this.uint=w(n)}getEncodingSchema(){return oo.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 oo({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class so{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"fee",valueSchema:new it,omitEmpty:!0},{key:"first-valid",valueSchema:new it,omitEmpty:!0},{key:"last-valid",valueSchema:new it,omitEmpty:!0},{key:"sender",valueSchema:new rt,omitEmpty:!0},{key:"application-transaction",valueSchema:new vt(co.encodingSchema),omitEmpty:!0},{key:"asset-config-transaction",valueSchema:new vt(lo.encodingSchema),omitEmpty:!0},{key:"asset-freeze-transaction",valueSchema:new vt(ho.encodingSchema),omitEmpty:!0},{key:"asset-transfer-transaction",valueSchema:new vt(uo.encodingSchema),omitEmpty:!0},{key:"auth-addr",valueSchema:new vt(new rt),omitEmpty:!0},{key:"close-rewards",valueSchema:new vt(new it),omitEmpty:!0},{key:"closing-amount",valueSchema:new vt(new it),omitEmpty:!0},{key:"confirmed-round",valueSchema:new vt(new it),omitEmpty:!0},{key:"created-application-index",valueSchema:new vt(new it),omitEmpty:!0},{key:"created-asset-index",valueSchema:new vt(new it),omitEmpty:!0},{key:"genesis-hash",valueSchema:new vt(new st),omitEmpty:!0},{key:"genesis-id",valueSchema:new vt(new rt),omitEmpty:!0},{key:"global-state-delta",valueSchema:new vt(new ht(Xi.encodingSchema)),omitEmpty:!0},{key:"group",valueSchema:new vt(new st),omitEmpty:!0},{key:"heartbeat-transaction",valueSchema:new vt(go.encodingSchema),omitEmpty:!0},{key:"id",valueSchema:new vt(new rt),omitEmpty:!0},{key:"inner-txns",valueSchema:new vt(new ht(so.encodingSchema)),omitEmpty:!0},{key:"intra-round-offset",valueSchema:new vt(new it),omitEmpty:!0},{key:"keyreg-transaction",valueSchema:new vt(mo.encodingSchema),omitEmpty:!0},{key:"lease",valueSchema:new vt(new st),omitEmpty:!0},{key:"local-state-delta",valueSchema:new vt(new ht(pi.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new vt(new ht(new st)),omitEmpty:!0},{key:"note",valueSchema:new vt(new st),omitEmpty:!0},{key:"payment-transaction",valueSchema:new vt(po.encodingSchema),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new vt(new it),omitEmpty:!0},{key:"rekey-to",valueSchema:new vt(new rt),omitEmpty:!0},{key:"round-time",valueSchema:new vt(new it),omitEmpty:!0},{key:"sender-rewards",valueSchema:new vt(new it),omitEmpty:!0},{key:"signature",valueSchema:new vt(fo.encodingSchema),omitEmpty:!0},{key:"state-proof-transaction",valueSchema:new vt(Io.encodingSchema),omitEmpty:!0},{key:"tx-type",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({fee:e,firstValid:t,lastValid:n,sender:a,applicationTransaction:r,assetConfigTransaction:i,assetFreezeTransaction:o,assetTransferTransaction:s,authAddr:c,closeRewards:l,closingAmount:h,confirmedRound:d,createdApplicationIndex:u,createdAssetIndex:g,genesisHash:m,genesisId:p,globalStateDelta:y,group:v,heartbeatTransaction:b,id:I,innerTxns:S,intraRoundOffset:A,keyregTransaction:C,lease:E,localStateDelta:x,logs:k,note:B,paymentTransaction:D,receiverRewards:N,rekeyTo:R,roundTime:M,senderRewards:L,signature:V,stateProofTransaction:W,txType:G}){this.fee=w(e),this.firstValid=w(t),this.lastValid=w(n),this.sender=a,this.applicationTransaction=r,this.assetConfigTransaction=i,this.assetFreezeTransaction=o,this.assetTransferTransaction=s,this.authAddr="string"==typeof c?H.fromString(c):c,this.closeRewards=void 0===l?void 0:w(l),this.closingAmount=void 0===h?void 0:w(h),this.confirmedRound=void 0===d?void 0:w(d),this.createdApplicationIndex=void 0===u?void 0:w(u),this.createdAssetIndex=void 0===g?void 0:w(g),this.genesisHash="string"==typeof m?T(m):m,this.genesisId=p,this.globalStateDelta=y,this.group="string"==typeof v?T(v):v,this.heartbeatTransaction=b,this.id=I,this.innerTxns=S,this.intraRoundOffset=void 0===A?void 0:f(A),this.keyregTransaction=C,this.lease="string"==typeof E?T(E):E,this.localStateDelta=x,this.logs=k,this.note="string"==typeof B?T(B):B,this.paymentTransaction=D,this.receiverRewards=void 0===N?void 0:w(N),this.rekeyTo="string"==typeof R?H.fromString(R):R,this.roundTime=void 0===M?void 0:f(M),this.senderRewards=void 0===L?void 0:w(L),this.signature=V,this.stateProofTransaction=W,this.txType=G}getEncodingSchema(){return so.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 so({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")?lo.fromEncodingData(e.get("asset-config-transaction")):void 0,assetFreezeTransaction:void 0!==e.get("asset-freeze-transaction")?ho.fromEncodingData(e.get("asset-freeze-transaction")):void 0,assetTransferTransaction:void 0!==e.get("asset-transfer-transaction")?uo.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=>Xi.fromEncodingData(e))):void 0,group:e.get("group"),heartbeatTransaction:void 0!==e.get("heartbeat-transaction")?go.fromEncodingData(e.get("heartbeat-transaction")):void 0,id:e.get("id"),innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map((e=>so.fromEncodingData(e))):void 0,intraRoundOffset:e.get("intra-round-offset"),keyregTransaction:void 0!==e.get("keyreg-transaction")?mo.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=>pi.fromEncodingData(e))):void 0,logs:e.get("logs"),note:e.get("note"),paymentTransaction:void 0!==e.get("payment-transaction")?po.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")?fo.fromEncodingData(e.get("signature")):void 0,stateProofTransaction:void 0!==e.get("state-proof-transaction")?Io.fromEncodingData(e.get("state-proof-transaction")):void 0,txType:e.get("tx-type")})}}class co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new it,omitEmpty:!0},{key:"accounts",valueSchema:new vt(new ht(new rt)),omitEmpty:!0},{key:"application-args",valueSchema:new vt(new ht(new st)),omitEmpty:!0},{key:"approval-program",valueSchema:new vt(new st),omitEmpty:!0},{key:"clear-state-program",valueSchema:new vt(new st),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new vt(new it),omitEmpty:!0},{key:"foreign-apps",valueSchema:new vt(new ht(new it)),omitEmpty:!0},{key:"foreign-assets",valueSchema:new vt(new ht(new it)),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 rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,accounts:t,applicationArgs:n,approvalProgram:a,clearStateProgram:r,extraProgramPages:i,foreignApps:o,foreignAssets:s,globalStateSchema:c,localStateSchema:l,onCompletion:h}){this.applicationId=w(e),this.accounts=void 0!==t?t.map((e=>"string"==typeof e?H.fromString(e):e)):void 0,this.applicationArgs=n,this.approvalProgram="string"==typeof a?T(a):a,this.clearStateProgram="string"==typeof r?T(r):r,this.extraProgramPages=void 0===i?void 0:f(i),this.foreignApps=void 0===o?void 0:o.map(w),this.foreignAssets=void 0===s?void 0:s.map(w),this.globalStateSchema=c,this.localStateSchema=l,this.onCompletion=h}getEncodingSchema(){return co.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["accounts",void 0!==this.accounts?this.accounts.map((e=>e.toString())):void 0],["application-args",this.applicationArgs],["approval-program",this.approvalProgram],["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]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionApplication: ${e}`);return new co({applicationId:e.get("application-id"),accounts:e.get("accounts"),applicationArgs:e.get("application-args"),approvalProgram:e.get("approval-program"),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")})}}class lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"asset-id",valueSchema:new vt(new it),omitEmpty:!0},{key:"params",valueSchema:new vt(Ni.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetId:e,params:t}){this.assetId=void 0===e?void 0:w(e),this.params=t}getEncodingSchema(){return lo.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 lo({assetId:e.get("asset-id"),params:void 0!==e.get("params")?Ni.fromEncodingData(e.get("params")):void 0})}}class ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new rt,omitEmpty:!0},{key:"asset-id",valueSchema:new it,omitEmpty:!0},{key:"new-freeze-status",valueSchema:new at,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,assetId:t,newFreezeStatus:n}){this.address=e,this.assetId=w(t),this.newFreezeStatus=n}getEncodingSchema(){return ho.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 ho({address:e.get("address"),assetId:e.get("asset-id"),newFreezeStatus:e.get("new-freeze-status")})}}class uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new it,omitEmpty:!0},{key:"asset-id",valueSchema:new it,omitEmpty:!0},{key:"receiver",valueSchema:new rt,omitEmpty:!0},{key:"close-amount",valueSchema:new vt(new it),omitEmpty:!0},{key:"close-to",valueSchema:new vt(new rt),omitEmpty:!0},{key:"sender",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,receiver:n,closeAmount:a,closeTo:r,sender:i}){this.amount=w(e),this.assetId=w(t),this.receiver=n,this.closeAmount=void 0===a?void 0:w(a),this.closeTo=r,this.sender=i}getEncodingSchema(){return uo.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 uo({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 go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"hb-address",valueSchema:new rt,omitEmpty:!0},{key:"hb-key-dilution",valueSchema:new it,omitEmpty:!0},{key:"hb-proof",valueSchema:Ki.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:r}){this.hbAddress=e,this.hbKeyDilution=w(t),this.hbProof=n,this.hbSeed="string"==typeof a?T(a):a,this.hbVoteId="string"==typeof r?T(r):r}getEncodingSchema(){return go.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 go({hbAddress:e.get("hb-address"),hbKeyDilution:e.get("hb-key-dilution"),hbProof:Ki.fromEncodingData(e.get("hb-proof")??new Map),hbSeed:e.get("hb-seed"),hbVoteId:e.get("hb-vote-id")})}}class mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"non-participation",valueSchema:new vt(new at),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 it),omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new vt(new it),omitEmpty:!0},{key:"vote-last-valid",valueSchema:new vt(new it),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:r,voteLastValid:i,voteParticipationKey:o}){this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?T(t):t,this.stateProofKey="string"==typeof n?T(n):n,this.voteFirstValid=void 0===a?void 0:w(a),this.voteKeyDilution=void 0===r?void 0:w(r),this.voteLastValid=void 0===i?void 0:w(i),this.voteParticipationKey="string"==typeof o?T(o):o}getEncodingSchema(){return mo.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 mo({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 po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new it,omitEmpty:!0},{key:"receiver",valueSchema:new rt,omitEmpty:!0},{key:"close-amount",valueSchema:new vt(new it),omitEmpty:!0},{key:"close-remainder-to",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,receiver:t,closeAmount:n,closeRemainderTo:a}){this.amount=w(e),this.receiver=t,this.closeAmount=void 0===n?void 0:w(n),this.closeRemainderTo=a}getEncodingSchema(){return po.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 po({amount:e.get("amount"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeRemainderTo:e.get("close-remainder-to")})}}class yo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"transaction",valueSchema:so.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transaction:t}){this.currentRound=w(e),this.transaction=t}getEncodingSchema(){return yo.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 yo({currentRound:e.get("current-round"),transaction:so.fromEncodingData(e.get("transaction")??new Map)})}}class fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"logicsig",valueSchema:new vt(vo.encodingSchema),omitEmpty:!0},{key:"multisig",valueSchema:new vt(wo.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?T(n):n}getEncodingSchema(){return fo.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 fo({logicsig:void 0!==e.get("logicsig")?vo.fromEncodingData(e.get("logicsig")):void 0,multisig:void 0!==e.get("multisig")?wo.fromEncodingData(e.get("multisig")):void 0,sig:e.get("sig")})}}class vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"logic",valueSchema:new st,omitEmpty:!0},{key:"args",valueSchema:new vt(new ht(new st)),omitEmpty:!0},{key:"multisig-signature",valueSchema:new vt(wo.encodingSchema),omitEmpty:!0},{key:"signature",valueSchema:new vt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({logic:e,args:t,multisigSignature:n,signature:a}){this.logic="string"==typeof e?T(e):e,this.args=t,this.multisigSignature=n,this.signature="string"==typeof a?T(a):a}getEncodingSchema(){return vo.encodingSchema}toEncodingData(){return new Map([["logic",this.logic],["args",this.args],["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 vo({logic:e.get("logic"),args:e.get("args"),multisigSignature:void 0!==e.get("multisig-signature")?wo.fromEncodingData(e.get("multisig-signature")):void 0,signature:e.get("signature")})}}class wo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"subsignature",valueSchema:new vt(new ht(bo.encodingSchema)),omitEmpty:!0},{key:"threshold",valueSchema:new vt(new it),omitEmpty:!0},{key:"version",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({subsignature:e,threshold:t,version:n}){this.subsignature=e,this.threshold=void 0===t?void 0:f(t),this.version=void 0===n?void 0:f(n)}getEncodingSchema(){return wo.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 wo({subsignature:void 0!==e.get("subsignature")?e.get("subsignature").map((e=>bo.fromEncodingData(e))):void 0,threshold:e.get("threshold"),version:e.get("version")})}}class bo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),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?T(e):e,this.signature="string"==typeof t?T(t):t}getEncodingSchema(){return bo.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 bo({publicKey:e.get("public-key"),signature:e.get("signature")})}}class Io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new vt(Oi.encodingSchema),omitEmpty:!0},{key:"state-proof",valueSchema:new vt($i.encodingSchema),omitEmpty:!0},{key:"state-proof-type",valueSchema:new vt(new it),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateProof:t,stateProofType:n}){this.message=e,this.stateProof=t,this.stateProofType=void 0===n?void 0:f(n)}getEncodingSchema(){return Io.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 Io({message:void 0!==e.get("message")?Oi.fromEncodingData(e.get("message")):void 0,stateProof:void 0!==e.get("state-proof")?$i.fromEncodingData(e.get("state-proof")):void 0,stateProofType:e.get("state-proof-type")})}}class So{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ut([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new it,omitEmpty:!0},{key:"transactions",valueSchema:new ht(so.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new vt(new rt),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transactions:t,nextToken:n}){this.currentRound=w(e),this.transactions=t,this.nextToken=n}getEncodingSchema(){return So.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 So({currentRound:e.get("current-round"),transactions:(e.get("transactions")??[]).map((e=>so.fromEncodingData(e))),nextToken:e.get("next-token")})}}class Ao extends Cr{path(){return"/health"}prepare(e){return tt(e.getJSONText(),ji)}}class Co extends Cr{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 tt(e.getJSONText(),ki)}}function Eo(e){return"string"==typeof e?e:L(e)}class xo extends Cr{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=Eo(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 tt(e.getJSONText(),So)}}class ko extends Cr{constructor(e,t){super(e),this.index=BigInt(t)}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=Eo(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 tt(e.getJSONText(),So)}}class Bo extends Cr{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 tt(e.getJSONText(),Ti)}}class Do extends Cr{constructor(e,t){super(e),this.txID=t}path(){return`/v2/transactions/${this.txID}`}prepare(e){return tt(e.getJSONText(),yo)}}class No extends Cr{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 tt(e.getJSONText(),mi)}}class Ro extends Cr{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 tt(e.getJSONText(),Di)}}class Mo extends Cr{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 tt(e.getJSONText(),Mi)}}class To extends Cr{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 tt(e.getJSONText(),wi)}}class Lo extends Cr{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 tt(e.getJSONText(),Ei)}}class Vo extends Cr{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 tt(e.getJSONText(),Ri)}}class Wo extends Cr{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 tt(e.getJSONText(),Ai)}}class Go extends Cr{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 tt(e.getJSONText(),Ii)}}class Fo extends Cr{constructor(e,t,n){super(e),this.index=BigInt(t);const a=L(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return tt(e.getJSONText(),Fi)}}class Yo extends Cr{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}prepare(e){return tt(e.getJSONText(),yi)}}class Zo extends Cr{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 tt(e.getJSONText(),Li)}}class zo extends Cr{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=Eo(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}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 tt(e.getJSONText(),So)}}class Po extends Cr{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 tt(e.getJSONText(),Mi)}}class Xo extends Cr{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 tt(e.getJSONText(),Ei)}}class Ho extends Cr{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 tt(e.getJSONText(),Zi)}}class Ko extends ie{constructor(e,t="http://127.0.0.1",n=8080,a={}){super("X-Indexer-API-Token",e,t,n,a)}makeHealthCheck(){return new Ao(this.c)}lookupAssetBalances(e){return new Co(this.c,e)}lookupAssetTransactions(e){return new ko(this.c,e)}lookupAccountTransactions(e){return new xo(this.c,e)}lookupBlock(e){return new Bo(this.c,e)}lookupTransactionByID(e){return new Do(this.c,e)}lookupAccountByID(e){return new No(this.c,e)}lookupAccountAssets(e){return new Ro(this.c,e)}lookupAccountCreatedAssets(e){return new Mo(this.c,e)}lookupAccountAppLocalStates(e){return new To(this.c,e)}lookupAccountCreatedApplications(e){return new Lo(this.c,e)}lookupAssetByID(e){return new Vo(this.c,e)}lookupApplications(e){return new Wo(this.c,e)}lookupApplicationLogs(e){return new Go(this.c,e)}searchAccounts(){return new Yo(this.c)}searchForBlockHeaders(){return new Zo(this.c)}searchForTransactions(){return new zo(this.c)}searchForAssets(){return new Po(this.c)}searchForApplications(){return new Xo(this.c)}searchForApplicationBoxes(e){return new Ho(this.c,e)}lookupApplicationBoxByIDandName(e,t){return new Fo(this.c,e,t)}}async function jo(e,t,n){const a=await e.status().do();if(void 0===a)throw new Error("Unable to get node status");const r=a.lastRound+BigInt(1),i=r+BigInt(n);let o=r;for(;o<i;){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 Oo(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 Uo(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 Jo(){const e=S((t=s.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"),s.randomBytes(t)));var t;return{addr:new H(e.publicKey),sk:e.secretKey}}const Qo=["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"],$o="failed to decode mnemonic",_o="the mnemonic contains a word that is not in the wordlist";function qo(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 es(e){return e.map((e=>Qo[e]))}function ts(e){return es(qo(I(e)))[0]}function ns(e){if(e.length!==D)throw new RangeError(`Seed length must be ${D}`);const t=es(qo(e)),n=ts(e);return`${t.join(" ")} ${n}`}function as(e){const t=e.split(" "),n=t.slice(0,24);for(const e of n)if(-1===Qo.indexOf(e))throw new Error(_o);const a=t[t.length-1];let r=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=>Qo.indexOf(e))));if(33!==r.length)throw new Error($o);if(0!==r[r.length-1])throw new Error($o);if(r=r.slice(0,r.length-1),ts(r)===a)return r;throw new Error($o)}function rs(e){const t=S(as(e));return{addr:new H(t.publicKey),sk:t.secretKey}}function is(e){return ns(e.slice(0,D))}function os(e){return as(e)}function ss(e){return ns(e)}const cs=16,ls=(new TextEncoder).encode("TG");function hs(e){const t=[];for(const n of e)t.push(n.rawTxID());const n=I(function(e){if(e.length>cs)throw new Error(`${e.length} transactions grouped together but max group size is ${cs}`);if(0===e.length)throw new Error("Cannot compute group ID of zero transactions");const t=Ze({txlist:e});return p(ls,t)}(t));return Uint8Array.from(n)}function ds(e){const t=hs(e);for(const n of e)n.group=t;return e}function us(e,t){let n,a;return t instanceof pn?(n=t.lsig,a=t.address()):(n=t,a=n.sig?new H(e.sender.publicKey):n.msig?tn({version:n.msig.v,threshold:n.msig.thr,pks:n.msig.subsig.map((e=>e.pk))}):n.address()),function(e,t,n){if(!t.verify(n.publicKey))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");let a;x(n.publicKey,e.sender.publicKey)||(a=n);const r=new In({lsig:t,txn:e,sgnr:a});return{txID:e.txID(),blob:et(r)}}(e,n,a)}function gs(e,t){return us(e,t)}const ms="Not enough multisig transactions to merge. Need at least two",ps="Cannot merge txs. txIDs differ",ys="Cannot merge txs. Auth addrs differ",fs="Cannot merge txs. Multisig preimages differ",vs="Cannot merge txs. subsigs are mismatched.",ws="Cannot add multisig signature. Signature is not of the correct length.",bs="Key does not exist";function Is(e,{version:t,threshold:n,addrs:a}){const r=en(a),i={v:t,thr:n,subsig:r.map((e=>({pk:e})))},o=tn({version:t,threshold:n,pks:r});let s;return e.sender.equals(o)||(s=o),et(new In({txn:e,msig:i,sgnr:s}))}function Ss(e,{rawSig:t,myPk:n},{version:a,threshold:r,pks:i}){const o=qe(Is(e,{version:a,threshold:r,addrs:i.map((e=>new H(e)))}),In);let s=!1;if(o.msig.subsig.forEach(((e,a)=>{x(e.pk,n)&&(s=!0,o.msig.subsig[a].s=t)})),!s)throw new Error(bs);return et(o)}function As(e,{version:t,threshold:n,pks:a},r){const i=C(r).publicKey;return Ss(e,{rawSig:e.rawSignTxn(r),myPk:i},{version:t,threshold:n,pks:a})}function Cs(e){if(e.length<2)throw new Error(ms);const t=qe(e[0],In);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,r=tn({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map((e=>e.pk))}),i=t.msig.subsig.map((e=>({...e})));for(let o=1;o<e.length;o++){const s=qe(e[o],In);if(!s.msig)throw new Error(`Invalid multisig transaction, multisig structure missing at index ${o}`);if(s.txn.txID()!==n)throw new Error(ps);if(a!==(s.sgnr?s.sgnr.toString():void 0))throw new Error(ys);if(s.msig.subsig.length!==t.msig.subsig.length)throw new Error(fs);const c=tn({version:s.msig.v,threshold:s.msig.thr,pks:s.msig.subsig.map((e=>e.pk))});if(!r.equals(c))throw new Error(fs);s.msig.subsig.forEach(((e,t)=>{if(!e.s)return;const n=i[t];if(n.s&&!m(e.s,n.s))throw new Error(vs);n.s=e.s}))}const o={v:t.msig.v,thr:t.msig.thr,subsig:i},s=void 0!==a?t.sgnr:void 0;return et(new In({msig:o,txn:t.txn,sgnr:s}))}function Es(e,{version:t,threshold:n,addrs:a},r){const i=As(e,{version:t,threshold:n,pks:en(a)},r);return{txID:e.txID(),blob:i}}function xs(e,{version:t,threshold:n,addrs:a},r){const i=en(a),o=qe(e,In),s=As(o.txn,{version:t,threshold:n,pks:i},r);return{txID:o.txn.txID(),blob:Cs([e,s])}}function ks(e,{version:t,threshold:n,addrs:a},r,i){const o=en(a),s=qe(e,In),c=function(e,t,n,a){if(!A(a.length))throw new Error(ws);return Ss(e,{rawSig:a,myPk:("string"==typeof n?H.fromString(n):n).publicKey},t)}(s.txn,{version:t,threshold:n,pks:o},r,i);return{txID:s.txn.txID(),blob:Cs([e,c])}}let Bs={},Ds={};function Ns(e){let t=[],n=0,a=0;for(let r=0;r<e.length;r+=1){let i=Bs[e[r]];if(void 0===i)throw new Error("Invalid character ("+e[r]+")");const o=32&i;if(i&=31,a+=i<<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){Bs[e]=t,Ds[t]=e}));class Rs{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 r=this.mappings.split(";").map(Ns);this.pcToLocation=new Map,this.sourceAndLineToPc=new Map;const i={line:0,column:0,sourceIndex:0,nameIndex:0};for(const[e,t]of r.entries()){if(t.length<4)continue;const n=t.length>4?t[4]:void 0,[,a,r,o]=t;i.sourceIndex+=a,i.line+=r,i.column+=o,void 0!==n&&(i.nameIndex+=n);const s=`${i.sourceIndex}:${i.line}`;let c=this.sourceAndLineToPc.get(s);void 0===c&&(c=[],this.sourceAndLineToPc.set(s,c));const l={pc:e,column:i.column},h={line:i.line,column:i.column,sourceIndex:i.sourceIndex};void 0!==n&&(l.nameIndex=i.nameIndex,h.nameIndex=i.nameIndex),c.push(l),this.pcToLocation.set(e,h)}}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}}const Ms=1380011588,Ts=30;async function Ls({client:e,txns:t,protocolVersion:n,latestTimestamp:a,round:r,sources:i}){const o=[],s=[],c=[],l=[],h=[];for(const e of t)if(e.txn.type===Je.appl)if(h.push(e.txn.sender.toString()),h.push(...e.txn.applicationCall.accounts.map((e=>e.toString()))),c.push(...e.txn.applicationCall.foreignApps),h.push(...e.txn.applicationCall.foreignApps.map(J).map((e=>e.toString()))),l.push(...e.txn.applicationCall.foreignAssets),e.txn.applicationCall.appIndex===BigInt(0))o.push(new pa({id:Ms,params:new ba({creator:e.txn.sender.toString(),approvalProgram:e.txn.applicationCall.approvalProgram,clearStateProgram:e.txn.applicationCall.clearProgram,localStateSchema:new Sa({numUint:e.txn.applicationCall.numLocalInts,numByteSlice:e.txn.applicationCall.numLocalByteSlices}),globalStateSchema:new Sa({numUint:e.txn.applicationCall.numGlobalInts,numByteSlice:e.txn.applicationCall.numGlobalByteSlices})})}));else{const{appIndex:t}=e.txn.applicationCall;c.push(t),h.push(J(t).toString())}const d=[];for(const t of new Set(l))d.push(e.getAssetByID(t).do().then((e=>{h.push(e.params.creator)})));await Promise.all(d);const u=[];for(const t of new Set(c))u.push(e.getApplicationByID(t).do().then((e=>{o.push(e),h.push(e.params.creator.toString())})));await Promise.all(u);const g=[];for(const t of new Set(h))g.push(e.accountInformation(t).do().then((e=>{s.push(e)})));return await Promise.all(g),new Za({txns:t.slice(),accounts:s,apps:o,latestTimestamp:a??0,round:r??0,protocolVersion:n??"",sources:i??[]})}function Vs(e,t){return e.length>t&&t>0?`${e.slice(0,t)}...`:e}function Ws(e,t){if(0===t.length)return"";let n=null;for(let a=0;a<t.length;a++)(a>e.length||g(e[a])!==g(t[a]))&&(n=a);if(null==n)return"";const a=t[n];return a.bytes.length>0?`${n} = 0x${G(a.bytes)}`:`${n} = ${a.uint.toString()}`}function Gs(e,t){return`[${(t?e.reverse():e).map((e=>{switch(e.type){case 1:return`0x${G(e.bytes)}`;case 2:return e.uint.toString();default:return""}})).join(", ")}]`}function Fs(e,t,n){const a=n.maxValueWidth||Ts,r=[["pc#","ln#","source","scratch","stack"]];for(let i=0;i<e.length;i++){const{line:o,error:s,pc:c,scratch:l,stack:h}=e[i],d=void 0!==l?l:[],u=i>0&&void 0!==e[i-1].scratch?e[i-1].scratch:[],g=s?`!! ${s} !!`:t[o];r.push([c.toString().padEnd(3," "),o.toString().padEnd(3," "),Vs(g,a),Vs(Ws(u,d),a),Vs(Gs(h,n.topOfStackFirst),a)])}const i=r.reduce(((e,t)=>{const n=new Array(r[0].length).fill(0);for(let a=0;a<e.length;a++)n[a]=t[a].length>e[a]?t[a].length:e[a];return n}),new Array(r[0].length).fill(0));return`${r.map((e=>e.map(((e,t)=>e.padEnd(i[t]+1," "))).join("|").trim())).join("\n")}\n`}function Ys(e,t){if(!e.appCallTrace||!e.disassembly)return"";let n=t;return n=void 0!==t?t:{maxValueWidth:Ts,topOfStackFirst:!1},Fs(e.appCallTrace,e.disassembly,n)}function Zs(e,t){if(!e.logicSigTrace||!e.logicSigDisassembly)return"";let n;return n=void 0!==t?t:{maxValueWidth:Ts,topOfStackFirst:!0},Fs(e.logicSigTrace,e.logicSigDisassembly,n)}function zs({sender:e,receiver:t,amount:n,closeRemainderTo:a,suggestedParams:r,note:i,lease:o,rekeyTo:s}){return new jt({type:Je.pay,sender:e,note:i,lease:o,rekeyTo:s,suggestedParams:r,paymentParams:{receiver:t,amount:n,closeRemainderTo:a}})}function Ps({sender:e,voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:r,voteLast:i,voteKeyDilution:o,nonParticipation:s,suggestedParams:c,note:l,lease:h,rekeyTo:d}){return new jt({type:Je.keyreg,sender:e,note:l,lease:h,rekeyTo:d,suggestedParams:c,keyregParams:{voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:r,voteLast:i,voteKeyDilution:o,nonParticipation:s}})}function Xs({sender:e,assetIndex:t,total:n,decimals:a,defaultFrozen:r,manager:i,reserve:o,freeze:s,clawback:c,unitName:l,assetName:h,assetURL:d,assetMetadataHash:u,note:g,lease:m,rekeyTo:p,suggestedParams:y}){return new jt({type:Je.acfg,sender:e,note:g,lease:m,rekeyTo:p,suggestedParams:y,assetConfigParams:{assetIndex:t,total:n,decimals:a,defaultFrozen:r,manager:i,reserve:o,freeze:s,clawback:c,unitName:l,assetName:h,assetURL:d,assetMetadataHash:u}})}function Hs({sender:e,total:t,decimals:n,defaultFrozen:a,manager:r,reserve:i,freeze:o,clawback:s,unitName:c,assetName:l,assetURL:h,assetMetadataHash:d,note:u,lease:g,rekeyTo:m,suggestedParams:p}){return Xs({sender:e,total:t,decimals:n,defaultFrozen:a,manager:r,reserve:i,freeze:o,clawback:s,unitName:c,assetName:l,assetURL:h,assetMetadataHash:d,note:u,lease:g,rekeyTo:m,suggestedParams:p})}function Ks({sender:e,assetIndex:t,manager:n,reserve:a,freeze:r,clawback:i,strictEmptyAddressChecking:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("assetIndex must be provided");if((o??1)&&(null==n||null==a||null==r||null==i))throw Error("strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.");return Xs({sender:e,assetIndex:t,manager:n,reserve:a,freeze:r,clawback:i,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function js({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:r,suggestedParams:i}){if(!t)throw Error("assetIndex must be provided");return Xs({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:r,suggestedParams:i})}function Os({sender:e,assetIndex:t,freezeTarget:n,frozen:a,suggestedParams:r,note:i,lease:o,rekeyTo:s}){return new jt({type:Je.afrz,sender:e,note:i,lease:o,rekeyTo:s,suggestedParams:r,assetFreezeParams:{assetIndex:t,freezeTarget:n,frozen:a}})}function Us({sender:e,receiver:t,amount:n,closeRemainderTo:a,assetSender:r,note:i,assetIndex:o,suggestedParams:s,rekeyTo:c,lease:l}){if(!o)throw Error("assetIndex must be provided");return new jt({type:Je.axfer,sender:e,note:i,lease:l,rekeyTo:c,suggestedParams:s,assetTransferParams:{assetIndex:o,receiver:t,amount:n,assetSender:r,closeRemainderTo:a}})}function Js({sender:e,appIndex:t,onComplete:n,appArgs:a,accounts:r,foreignApps:i,foreignAssets:o,boxes:s,approvalProgram:c,clearProgram:l,numLocalInts:h,numLocalByteSlices:d,numGlobalInts:u,numGlobalByteSlices:g,extraPages:m,note:p,lease:y,rekeyTo:f,suggestedParams:v}){if(null==n)throw Error("onComplete must be provided");return new jt({type:Je.appl,sender:e,note:p,lease:y,rekeyTo:f,suggestedParams:v,appCallParams:{appIndex:t,onComplete:n,appArgs:a,accounts:r,foreignAssets:o,foreignApps:i,boxes:s,approvalProgram:c,clearProgram:l,numLocalInts:h,numLocalByteSlices:d,numGlobalInts:u,numGlobalByteSlices:g,extraPages:m}})}function Qs({sender:e,onComplete:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:c,numLocalInts:l,numLocalByteSlices:h,numGlobalInts:d,numGlobalByteSlices:u,extraPages:g,note:m,lease:p,rekeyTo:y,suggestedParams:f}){if(!s||!c)throw Error("approvalProgram and clearProgram must be provided");if(null==t)throw Error("onComplete must be provided");return Js({sender:e,appIndex:0,onComplete:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:c,numLocalInts:l,numLocalByteSlices:h,numGlobalInts:d,numGlobalByteSlices:u,extraPages:g,note:m,lease:p,rekeyTo:y,suggestedParams:f})}function $s({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:c,note:l,lease:h,rekeyTo:d,suggestedParams:u}){if(!t)throw Error("appIndex must be provided");if(!s||!c)throw Error("approvalProgram and clearProgram must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.UpdateApplicationOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,approvalProgram:s,clearProgram:c,note:l,lease:h,rekeyTo:d,suggestedParams:u})}function _s({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.DeleteApplicationOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function qs({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.OptInOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function ec({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.CloseOutOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function tc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.ClearStateOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function nc({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h}){if(!t)throw Error("appIndex must be provided");return Js({sender:e,appIndex:t,onComplete:Qe.NoOpOC,appArgs:n,accounts:a,foreignApps:r,foreignAssets:i,boxes:o,note:s,lease:c,rekeyTo:l,suggestedParams:h})}function ac(e){return(t,n)=>{const a=[];for(const r of n)a.push(t[r].signTxn(e.sk));return Promise.resolve(a)}}function rc(e){return(t,n)=>{const a=[];for(const r of n){const{blob:n}=us(t[r],e);a.push(n)}return Promise.resolve(a)}}function ic(e,t){return(n,a)=>{const r=[];for(const i of a){const a=n[i],o=[];for(const n of t){const{blob:t}=Es(a,e,n);o.push(t)}o.length>1?r.push(Cs(o)):r.push(o[0])}return Promise.resolve(r)}}function oc(){return(e,t)=>{const n=[];for(const a of t)n.push(An(e[a]));return Promise.resolve(n)}}function sc(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}const cc=65535,lc=32,hc=1,dc=1,uc=2,gc=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,mc=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class pc{static from(e){if(e.endsWith("[]")){const t=pc.from(e.slice(0,e.length-2));return new Ac(t)}if(e.endsWith("]")){const t=e.match(gc);if(!t||3!==t.length)throw new Error(`malformed static array string: ${e}`);const n=t[2],a=parseInt(n,10);if(a>cc)throw new Error(`array length exceeds limit ${cc}`);const r=pc.from(t[1]);return new Sc(r,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>cc)throw new Error(`malformed uint string: ${a}`);return new yc(a)}if("byte"===e)return new bc;if(e.startsWith("ufixed")){const t=e.match(mc);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 fc(n,a)}if("bool"===e)return new wc;if("address"===e)return new vc;if("string"===e)return new Ic;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){const t=Cc.parseTupleContent(e.slice(1,e.length-1)),n=[];for(let e=0;e<t.length;e++){const a=pc.from(t[e]);n.push(a)}return new Cc(n)}throw new Error(`cannot convert a string ${e} to an ABI type`)}}class yc extends pc{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 yc&&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 Oo(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 Uo(e)}}class fc extends pc{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 fc&&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 Oo(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return Uo(e)}}class vc extends pc{toString(){return"address"}equals(e){return e instanceof vc}isDynamic(){return!1}byteLen(){return lc}encode(e){if("string"==typeof e)return K(e).publicKey;if(e instanceof H)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 O(e)}}class wc extends pc{toString(){return"bool"}equals(e){return e instanceof wc}isDynamic(){return!1}byteLen(){return dc}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 bc extends pc{toString(){return"byte"}equals(e){return e instanceof bc}isDynamic(){return!1}byteLen(){return hc}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 Ic extends pc{toString(){return"string"}equals(e){return e instanceof Ic}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=Oo(t.length,uc),a=new Uint8Array(t.length+uc);return a.set(n),a.set(t,uc),a}decode(e){if(e.length<uc)throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${uc}`);const t=new DataView(e.buffer,e.byteOffset,uc).getUint16(0),n=e.slice(uc,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 Sc extends pc{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 Sc&&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 Cc(Array(this.staticLength).fill(this.childType))}}class Ac extends pc{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof Ac&&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 p(Oo(t.childTypes.length,uc),n)}decode(e){const t=new DataView(e.buffer,0,uc).getUint16(0);return this.toABITupleType(t).decode(e.slice(uc,e.length))}toABITupleType(e){return new Cc(Array(e).fill(this.childType))}}class Cc extends pc{constructor(e){if(super(),e.length>=cc)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 Cc&&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=xc(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>cc)throw new Error("length of tuple array should not exceed a uint16");const n=this.childTypes,a=[],r=[],i=new Map;let o=0;for(;o<n.length;){const e=n[o];if(e.isDynamic())i.set(a.length,!0),a.push(new Uint8Array([0,0])),r.push(e.encode(t[o]));else{if(e.constructor===wc){const e=xc(n,o,-1);let r=xc(n,o,1);if(e%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");r=Math.min(7,r);const i=Ec(t.slice(o,o+r+1));a.push(Oo(i,1)),o+=r}else{const n=e.encode(t[o]);a.push(n)}i.set(o,!1),r.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(i.get(e)){const t=s+c;if(t>cc)throw new Error(`byte length of ${t} should not exceed a uint16`);a[e]=Oo(t,uc)}c+=r[e].length}return p(...a,...r)}decode(e){const t=this.childTypes,n=[],a=[];let r=0,i=0;const o=new DataView(e.buffer);for(;r<t.length;){const s=t[r];if(s.isDynamic()){if(e.slice(i,e.length).length<uc)throw new Error("dynamic type in tuple is too short to be decoded");const t=o.getUint16(i);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 r={left:t,right:-1};n.push(r),a.push(null),i+=uc}else if(s.constructor===wc){const t=xc(this.childTypes,r,-1);let n=xc(this.childTypes,r,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[i]&n)>0?a.push(new Uint8Array([128])):a.push(new Uint8Array([0]))}r+=n,i+=1}else{const t=s.byteLen();a.push(e.slice(i,i+t)),i+=t}if(r!==t.length-1&&i>=e.length)throw new Error("input byte not enough to decode");r+=1}if(n.length>0&&(n[n.length-1].right=e.length,i=e.length),i<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 r=0;r<t.length;r++)t[r].isDynamic()&&(a[r]=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 r of e)a+=r,"("===r?n+=1:")"===r?n-=1:","===r&&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 Ec(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 xc(e,t,n){let a=0;for(;;){const r=t+n*a;if(e[r].constructor!==wc){a-=1;break}if(r!==e.length-1&&1===n)a+=1;else{if(!(r>0&&-1===n))break;a+=1}}return a}var kc,Bc;function Dc(e){return e===kc.any||e===kc.pay||e===kc.keyreg||e===kc.acfg||e===kc.axfer||e===kc.afrz||e===kc.appl}function Nc(e,t){return e===kc.any||!!t.type&&t.type.toString()===e.toString()}function Rc(e){return e===Bc.account||e===Bc.application||e===Bc.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(kc||(kc={})),function(e){e.account="account",e.application="application",e.asset="asset"}(Bc||(Bc={}));class Mc{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})=>Dc(e)||Rc(e)?{type:e,name:t,description:n}:{type:pc.from(e),name:t,description:n})),this.returns={type:"void"===e.returns.type?e.returns.type:pc.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=I(this.getSignature());return new Uint8Array(e.slice(0,4))}txnCount(){let e=1;for(const t of this.args)"string"==typeof t.type&&Dc(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 r=t;r<e.length;r++){const t=e[r];if("("===t)a+=1;else if(")"===t){if(0===a)break;if(a-=1,0===a){n=r;break}}}if(-1===n)throw new Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:Cc.parseTupleContent(e.slice(t+1,n)),returns:e.slice(n+1)}}(e);return new Mc({name:t,args:n.map((e=>({type:e}))),returns:{type:a}})}}function Tc(e,t){if(null===e||!Array.isArray(e)||!e.every((e=>e instanceof Mc)))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 Lc{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 Mc(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 Tc(this.methods,e)}}class Vc{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 Mc(e)))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map((e=>e.toJSON()))}}getMethodByName(e){return Tc(this.methods,e)}}const Wc=new Uint8Array([21,31,124,117]);var Gc;function Fc(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"}(Gc||(Gc={}));class Yc{constructor(){this.status=Gc.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const e=new Yc;return e.transactions=this.transactions.map((({txn:e,signer:t})=>{const n=e.toEncodingData();return n.delete("grp"),{txn:jt.fromEncodingData(n),signer:t}})),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==Gc.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===Yc.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${Yc.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:r,onComplete:i,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:l,numLocalInts:h,numLocalByteSlices:d,extraPages:u,appAccounts:g,appForeignApps:m,appForeignAssets:p,boxes:y,note:f,lease:v,rekeyTo:w,signer:I}){if(this.status!==Gc.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>Yc.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${Yc.MAX_GROUP_SIZE}`);if(BigInt(e)===BigInt(0)){if(null==o||null==s||null==c||null==l||null==h||null==d)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(i===Qe.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!=l||null!=h||null!=d||null!=u)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!=l||null!=h||null!=d||null!=u)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(null==n&&(n=[]),n.length!==t.args.length)throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${n.length}`);let S=[],A=[];const C=[],E=[],x=[],k=new Map,B=y||[];for(let e=0;e<n.length;e++){let a=t.args[e].type;const r=n[e];if(Dc(a)){if(!sc(r)||!Nc(a,r.txn))throw new Error(`Expected ${a} TransactionWithSigner for argument at index ${e}`);if(r.txn.group&&r.txn.group.some((e=>0!==e)))throw new Error("Cannot add a transaction with nonzero group ID");C.push(r)}else{if(sc(r))throw new Error(`Expected non-transaction value for argument at index ${e}`);if(Rc(a)&&(k.set(E.length,S.length),E.push(a),x.push(r),a=new yc(8)),"string"==typeof a)throw new Error(`Unknown ABI type: ${a}`);S.push(a),A.push(r)}}const D=[],N=null==g?[]:g.map((e=>e.toString())),R=null==m?[]:m.map(b),M=null==p?[]:p.map(b);for(let t=0;t<E.length;t++){const n=E[t],r=x[t];let i=0;switch(n){case Bc.account:{const e=new vc;i=Fc(e.decode(e.encode(r)),N,a.toString());break}case Bc.application:{const t=new yc(64),n=t.decode(t.encode(r));if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${n}`);i=Fc(n,R,b(e));break}case Bc.asset:{const e=new yc(64),t=e.decode(e.encode(r));if(t>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${t}`);i=Fc(t,M);break}default:throw new Error(`Unknown reference type: ${n}`)}D.push(i)}for(let e=0;e<D.length;e++)A[k.get(e)]=D[e];if(S.length>15){const e=S.slice(14),t=A.slice(14);S=S.slice(0,14),A=A.slice(0,14),S.push(new Cc(e)),A.push(t)}const T=[t.getSelector()];for(let e=0;e<S.length;e++)T.push(S[e].encode(A[e]));const L={txn:Js({sender:a,appIndex:e,appArgs:T,accounts:N,foreignApps:R,foreignAssets:M,boxes:B,onComplete:null==i?Qe.NoOpOC:i,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:l,numLocalInts:h,numLocalByteSlices:d,extraPages:u,lease:v,note:f,rekeyTo:w,suggestedParams:r}),signer:I};this.transactions.push(...C,L),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===Gc.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&ds(this.transactions.map((e=>e.txn))),this.status=Gc.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=Gc.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),r=await Promise.all(a.map((([e,n])=>e(t,n)))),i=e.map((()=>null));for(let e=0;e<a.length;e++){const t=a[e][1],n=r[e];for(let e=0;e<t.length;e++)i[t[e]]=n[e]}if(!i.every((e=>null!=e)))throw new Error(`Missing signatures. Got ${i}`);const o=i.map(((e,t)=>{try{return qe(e,In).txn.txID()}catch(e){throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`)}}));return this.signedTxns=i,this.txIDs=o,this.status=Gc.SIGNED,i}async submit(e){if(this.status>Gc.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=Gc.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>Gc.SUBMITTED)throw new Error("Simulated Transaction group has already been submitted to the network");const n=(await this.gatherSignatures()).map((e=>qe(e,In))),a=null==t?new ir({txnGroups:[]}):t;a.txnGroups=[new or({txns:n})];const r=await e.simulateTransactions(a).do(),i=[];for(const[e,t]of this.methodCalls){const n=this.txIDs[e],a=r.txnGroups[0].txnResults[e].txnResult,o={txID:n,rawReturnValue:new Uint8Array,method:t};i.push(Yc.parseMethodResponse(t,o,a))}return{methodResults:i,simulateResponse:r}}async execute(e,t){if(this.status===Gc.COMMITTED)throw new Error("Transaction group has already been executed successfully");const n=await this.submit(e);this.status=Gc.SUBMITTED;const a=this.transactions.findIndex(((e,t)=>this.methodCalls.has(t))),r=-1===a?0:a,i=await jo(e,n[r],t);this.status=Gc.COMMITTED;const o=i.confirmedRound,s=[];for(const[t,r]of this.methodCalls){const o=n[t];let c={txID:o,rawReturnValue:new Uint8Array,method:r};try{const n=t===a?i:await e.pendingTransactionInformation(o).do();c=Yc.parseMethodResponse(r,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 r=n.logs||[];if(0===r.length)throw new Error(`App call transaction did not log a return value ${g(n)}`);const i=r[r.length-1];if(i.byteLength<4||!m(i.slice(0,4),Wc))throw new Error(`App call transaction did not log a ABI return value ${g(n)}`);a.rawReturnValue=new Uint8Array(i.slice(4)),a.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){a.decodeError=e}return a}}Yc.MAX_GROUP_SIZE=16;const Zc=Uint8Array.from([77,88]),zc="The transaction sender address and multisig preimage do not match.";function Pc(e,t){return{txID:e.txID(),blob:e.signTxn(t)}}function Xc(e,t){return E(p(Zc,e),t)}function Hc(e,t,n){return k(p(Zc,e),t,("string"==typeof n?H.fromString(n):n).publicKey)}const Kc=new Error(zc),jc=new Error($),Oc=i},4143:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(1601),r=n.n(a),i=n(6314),o=n.n(i)()(r());o.push([e.id,'/* ==========================================\n SDK-SPECIFIC STYLES (ALGOMINTX)\n ========================================== */\n\n/* Outer panel: tabs + forms — hidden until wallet connects */\n#algox-mintx-content {\n padding: 0;\n gap: 0;\n display: none;\n flex-direction: column;\n overflow-y: auto;\n flex-grow: 1;\n}\n\n#algox-mintx-nft-form,\n#algox-mintx-ft-content {\n display: flex;\n padding: 15px;\n flex-direction: column;\n gap: 10px;\n overflow-y: auto;\n flex-grow: 1;\n border-bottom: 1px solid #ddd;\n}\n\n.dark-theme #algox-mintx-nft-form,\n.dark-theme #algox-mintx-ft-content {\n border-bottom-color: #333;\n}\n\n#algox-mintx-nft-form input[type="text"],\n#algox-mintx-nft-form textarea,\n#algox-mintx-nft-form input[type="file"],\n#algox-mintx-ft-content input[type="text"],\n#algox-mintx-ft-content input[type="number"],\n#algox-mintx-ft-content textarea,\n#algox-mintx-ft-content input[type="file"] {\n padding: 8px;\n font-size: 1rem;\n color: #111827;\n background-color: white;\n border: 1px solid #ddd;\n border-radius: 4px;\n transition: border-color 0.3s ease;\n}\n\n.dark-theme #algox-mintx-nft-form input[type="text"],\n.dark-theme #algox-mintx-nft-form textarea,\n.dark-theme #algox-mintx-nft-form input[type="file"],\n.dark-theme #algox-mintx-ft-content input[type="text"],\n.dark-theme #algox-mintx-ft-content input[type="number"],\n.dark-theme #algox-mintx-ft-content textarea,\n.dark-theme #algox-mintx-ft-content input[type="file"] {\n color: #f9fafb;\n background-color: #2d2d2d;\n border-color: #444;\n}\n\n#algox-mintx-nft-form input[type="text"]:focus,\n#algox-mintx-nft-form textarea:focus,\n#algox-mintx-ft-content input[type="text"]:focus,\n#algox-mintx-ft-content input[type="number"]:focus,\n#algox-mintx-ft-content textarea:focus {\n outline: none;\n border-color: #3498db;\n}\n\n#algox-mintx-nft-form input[type="text"].error,\n#algox-mintx-nft-form textarea.error,\n#algox-mintx-ft-content input[type="text"].error,\n#algox-mintx-ft-content input[type="number"].error,\n#algox-mintx-ft-content textarea.error {\n border-color: #ff4444;\n}\n\n#algox-mintx-nft-form textarea,\n#algox-mintx-ft-content textarea {\n resize: vertical;\n min-height: 10vh;\n}\n\n#algox-mintx-ft-content .algox-mintx-ft-file-label {\n font-size: 0.8rem;\n color: #6b7280;\n margin-bottom: -4px;\n}\n\n.dark-theme #algox-mintx-ft-content .algox-mintx-ft-file-label {\n color: #9ca3af;\n}\n\n#algox-mintx-nft-form button,\n#algox-mintx-ft-content button {\n padding: 10px;\n font-size: 1rem;\n cursor: pointer;\n background-color: #f8f9fa;\n border: 1px solid #ddd;\n border-radius: 4px;\n color: #111827;\n}\n\n.dark-theme #algox-mintx-nft-form button,\n.dark-theme #algox-mintx-ft-content button {\n background-color: #2d2d2d;\n border-color: #444;\n color: #f9fafb;\n}\n\n#algox-mintx-nft-form button:disabled,\n#algox-mintx-ft-content button:disabled {\n cursor: not-allowed;\n opacity: 0.7;\n}\n\n#algox-mintx-nft-form button:disabled:hover,\n#algox-mintx-ft-content button:disabled:hover {\n transform: none;\n box-shadow: none;\n}\n\n#algox-mintx-reset-btn,\n#algox-mintx-ft-reset-btn {\n display: none;\n}\n\n#algox-mintx-messages,\n#algox-mintx-ft-messages {\n margin-top: 10px;\n font-size: 0.85rem;\n color: #111827;\n word-break: break-word;\n user-select: text;\n cursor: pointer;\n display: none;\n padding: 8px;\n background-color: #f8f9fa;\n border-radius: 4px;\n border: 1px solid #ddd;\n}\n\n#algox-mintx-messages:not(:empty),\n#algox-mintx-ft-messages:not(:empty) {\n display: block;\n}\n\n.dark-theme #algox-mintx-messages,\n.dark-theme #algox-mintx-ft-messages {\n color: #f9fafb;\n background-color: #2d2d2d;\n border-color: #444;\n}\n\n#algox-nft-tab,\n#algox-ft-tab {\n gap: 0;\n}\n',""]);const s=o},4462:(e,t,n)=>{var a;!function(){var t="input is invalid type",r="object"==typeof window,i=r?window:{};i.JS_SHA512_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self;!i.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?i=n.g:o&&(i=self);var s=!i.JS_SHA512_NO_COMMON_JS&&e.exports,c=n.amdO,l=!i.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),d=[-2147483648,8388608,32768,128],u=[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=[];!i.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!i.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(n){return new b(t,!0).update(n)[e]()}},f=function(e){var t=y("hex",e);t.create=function(){return new b(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=y(a,e)}return t},v=function(e,t){return function(n,a){return new I(n,t,!0).update(a)[e]()}},w=function(e){var t=v("hex",e);t.create=function(t){return new I(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]=v(a,e)}return t};function b(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 I(e,n,a){var r,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var o=e.length;if(!r){for(var s,c=[],h=(o=e.length,0),d=0;d<o;++d)(s=e.charCodeAt(d))<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(++d)),c[h++]=240|s>>18,c[h++]=128|s>>12&63,c[h++]=128|s>>6&63,c[h++]=128|63&s);e=c}e.length>128&&(e=new b(n,!0).update(e).array());var u=[],g=[];for(d=0;d<128;++d){var m=e[d]||0;u[d]=92^m,g[d]=54^m}b.call(this,n,a),this.update(g),this.oKeyPad=u,this.inner=!0,this.sharedMemory=a}b.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(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var r,i,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(i=this.start;o<s&&i<128;++o)c[i>>2]|=e[o]<<u[3&i++];else for(i=this.start;o<s&&i<128;++o)(r=e.charCodeAt(o))<128?c[i>>2]|=r<<u[3&i++]:r<2048?(c[i>>2]|=(192|r>>6)<<u[3&i++],c[i>>2]|=(128|63&r)<<u[3&i++]):r<55296||r>=57344?(c[i>>2]|=(224|r>>12)<<u[3&i++],c[i>>2]|=(128|r>>6&63)<<u[3&i++],c[i>>2]|=(128|63&r)<<u[3&i++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),c[i>>2]|=(240|r>>18)<<u[3&i++],c[i>>2]|=(128|r>>12&63)<<u[3&i++],c[i>>2]|=(128|r>>6&63)<<u[3&i++],c[i>>2]|=(128|63&r)<<u[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=128?(this.block=c[32],this.start=i-128,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},b.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=d[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()}},b.prototype.hash=function(){var e,t,n,a,r,i,o,s,c,l,h,d,u,m,p,y,f,v,w,b,I,S,A,C,E,x=this.h0h,k=this.h0l,B=this.h1h,D=this.h1l,N=this.h2h,R=this.h2l,M=this.h3h,T=this.h3l,L=this.h4h,V=this.h4l,W=this.h5h,G=this.h5l,F=this.h6h,Y=this.h6l,Z=this.h7h,z=this.h7l,P=this.blocks;for(e=32;e<160;e+=2)t=((b=P[e-30])>>>1|(I=P[e-29])<<31)^(b>>>8|I<<24)^b>>>7,n=(I>>>1|b<<31)^(I>>>8|b<<24)^(I>>>7|b<<25),a=((b=P[e-4])>>>19|(I=P[e-3])<<13)^(I>>>29|b<<3)^b>>>6,r=(I>>>19|b<<13)^(b>>>29|I<<3)^(I>>>6|b<<26),b=P[e-32],I=P[e-31],c=((S=P[e-14])>>>16)+(b>>>16)+(t>>>16)+(a>>>16)+((s=(65535&S)+(65535&b)+(65535&t)+(65535&a)+((o=((A=P[e-13])>>>16)+(I>>>16)+(n>>>16)+(r>>>16)+((i=(65535&A)+(65535&I)+(65535&n)+(65535&r))>>>16))>>>16))>>>16),P[e]=c<<16|65535&s,P[e+1]=o<<16|65535&i;var X=x,H=k,K=B,j=D,O=N,U=R,J=M,Q=T,$=L,_=V,q=W,ee=G,te=F,ne=Y,ae=Z,re=z;for(y=K&O,f=j&U,e=0;e<160;e+=8)t=(X>>>28|H<<4)^(H>>>2|X<<30)^(H>>>7|X<<25),n=(H>>>28|X<<4)^(X>>>2|H<<30)^(X>>>7|H<<25),a=($>>>14|_<<18)^($>>>18|_<<14)^(_>>>9|$<<23),r=(_>>>14|$<<18)^(_>>>18|$<<14)^($>>>9|_<<23),v=(l=X&K)^X&O^y,w=(h=H&j)^H&U^f,C=$&q^~$&te,E=_&ee^~_&ne,b=P[e],I=P[e+1],b=(c=((S=g[e])>>>16)+(b>>>16)+(C>>>16)+(a>>>16)+(ae>>>16)+((s=(65535&S)+(65535&b)+(65535&C)+(65535&a)+(65535&ae)+((o=((A=g[e+1])>>>16)+(I>>>16)+(E>>>16)+(r>>>16)+(re>>>16)+((i=(65535&A)+(65535&I)+(65535&E)+(65535&r)+(65535&re))>>>16))>>>16))>>>16))<<16|65535&s,I=o<<16|65535&i,S=(c=(v>>>16)+(t>>>16)+((s=(65535&v)+(65535&t)+((o=(w>>>16)+(n>>>16)+((i=(65535&w)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,A=o<<16|65535&i,ae=(c=(J>>>16)+(b>>>16)+((s=(65535&J)+(65535&b)+((o=(Q>>>16)+(I>>>16)+((i=(65535&Q)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s,re=o<<16|65535&i,t=((J=(c=(S>>>16)+(b>>>16)+((s=(65535&S)+(65535&b)+((o=(A>>>16)+(I>>>16)+((i=(65535&A)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Q=o<<16|65535&i)<<4)^(Q>>>2|J<<30)^(Q>>>7|J<<25),n=(Q>>>28|J<<4)^(J>>>2|Q<<30)^(J>>>7|Q<<25),a=(ae>>>14|re<<18)^(ae>>>18|re<<14)^(re>>>9|ae<<23),r=(re>>>14|ae<<18)^(re>>>18|ae<<14)^(ae>>>9|re<<23),v=(d=J&X)^J&K^l,w=(u=Q&H)^Q&j^h,C=ae&$^~ae&q,E=re&_^~re&ee,b=P[e+2],I=P[e+3],b=(c=((S=g[e+2])>>>16)+(b>>>16)+(C>>>16)+(a>>>16)+(te>>>16)+((s=(65535&S)+(65535&b)+(65535&C)+(65535&a)+(65535&te)+((o=((A=g[e+3])>>>16)+(I>>>16)+(E>>>16)+(r>>>16)+(ne>>>16)+((i=(65535&A)+(65535&I)+(65535&E)+(65535&r)+(65535&ne))>>>16))>>>16))>>>16))<<16|65535&s,I=o<<16|65535&i,S=(c=(v>>>16)+(t>>>16)+((s=(65535&v)+(65535&t)+((o=(w>>>16)+(n>>>16)+((i=(65535&w)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,A=o<<16|65535&i,te=(c=(O>>>16)+(b>>>16)+((s=(65535&O)+(65535&b)+((o=(U>>>16)+(I>>>16)+((i=(65535&U)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s,ne=o<<16|65535&i,t=((O=(c=(S>>>16)+(b>>>16)+((s=(65535&S)+(65535&b)+((o=(A>>>16)+(I>>>16)+((i=(65535&A)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(U=o<<16|65535&i)<<4)^(U>>>2|O<<30)^(U>>>7|O<<25),n=(U>>>28|O<<4)^(O>>>2|U<<30)^(O>>>7|U<<25),a=(te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23),r=(ne>>>14|te<<18)^(ne>>>18|te<<14)^(te>>>9|ne<<23),v=(m=O&J)^O&X^d,w=(p=U&Q)^U&H^u,C=te&ae^~te&$,E=ne&re^~ne&_,b=P[e+4],I=P[e+5],b=(c=((S=g[e+4])>>>16)+(b>>>16)+(C>>>16)+(a>>>16)+(q>>>16)+((s=(65535&S)+(65535&b)+(65535&C)+(65535&a)+(65535&q)+((o=((A=g[e+5])>>>16)+(I>>>16)+(E>>>16)+(r>>>16)+(ee>>>16)+((i=(65535&A)+(65535&I)+(65535&E)+(65535&r)+(65535&ee))>>>16))>>>16))>>>16))<<16|65535&s,I=o<<16|65535&i,S=(c=(v>>>16)+(t>>>16)+((s=(65535&v)+(65535&t)+((o=(w>>>16)+(n>>>16)+((i=(65535&w)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,A=o<<16|65535&i,q=(c=(K>>>16)+(b>>>16)+((s=(65535&K)+(65535&b)+((o=(j>>>16)+(I>>>16)+((i=(65535&j)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s,ee=o<<16|65535&i,t=((K=(c=(S>>>16)+(b>>>16)+((s=(65535&S)+(65535&b)+((o=(A>>>16)+(I>>>16)+((i=(65535&A)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(j=o<<16|65535&i)<<4)^(j>>>2|K<<30)^(j>>>7|K<<25),n=(j>>>28|K<<4)^(K>>>2|j<<30)^(K>>>7|j<<25),a=(q>>>14|ee<<18)^(q>>>18|ee<<14)^(ee>>>9|q<<23),r=(ee>>>14|q<<18)^(ee>>>18|q<<14)^(q>>>9|ee<<23),v=(y=K&O)^K&J^m,w=(f=j&U)^j&Q^p,C=q&te^~q&ae,E=ee&ne^~ee&re,b=P[e+6],I=P[e+7],b=(c=((S=g[e+6])>>>16)+(b>>>16)+(C>>>16)+(a>>>16)+($>>>16)+((s=(65535&S)+(65535&b)+(65535&C)+(65535&a)+(65535&$)+((o=((A=g[e+7])>>>16)+(I>>>16)+(E>>>16)+(r>>>16)+(_>>>16)+((i=(65535&A)+(65535&I)+(65535&E)+(65535&r)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,I=o<<16|65535&i,S=(c=(v>>>16)+(t>>>16)+((s=(65535&v)+(65535&t)+((o=(w>>>16)+(n>>>16)+((i=(65535&w)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,A=o<<16|65535&i,$=(c=(X>>>16)+(b>>>16)+((s=(65535&X)+(65535&b)+((o=(H>>>16)+(I>>>16)+((i=(65535&H)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s,_=o<<16|65535&i,X=(c=(S>>>16)+(b>>>16)+((s=(65535&S)+(65535&b)+((o=(A>>>16)+(I>>>16)+((i=(65535&A)+(65535&I))>>>16))>>>16))>>>16))<<16|65535&s,H=o<<16|65535&i;c=(x>>>16)+(X>>>16)+((s=(65535&x)+(65535&X)+((o=(k>>>16)+(H>>>16)+((i=(65535&k)+(65535&H))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&s,this.h0l=o<<16|65535&i,c=(B>>>16)+(K>>>16)+((s=(65535&B)+(65535&K)+((o=(D>>>16)+(j>>>16)+((i=(65535&D)+(65535&j))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&s,this.h1l=o<<16|65535&i,c=(N>>>16)+(O>>>16)+((s=(65535&N)+(65535&O)+((o=(R>>>16)+(U>>>16)+((i=(65535&R)+(65535&U))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&s,this.h2l=o<<16|65535&i,c=(M>>>16)+(J>>>16)+((s=(65535&M)+(65535&J)+((o=(T>>>16)+(Q>>>16)+((i=(65535&T)+(65535&Q))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&s,this.h3l=o<<16|65535&i,c=(L>>>16)+($>>>16)+((s=(65535&L)+(65535&$)+((o=(V>>>16)+(_>>>16)+((i=(65535&V)+(65535&_))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&s,this.h4l=o<<16|65535&i,c=(W>>>16)+(q>>>16)+((s=(65535&W)+(65535&q)+((o=(G>>>16)+(ee>>>16)+((i=(65535&G)+(65535&ee))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&s,this.h5l=o<<16|65535&i,c=(F>>>16)+(te>>>16)+((s=(65535&F)+(65535&te)+((o=(Y>>>16)+(ne>>>16)+((i=(65535&Y)+(65535&ne))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&s,this.h6l=o<<16|65535&i,c=(Z>>>16)+(ae>>>16)+((s=(65535&Z)+(65535&ae)+((o=(z>>>16)+(re>>>16)+((i=(65535&z)+(65535&re))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&s,this.h7l=o<<16|65535&i},b.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,r=this.h2h,i=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,l=this.h4l,d=this.h5h,u=this.h5l,g=this.h6h,m=this.h6l,p=this.h7h,y=this.h7l,f=this.bits,v=h[e>>28&15]+h[e>>24&15]+h[e>>20&15]+h[e>>16&15]+h[e>>12&15]+h[e>>8&15]+h[e>>4&15]+h[15&e]+h[t>>28&15]+h[t>>24&15]+h[t>>20&15]+h[t>>16&15]+h[t>>12&15]+h[t>>8&15]+h[t>>4&15]+h[15&t]+h[n>>28&15]+h[n>>24&15]+h[n>>20&15]+h[n>>16&15]+h[n>>12&15]+h[n>>8&15]+h[n>>4&15]+h[15&n]+h[a>>28&15]+h[a>>24&15]+h[a>>20&15]+h[a>>16&15]+h[a>>12&15]+h[a>>8&15]+h[a>>4&15]+h[15&a]+h[r>>28&15]+h[r>>24&15]+h[r>>20&15]+h[r>>16&15]+h[r>>12&15]+h[r>>8&15]+h[r>>4&15]+h[15&r]+h[i>>28&15]+h[i>>24&15]+h[i>>20&15]+h[i>>16&15]+h[i>>12&15]+h[i>>8&15]+h[i>>4&15]+h[15&i]+h[o>>28&15]+h[o>>24&15]+h[o>>20&15]+h[o>>16&15]+h[o>>12&15]+h[o>>8&15]+h[o>>4&15]+h[15&o];return f>=256&&(v+=h[s>>28&15]+h[s>>24&15]+h[s>>20&15]+h[s>>16&15]+h[s>>12&15]+h[s>>8&15]+h[s>>4&15]+h[15&s]),f>=384&&(v+=h[c>>28&15]+h[c>>24&15]+h[c>>20&15]+h[c>>16&15]+h[c>>12&15]+h[c>>8&15]+h[c>>4&15]+h[15&c]+h[l>>28&15]+h[l>>24&15]+h[l>>20&15]+h[l>>16&15]+h[l>>12&15]+h[l>>8&15]+h[l>>4&15]+h[15&l]+h[d>>28&15]+h[d>>24&15]+h[d>>20&15]+h[d>>16&15]+h[d>>12&15]+h[d>>8&15]+h[d>>4&15]+h[15&d]+h[u>>28&15]+h[u>>24&15]+h[u>>20&15]+h[u>>16&15]+h[u>>12&15]+h[u>>8&15]+h[u>>4&15]+h[15&u]),512==f&&(v+=h[g>>28&15]+h[g>>24&15]+h[g>>20&15]+h[g>>16&15]+h[g>>12&15]+h[g>>8&15]+h[g>>4&15]+h[15&g]+h[m>>28&15]+h[m>>24&15]+h[m>>20&15]+h[m>>16&15]+h[m>>12&15]+h[m>>8&15]+h[m>>4&15]+h[15&m]+h[p>>28&15]+h[p>>24&15]+h[p>>20&15]+h[p>>16&15]+h[p>>12&15]+h[p>>8&15]+h[p>>4&15]+h[15&p]+h[y>>28&15]+h[y>>24&15]+h[y>>20&15]+h[y>>16&15]+h[y>>12&15]+h[y>>8&15]+h[y>>4&15]+h[15&y]),v},b.prototype.toString=b.prototype.hex,b.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,r=this.h2h,i=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,l=this.h4l,h=this.h5h,d=this.h5l,u=this.h6h,g=this.h6l,m=this.h7h,p=this.h7l,y=this.bits,f=[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,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return y>=256&&f.push(s>>24&255,s>>16&255,s>>8&255,255&s),y>=384&&f.push(c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d),512==y&&f.push(u>>24&255,u>>16&255,u>>8&255,255&u,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),f},b.prototype.array=b.prototype.digest,b.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},b.prototype.clone=function(){var e=new b(this.bits,!1);return this.copyTo(e),e},b.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]},I.prototype=new b,I.prototype.finalize=function(){if(b.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();b.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),b.prototype.finalize.call(this)}},I.prototype.clone=function(){var e=new I([],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 S=f(512);S.sha512=S,S.sha384=f(384),S.sha512_256=f(256),S.sha512_224=f(224),S.sha512.hmac=w(512),S.sha384.hmac=w(384),S.sha512_256.hmac=w(256),S.sha512_224.hmac=w(224),s?e.exports=S:(i.sha512=S.sha512,i.sha384=S.sha384,i.sha512_256=S.sha512_256,i.sha512_224=S.sha512_224,c&&(void 0===(a=function(){return S}.call(S,n,S,e))||(e.exports=a)))}()},5056:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},5072:e=>{var t=[];function n(e){for(var n=-1,a=0;a<t.length;a++)if(t[a].identifier===e){n=a;break}return n}function a(e,a){for(var i={},o=[],s=0;s<e.length;s++){var c=e[s],l=a.base?c[0]+a.base:c[0],h=i[l]||0,d="".concat(l," ").concat(h);i[l]=h+1;var u=n(d),g={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(g);else{var m=r(g,a);a.byIndex=s,t.splice(s,0,{identifier:d,updater:m,references:1})}o.push(d)}return o}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var i=a(e=e||[],r=r||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var s=n(i[o]);t[s].references--}for(var c=a(e,r),l=0;l<i.length;l++){var h=n(i[l]);0===t[h].references&&(t[h].updater(),t.splice(h,1))}i=c}}},5818:(e,t,n)=>{var a;!function(){var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=n.g);var r=!t.HI_BASE32_NO_COMMON_JS&&e.exports,i=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],l=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},h=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,n,a,r,i,o,c,l,h=[],d=0,u=(e=e.replace(/=/g,"")).length,g=0,m=u>>3<<3;g<m;)t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],r=s[e.charAt(g++)],i=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],l=s[e.charAt(g++)],h[d++]=255&(t<<3|n>>>2),h[d++]=255&(n<<6|a<<1|r>>>4),h[d++]=255&(r<<4|i>>>1),h[d++]=255&(i<<7|o<<2|c>>>3),h[d++]=255&(c<<5|l);var p=u-m;return 2===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],h[d++]=255&(t<<3|n>>>2)):4===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],r=s[e.charAt(g++)],h[d++]=255&(t<<3|n>>>2),h[d++]=255&(n<<6|a<<1|r>>>4)):5===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],r=s[e.charAt(g++)],i=s[e.charAt(g++)],h[d++]=255&(t<<3|n>>>2),h[d++]=255&(n<<6|a<<1|r>>>4),h[d++]=255&(r<<4|i>>>1)):7===p&&(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],r=s[e.charAt(g++)],i=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],h[d++]=255&(t<<3|n>>>2),h[d++]=255&(n<<6|a<<1|r>>>4),h[d++]=255&(r<<4|i>>>1),h[d++]=255&(i<<7|o<<2|c>>>3)),h},d=function(e,t){if(!t)return function(e){for(var t,n,a="",r=e.length,i=0,o=0;i<r;)if((t=e[i++])<=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):l(i,a);for(var s=0;s<o;++s)((t=e[i++])<128||t>191)&&l(i,a),n<<=6,n+=63&t;n>=55296&&n<=57343&&l(i,a),n>1114111&&l(i,a),n<=65535?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296+(n>>10)),a+=String.fromCharCode(56320+(1023&n)))}return a}(h(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var n,a,r,i,o,c,d,u,g="",m=e.indexOf("=");-1===m&&(m=e.length);for(var p=0,y=m>>3<<3;p<y;)n=s[e.charAt(p++)],a=s[e.charAt(p++)],r=s[e.charAt(p++)],i=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],d=s[e.charAt(p++)],u=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|r<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|d>>>3))+String.fromCharCode(255&(d<<5|u));var f=m-y;return 2===f?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))):4===f?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],r=s[e.charAt(p++)],i=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|r<<1|i>>>4))):5===f?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],r=s[e.charAt(p++)],i=s[e.charAt(p++)],o=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|r<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))):7===f&&(n=s[e.charAt(p++)],a=s[e.charAt(p++)],r=s[e.charAt(p++)],i=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],d=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|r<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|d>>>3))),g},u={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,r,i,s="",c=e.length,l=0,h=5*parseInt(c/5);l<h;)t=e[l++],n=e[l++],a=e[l++],r=e[l++],i=e[l++],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[31&(r<<3|i>>>5)]+o[31&i];var d=c-h;return 1===d?(t=e[l],s+=o[t>>>3]+o[t<<2&31]+"======"):2===d?(t=e[l++],n=e[l],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===d?(t=e[l++],n=e[l++],a=e[l],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===d&&(t=e[l++],n=e[l++],a=e[l++],r=e[l],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[r<<3&31]+"="),s}(e):t?function(e){for(var t,n,a,r,i,s="",c=e.length,l=0,h=5*parseInt(c/5);l<h;)t=e.charCodeAt(l++),n=e.charCodeAt(l++),a=e.charCodeAt(l++),r=e.charCodeAt(l++),i=e.charCodeAt(l++),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[31&(r<<3|i>>>5)]+o[31&i];var d=c-h;return 1===d?(t=e.charCodeAt(l),s+=o[t>>>3]+o[t<<2&31]+"======"):2===d?(t=e.charCodeAt(l++),n=e.charCodeAt(l),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===d?(t=e.charCodeAt(l++),n=e.charCodeAt(l++),a=e.charCodeAt(l),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===d&&(t=e.charCodeAt(l++),n=e.charCodeAt(l++),a=e.charCodeAt(l++),r=e.charCodeAt(l),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[r<<3&31]+"="),s}(e):function(e){var t,n,a,r,i,s,l,h=!1,d="",u=0,g=0,m=e.length;if(""===e)return d;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],l=g;u<m&&l<5;++u)(s=e.charCodeAt(u))<128?c[l++]=s:s<2048?(c[l++]=192|s>>6,c[l++]=128|63&s):s<55296||s>=57344?(c[l++]=224|s>>12,c[l++]=128|s>>6&63,c[l++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++u)),c[l++]=240|s>>18,c[l++]=128|s>>12&63,c[l++]=128|s>>6&63,c[l++]=128|63&s);g=l-5,u===m&&++u,u>m&&l<6&&(h=!0),t=c[0],l>4?(n=c[1],a=c[2],r=c[3],i=c[4],d+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[31&(r<<3|i>>>5)]+o[31&i]):1===l?d+=o[t>>>3]+o[t<<2&31]+"======":2===l?(n=c[1],d+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===l?(n=c[1],a=c[2],d+=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],r=c[3],d+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|r>>>7)]+o[r>>>2&31]+o[r<<3&31]+"=")}while(!h);return d}(e)},decode:d};d.asBytes=h,r?e.exports=u:(t.base32=u,i&&(void 0===(a=function(){return u}.call(u,n,u,e))||(e.exports=a)))}()},6314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(o[c]=!0)}for(var l=0;l<e.length;l++){var h=[].concat(e[l]);a&&o[h[0]]||(void 0!==i&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=i),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),r&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=r):h[4]="".concat(r)),t.push(h))}},t}},7007:e=>{var t,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,a){function r(n){e.removeListener(t,i),a(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}p(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,r)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,a){var r,i,o,l;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),o=i[t]),void 0===o)o=i[t]=n,++e._eventsCount;else if("function"==typeof o?o=i[t]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),(r=c(e))>0&&o.length>r&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,l=h,console&&console.warn&&console.warn(l)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=h.bind(a);return r.listener=n,a.wrapFn=r,r}function u(e,t,n){var a=e._events;if(void 0===a)return[];var r=a[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):m(r,r.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function p(e,t,n,a){if("function"==typeof e.on)a.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(i){a.once&&e.removeEventListener(t,r),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)a(c,this,t);else{var l=c.length,h=m(c,l);for(n=0;n<l;++n)a(h[n],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,a,r,i,o;if(s(t),void 0===(a=this._events))return this;if(void 0===(n=a[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){o=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(a[e]=n[0]),void 0!==a.removeListener&&this.emit("removeListener",e,o||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,a;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,i=Object.keys(n);for(a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this},i.prototype.listeners=function(e){return u(this,e,!0)},i.prototype.rawListeners=function(e){return u(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},i.prototype.listenerCount=g,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7372:(e,t,n)=>{var a=n(1594),r=e.exports;!function(){var e,t,n,i=/[\\\"\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 i.lastIndex=0,i.test(e)?'"'+e.replace(i,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(r,i){var o,l,h,d,u,g=e,m=i[r],p=null!=m&&(m instanceof a||a.isBigNumber(m));switch(m&&"object"==typeof m&&"function"==typeof m.toJSON&&(m=m.toJSON(r)),"function"==typeof n&&(m=n.call(i,r,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,u=[],"[object Array]"===Object.prototype.toString.apply(m)){for(d=m.length,o=0;o<d;o+=1)u[o]=c(o,m)||"null";return h=0===u.length?"[]":e?"[\n"+e+u.join(",\n"+e)+"\n"+g+"]":"["+u.join(",")+"]",e=g,h}if(n&&"object"==typeof n)for(d=n.length,o=0;o<d;o+=1)"string"==typeof n[o]&&(h=c(l=n[o],m))&&u.push(s(l)+(e?": ":":")+h);else Object.keys(m).forEach((function(t){var n=c(t,m);n&&u.push(s(t)+(e?": ":":")+n)}));return h=0===u.length?"{}":e?"{\n"+e+u.join(",\n"+e)+"\n"+g+"}":"{"+u.join(",")+"}",e=g,h}}"function"!=typeof r.stringify&&(r.stringify=function(a,r,i){var o;if(e="",t="","number"==typeof i)for(o=0;o<i;o+=1)t+=" ";else"string"==typeof i&&(t=i);if(n=r,r&&"function"!=typeof r&&("object"!=typeof r||"number"!=typeof r.length))throw new Error("JSON.stringify");return c("",{"":a})})}()},7659:e=>{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},7825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,r&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},8146:(e,t,n)=>{var a=null;const r=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,i=/(?: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){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,l,h={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},d=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},u=function(e){return e&&e!==s&&d("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(o),o+=1,s},g=function(){var e,r="";for("-"===s&&(r="-",u("-"));s>="0"&&s<="9";)r+=s,u();if("."===s)for(r+=".";u()&&s>="0"&&s<="9";)r+=s;if("e"===s||"E"===s)for(r+=s,u(),"-"!==s&&"+"!==s||(r+=s,u());s>="0"&&s<="9";)r+=s,u();if(e=+r,isFinite(e))return null==a&&(a=n(1594)),r.length>15?t.storeAsString?r:t.useNativeBigInt?BigInt(r):new a(r):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new a(e):e;d("Bad number")},m=function(){var e,t,n,a="";if('"'===s)for(var r=o;u();){if('"'===s)return o-1>r&&(a+=c.substring(r,o-1)),u(),a;if("\\"===s){if(o-1>r&&(a+=c.substring(r,o-1)),u(),"u"===s){for(n=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)n=16*n+e;a+=String.fromCharCode(n)}else{if("string"!=typeof h[s])break;a+=h[s]}r=o}}d("Bad string")},p=function(){for(;s&&s<=" ";)u()};return l=function(){switch(p(),s){case"{":return function(){var e,n=Object.create(null);if("{"===s){if(u("{"),p(),"}"===s)return u("}"),n;for(;s;){if(e=m(),p(),u(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&d('Duplicate key "'+e+'"'),!0===r.test(e)?"error"===t.protoAction?d("Object contains forbidden prototype property"):"ignore"===t.protoAction?l():n[e]=l():!0===i.test(e)?"error"===t.constructorAction?d("Object contains forbidden constructor property"):"ignore"===t.constructorAction?l():n[e]=l():n[e]=l(),p(),"}"===s)return u("}"),n;u(","),p()}}d("Bad object")}();case"[":return function(){var e=[];if("["===s){if(u("["),p(),"]"===s)return u("]"),e;for(;s;){if(e.push(l()),p(),"]"===s)return u("]"),e;u(","),p()}}d("Bad array")}();case'"':return m();case"-":return g();default:return s>="0"&&s<="9"?g():function(){switch(s){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}d("Unexpected '"+s+"'")}()}},function(e,t){var n;return c=e+"",o=0,s=" ",n=l(),p(),s&&d("Syntax error"),"function"==typeof t?function e(n,a){var r,i=n[a];return i&&"object"==typeof i&&Object.keys(i).forEach((function(t){void 0!==(r=e(i,t))?i[t]=r:delete i[t]})),t.call(n,a,i)}({"":n},""):n}}},8333:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(1601),r=n.n(a),i=n(6314),o=n.n(i)()(r());o.push([e.id,'/* ==========================================\n ALGOXSUITE COMMON UI STYLES\n ========================================== */\n\n/* SDK Container */\n#algox-sdk-container {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999999;\n width: 360px;\n background-color: white;\n border: 1px solid #ccc;\n border-radius: 8px;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n display: flex;\n flex-direction: column;\n max-height: 80vh;\n overflow: hidden;\n opacity: 1;\n visibility: visible;\n transform-origin: center;\n}\n\n#algox-sdk-container.dark-theme {\n background-color: #1a1a1a;\n border-color: #333;\n color: #fff;\n}\n\n#algox-sdk-container.minimizing {\n opacity: 0;\n visibility: hidden;\n transform: translate(-50%, -50%) scale(0.95);\n}\n\n#algox-sdk-container.maximizing {\n opacity: 0;\n visibility: hidden;\n transform: translate(-50%, -50%) scale(0.95);\n}\n\n/* Loading Overlay */\n#algox-loading-overlay {\n position: absolute;\n top: 45px;\n left: 0;\n right: 0;\n bottom: 90px;\n background: rgba(255, 255, 255, 0.7);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 15px;\n z-index: 10000000;\n opacity: 0;\n visibility: hidden;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n}\n\n.dark-theme #algox-loading-overlay {\n background: rgba(26, 26, 26, 0.7);\n border-top-color: rgba(255, 255, 255, 0.1);\n border-bottom-color: rgba(255, 255, 255, 0.1);\n}\n\n#algox-loading-overlay.visible {\n opacity: 1;\n visibility: visible;\n}\n\n#algox-loader {\n width: 40px;\n height: 40px;\n border: 3px solid #f3f3f3;\n border-top: 3px solid #3498db;\n border-radius: 50%;\n animation: algox-spin 1s linear infinite;\n}\n\n.dark-theme #algox-loader {\n border-color: #2d2d2d;\n border-top-color: #3498db;\n}\n\n@keyframes algox-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n#algox-processing-message {\n font-size: 0.9rem;\n color: #333;\n text-align: center;\n padding: 0 20px;\n line-height: 1.4;\n}\n\n.dark-theme #algox-processing-message {\n color: #fff;\n}\n\n/* Minimized Button */\n#algox-minimized-btn {\n position: fixed;\n bottom: 20px;\n width: 50px;\n height: 50px;\n border-radius: 50%;\n background-color: #ffffff;\n color: #111827;\n border: 1px solid #e5e7eb;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n font-weight: 900;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);\n z-index: 9999998;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n opacity: 0;\n transform: scale(0.8);\n}\n\n#algox-minimized-btn img {\n width: 35px;\n height: 35px;\n object-fit: contain;\n}\n\n#algox-minimized-btn span {\n font-size: 1.1rem;\n line-height: 1;\n}\n\n#algox-minimized-btn:hover {\n transform: scale(1.1);\n background-color: #f3f4f6;\n}\n\n#algox-minimized-btn.dark-theme {\n background-color: #2d2d2d;\n color: #fff;\n}\n\n#algox-minimized-btn.dark-theme:hover {\n background-color: #1a1a1a;\n}\n\n#algox-minimized-btn.left {\n left: 20px;\n}\n\n#algox-minimized-btn.right {\n right: 20px;\n}\n\n#algox-minimized-btn.showing {\n opacity: 1;\n transform: scale(1);\n}\n\n#algox-minimized-btn.hiding {\n opacity: 0;\n transform: scale(0.8);\n}\n\n#algox-minimized-btn::before {\n content: "";\n position: absolute;\n top: -3px;\n left: -3px;\n right: -3px;\n bottom: -3px;\n border-radius: 50%;\n border: 3px solid transparent;\n opacity: 0;\n transition: opacity 0.3s ease;\n z-index: 99999999;\n pointer-events: none;\n}\n\n#algox-minimized-btn.processing::before {\n opacity: 1;\n border-top-color: #3498db;\n border-right-color: #3498db;\n animation: algox-spin 1s linear infinite;\n z-index: 99999999;\n}\n\n.dark-theme #algox-minimized-btn.processing::before {\n border-top-color: #3498db;\n border-right-color: #3498db;\n}\n\n/* Header */\n#algox-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 14px;\n border-bottom: 1px solid #e5e7eb;\n background-color: #f8f9fa;\n}\n\n.dark-theme #algox-header {\n background-color: #2d2d2d;\n border-bottom-color: #444;\n}\n\n#algox-header .header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n#algox-header .header-left img {\n width: 28px;\n height: 28px;\n object-fit: contain;\n}\n\n#algox-header .header-left h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: #111827;\n}\n\n.dark-theme #algox-header .header-left h3 {\n color: #f9fafb;\n}\n\n#algox-header .header-right {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n#algox-header .header-right button {\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 4px 8px;\n border-radius: 4px;\n transition: background-color 0.2s;\n font-size: 1.25rem;\n color: #111827;\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n#algox-header .header-right button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.dark-theme #algox-header .header-right button {\n color: #f9fafb;\n}\n\n.dark-theme #algox-header .header-right button:hover {\n background-color: rgba(255, 255, 255, 0.08);\n}\n\n#algox-logout-btn {\n transform: rotate(180deg);\n transition: opacity 0.3s ease;\n}\n\n#algox-logout-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Wallet Selection Screen */\n#algox-wallet-choice {\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.algox-wallet-btn {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n padding: 12px 14px;\n background: #ffffff;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s;\n font-weight: 600;\n color: #333;\n}\n\n.algox-wallet-btn:hover {\n background-color: #f9fafb;\n border-color: #3498db;\n transform: translateY(-2px);\n}\n\n.algox-wallet-btn img {\n width: 24px;\n height: 24px;\n object-fit: contain;\n}\n\n.dark-theme .algox-wallet-btn {\n background-color: #111827;\n border-color: #374151;\n color: #f9fafb;\n}\n\n.dark-theme .algox-wallet-btn:hover {\n background-color: #1f2937;\n border-color: #60a5fa;\n}\n\n/* Wallet Address Bar */\n#algox-wallet-address {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n user-select: text;\n cursor: pointer;\n display: none;\n color: #111827;\n padding: 12px 15px;\n font-size: 0.85rem;\n font-family: monospace;\n background-color: #f8f9fa;\n border-top: 1px solid #ddd;\n letter-spacing: 0.5px;\n}\n\n.dark-theme #algox-wallet-address {\n color: #f9fafb;\n background-color: #2d2d2d;\n border-top-color: #444;\n}\n\n/* Footer */\n#algox-footer {\n padding: 8px 15px;\n font-size: 0.85rem;\n text-align: center;\n color: #666;\n background-color: #f8f9fa;\n border-top: 1px solid #ddd;\n user-select: none;\n}\n\n.dark-theme #algox-footer {\n color: #999;\n background-color: #2d2d2d;\n border-top-color: #444;\n}\n\n#algox-footer a {\n color: #3498db;\n text-decoration: none;\n transition: color 0.2s ease;\n}\n\n#algox-footer a:hover {\n color: #2980b9;\n text-decoration: underline;\n}\n\n.dark-theme #algox-footer a {\n color: #5dade2;\n}\n\n.dark-theme #algox-footer a:hover {\n color: #3498db;\n}\n\n/* Toast Notifications */\n#algox-toast {\n position: fixed;\n z-index: 10000002;\n opacity: 0;\n transition: opacity 0.2s ease;\n min-width: 280px;\n max-width: 420px;\n background: #ffffff;\n color: #111827;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);\n padding: 10px 12px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n#algox-toast.top-left {\n top: 20px;\n left: 20px;\n}\n\n#algox-toast.top-right {\n top: 20px;\n right: 20px;\n}\n\n.dark-theme #algox-toast {\n background: #1f2937;\n color: #f9fafb;\n border-color: #374151;\n}\n\n#algox-toast .toast-content {\n flex: 1;\n word-wrap: break-word;\n overflow-wrap: break-word;\n white-space: normal;\n}\n\n#algox-toast .toast-close {\n background: none;\n border: none;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n padding: 0;\n font-size: 16px;\n line-height: 1;\n transition: opacity 0.2s ease;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n#algox-toast .toast-close:hover {\n opacity: 1;\n}\n\n#algox-toast.success {\n border-left: 4px solid #10b981;\n}\n\n#algox-toast.error {\n border-left: 4px solid #ef4444;\n}\n\n#algox-toast.warning {\n border-left: 4px solid #f59e0b;\n}\n\n#algox-toast.info {\n border-left: 4px solid #3498db;\n}\n\n/* Temporary Wallet Connection UI (Headless Mode) */\n#algox-temp-wallet-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 999999;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n}\n\n#algox-temp-wallet-overlay .temp-wallet-container {\n background: white;\n padding: 2rem;\n border-radius: 12px;\n text-align: center;\n max-width: 400px;\n width: 90%;\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);\n margin: 1rem;\n}\n\n#algox-temp-wallet-overlay .temp-wallet-title {\n margin: 0 0 1rem 0;\n color: #1f2937;\n font-size: 1.5rem;\n font-weight: 600;\n}\n\n#algox-temp-wallet-overlay .temp-wallet-message {\n margin: 0 0 1.5rem 0;\n color: #6b7280;\n font-size: 1rem;\n line-height: 1.5;\n}\n\n#algox-temp-wallet-overlay .temp-wallet-spinner {\n width: 40px;\n height: 40px;\n border: 4px solid #e5e7eb;\n border-top: 4px solid #3b82f6;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n margin: 0 auto 1rem auto;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n#algox-temp-wallet-overlay .temp-wallet-cancel-btn {\n background: #ef4444;\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: 8px;\n font-size: 1rem;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n\n#algox-temp-wallet-overlay .temp-wallet-cancel-btn:hover {\n background: #dc2626;\n}\n\n/* ==========================================\n COMMON TAB UI SYSTEM (ALGOXSUITE STANDARD)\n ========================================== */\n\n/* Tab Container */\n.algox-tabs-container {\n display: flex;\n align-items: center;\n gap: 8px;\n border-bottom: 2px solid #e5e7eb;\n padding: 0 16px;\n margin-top: 12px;\n position: relative;\n}\n\n.dark-theme .algox-tabs-container {\n border-bottom-color: #444;\n}\n\n/* Tab Navigation Buttons */\n.algox-tab-nav-btn {\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 8px;\n border-radius: 4px;\n transition: background-color 0.2s;\n color: #6b7280;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.1rem;\n flex-shrink: 0;\n}\n\n.algox-tab-nav-btn:hover:not(:disabled) {\n background-color: rgba(0, 0, 0, 0.05);\n color: #111827;\n}\n\n.algox-tab-nav-btn:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.dark-theme .algox-tab-nav-btn {\n color: #9ca3af;\n}\n\n.dark-theme .algox-tab-nav-btn:hover:not(:disabled) {\n background-color: rgba(255, 255, 255, 0.08);\n color: #f9fafb;\n}\n\n/* Tabs Wrapper */\n.algox-tabs-wrapper {\n flex: 1;\n overflow: hidden;\n position: relative;\n}\n\n/* Tabs Track */\n.algox-tabs-track {\n display: flex;\n gap: 6px;\n transition: transform 0.3s ease;\n}\n\n/* Tab Buttons */\n.algox-tab-btn {\n flex: 0 0 calc(50% - 3px);\n min-width: calc(50% - 3px);\n padding: 10px;\n border: none;\n background: none;\n cursor: pointer;\n color: #6b7280;\n border-bottom: 2px solid transparent;\n font-size: 13px;\n font-weight: 500;\n transition: all 0.2s;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.algox-tab-btn:hover {\n color: #111827;\n background-color: rgba(0, 0, 0, 0.03);\n}\n\n.dark-theme .algox-tab-btn {\n color: #9ca3af;\n}\n\n.dark-theme .algox-tab-btn:hover {\n color: #f9fafb;\n background: rgba(255, 255, 255, 0.05);\n}\n\n.algox-tab-btn.active {\n color: #3498db;\n border-bottom-color: #3498db;\n}\n\n.dark-theme .algox-tab-btn.active {\n color: #60a5fa;\n border-bottom-color: #60a5fa;\n}\n\n/* Tab Content */\n.algox-tab-content {\n padding: 16px;\n overflow-y: auto;\n flex-grow: 1;\n}\n\n.algox-tab-pane {\n display: none;\n}\n\n.algox-tab-pane.active {\n display: block;\n}\n',""]);const s=o},8947:(e,t,n)=>{!function(e){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},a=function(){throw new Error("no PRNG")},r=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var o=t(),s=t([1]),c=t([56129,1]),l=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]),g=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(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 p(e,t,n,a,r){var i,o=0;for(i=0;i<r;i++)o|=e[t+i]^n[a+i];return(1&o-1>>>8)-1}function y(e,t,n,a){return p(e,t,n,a,16)}function f(e,t,n,a){return p(e,t,n,a,32)}function v(e,t,n,a){!function(e,t,n,a){for(var r,i=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,l=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,u=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,y=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,f=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,w=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,I=i,S=o,A=s,C=c,E=l,x=h,k=d,B=u,D=g,N=m,R=p,M=y,T=f,L=v,V=w,W=b,G=0;G<20;G+=2)I^=(r=(T^=(r=(D^=(r=(E^=(r=I+T|0)<<7|r>>>25)+I|0)<<9|r>>>23)+E|0)<<13|r>>>19)+D|0)<<18|r>>>14,x^=(r=(S^=(r=(L^=(r=(N^=(r=x+S|0)<<7|r>>>25)+x|0)<<9|r>>>23)+N|0)<<13|r>>>19)+L|0)<<18|r>>>14,R^=(r=(k^=(r=(A^=(r=(V^=(r=R+k|0)<<7|r>>>25)+R|0)<<9|r>>>23)+V|0)<<13|r>>>19)+A|0)<<18|r>>>14,W^=(r=(M^=(r=(B^=(r=(C^=(r=W+M|0)<<7|r>>>25)+W|0)<<9|r>>>23)+C|0)<<13|r>>>19)+B|0)<<18|r>>>14,I^=(r=(C^=(r=(A^=(r=(S^=(r=I+C|0)<<7|r>>>25)+I|0)<<9|r>>>23)+S|0)<<13|r>>>19)+A|0)<<18|r>>>14,x^=(r=(E^=(r=(B^=(r=(k^=(r=x+E|0)<<7|r>>>25)+x|0)<<9|r>>>23)+k|0)<<13|r>>>19)+B|0)<<18|r>>>14,R^=(r=(N^=(r=(D^=(r=(M^=(r=R+N|0)<<7|r>>>25)+R|0)<<9|r>>>23)+M|0)<<13|r>>>19)+D|0)<<18|r>>>14,W^=(r=(V^=(r=(L^=(r=(T^=(r=W+V|0)<<7|r>>>25)+W|0)<<9|r>>>23)+T|0)<<13|r>>>19)+L|0)<<18|r>>>14;I=I+i|0,S=S+o|0,A=A+s|0,C=C+c|0,E=E+l|0,x=x+h|0,k=k+d|0,B=B+u|0,D=D+g|0,N=N+m|0,R=R+p|0,M=M+y|0,T=T+f|0,L=L+v|0,V=V+w|0,W=W+b|0,e[0]=I>>>0&255,e[1]=I>>>8&255,e[2]=I>>>16&255,e[3]=I>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=D>>>0&255,e[33]=D>>>8&255,e[34]=D>>>16&255,e[35]=D>>>24&255,e[36]=N>>>0&255,e[37]=N>>>8&255,e[38]=N>>>16&255,e[39]=N>>>24&255,e[40]=R>>>0&255,e[41]=R>>>8&255,e[42]=R>>>16&255,e[43]=R>>>24&255,e[44]=M>>>0&255,e[45]=M>>>8&255,e[46]=M>>>16&255,e[47]=M>>>24&255,e[48]=T>>>0&255,e[49]=T>>>8&255,e[50]=T>>>16&255,e[51]=T>>>24&255,e[52]=L>>>0&255,e[53]=L>>>8&255,e[54]=L>>>16&255,e[55]=L>>>24&255,e[56]=V>>>0&255,e[57]=V>>>8&255,e[58]=V>>>16&255,e[59]=V>>>24&255,e[60]=W>>>0&255,e[61]=W>>>8&255,e[62]=W>>>16&255,e[63]=W>>>24&255}(e,t,n,a)}function w(e,t,n,a){!function(e,t,n,a){for(var r,i=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,l=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,u=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,y=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,f=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,w=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,I=0;I<20;I+=2)i^=(r=(f^=(r=(g^=(r=(l^=(r=i+f|0)<<7|r>>>25)+i|0)<<9|r>>>23)+l|0)<<13|r>>>19)+g|0)<<18|r>>>14,h^=(r=(o^=(r=(v^=(r=(m^=(r=h+o|0)<<7|r>>>25)+h|0)<<9|r>>>23)+m|0)<<13|r>>>19)+v|0)<<18|r>>>14,p^=(r=(d^=(r=(s^=(r=(w^=(r=p+d|0)<<7|r>>>25)+p|0)<<9|r>>>23)+w|0)<<13|r>>>19)+s|0)<<18|r>>>14,b^=(r=(y^=(r=(u^=(r=(c^=(r=b+y|0)<<7|r>>>25)+b|0)<<9|r>>>23)+c|0)<<13|r>>>19)+u|0)<<18|r>>>14,i^=(r=(c^=(r=(s^=(r=(o^=(r=i+c|0)<<7|r>>>25)+i|0)<<9|r>>>23)+o|0)<<13|r>>>19)+s|0)<<18|r>>>14,h^=(r=(l^=(r=(u^=(r=(d^=(r=h+l|0)<<7|r>>>25)+h|0)<<9|r>>>23)+d|0)<<13|r>>>19)+u|0)<<18|r>>>14,p^=(r=(m^=(r=(g^=(r=(y^=(r=p+m|0)<<7|r>>>25)+p|0)<<9|r>>>23)+y|0)<<13|r>>>19)+g|0)<<18|r>>>14,b^=(r=(w^=(r=(v^=(r=(f^=(r=b+w|0)<<7|r>>>25)+b|0)<<9|r>>>23)+f|0)<<13|r>>>19)+v|0)<<18|r>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=h>>>0&255,e[5]=h>>>8&255,e[6]=h>>>16&255,e[7]=h>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=b>>>0&255,e[13]=b>>>8&255,e[14]=b>>>16&255,e[15]=b>>>24&255,e[16]=d>>>0&255,e[17]=d>>>8&255,e[18]=d>>>16&255,e[19]=d>>>24&255,e[20]=u>>>0&255,e[21]=u>>>8&255,e[22]=u>>>16&255,e[23]=u>>>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 b=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function I(e,t,n,a,r,i,o){var s,c,l=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)l[c]=0;for(c=0;c<8;c++)l[c]=i[c];for(;r>=64;){for(v(h,l,o,b),c=0;c<64;c++)e[t+c]=n[a+c]^h[c];for(s=1,c=8;c<16;c++)s=s+(255&l[c])|0,l[c]=255&s,s>>>=8;r-=64,t+=64,a+=64}if(r>0)for(v(h,l,o,b),c=0;c<r;c++)e[t+c]=n[a+c]^h[c];return 0}function S(e,t,n,a,r){var i,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(v(c,s,r,b),o=0;o<64;o++)e[t+o]=c[o];for(i=1,o=8;o<16;o++)i=i+(255&s[o])|0,s[o]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(v(c,s,r,b),o=0;o<n;o++)e[t+o]=c[o];return 0}function A(e,t,n,a,r){var i=new Uint8Array(32);w(i,a,r,b);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=a[s+16];return S(e,t,n,o,i)}function C(e,t,n,a,r,i,o){var s=new Uint8Array(32);w(s,i,o,b);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=i[l+16];return I(e,t,n,a,r,c,s)}var E=function(e){var t,n,a,r,i,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),r=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(a>>>7|r<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(r>>>4|i<<12),this.r[5]=i>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>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 x(e,t,n,a,r,i){var o=new E(i);return o.update(n,a,r),o.finish(e,t),0}function k(e,t,n,a,r,i){var o=new Uint8Array(16);return x(o,0,n,a,r,i),y(e,t,o,0)}function B(e,t,n,a,r){var i;if(n<32)return-1;for(C(e,0,t,0,n,a,r),x(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function D(e,t,n,a,r){var i,o=new Uint8Array(32);if(n<32)return-1;if(A(o,0,32,a,r),0!==k(t,16,t,32,n-32,o))return-1;for(C(e,0,t,0,n,a,r),i=0;i<32;i++)e[i]=0;return 0}function N(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function R(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 M(e,t,n){for(var a,r=~(n-1),i=0;i<16;i++)a=r&(e[i]^t[i]),e[i]^=a,t[i]^=a}function T(e,n){var a,r,i,o=t(),s=t();for(a=0;a<16;a++)s[a]=n[a];for(R(s),R(s),R(s),r=0;r<2;r++){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),i=o[15]>>16&1,o[14]&=65535,M(s,o,1-i)}for(a=0;a<16;a++)e[2*a]=255&s[a],e[2*a+1]=s[a]>>8}function L(e,t){var n=new Uint8Array(32),a=new Uint8Array(32);return T(n,e),T(a,t),f(n,0,a,0)}function V(e){var t=new Uint8Array(32);return T(t,e),1&t[0]}function W(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function G(e,t,n){for(var a=0;a<16;a++)e[a]=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*H,B+=a*K,D+=a*j,N+=a*O,R+=a*U,M+=a*J,T+=a*Q,L+=a*$,b+=(a=t[15])*W,o+=38*(S+=a*F),s+=38*(A+=a*Y),c+=38*(C+=a*Z),l+=38*(E+=a*z),h+=38*(x+=a*P),d+=38*(k+=a*X),u+=38*(B+=a*H),g+=38*(D+=a*K),m+=38*(N+=a*j),p+=38*(R+=a*O),y+=38*(M+=a*U),f+=38*(T+=a*J),v+=38*(L+=a*Q),w+=38*(V+=a*$),i=(a=(i+=38*(I+=a*G))+(r=1)+65535)-65536*(r=Math.floor(a/65536)),o=(a=o+r+65535)-65536*(r=Math.floor(a/65536)),s=(a=s+r+65535)-65536*(r=Math.floor(a/65536)),c=(a=c+r+65535)-65536*(r=Math.floor(a/65536)),l=(a=l+r+65535)-65536*(r=Math.floor(a/65536)),h=(a=h+r+65535)-65536*(r=Math.floor(a/65536)),d=(a=d+r+65535)-65536*(r=Math.floor(a/65536)),u=(a=u+r+65535)-65536*(r=Math.floor(a/65536)),g=(a=g+r+65535)-65536*(r=Math.floor(a/65536)),m=(a=m+r+65535)-65536*(r=Math.floor(a/65536)),p=(a=p+r+65535)-65536*(r=Math.floor(a/65536)),y=(a=y+r+65535)-65536*(r=Math.floor(a/65536)),f=(a=f+r+65535)-65536*(r=Math.floor(a/65536)),v=(a=v+r+65535)-65536*(r=Math.floor(a/65536)),w=(a=w+r+65535)-65536*(r=Math.floor(a/65536)),b=(a=b+r+65535)-65536*(r=Math.floor(a/65536)),i=(a=(i+=r-1+37*(r-1))+(r=1)+65535)-65536*(r=Math.floor(a/65536)),o=(a=o+r+65535)-65536*(r=Math.floor(a/65536)),s=(a=s+r+65535)-65536*(r=Math.floor(a/65536)),c=(a=c+r+65535)-65536*(r=Math.floor(a/65536)),l=(a=l+r+65535)-65536*(r=Math.floor(a/65536)),h=(a=h+r+65535)-65536*(r=Math.floor(a/65536)),d=(a=d+r+65535)-65536*(r=Math.floor(a/65536)),u=(a=u+r+65535)-65536*(r=Math.floor(a/65536)),g=(a=g+r+65535)-65536*(r=Math.floor(a/65536)),m=(a=m+r+65535)-65536*(r=Math.floor(a/65536)),p=(a=p+r+65535)-65536*(r=Math.floor(a/65536)),y=(a=y+r+65535)-65536*(r=Math.floor(a/65536)),f=(a=f+r+65535)-65536*(r=Math.floor(a/65536)),v=(a=v+r+65535)-65536*(r=Math.floor(a/65536)),w=(a=w+r+65535)-65536*(r=Math.floor(a/65536)),b=(a=b+r+65535)-65536*(r=Math.floor(a/65536)),i+=r-1+37*(r-1),e[0]=i,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=h,e[6]=d,e[7]=u,e[8]=g,e[9]=m,e[10]=p,e[11]=y,e[12]=f,e[13]=v,e[14]=w,e[15]=b}function Z(e,t){Y(e,t,t)}function z(e,n){var a,r=t();for(a=0;a<16;a++)r[a]=n[a];for(a=253;a>=0;a--)Z(r,r),2!==a&&4!==a&&Y(r,r,n);for(a=0;a<16;a++)e[a]=r[a]}function P(e,n){var a,r=t();for(a=0;a<16;a++)r[a]=n[a];for(a=250;a>=0;a--)Z(r,r),1!==a&&Y(r,r,n);for(a=0;a<16;a++)e[a]=r[a]}function X(e,n,a){var r,i,o=new Uint8Array(32),s=new Float64Array(80),l=t(),h=t(),d=t(),u=t(),g=t(),m=t();for(i=0;i<31;i++)o[i]=n[i];for(o[31]=127&n[31]|64,o[0]&=248,W(s,a),i=0;i<16;i++)h[i]=s[i],u[i]=l[i]=d[i]=0;for(l[0]=u[0]=1,i=254;i>=0;--i)M(l,h,r=o[i>>>3]>>>(7&i)&1),M(d,u,r),G(g,l,d),F(l,l,d),G(d,h,u),F(h,h,u),Z(u,g),Z(m,l),Y(l,d,l),Y(d,h,g),G(g,l,d),F(l,l,d),Z(h,l),F(d,u,m),Y(l,d,c),G(l,l,u),Y(d,d,l),Y(l,u,m),Y(u,h,s),Z(h,g),M(l,h,r),M(d,u,r);for(i=0;i<16;i++)s[i+16]=l[i],s[i+32]=d[i],s[i+48]=h[i],s[i+64]=u[i];var p=s.subarray(32),y=s.subarray(16);return z(p,p),Y(y,y,p),T(e,y),0}function H(e,t){return X(e,t,i)}function K(e,t){return a(t,32),H(e,t)}function j(e,t,n){var a=new Uint8Array(32);return X(a,n,t),w(e,r,a,b)}E.prototype.blocks=function(e,t,n){for(var a,r,i,o,s,c,l,h,d,u,g,m,p,y,f,v,w,b,I,S=this.fin?0:2048,A=this.h[0],C=this.h[1],E=this.h[2],x=this.h[3],k=this.h[4],B=this.h[5],D=this.h[6],N=this.h[7],R=this.h[8],M=this.h[9],T=this.r[0],L=this.r[1],V=this.r[2],W=this.r[3],G=this.r[4],F=this.r[5],Y=this.r[6],Z=this.r[7],z=this.r[8],P=this.r[9];n>=16;)u=d=0,u+=(A+=8191&(a=255&e[t+0]|(255&e[t+1])<<8))*T,u+=(C+=8191&(a>>>13|(r=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*P),u+=(E+=8191&(r>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*z),u+=(x+=8191&(i>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*Z),d=(u+=(k+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*Y))>>>13,u&=8191,u+=(B+=s>>>1&8191)*(5*F),u+=(D+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*G),u+=(N+=8191&(c>>>11|(l=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*W),u+=(R+=8191&(l>>>8|(h=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*V),g=d+=(u+=(M+=h>>>5|S)*(5*L))>>>13,g+=A*L,g+=C*T,g+=E*(5*P),g+=x*(5*z),d=(g+=k*(5*Z))>>>13,g&=8191,g+=B*(5*Y),g+=D*(5*F),g+=N*(5*G),g+=R*(5*W),d+=(g+=M*(5*V))>>>13,g&=8191,m=d,m+=A*V,m+=C*L,m+=E*T,m+=x*(5*P),d=(m+=k*(5*z))>>>13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ype.finish=function(e,t){var n,a,r,i,o=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=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,i=1;i<10;i++)o[i]=this.h[i]+n,n=o[i]>>>13,o[i]&=8191;for(o[9]-=8192,a=(1^n)-1,i=0;i<10;i++)o[i]&=a;for(a=~a,i=0;i<10;i++)this.h[i]=this.h[i]&a|o[i];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),r=this.h[0]+this.pad[0],this.h[0]=65535&r,i=1;i<8;i++)r=(this.h[i]+this.pad[i]|0)+(r>>>16)|0,this.h[i]=65535&r;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},E.prototype.update=function(e,t,n){var a,r;if(this.leftover){for((r=16-this.leftover)>n&&(r=n),a=0;a<r;a++)this.buffer[this.leftover+a]=e[t+a];if(n-=r,t+=r,this.leftover+=r,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(r=n-n%16,this.blocks(e,t,r),t+=r,n-=r),n){for(a=0;a<n;a++)this.buffer[this.leftover+a]=e[t+a];this.leftover+=n}};var O=B,U=D,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 Q(e,t,n,a){for(var r,i,o,s,c,l,h,d,u,g,m,p,y,f,v,w,b,I,S,A,C,E,x,k,B,D,N=new Int32Array(16),R=new Int32Array(16),M=e[0],T=e[1],L=e[2],V=e[3],W=e[4],G=e[5],F=e[6],Y=e[7],Z=t[0],z=t[1],P=t[2],X=t[3],H=t[4],K=t[5],j=t[6],O=t[7],U=0;a>=128;){for(S=0;S<16;S++)A=8*S+U,N[S]=n[A+0]<<24|n[A+1]<<16|n[A+2]<<8|n[A+3],R[S]=n[A+4]<<24|n[A+5]<<16|n[A+6]<<8|n[A+7];for(S=0;S<80;S++)if(r=M,i=T,o=L,s=V,c=W,l=G,h=F,u=Z,g=z,m=P,p=X,y=H,f=K,v=j,x=65535&(E=O),k=E>>>16,B=65535&(C=Y),D=C>>>16,x+=65535&(E=(H>>>14|W<<18)^(H>>>18|W<<14)^(W>>>9|H<<23)),k+=E>>>16,B+=65535&(C=(W>>>14|H<<18)^(W>>>18|H<<14)^(H>>>9|W<<23)),D+=C>>>16,x+=65535&(E=H&K^~H&j),k+=E>>>16,B+=65535&(C=W&G^~W&F),D+=C>>>16,x+=65535&(E=J[2*S+1]),k+=E>>>16,B+=65535&(C=J[2*S]),D+=C>>>16,C=N[S%16],k+=(E=R[S%16])>>>16,B+=65535&C,D+=C>>>16,B+=(k+=(x+=65535&E)>>>16)>>>16,x=65535&(E=I=65535&x|k<<16),k=E>>>16,B=65535&(C=b=65535&B|(D+=B>>>16)<<16),D=C>>>16,x+=65535&(E=(Z>>>28|M<<4)^(M>>>2|Z<<30)^(M>>>7|Z<<25)),k+=E>>>16,B+=65535&(C=(M>>>28|Z<<4)^(Z>>>2|M<<30)^(Z>>>7|M<<25)),D+=C>>>16,k+=(E=Z&z^Z&P^z&P)>>>16,B+=65535&(C=M&T^M&L^T&L),D+=C>>>16,d=65535&(B+=(k+=(x+=65535&E)>>>16)>>>16)|(D+=B>>>16)<<16,w=65535&x|k<<16,x=65535&(E=p),k=E>>>16,B=65535&(C=s),D=C>>>16,k+=(E=I)>>>16,B+=65535&(C=b),D+=C>>>16,T=r,L=i,V=o,W=s=65535&(B+=(k+=(x+=65535&E)>>>16)>>>16)|(D+=B>>>16)<<16,G=c,F=l,Y=h,M=d,z=u,P=g,X=m,H=p=65535&x|k<<16,K=y,j=f,O=v,Z=w,S%16==15)for(A=0;A<16;A++)C=N[A],x=65535&(E=R[A]),k=E>>>16,B=65535&C,D=C>>>16,C=N[(A+9)%16],x+=65535&(E=R[(A+9)%16]),k+=E>>>16,B+=65535&C,D+=C>>>16,b=N[(A+1)%16],x+=65535&(E=((I=R[(A+1)%16])>>>1|b<<31)^(I>>>8|b<<24)^(I>>>7|b<<25)),k+=E>>>16,B+=65535&(C=(b>>>1|I<<31)^(b>>>8|I<<24)^b>>>7),D+=C>>>16,b=N[(A+14)%16],k+=(E=((I=R[(A+14)%16])>>>19|b<<13)^(b>>>29|I<<3)^(I>>>6|b<<26))>>>16,B+=65535&(C=(b>>>19|I<<13)^(I>>>29|b<<3)^b>>>6),D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,N[A]=65535&B|D<<16,R[A]=65535&x|k<<16;x=65535&(E=Z),k=E>>>16,B=65535&(C=M),D=C>>>16,C=e[0],k+=(E=t[0])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[0]=M=65535&B|D<<16,t[0]=Z=65535&x|k<<16,x=65535&(E=z),k=E>>>16,B=65535&(C=T),D=C>>>16,C=e[1],k+=(E=t[1])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[1]=T=65535&B|D<<16,t[1]=z=65535&x|k<<16,x=65535&(E=P),k=E>>>16,B=65535&(C=L),D=C>>>16,C=e[2],k+=(E=t[2])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[2]=L=65535&B|D<<16,t[2]=P=65535&x|k<<16,x=65535&(E=X),k=E>>>16,B=65535&(C=V),D=C>>>16,C=e[3],k+=(E=t[3])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[3]=V=65535&B|D<<16,t[3]=X=65535&x|k<<16,x=65535&(E=H),k=E>>>16,B=65535&(C=W),D=C>>>16,C=e[4],k+=(E=t[4])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[4]=W=65535&B|D<<16,t[4]=H=65535&x|k<<16,x=65535&(E=K),k=E>>>16,B=65535&(C=G),D=C>>>16,C=e[5],k+=(E=t[5])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[5]=G=65535&B|D<<16,t[5]=K=65535&x|k<<16,x=65535&(E=j),k=E>>>16,B=65535&(C=F),D=C>>>16,C=e[6],k+=(E=t[6])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[6]=F=65535&B|D<<16,t[6]=j=65535&x|k<<16,x=65535&(E=O),k=E>>>16,B=65535&(C=Y),D=C>>>16,C=e[7],k+=(E=t[7])>>>16,B+=65535&C,D+=C>>>16,D+=(B+=(k+=(x+=65535&E)>>>16)>>>16)>>>16,e[7]=Y=65535&B|D<<16,t[7]=O=65535&x|k<<16,U+=128,a-=128}return a}function $(e,t,n){var a,r=new Int32Array(8),i=new Int32Array(8),o=new Uint8Array(256),s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(r,i,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,m(o,n-8,s/536870912|0,s<<3),Q(r,i,o,n),a=0;a<8;a++)m(e,8*a,r[a],i[a]);return 0}function _(e,n){var a=t(),r=t(),i=t(),o=t(),s=t(),c=t(),l=t(),d=t(),u=t();F(a,e[1],e[0]),F(u,n[1],n[0]),Y(a,a,u),G(r,e[0],e[1]),G(u,n[0],n[1]),Y(r,r,u),Y(i,e[3],n[3]),Y(i,i,h),Y(o,e[2],n[2]),G(o,o,o),F(s,r,a),F(c,o,i),G(l,o,i),G(d,r,a),Y(e[0],s,c),Y(e[1],d,l),Y(e[2],l,c),Y(e[3],s,d)}function q(e,t,n){var a;for(a=0;a<4;a++)M(e[a],t[a],n)}function ee(e,n){var a=t(),r=t(),i=t();z(i,n[2]),Y(a,n[0],i),Y(r,n[1],i),T(e,r),e[31]^=V(a)<<7}function te(e,t,n){var a,r;for(N(e[0],o),N(e[1],s),N(e[2],s),N(e[3],o),r=255;r>=0;--r)q(e,t,a=n[r/8|0]>>(7&r)&1),_(t,e),_(e,e),q(e,t,a)}function ne(e,n){var a=[t(),t(),t(),t()];N(a[0],d),N(a[1],u),N(a[2],s),Y(a[3],d,u),te(e,a,n)}function ae(e,n,r){var i,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(r||a(n,32),$(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,ne(s,o),ee(e,s),i=0;i<32;i++)n[i+32]=e[i];return 0}var re=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,r,i;for(a=63;a>=32;--a){for(n=0,r=a-32,i=a-12;r<i;++r)t[r]+=n-16*t[a]*re[r-(a-32)],n=Math.floor((t[r]+128)/256),t[r]-=256*n;t[r]+=n,t[a]=0}for(n=0,r=0;r<32;r++)t[r]+=n-(t[31]>>4)*re[r],n=t[r]>>8,t[r]&=255;for(r=0;r<32;r++)t[r]-=n*re[r];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function oe(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 se(e,n,a,r){var i,o,s=new Uint8Array(64),c=new Uint8Array(64),l=new Uint8Array(64),h=new Float64Array(64),d=[t(),t(),t(),t()];$(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64;var u=a+64;for(i=0;i<a;i++)e[64+i]=n[i];for(i=0;i<32;i++)e[32+i]=s[32+i];for($(l,e.subarray(32),a+32),oe(l),ne(d,l),ee(e,d),i=32;i<64;i++)e[i]=r[i];for($(c,e,a+64),oe(c),i=0;i<64;i++)h[i]=0;for(i=0;i<32;i++)h[i]=l[i];for(i=0;i<32;i++)for(o=0;o<32;o++)h[i+o]+=c[i]*s[o];return ie(e.subarray(32),h),u}function ce(e,n,a,r){var i,c=new Uint8Array(32),h=new Uint8Array(64),d=[t(),t(),t(),t()],u=[t(),t(),t(),t()];if(a<64)return-1;if(function(e,n){var a=t(),r=t(),i=t(),c=t(),h=t(),d=t(),u=t();return N(e[2],s),W(e[1],n),Z(i,e[1]),Y(c,i,l),F(i,i,e[2]),G(c,e[2],c),Z(h,c),Z(d,h),Y(u,d,h),Y(a,u,i),Y(a,a,c),P(a,a),Y(a,a,i),Y(a,a,c),Y(a,a,c),Y(e[0],a,c),Z(r,e[0]),Y(r,r,c),L(r,i)&&Y(e[0],e[0],g),Z(r,e[0]),Y(r,r,c),L(r,i)?-1:(V(e[0])===n[31]>>7&&F(e[0],o,e[0]),Y(e[3],e[0],e[1]),0)}(u,r))return-1;for(i=0;i<a;i++)e[i]=n[i];for(i=0;i<32;i++)e[i+32]=r[i];if($(h,e,a),oe(h),te(d,u,h),ne(u,n.subarray(32)),_(d,u),ee(c,d),a-=64,f(n,0,c,0)){for(i=0;i<a;i++)e[i]=0;return-1}for(i=0;i<a;i++)e[i]=n[i+64];return a}var le=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 ge(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function me(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:C,crypto_stream:A,crypto_stream_salsa20_xor:I,crypto_stream_salsa20:S,crypto_onetimeauth:x,crypto_onetimeauth_verify:k,crypto_verify_16:y,crypto_verify_32:f,crypto_secretbox:B,crypto_secretbox_open:D,crypto_scalarmult:X,crypto_scalarmult_base:H,crypto_box_beforenm:j,crypto_box_afternm:O,crypto_box:function(e,t,n,a,r,i){var o=new Uint8Array(32);return j(o,r,i),O(e,t,n,a,o)},crypto_box_open:function(e,t,n,a,r,i){var o=new Uint8Array(32);return j(o,r,i),U(e,t,n,a,o)},crypto_box_keypair:K,crypto_hash:$,crypto_sign:se,crypto_sign_keypair:ae,crypto_sign_open:ce,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:le,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:de,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:l,L:re,pack25519:T,unpack25519:W,M:Y,A:G,S:Z,Z:F,pow2523:P,add:_,set25519:N,modL:ie,scalarmult:te,scalarbase:ne},e.randomBytes=function(e){var t=new Uint8Array(e);return a(t,e),t},e.secretbox=function(e,t,n){ge(e,t,n),ue(n,t);for(var a=new Uint8Array(32+e.length),r=new Uint8Array(a.length),i=0;i<e.length;i++)a[i+32]=e[i];return B(r,a,a.length,t,n),r.subarray(16)},e.secretbox.open=function(e,t,n){ge(e,t,n),ue(n,t);for(var a=new Uint8Array(16+e.length),r=new Uint8Array(a.length),i=0;i<e.length;i++)a[i+16]=e[i];return a.length<32||0!==D(r,a,a.length,t,n)?null:r.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(ge(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 X(n,e,t),n},e.scalarMult.base=function(e){if(ge(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,a,r){var i=e.box.before(a,r);return e.secretbox(t,n,i)},e.box.before=function(e,t){ge(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 j(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,a,r){var i=e.box.before(a,r);return e.secretbox.open(t,n,i)},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(ge(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(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(ge(e,t),t.length!==de)throw new Error("bad secret key size");var n=new Uint8Array(le+e.length);return se(n,e,e.length,t),n},e.sign.open=function(e,t){if(ge(e,t),t.length!==he)throw new Error("bad public key size");var n=new Uint8Array(e.length),a=ce(n,e,e.length,t);if(a<0)return null;for(var r=new Uint8Array(a),i=0;i<r.length;i++)r[i]=n[i];return r},e.sign.detached=function(t,n){for(var a=e.sign(t,n),r=new Uint8Array(le),i=0;i<r.length;i++)r[i]=a[i];return r},e.sign.detached.verify=function(e,t,n){if(ge(e,t,n),t.length!==le)throw new Error("bad signature size");if(n.length!==he)throw new Error("bad public key size");var a,r=new Uint8Array(le+e.length),i=new Uint8Array(le+e.length);for(a=0;a<le;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+le]=e[a];return ce(i,r,r.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(de);return ae(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(ge(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(ge(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 ae(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=de,e.sign.seedLength=32,e.sign.signatureLength=le,e.hash=function(e){ge(e);var t=new Uint8Array(64);return $(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return ge(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===p(e,0,t,0,e.length)},e.setPRNG=function(e){a=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,n){var a,r=new Uint8Array(n);for(a=0;a<n;a+=65536)t.getRandomValues(r.subarray(a,a+Math.min(n-a,65536)));for(a=0;a<n;a++)e[a]=r[a];me(r)})):(t=n(1281))&&t.randomBytes&&e.setPRNG((function(e,n){var a,r=t.randomBytes(n);for(a=0;a<n;a++)e[a]=r[a];me(r)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},9698:e=>{e.exports=JSON.parse('{"hints":{"addNFTListing(uint64,string,string,string)byte[]":{"call_config":{"no_op":"CALL"}},"getNFTListing(string,uint64)(string,string,string)":{"read_only":true,"call_config":{"no_op":"CALL"},"structs":{"output":{"name":"Listing","elements":[["seller","string"],["nftPrice","string"],["marketplace","string"]]}}},"removeNFTListing(string,uint64)byte[]":{"call_config":{"no_op":"CALL"}},"contractOptInToNFT(string,uint64)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToContractAndAddListing(uint64,string,string,string)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToContract(string,uint64)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToReceiver(string,uint64,string)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToSeller(string,uint64,string)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToReceiverAndRemoveListing(uint64,string,string)byte[]":{"call_config":{"no_op":"CALL"}},"transferNFTToSellerAndRemoveListing(uint64,string,string)byte[]":{"call_config":{"no_op":"CALL"}},"fundContract(uint64)void":{"call_config":{"no_op":"CALL"}},"withdrawExcessFunds()void":{"call_config":{"no_op":"CALL"}}},"source":{"approval":"I3ByYWdtYSB2ZXJzaW9uIDExCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBpbnRjYmxvY2sgMCAyIDEgOAogICAgYnl0ZWNibG9jayAibGlzdGluZ18iIDB4MTUxZjdjNzUwMDIwIDB4MDAwNgogICAgLy8gc21hcnRfY29udHJhY3RzL0FsZ29NaW50WC9jb250cmFjdC5hbGdvLnRzOjI3CiAgICAvLyBleHBvcnQgY2xhc3MgQWxnb01pbnRYIGV4dGVuZHMgQ29udHJhY3QgewogICAgdHhuIE51bUFwcEFyZ3MKICAgIGJ6IG1haW5fX19hbGdvdHNfXy5kZWZhdWx0Q3JlYXRlQDE5CiAgICB0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WJtaXQoKTsKICAgIGl0eG5fc3VibWl0CiAgICAvLyBzbWFydF9jb250cmFjdHMvQWxnb01pbnRYL2NvbnRyYWN0LmFsZ28udHM6OTgKICAgIC8vIEBhYmltZXRob2QoKQogICAgYnl0ZWNfMSAvLyAweDE1MWY3Yzc1MDAyMAogICAgLy8gc21hcnRfY29udHJhY3RzL0FsZ29NaW50WC9jb250cmFjdC5hbGdvLnRzOjExNgogICAgLy8gcmV0dXJuIFR4bi50eElkOwogICAgdHhuIFR4SUQKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9BbGdvTWludFgvY29udHJhY3QuYWxnby50czo5OAogICAgLy8gQGFiaW1ldGhvZCgpCiAgICBjb25jYXQKICAgIGxvZwogICAgaW50Y18yIC8vIDEKICAgIHJldHVybgoKCi8vIHNtYXJ0X2NvbnRyYWN0cy9BbGdvTWludFgvY29udHJhY3QuYWxnby50czo6QWxnb01pbnRYLnRyYW5zZmVyTkZUVG9Db250cmFjdEFuZEFkZExpc3Rpbmdbcm91dGluZ10oKSAtPiB2b2lkOgp0cmFuc2Zlck5GVFRvQ29udHJhY3RBbmRBZGRMaXN0aW5nOgogICAgLy8gc21hcnRfY29udHJhY3RzL0FsZ29NaW50WC9jb250cmFjdC5hbGdvLnRzOjEyNAogICAgLy8gQGFiaW1ldGhvZCgpCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICBkdXAKICAgIGxlbgogICAgaW50Y18zIC8vIDgKICAgID09CiAgICBhc3NlcnQgLy8gaW52YWxpZCBudW1iZXIgb2YgYnl0ZXMgZm9yIGFyYzQudWludDY0CiAgICBidG9pCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAyCiAgICBkdXAKICAgIGludGNfMCAvLyAwCiAgICBleHRyYWN0X3VpbnQxNiAvLyBvbiBlcnJvcjogaW52YWxpZCBhcnJheSBsZW5ndGggaGVhZGVyCiAgICBpbnRjXzEgLy8gMgogICAgKwogICAgZGlnIDEKICAgIGxlbgogICAgZ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WludFgvY29udHJhY3QuYWxnby50czoyODkKICAgIC8vIEBhYmltZXRob2QoKQogICAgYnl0ZWNfMSAvLyAweDE1MWY3Yzc1MDAyMAogICAgLy8gc21hcnRfY29udHJhY3RzL0FsZ29NaW50WC9jb250cmFjdC5hbGdvLnRzOjMyNQogICAgLy8gcmV0dXJuIFR4bi50eElkOwogICAgdHhuIFR4SUQKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9BbGdvTWludFgvY29udHJhY3QuYWxnby50czoyODkKICAgIC8vIEBhYmltZXRob2QoKQogICAgY29uY2F0CiAgICBsb2cKICAgIGludGNfMiAvLyAxCiAgICByZXR1cm4KCgovLyBzbWFydF9jb250cmFjdHMvQWxnb01pbnRYL2NvbnRyYWN0LmFsZ28udHM6OkFsZ29NaW50WC5mdW5kQ29udHJhY3Rbcm91dGluZ10oKSAtPiB2b2lkOgpmdW5kQ29udHJhY3Q6CiAgICAvLyBzbWFydF9jb250cmFjdHMvQWxnb01pbnRYL2NvbnRyYWN0LmFsZ28udHM6MzMzCiAgICAvLyBAYWJpbWV0aG9kKCkKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIGR1cAogICAgbGVuCiAgICBpbnRjXzMgLy8gOAogICAgPT0KICAgIGFzc2VydCAvLyBpbnZhbGlkIG51bWJlciBvZiBieXRlcyBmb3IgYXJjNC51aW50NjQKICAgIGJ0b2kKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9BbGdvTWludFgvY29udHJhY3QuYWxnby50czozMzYKICAgIC8vIFR4bi5zZW5kZXIgPT09IEdsb2JhbC5jcmVhdG9yQWRkcmVzcywKICAgIHR4biBTZW5kZXIKICAgIGdsb2JhbCBDcmVhdG9yQWRkcmVzcwogICAgPT0KICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9BbGdvTWludFgvY29udHJhY3QuYWxnby50czozMzUtMzM4CiAgICAvLyBhc3NlcnQoCiAgICAvLyAgIFR4bi5zZW5kZXIgPT09IEdsb2JhbC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JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg=="},"state":{"global":{"num_byte_slices":0,"num_uints":0},"local":{"num_byte_slices":0,"num_uints":0}},"schema":{"global":{"declared":{},"reserved":{}},"local":{"declared":{},"reserved":{}}},"contract":{"name":"AlgoMintX","methods":[{"name":"addNFTListing","args":[{"type":"uint64","name":"assetId"},{"type":"string","name":"senderWalletAddress"},{"type":"string","name":"nftPrice"},{"type":"string","name":"marketplace"}],"readonly":false,"returns":{"type":"byte[]"},"desc":"\\nBox only methods"},{"name":"getNFTListing","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"}],"readonly":true,"returns":{"type":"(string,string,string)"}},{"name":"removeNFTListing","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"}],"readonly":false,"returns":{"type":"byte[]"}},{"name":"contractOptInToNFT","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"}],"readonly":false,"returns":{"type":"byte[]"},"desc":"\\nNFT methods"},{"name":"transferNFTToContractAndAddListing","args":[{"type":"uint64","name":"assetId"},{"type":"string","name":"senderWalletAddress"},{"type":"string","name":"nftPrice"},{"type":"string","name":"marketplace"}],"readonly":false,"returns":{"type":"byte[]"},"desc":"Records a listing and opt-ins the contract to the asset.\\nEscrow is completed by a user-signed asset transfer in the same atomic group\\n(mirrors AlgoStakeX stake: app call + outer asset transfer)."},{"name":"transferNFTToContract","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"}],"readonly":false,"returns":{"type":"byte[]"},"desc":"Opt-in only. Pair with a user-signed asset transfer in the same atomic group."},{"name":"transferNFTToReceiver","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"},{"type":"string","name":"sellerWalletAddress"}],"readonly":false,"returns":{"type":"byte[]"}},{"name":"transferNFTToSeller","args":[{"type":"string","name":"marketplace"},{"type":"uint64","name":"assetId"},{"type":"string","name":"sellerWalletAddress"}],"readonly":false,"returns":{"type":"byte[]"}},{"name":"transferNFTToReceiverAndRemoveListing","args":[{"type":"uint64","name":"assetId"},{"type":"string","name":"sellerWalletAddress"},{"type":"string","name":"marketplace"}],"readonly":false,"returns":{"type":"byte[]"},"desc":"\\nNFT + Box methods"},{"name":"transferNFTToSellerAndRemoveListing","args":[{"type":"uint64","name":"assetId"},{"type":"string","name":"sellerWalletAddress"},{"type":"string","name":"marketplace"}],"readonly":false,"returns":{"type":"byte[]"}},{"name":"fundContract","args":[{"type":"uint64","name":"amount"}],"readonly":false,"returns":{"type":"void"},"desc":"\\nMisc methods"},{"name":"withdrawExcessFunds","args":[],"readonly":false,"returns":{"type":"void"}}],"networks":{}},"bare_call_config":{"no_op":"CREATE"}}')}},a={};function r(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=n,r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>e+".algomintx.esm.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),e={792:0},t=t=>{var n,a,{__webpack_ids__:i,__webpack_modules__:o,__webpack_runtime__:s}=t,c=0;for(n in o)r.o(o,n)&&(r.m[n]=o[n]);for(s&&s(r);c<i.length;c++)a=i[c],r.o(e,a)&&e[a]&&e[a][0](),e[i[c]]=0},r.f.j=(n,a)=>{var i=r.o(e,n)?e[n]:void 0;if(0!==i)if(i)a.push(i[1]);else{var o=import("./"+r.u(n)).then(t,(t=>{throw 0!==e[n]&&(e[n]=void 0),t}));o=Promise.race([o,new Promise((t=>i=e[n]=[t]))]),a.push(i[1]=o)}},r.nc=void 0;var i={};r.d(i,{A:()=>xn});var o=r(3899),s=new(r(7007).EventEmitter);s.setMaxListeners(20);const c=s;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function h(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function u(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,g(a.key),a)}}function g(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,n=[{key:"validateRequired",value:function(e,t){if(null==e)throw new Error("".concat(t," is required"));return e}},{key:"validateString",value:function(t,n){if(e.validateRequired(t,n),"string"!=typeof t)throw new Error("".concat(n," must be a string"));if(0===t.trim().length)throw new Error("".concat(n," cannot be empty"));return t}},{key:"validateEnum",value:function(t,n,a){if(e.validateString(t,n),!a.includes(t))throw new Error("".concat(n," must be one of: ").concat(a.join(", ")));return t}},{key:"validateNumber",value:function(e,t){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)return null!==(n=a.default)&&void 0!==n?n:0;if("number"!=typeof e)throw new Error("".concat(t," must be a number"));if(!Number.isFinite(e))throw new Error("".concat(t," must be a finite number"));if(void 0!==a.min&&e<a.min)throw new Error("".concat(t," must be greater than or equal to ").concat(a.min));if(void 0!==a.max&&e>a.max)throw new Error("".concat(t," must be less than or equal to ").concat(a.max));return e}},{key:"validateBoolean",value:function(e,t){if(null==e)return arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("boolean"!=typeof e)throw new Error("".concat(t," must be a boolean"));return e}},{key:"validateUrl",value:function(t,n){e.validateString(t,n);try{return new URL(t),t}catch(e){throw new Error("".concat(n," must be a valid URL"))}}},{key:"validatePinataServerKey",value:function(t){return e.validateString(t,"Pinata IPFS server key")}},{key:"validatePinataGatewayUrl",value:function(t){if(null==t)return null;var n=e.validateString(t,"Pinata IPFS gateway URL");if(n.startsWith("http://")||n.startsWith("https://"))throw new Error("Pinata IPFS gateway URL must not include http:// or https://");if(n.includes("/"))throw new Error("Pinata IPFS gateway URL must not contain any forward slashes");try{return new URL("https://".concat(n)),n}catch(e){throw new Error("Pinata IPFS gateway URL must be a valid URL")}}},{key:"validateEnvironment",value:function(t){return e.validateEnum(t,"Environment",["testnet","mainnet"])}},{key:"validateMarketplaceType",value:function(t){return e.validateEnum(t,"marketplaceType",["FT","NFT"])}},{key:"validateNamespace",value:function(t){var n=e.validateString(t,"Namespace");if(5!==n.length)throw new Error("Namespace must be exactly 5 characters long");if(!/^[A-Z]+$/.test(n))throw new Error("Namespace must contain only uppercase letters");return n}},{key:"validateRevenueWalletAddress",value:function(t){var n=e.validateString(t,"Revenue wallet address");if(58!==n.length)throw new Error("Revenue wallet address must be 58 characters long");if(!/^[A-Z2-7]{58}$/.test(n))throw new Error("Invalid Algorand wallet address format");return n}},{key:"validateFee",value:function(t,n){return e.validateNumber(t,n,{min:0})}},{key:"validateDisableToast",value:function(t){return e.validateBoolean(t,"disableToast",!1)}},{key:"validateDisableUi",value:function(t){return e.validateBoolean(t,"disableUi",!1)}},{key:"validateMinimizeUILocation",value:function(t){return e.validateEnum(t,"minimizeUILocation",["left","right"])||"right"}},{key:"validateLogo",value:function(t){if(null==t)return null;var n=e.validateString(t,"Logo");if(n.startsWith("http://")||n.startsWith("https://"))return e.validateUrl(n,"Logo");if(n.startsWith("./")||n.startsWith("../")||n.startsWith("/")){if(!/^[./\\a-zA-Z0-9_-]+\.(png|jpg|jpeg|gif|svg|webp)$/i.test(n))throw new Error("Invalid logo file path. Must be a valid image file path");return n}throw new Error("Logo must be either a valid URL or a valid local file path")}},{key:"validateToastLocation",value:function(t){return e.validateEnum(t,"Toast location",["TOP_LEFT","TOP_RIGHT"])}},{key:"validateSupportedMediaFormats",value:function(e){if(!Array.isArray(e))throw new Error("supportedMediaFormats must be an array");var t=["IMAGE","VIDEO","AUDIO"],n=e.filter((function(e){return!t.includes(e)}));if(n.length>0)throw new Error("Invalid media formats: ".concat(n.join(", "),". Valid formats are: ").concat(t.join(", ")));return e}},{key:"validateFileType",value:function(e,t){var n,a,r={IMAGE:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml"],VIDEO:["video/mp4","video/webm","video/ogg","video/quicktime"],AUDIO:["audio/mpeg","audio/wav","audio/ogg","audio/mp4","audio/webm"]},i=t.reduce((function(e,t){return[].concat(h(e),h(r[t]))}),[]),o=e.type||e.mimetype;if(!o||!i.includes(o)){var s=t.map((function(e){return e.toLowerCase()})).join(", ");return{valid:!1,message:"Please upload a supported file type (".concat(s,")")}}var c=null!==(n=e.size)&&void 0!==n?n:e.data instanceof Uint8Array?e.data.byteLength:null===(a=e.data)||void 0===a?void 0:a.length;return null!=c&&c>104857600?{valid:!1,message:"File size must be less than 100MB"}:{valid:!0}}},{key:"sanitizeInput",value:function(e){return(e=(e=(e=(e=e.replace(/<[^>]*>/g,"")).replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")).replace(/[^a-zA-Z0-9\s.,!?@#$%^&*()_+\-=\[\]{};':"\\|<>\/]/g,"")).replace(/\s+/g," ")).trim()}},{key:"validateNFTName",value:function(e){return e.length<1||e.length>50?{valid:!1,message:"NFT name must be between 1 and 50 characters"}:{valid:!0}}},{key:"validateNFTDescription",value:function(e){return e.length<1||e.length>500?{valid:!1,message:"NFT description must be between 1 and 500 characters"}:{valid:!0}}},{key:"validateFTName",value:function(e){return e.length<1||e.length>50?{valid:!1,message:"FT name must be between 1 and 50 characters"}:{valid:!0}}},{key:"validateFTDescription",value:function(e){return e.length<1||e.length>500?{valid:!1,message:"FT description must be between 1 and 500 characters"}:{valid:!0}}},{key:"validateFTDecimals",value:function(e){if(null==e||""===e)return{valid:!1,message:"Decimals is required"};var t=Number(e);return Number.isInteger(t)?t<0||t>19?{valid:!1,message:"Decimals must be between 0 and 19"}:{valid:!0}:{valid:!1,message:"Decimals must be a whole number"}}},{key:"validateFTTotalSupply",value:function(e){if(null==e||""===e)return{valid:!1,message:"Total supply is required"};var t=Number(e);return Number.isInteger(t)?t<1?{valid:!1,message:"Total supply must be at least 1"}:t>Number.MAX_SAFE_INTEGER?{valid:!1,message:"Total supply is too large"}:{valid:!0}:{valid:!1,message:"Total supply must be a whole number"}}}],null&&u(t.prototype,null),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}(),p=r(5072),y=r.n(p),f=r(7825),v=r.n(f),w=r(7659),b=r.n(w),I=r(5056),S=r.n(I),A=r(540),C=r.n(A),E=r(1113),x=r.n(E),k=r(8333),B={};B.styleTagTransform=x(),B.setAttributes=S(),B.insert=b().bind(null,"head"),B.domAPI=v(),B.insertStyleElement=C(),y()(k.A,B),k.A&&k.A.locals&&k.A.locals;var D=r(4143),N={};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function M(){M=function(){return t};var e,t={},n=Object.prototype,a=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function h(e,t,n,a){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new N(a||[]);return r(o,"_invoke",{value:x(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var u="suspendedStart",g="suspendedYield",m="executing",p="completed",y={};function f(){}function v(){}function w(){}var b={};l(b,o,(function(){return this}));var I=Object.getPrototypeOf,S=I&&I(I(T([])));S&&S!==n&&a.call(S,o)&&(b=S);var A=w.prototype=f.prototype=Object.create(b);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,i,o,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==R(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,a){function r(){return new t((function(t,r){n(e,a,t,r)}))}return i=i?i.then(r,r):r()}})}function x(t,n,a){var r=u;return function(i,o){if(r===m)throw Error("Generator is already running");if(r===p){if("throw"===i)throw o;return{value:e,done:!0}}for(a.method=i,a.arg=o;;){var s=a.delegate;if(s){var c=k(s,a);if(c){if(c===y)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===u)throw r=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=m;var l=d(t,n,a);if("normal"===l.type){if(r=a.done?p:g,l.arg===y)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r=p,a.method="throw",a.arg=l.arg)}}}function k(t,n){var a=n.method,r=t.iterator[a];if(r===e)return n.delegate=null,"throw"===a&&t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var i=d(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(a.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(R(t)+" is not iterable")}return v.prototype=w,r(A,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:v,configurable:!0}),v.displayName=l(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},C(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,a,r,i){void 0===i&&(i=Promise);var o=new E(h(e,n,a,r),i);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(A),l(A,c,"Generator"),l(A,o,(function(){return this})),l(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(a,r){return s.type="throw",s.arg=t,n.next=a,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,a){return this.delegate={iterator:T(t),resultName:n,nextLoc:a},"next"===this.method&&(this.arg=e),y}},t}function T(e,t,n,a,r,i,o){try{var s=e[i](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(a,r)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var i=e.apply(t,n);function o(e){T(i,a,r,o,s,"next",e)}function s(e){T(i,a,r,o,s,"throw",e)}o(void 0)}))}}function V(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,W(a.key),a)}}function W(e){var t=function(e){if("object"!=R(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==R(t)?t:t+""}function G(e,t,n){F(e,t),t.set(e,n)}function F(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Y(e,t){return e.get(z(e,t))}function Z(e,t,n){return e.set(z(e,t),n),n}function z(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}N.styleTagTransform=x(),N.setAttributes=S(),N.insert=b().bind(null,"head"),N.domAPI=v(),N.insertStyleElement=C(),y()(D.A,N),D.A&&D.A.locals&&D.A.locals;var P=new WeakMap,X=new WeakMap,H=new WeakMap,K=new WeakMap,j=new WeakMap,O=new WeakMap,U=new WeakMap,J=new WeakMap,Q=new WeakMap,$=new WeakMap,_=new WeakSet,q=function(){return e=function e(t,n){var a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),F(this,a=_),a.add(this),G(this,P,void 0),G(this,X,void 0),G(this,H,void 0),G(this,K,void 0),G(this,j,void 0),G(this,O,void 0),G(this,U,void 0),G(this,J,void 0),G(this,Q,void 0),G(this,$,void 0),Z(P,this,t),Z(X,this,n.disableUi),Z(H,this,n.disableToast),Z(K,this,n.logo),Z(j,this,n.minimizeUILocation),Z(O,this,n.toastLocation),Z(U,this,null),Z(J,this,n.marketplaceType||"NFT"),Z(Q,this,null),Z($,this,null)},t=[{key:"initUI",value:function(e){if(!Y(X,this)){var t=document.getElementById("algox-sdk-container");t&&t.remove();var n=document.createElement("div");n.id="algox-sdk-container",n.style.display=Y(P,this).isMinimized?"none":"flex";var a='\n <div id="algox-header">\n <div class="header-left">\n '.concat(Y(K,this)?'<img src="'.concat(Y(K,this),'" alt="AlgoMintX" onerror="this.style.display=\'none\'; this.nextElementSibling.style.display=\'block\';" />'):"",'\n <h3 style="').concat(Y(K,this)?"display: none;":"display: block;",'">AlgoMintX</h3>\n </div>\n <div class="header-right">\n <button id="algox-theme-btn" title="Toggle Theme">🌓</button>\n <button id="algox-logout-btn" title="Logout" style="display: none;">⏻</button>\n <button id="algox-minimize-btn" title="Minimize">&#x2013;</button>\n </div>\n </div>\n \n <div id="algox-wallet-choice">\n <button class="algox-wallet-btn" data-wallet="pera">\n <img src="https://perawallet.s3.amazonaws.com/images/media-kit/logomark-white.svg" alt="Pera Wallet" />\n Connect Pera Wallet\n </button>\n <button class="algox-wallet-btn" data-wallet="defly">\n <img src="https://docs.defly.app/~gitbook/image?url=https%3A%2F%2F2700986753-files.gitbook.io%2F~%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fcollections%252FWDbwYIFtoiPa3JoJufCw%252Ficon%252FbQUUOW6VhH6vKR0XH7UB%252Flogo-notext-whiteonblack.png%3Falt%3Dmedia%26token%3D7d62c65b-fd29-47b6-a83b-162caac2fc8f&width=32&dpr=2&quality=100&sign=952138fe&sv=2" alt="Defly Wallet" />\n Connect Defly Wallet\n </button>\n </div>'),r="NFT"===Y(J,this),i="FT"===Y(J,this),o='\n <div id="algox-mintx-content">\n <div class="algox-tabs-container">\n <button class="algox-tab-nav-btn" id="algox-tab-prev">‹</button>\n <div class="algox-tabs-wrapper">\n <div class="algox-tabs-track">\n '.concat(r?'<button class="algox-tab-btn active" data-tab="nft">Mint NFT</button>':"","\n ").concat(i?'<button class="algox-tab-btn'.concat(r?"":" active",'" data-tab="ft">Mint FT</button>'):"",'\n </div>\n </div>\n <button class="algox-tab-nav-btn" id="algox-tab-next">›</button>\n </div>\n\n <div class="algox-tab-content">\n ').concat(r?'<div id="algox-nft-tab" class="algox-tab-pane active">\n <div id="algox-mintx-nft-form">\n <input type="text" id="algox-mintx-nft-name" placeholder="NFT Name" />\n <textarea id="algox-mintx-nft-description" placeholder="NFT Description"></textarea>\n <input type="file" id="algox-mintx-nft-file" accept="image/*,video/*" />\n <button id="algox-mintx-mint-btn" title="Mint NFT">Mint NFT</button>\n <button id="algox-mintx-reset-btn">Mint another NFT</button>\n <div id="algox-mintx-messages" title="Click to copy"></div>\n </div>\n </div>':"","\n ").concat(i?'<div id="algox-ft-tab" class="algox-tab-pane'.concat(r?"":" active",'">\n <div id="algox-mintx-ft-content">\n <input type="text" id="algox-mintx-ft-name" placeholder="Token Name" />\n <textarea id="algox-mintx-ft-description" placeholder="Token Description"></textarea>\n <input type="number" id="algox-mintx-ft-decimals" placeholder="Decimals (0 - 19)" min="0" max="19" step="1" />\n <input type="number" id="algox-mintx-ft-supply" placeholder="Total Supply" min="1" step="1" />\n <label class="algox-mintx-ft-file-label" for="algox-mintx-ft-file">Token Icon (optional)</label>\n <input type="file" id="algox-mintx-ft-file" accept="image/*" />\n <button id="algox-mintx-ft-mint-btn" title="Mint FT">Mint FT</button>\n <button id="algox-mintx-ft-reset-btn">Mint another FT</button>\n <div id="algox-mintx-ft-messages" title="Click to copy"></div>\n </div>\n </div>'):"","\n </div>\n </div>"),s=Y(K,this)?"":'\n <div id="algox-footer">\n <span>AlgoMintX crafted with ❤️ by <a href="https://ibhagyesh.com/" target="_blank" rel="noopener noreferrer">ibhagyesh</a></span>\n </div>',c='\n <div id="algox-wallet-address" title="Click to copy connected wallet address"></div>\n '.concat(s,'\n\n <div id="algox-loading-overlay">\n <div id="algox-loader"></div>\n <div id="algox-processing-message"></div>\n </div>');n.innerHTML=a+o+c,document.body.appendChild(n);var l=document.getElementById("algox-minimized-btn");l&&l.remove();var h=document.createElement("button");h.id="algox-minimized-btn",h.innerHTML=Y(K,this)?'<img src="'.concat(Y(K,this),'" alt="AMX" onerror="this.style.display=\'none\'; this.nextElementSibling.style.display=\'block\';" /><span style="display: none;">AMX</span>'):"AMX",document.body.appendChild(h),this.applyTheme(),this.setupThemeListener(),z(_,this,ee).call(this,e),z(_,this,ne).call(this,e),this.setupToastContainer()}}},{key:"showSDKUI",value:function(){Y(X,this)||(Y(P,this)&&Y(P,this).account?(document.getElementById("algox-sdk-container").style.display="flex",document.getElementById("algox-header").style.display="flex",document.getElementById("algox-logout-btn").style.display="contents",document.getElementById("algox-wallet-choice").style.display="none",document.getElementById("algox-mintx-content").style.display="flex",this.updateWalletAddressBar(),Y(P,this).isMinimized?this.minimizeSDK(!0):this.maximizeSDK(!0)):this.resetToLoginUI())}},{key:"resetToLoginUI",value:function(){Y(X,this)||(this.clearMessage(),this.clearFTMessage(),this.updateWalletAddressBar(),document.getElementById("algox-sdk-container").style.display="flex",document.getElementById("algox-header").style.display="flex",document.getElementById("algox-logout-btn").style.display="none",document.getElementById("algox-wallet-choice").style.display="flex",document.getElementById("algox-mintx-content").style.display="none",Y(P,this).isMinimized?this.minimizeSDK(!0):this.maximizeSDK(!0))}},{key:"updateWalletAddressBar",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-wallet-address");e&&(Y(P,this).account?(e.innerText=Y(P,this).account,e.style.display="block"):(e.innerText="",e.style.display="none"))}}},{key:"setupToastContainer",value:function(){if(!Y(H,this)&&!Y(X,this)){var e=document.getElementById("algox-toast-container");e||((e=document.createElement("div")).id="algox-toast-container",e.className="TOP_LEFT"===Y(O,this)?"top-left":"top-right",document.body.appendChild(e))}}},{key:"showToast",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";if(c.emit("toast:show",{message:e,type:t}),!Y(H,this)&&!Y(X,this)){var n="algox-toast",a=document.getElementById(n);a&&a.remove();var r=document.createElement("div");r.id=n;var i=document.createElement("div");i.className="toast-content",i.innerText=e;var o=document.createElement("button");o.className="toast-close",o.innerHTML="×",o.onclick=function(){r.style.opacity="0",r.addEventListener("transitionend",(function(){return r.remove()}),{once:!0})},r.appendChild(i),r.appendChild(o),r.classList.add("error"===t?"error":"success"===t?"success":"warning"===t?"warning":"info"),r.classList.add(Y(O,this).toLowerCase().replace("_","-")),document.body.appendChild(r),requestAnimationFrame((function(){r.style.opacity="1"})),setTimeout((function(){return o.onclick()}),3500)}}},{key:"showLoadingOverlay",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Processing...";if(!Y(X,this)){var t=document.getElementById("algox-loading-overlay"),n=document.getElementById("algox-minimized-btn"),a=document.getElementById("algox-processing-message");t&&a&&(a.textContent=e,Z(U,this,e),"dark"===Y(P,this).theme?t.classList.add("dark-theme"):t.classList.remove("dark-theme"),requestAnimationFrame((function(){t.classList.add("visible"),n&&n.classList.add("processing")})))}}},{key:"hideLoadingOverlay",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-loading-overlay"),t=document.getElementById("algox-minimized-btn");e?requestAnimationFrame((function(){e.classList.remove("visible"),t&&t.classList.remove("processing")})):t&&t.classList.remove("processing")}}},{key:"updateLoadingMessage",value:function(e){if(!Y(X,this)){var t=document.getElementById("algox-processing-message");t&&(t.textContent=e,Z(U,this,e))}}},{key:"getSystemTheme",value:function(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}},{key:"setupThemeListener",value:function(){var e=this;Y(X,this)||window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(t){var n=localStorage.getItem("amx");if(n)try{JSON.parse(n).theme||(Y(P,e).theme=t.matches?"dark":"light",e.saveUIState(),e.applyTheme())}catch(e){console.error("Failed to parse saved state:",e)}}))}},{key:"applyTheme",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-sdk-container"),t=document.getElementById("algox-minimized-btn");e&&("dark"===Y(P,this).theme?(e.classList.add("dark-theme"),t&&t.classList.add("dark-theme")):(e.classList.remove("dark-theme"),t&&t.classList.remove("dark-theme")))}}},{key:"saveUIState",value:function(){Y(X,this)||localStorage.setItem("axs",JSON.stringify({minimized:Y(P,this).isMinimized,theme:Y(P,this).theme}))}},{key:"minimizeSDK",value:function(e){if(!Y(X,this)&&(e||!Y(P,this).isMinimized)){var t=document.getElementById("algox-sdk-container"),n=document.getElementById("algox-minimized-btn");t&&n&&(n.style.right="right"===Y(j,this)?"20px":"auto",n.style.left="left"===Y(j,this)?"20px":"auto",t.classList.add("minimizing"),n.style.display="block",setTimeout((function(){t.style.display="none",t.classList.remove("minimizing"),n.classList.add("showing")}),300),Y(P,this).isMinimized=!0,this.saveUIState(),c.emit("window:size:minimized",{minimized:Y(P,this).isMinimized}))}}},{key:"maximizeSDK",value:function(e){if(!Y(X,this)&&(e||Y(P,this).isMinimized)){var t=document.getElementById("algox-sdk-container"),n=document.getElementById("algox-minimized-btn");t&&n&&(n.classList.remove("showing"),n.classList.add("hiding"),setTimeout((function(){n.style.display="none",n.classList.remove("hiding"),t.style.display="flex",t.classList.add("maximizing"),setTimeout((function(){t.classList.remove("maximizing")}),300)}),200),Y(P,this).isMinimized=!1,this.saveUIState(),c.emit("window:size:maximized",{minimized:Y(P,this).isMinimized}))}}},{key:"setupNFTInputValidation",value:function(e){var t=this;if(!Y(X,this)){var n=document.getElementById("algox-mintx-nft-name"),a=document.getElementById("algox-mintx-nft-description"),r=document.getElementById("algox-mintx-nft-file"),i={IMAGE:"image/jpeg,image/png,image/gif,image/webp,image/svg+xml",VIDEO:"video/mp4,video/webm,video/ogg,video/quicktime",AUDIO:"audio/mpeg,audio/wav,audio/ogg,audio/mp4,audio/webm"},o=e.getSupportedMediaFormats().map((function(e){return i[e]})).join(",");r.setAttribute("accept",o),n.addEventListener("input",(function(n){if(n.target.value.length>50)return n.target.value=n.target.value.slice(0,50),void t.showToast("NFT name cannot exceed 50 characters","error");if(n.target.value.includes("<")||n.target.value.includes(">")){var a=e.sanitizeInput(n.target.value);a!==n.target.value&&(n.target.value=a)}t.validateMintButton()})),a.addEventListener("input",(function(n){if(n.target.value.length>500)return n.target.value=n.target.value.slice(0,500),void t.showToast("NFT description cannot exceed 500 characters","error");if(n.target.value.includes("<")||n.target.value.includes(">")){var a=e.sanitizeInput(n.target.value);a!==n.target.value&&(n.target.value=a)}t.validateMintButton()})),r.addEventListener("change",(function(n){var a=n.target.files[0];if(a){var r=e.validateFileType(a);r.valid||(t.showToast(r.message,"error"),n.target.value=""),t.validateMintButton()}else t.validateMintButton()})),n.addEventListener("paste",(function(n){n.preventDefault();var a=(n.clipboardData||window.clipboardData).getData("text"),r=a.slice(0,50),i=e.sanitizeInput(r);n.target.value=i,a.length>50&&t.showToast("NFT name cannot exceed 50 characters","error"),t.validateMintButton()})),a.addEventListener("paste",(function(n){n.preventDefault();var a=(n.clipboardData||window.clipboardData).getData("text"),r=a.slice(0,500),i=e.sanitizeInput(r);n.target.value=i,a.length>500&&t.showToast("NFT description cannot exceed 500 characters","error"),t.validateMintButton()})),this.validateMintButton()}}},{key:"validateMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-mint-btn"),t=document.getElementById("algox-mintx-nft-name"),n=document.getElementById("algox-mintx-nft-description"),a=document.getElementById("algox-mintx-nft-file"),r=t.value.trim().length>0,i=n.value.trim().length>0,o=a.files.length>0;e.disabled=!(r&&i&&o)}}},{key:"clearMessage",value:function(){Y(X,this)||Y(Q,this)&&(Y(Q,this).innerText="",Y(Q,this).style.display="none",Y(Q,this).style.cursor="pointer")}},{key:"resetNFTDetails",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-nft-name"),t=document.getElementById("algox-mintx-nft-description"),n=document.getElementById("algox-mintx-nft-file"),a=document.getElementById("algox-mintx-mint-btn"),r=document.getElementById("algox-mintx-reset-btn");e.value="",t.value="",n.value="",a.style.display="block",r.style.display="none",a.disabled=!0,this.clearMessage(),this.validateMintButton()}}},{key:"updateMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pointer";Y(X,this)||Y(Q,this)&&(Y(Q,this).innerText=e,Y(Q,this).style.display="block",Y(Q,this).style.cursor=t)}},{key:"disableMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-mint-btn"),t=document.getElementById("algox-logout-btn");e&&(e.disabled=!0),t&&(t.disabled=!0)}}},{key:"enableMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-mint-btn"),t=document.getElementById("algox-logout-btn");e&&(e.disabled=!1),t&&(t.disabled=!1)}}},{key:"showResetButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-mint-btn"),t=document.getElementById("algox-mintx-reset-btn");e&&(e.style.display="none"),t&&(t.style.display="block")}}},{key:"setupFTInputValidation",value:function(e){var t=this;if(!Y(X,this)){var n=document.getElementById("algox-mintx-ft-name"),a=document.getElementById("algox-mintx-ft-description"),r=document.getElementById("algox-mintx-ft-decimals"),i=document.getElementById("algox-mintx-ft-supply"),o=document.getElementById("algox-mintx-ft-file");n.addEventListener("input",(function(n){if(n.target.value.length>50)return n.target.value=n.target.value.slice(0,50),void t.showToast("Token name cannot exceed 50 characters","error");if(n.target.value.includes("<")||n.target.value.includes(">")){var a=e.sanitizeInput(n.target.value);a!==n.target.value&&(n.target.value=a)}t.validateFTMintButton()})),a.addEventListener("input",(function(n){if(n.target.value.length>500)return n.target.value=n.target.value.slice(0,500),void t.showToast("Token description cannot exceed 500 characters","error");if(n.target.value.includes("<")||n.target.value.includes(">")){var a=e.sanitizeInput(n.target.value);a!==n.target.value&&(n.target.value=a)}t.validateFTMintButton()})),r.addEventListener("input",(function(e){var n=e.target.value.replace(/[^0-9]/g,"");""!==n&&Number(n)>19&&(n="19",t.showToast("Decimals cannot exceed 19","error")),e.target.value=n,t.validateFTMintButton()})),i.addEventListener("input",(function(e){var n=e.target.value.replace(/[^0-9]/g,"");e.target.value=n,t.validateFTMintButton()})),o.addEventListener("change",(function(n){var a=n.target.files[0];if(a){var r=e.validateFileType(a);r.valid||(t.showToast(r.message,"error"),n.target.value="")}t.validateFTMintButton()})),n.addEventListener("paste",(function(n){n.preventDefault();var a=(n.clipboardData||window.clipboardData).getData("text"),r=a.slice(0,50);n.target.value=e.sanitizeInput(r),a.length>50&&t.showToast("Token name cannot exceed 50 characters","error"),t.validateFTMintButton()})),a.addEventListener("paste",(function(n){n.preventDefault();var a=(n.clipboardData||window.clipboardData).getData("text"),r=a.slice(0,500);n.target.value=e.sanitizeInput(r),a.length>500&&t.showToast("Token description cannot exceed 500 characters","error"),t.validateFTMintButton()})),this.validateFTMintButton()}}},{key:"validateFTMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-ft-mint-btn"),t=document.getElementById("algox-mintx-ft-name"),n=document.getElementById("algox-mintx-ft-description"),a=document.getElementById("algox-mintx-ft-decimals"),r=document.getElementById("algox-mintx-ft-supply"),i=t.value.trim().length>0,o=n.value.trim().length>0,s=Number(a.value),c=""!==a.value&&Number.isInteger(s)&&s>=0&&s<=19,l=Number(r.value),h=""!==r.value&&Number.isInteger(l)&&l>=1;e.disabled=!(i&&o&&c&&h)}}},{key:"resetFTDetails",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-ft-name"),t=document.getElementById("algox-mintx-ft-description"),n=document.getElementById("algox-mintx-ft-decimals"),a=document.getElementById("algox-mintx-ft-supply"),r=document.getElementById("algox-mintx-ft-file"),i=document.getElementById("algox-mintx-ft-mint-btn"),o=document.getElementById("algox-mintx-ft-reset-btn");e.value="",t.value="",n.value="",a.value="",r.value="",i.style.display="block",o.style.display="none",i.disabled=!0,this.clearFTMessage(),this.validateFTMintButton()}}},{key:"clearFTMessage",value:function(){Y(X,this)||Y($,this)&&(Y($,this).innerText="",Y($,this).style.display="none",Y($,this).style.cursor="pointer")}},{key:"updateFTMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pointer";Y(X,this)||Y($,this)&&(Y($,this).innerText=e,Y($,this).style.display="block",Y($,this).style.cursor=t)}},{key:"disableFTMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-ft-mint-btn"),t=document.getElementById("algox-logout-btn");e&&(e.disabled=!0),t&&(t.disabled=!0)}}},{key:"enableFTMintButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-ft-mint-btn"),t=document.getElementById("algox-logout-btn");e&&(e.disabled=!1),t&&(t.disabled=!1)}}},{key:"showFTResetButton",value:function(){if(!Y(X,this)){var e=document.getElementById("algox-mintx-ft-mint-btn"),t=document.getElementById("algox-mintx-ft-reset-btn");e&&(e.style.display="none"),t&&(t.style.display="block")}}}],t&&V(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ee(e){var t=this;document.getElementById("algox-wallet-choice").addEventListener("click",function(){var t=L(M().mark((function t(n){var a,r,i,o;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i=null===(a=(r=n.target).closest)||void 0===a?void 0:a.call(r,".algox-wallet-btn"))){t.next=5;break}return o=i.getAttribute("data-wallet"),t.next=5,e.onWalletConnect(o);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),document.getElementById("algox-minimized-btn").addEventListener("click",(function(){return e.onMaximize()})),document.getElementById("algox-minimize-btn").addEventListener("click",(function(){return e.onMinimize()})),document.getElementById("algox-logout-btn").addEventListener("click",(function(){return e.onLogout()})),document.getElementById("algox-theme-btn").addEventListener("click",(function(){e.onThemeToggle()})),document.getElementById("algox-wallet-address").addEventListener("click",(function(){Y(P,t).account&&(navigator.clipboard.writeText(Y(P,t).account),t.showToast("Wallet address copied to clipboard","success"))}))}function te(e){var t=document.getElementById("algox-sdk-container"),n=null==t?void 0:t.querySelector(".algox-tabs-container"),a=null==t?void 0:t.querySelector(".algox-tab-content"),r=null==t?void 0:t.querySelector(".algox-tabs-track"),i=null==t?void 0:t.querySelectorAll(".algox-tab-btn"),o=null==t?void 0:t.querySelector("#algox-tab-prev"),s=null==t?void 0:t.querySelector("#algox-tab-next");if(r&&i&&0!==i.length){if(i.length<=1)return n&&(n.style.display="none"),void(a&&(a.style.display="contents"));var c=0,l=i.length;l<=2&&(o&&(o.style.display="none"),s&&(s.style.display="none"));var h=function(){!o||!s||l<=2||(o.disabled=0===c,s.disabled=c>=l-2)},d=function(e){"prev"===e&&c>0?c--:"next"===e&&c<l-2&&c++;var t=-50*c;r.style.transform="translateX(".concat(t,"%)"),h()};i.forEach((function(e){e.addEventListener("click",(function(){var n=e.getAttribute("data-tab");i.forEach((function(e){return e.classList.remove("active")})),e.classList.add("active"),t.querySelectorAll(".algox-tab-pane").forEach((function(e){return e.classList.remove("active")}));var a=t.querySelector("#algox-".concat(n,"-tab"));a&&a.classList.add("active")}))})),null==o||o.addEventListener("click",(function(){return d("prev")})),null==s||s.addEventListener("click",(function(){return d("next")})),h()}}function ne(e){var t=this;z(_,this,te).call(this,e),document.getElementById("algox-mintx-mint-btn").addEventListener("click",L(M().mark((function t(){return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onMintNFT();case 2:case"end":return t.stop()}}),t)})))),document.getElementById("algox-mintx-reset-btn").addEventListener("click",(function(){return e.onResetNFT()})),document.getElementById("algox-mintx-ft-mint-btn").addEventListener("click",L(M().mark((function t(){return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onMintFT();case 2:case"end":return t.stop()}}),t)})))),document.getElementById("algox-mintx-ft-reset-btn").addEventListener("click",(function(){return e.onResetFT()})),Z(Q,this,document.getElementById("algox-mintx-messages")),Y(Q,this)&&Y(Q,this).addEventListener("click",(function(){if(Y(Q,t).innerText&&"Minting NFT... Please wait."!==Y(Q,t).innerText){var e=Y(Q,t).innerText.replace("NFT Minted! Transaction ID: ","");navigator.clipboard.writeText(e),t.showToast("Transaction ID copied to clipboard","success");var n="mainnet"===Y(P,t).network?"mainnet":"testnet",a="https://lora.algokit.io/".concat(n,"/transaction/").concat(e);window.open(a,"_blank")}})),Z($,this,document.getElementById("algox-mintx-ft-messages")),Y($,this)&&Y($,this).addEventListener("click",(function(){if(Y($,t).innerText&&"Minting FT... Please wait."!==Y($,t).innerText){var e=Y($,t).innerText.replace("FT Minted! Transaction ID: ","");navigator.clipboard.writeText(e),t.showToast("Transaction ID copied to clipboard","success");var n="mainnet"===Y(P,t).network?"mainnet":"testnet",a="https://lora.algokit.io/".concat(n,"/transaction/").concat(e);window.open(a,"_blank")}}))}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function re(){return"undefined"!=typeof globalThis&&void 0!==globalThis.window&&void 0!==globalThis.document}var ie=new Map;function oe(){return re()&&"undefined"!=typeof localStorage?localStorage:{getItem:function(e){return ie.has(e)?ie.get(e):null},setItem:function(e,t){ie.set(e,String(t))},removeItem:function(e){ie.delete(e)}}}function se(e){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},se(e)}function ce(){ce=function(){return t};var e,t={},n=Object.prototype,a=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function h(e,t,n,a){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new N(a||[]);return r(o,"_invoke",{value:x(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var u="suspendedStart",g="suspendedYield",m="executing",p="completed",y={};function f(){}function v(){}function w(){}var b={};l(b,o,(function(){return this}));var I=Object.getPrototypeOf,S=I&&I(I(R([])));S&&S!==n&&a.call(S,o)&&(b=S);var A=w.prototype=f.prototype=Object.create(b);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,i,o,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==se(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,a){function r(){return new t((function(t,r){n(e,a,t,r)}))}return i=i?i.then(r,r):r()}})}function x(t,n,a){var r=u;return function(i,o){if(r===m)throw Error("Generator is already running");if(r===p){if("throw"===i)throw o;return{value:e,done:!0}}for(a.method=i,a.arg=o;;){var s=a.delegate;if(s){var c=k(s,a);if(c){if(c===y)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===u)throw r=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=m;var l=d(t,n,a);if("normal"===l.type){if(r=a.done?p:g,l.arg===y)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r=p,a.method="throw",a.arg=l.arg)}}}function k(t,n){var a=n.method,r=t.iterator[a];if(r===e)return n.delegate=null,"throw"===a&&t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var i=d(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(a.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(se(t)+" is not iterable")}return v.prototype=w,r(A,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:v,configurable:!0}),v.displayName=l(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},C(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,a,r,i){void 0===i&&(i=Promise);var o=new E(h(e,n,a,r),i);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(A),l(A,c,"Generator"),l(A,o,(function(){return this})),l(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},t.values=R,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(a,r){return s.type="throw",s.arg=t,n.next=a,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,a){return this.delegate={iterator:R(t),resultName:n,nextLoc:a},"next"===this.method&&(this.arg=e),y}},t}function le(e,t,n,a,r,i,o){try{var s=e[i](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(a,r)}function he(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var i=e.apply(t,n);function o(e){le(i,a,r,o,s,"next",e)}function s(e){le(i,a,r,o,s,"throw",e)}o(void 0)}))}}function de(e){if(!e)throw new Error("File is required.");if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(null!=e.data&&e.name){var t=e.data instanceof Uint8Array?e.data:Buffer.from(e.data);return new Blob([t],{type:e.type||e.mimetype||"application/octet-stream"})}throw new Error("Invalid file input. Provide a File/Blob in the browser or { data, name, type } in Node.js.")}function ue(e){return ge.apply(this,arguments)}function ge(){return(ge=he(ce().mark((function e(t){var n;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(n=de(t)).arrayBuffer){e.next=3;break}return e.abrupt("return",n.arrayBuffer());case 3:throw new Error("Unable to read file buffer.");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){return pe.apply(this,arguments)}function pe(){return pe=he(ce().mark((function e(t){var n,a,r;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new TextEncoder,a=n.encode(t),e.next=4,crypto.subtle.digest("SHA-256",a);case 4:return r=e.sent,e.abrupt("return",new Uint8Array(r));case 6:case"end":return e.stop()}}),e)}))),pe.apply(this,arguments)}function ye(e){return fe.apply(this,arguments)}function fe(){return(fe=he(ce().mark((function e(t){var n,a,r;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ue(t);case 2:return n=e.sent,e.next=5,crypto.subtle.digest("SHA-256",n);case 5:return a=e.sent,r=Array.from(new Uint8Array(a)),e.abrupt("return","sha256-".concat((o=r,"undefined"!=typeof btoa?btoa(String.fromCharCode.apply(String,function(e){if(Array.isArray(e))return ae(e)}(i=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):Buffer.from(o).toString("base64"))));case 8:case"end":return e.stop()}var i,o}),e)})))).apply(this,arguments)}function ve(e,t){return we.apply(this,arguments)}function we(){return(we=he(ce().mark((function e(t,n){var a,r,i,o,s;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=de(t),r=new FormData,re()&&"undefined"!=typeof File&&t instanceof File?r.append("file",t):(i=t.name||(a.type?"upload.".concat(a.type.split("/")[1]||"bin"):"upload.bin"),r.append("file",a,i)),e.next=6,fetch("https://api.pinata.cloud/pinning/pinFileToIPFS",{method:"POST",headers:{Authorization:"Bearer ".concat(n)},body:r});case 6:if((o=e.sent).ok){e.next=9;break}throw new Error("Failed to upload file to IPFS: ".concat(o.status," ").concat(o.statusText));case 9:return e.next=11,o.json();case 11:if((s=e.sent).IpfsHash){e.next=14;break}throw new Error("Pinata did not return an IPFS hash.");case 14:return e.abrupt("return",s.IpfsHash);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e,t){return Ie.apply(this,arguments)}function Ie(){return(Ie=he(ce().mark((function e(t,n){var a,r;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,fetch("https://api.pinata.cloud/pinning/pinJSONToIPFS",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(t)});case 3:if((a=e.sent).ok){e.next=6;break}throw new Error("Failed to upload JSON to IPFS: ".concat(a.status," ").concat(a.statusText));case 6:return e.next=8,a.json();case 8:if((r=e.sent).IpfsHash){e.next=11;break}throw new Error("Pinata did not return an IPFS hash for metadata.");case 11:return e.abrupt("return",r.IpfsHash);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(e,t){return Ae.apply(this,arguments)}function Ae(){return(Ae=he(ce().mark((function e(t,n){var a;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("https://api.pinata.cloud/pinning/unpin/".concat(t),{method:"DELETE",headers:{Authorization:"Bearer ".concat(n)}});case 3:if((a=e.sent).ok){e.next=6;break}throw new Error("Failed to delete from IPFS: ".concat(a.statusText));case 6:return e.abrupt("return",!0);case 9:throw e.prev=9,e.t0=e.catch(0),console.error("Error deleting from IPFS:",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function Ce(e){return Math.round(1e6*e)}function Ee(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||"ipfs.io";return e.replace("ipfs://","https://".concat(t,"/ipfs/"))}function xe(e,t){var n=(new TextEncoder).encode("listing_"),a=(new TextEncoder).encode(e),r=(new TextEncoder).encode("_"),i=o.Ay$.encodeUint64(BigInt(t)),s=n.length+2+a.length+2+r.length+i.length,c=new Uint8Array(s),l=0,h=new DataView(c.buffer);return c.set(n,l),l+=n.length,h.setUint16(l,a.length,!1),l+=2,c.set(a,l),l+=a.length,h.setUint16(l,r.length,!1),l+=2,c.set(r,l),l+=r.length,c.set(i,l),c}function ke(e,t,n){return{appIndex:e,name:xe(t,n)}}function Be(e){try{var t="string"==typeof e?Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)})):e,n=0;if("listing_"!==(new TextDecoder).decode(t.slice(0,8)))return null;n+=8;var a=new DataView(t.buffer,t.byteOffset,t.byteLength),r=a.getUint16(n,!1);n+=2;var i=(new TextDecoder).decode(t.slice(n,n+r));n+=r;var s=a.getUint16(n,!1);n+=2;var c=(new TextDecoder).decode(t.slice(n,n+s));if(n+=s,"_"!==c)return null;var l=Number(o.Ay$.decodeUint64(t.slice(n,n+8),"safe"));return{marketplace:i,assetId:String(l)}}catch(e){return console.warn("Failed to decode listing box name",e),null}}function De(e){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(e)}function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){Me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Me(e,t,n){return(t=Ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Le(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function Le(e,t){if(e){if("string"==typeof e)return Ve(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(e,t):void 0}}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function We(){We=function(){return t};var e,t={},n=Object.prototype,a=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function h(e,t,n,a){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new N(a||[]);return r(o,"_invoke",{value:x(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var u="suspendedStart",g="suspendedYield",m="executing",p="completed",y={};function f(){}function v(){}function w(){}var b={};l(b,o,(function(){return this}));var I=Object.getPrototypeOf,S=I&&I(I(R([])));S&&S!==n&&a.call(S,o)&&(b=S);var A=w.prototype=f.prototype=Object.create(b);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,i,o,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==De(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,a){function r(){return new t((function(t,r){n(e,a,t,r)}))}return i=i?i.then(r,r):r()}})}function x(t,n,a){var r=u;return function(i,o){if(r===m)throw Error("Generator is already running");if(r===p){if("throw"===i)throw o;return{value:e,done:!0}}for(a.method=i,a.arg=o;;){var s=a.delegate;if(s){var c=k(s,a);if(c){if(c===y)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===u)throw r=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=m;var l=d(t,n,a);if("normal"===l.type){if(r=a.done?p:g,l.arg===y)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r=p,a.method="throw",a.arg=l.arg)}}}function k(t,n){var a=n.method,r=t.iterator[a];if(r===e)return n.delegate=null,"throw"===a&&t.iterator.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),y;var i=d(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(a.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(De(t)+" is not iterable")}return v.prototype=w,r(A,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:v,configurable:!0}),v.displayName=l(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},C(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,a,r,i){void 0===i&&(i=Promise);var o=new E(h(e,n,a,r),i);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(A),l(A,c,"Generator"),l(A,o,(function(){return this})),l(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},t.values=R,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(a,r){return s.type="throw",s.arg=t,n.next=a,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,a){return this.delegate={iterator:R(t),resultName:n,nextLoc:a},"next"===this.method&&(this.arg=e),y}},t}function Ge(e,t,n,a,r,i,o){try{var s=e[i](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(a,r)}function Fe(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var i=e.apply(t,n);function o(e){Ge(i,a,r,o,s,"next",e)}function s(e){Ge(i,a,r,o,s,"throw",e)}o(void 0)}))}}function Ye(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,Ze(a.key),a)}}function Ze(e){var t=function(e){if("object"!=De(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=De(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==De(t)?t:t+""}function ze(e,t,n){Pe(e,t),t.set(e,n)}function Pe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(e,t){return e.get(Ke(e,t))}function He(e,t,n){return e.set(Ke(e,t),n),n}function Ke(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var je=r(9698),Oe=new o.Ay$.ABIContract({name:je.contract.name,methods:je.contract.methods}),Ue=new WeakMap,Je=new WeakMap,Qe=new WeakMap,$e=new WeakMap,_e=new WeakMap,qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,it=new WeakMap,ot=new WeakMap,st=new WeakMap,ct=new WeakMap,lt=new WeakMap,ht=new WeakMap,dt=new WeakMap,ut=new WeakMap,gt=new WeakMap,mt=new WeakMap,pt=new WeakMap,yt=new WeakMap,ft=new WeakMap,vt=new WeakMap,wt=new WeakMap,bt=new WeakMap,It=new WeakMap,St=new WeakMap,At=new WeakMap,Ct=new WeakMap,Et=new WeakMap,xt=new WeakMap,kt=new WeakMap,Bt=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Rt=new WeakSet,Mt=function(){return e=function e(t){var n,a=t.env,r=t.disableUi,i=void 0!==r&&r,s=t.disableToast,l=void 0!==s&&s,h=t.toastLocation,d=void 0===h?"TOP_RIGHT":h,u=t.minimizeUILocation,g=void 0===u?"right":u,p=t.logo,y=void 0===p?null:p,f=t.namespace,v=t.pinata_ipfs_server_key,w=t.revenueWalletAddress,b=t.marketplaceType,I=void 0===b?"NFT":b,S=t.pinata_ipfs_gateway_url,A=void 0===S?null:S,C=t.listingFee,E=void 0===C?0:C,x=t.buyingFee,k=void 0===x?0:x,B=t.unListingFee,D=void 0===B?0:B,N=t.mintFee,R=void 0===N?0:N,M=t.supportedMediaFormats,T=void 0===M?["IMAGE"]:M;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Pe(this,n=Rt),n.add(this),ze(this,Ue,void 0),ze(this,Je,void 0),ze(this,Qe,void 0),ze(this,$e,void 0),ze(this,_e,void 0),ze(this,qe,void 0),ze(this,et,void 0),ze(this,tt,void 0),ze(this,nt,void 0),ze(this,at,void 0),ze(this,rt,void 0),ze(this,it,void 0),ze(this,ot,void 0),ze(this,st,void 0),ze(this,ct,void 0),ze(this,lt,void 0),ze(this,ht,void 0),ze(this,dt,void 0),ze(this,ut,void 0),ze(this,gt,void 0),ze(this,mt,void 0),ze(this,pt,void 0),ze(this,yt,void 0),ze(this,ft,void 0),ze(this,vt,void 0),ze(this,wt,void 0),ze(this,bt,void 0),ze(this,It,void 0),ze(this,St,void 0),ze(this,At,void 0),ze(this,Ct,void 0),ze(this,Et,void 0),ze(this,xt,void 0),ze(this,kt,void 0),ze(this,Bt,void 0),ze(this,Dt,void 0),ze(this,Nt,void 0);try{if(this.network=m.validateEnvironment(a),He(nt,this,m.validateDisableUi(i)),He(tt,this,m.validateDisableToast(l)),He(st,this,m.validateToastLocation(d)),He(at,this,m.validateMinimizeUILocation(g)),He(rt,this,m.validateLogo(y)),He(wt,this,m.validateNamespace(f)),He(At,this,m.validatePinataServerKey(v)),He(Et,this,m.validateRevenueWalletAddress(w)),He(bt,this,m.validateMarketplaceType(I)),He(Ct,this,m.validatePinataGatewayUrl(A)),He(xt,this,m.validateFee(E,"Listing fee")),He(kt,this,m.validateFee(k,"Buying fee")),He(Bt,this,m.validateFee(D,"unListingFee fee")),He(Dt,this,m.validateFee(R,"Mint fee")),He(Nt,this,m.validateSupportedMediaFormats(T)),He(lt,this,new q(this,{disableUi:Xe(nt,this),disableToast:Xe(tt,this),logo:Xe(rt,this),minimizeUILocation:Xe(at,this),toastLocation:Xe(st,this),marketplaceType:Xe(bt,this)})),this.processing=!1,this.events=c,He(it,this,["mainnet","testnet"]),He(Ue,this,null),He(Je,this,!1),this.account=null,He(Qe,this,null),He($e,this,!1),He(_e,this,["pera","defly"]),He(qe,this,null),He(et,this,new o.Ay$.Algodv2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","mainnet"===this.network?"https://mainnet-api.algonode.cloud":"https://testnet-api.algonode.cloud",443)),He(ht,this,"mainnet"===this.network?"https://mainnet-idx.algonode.cloud":"https://testnet-idx.algonode.cloud"),He(dt,this,"mainnet"===this.network?"https://mainnet-api.algonode.cloud":"https://testnet-api.algonode.cloud"),He(ut,this,null),He(gt,this,0),He(mt,this,null),He(pt,this,0),He(yt,this,null),He(It,this,"AMX".concat(Xe(wt,this))),He(St,this,"AlgoMintX"),He(ft,this,(this.network,764970022)),He(vt,this,(this.network,"YUS4ATNZYFNBOSN4MYP5BYPJKQNYSYRGU6PFP65ZLWXPWWBLUZYSHWJGUA")),!Xe(nt,this)&&re()){var L=oe().getItem("axs");if(L)try{var V=JSON.parse(L);this.isMinimized=V.minimized||!1,this.theme=V.theme||Xe(lt,this).getSystemTheme()}catch(e){this.isMinimized=!1,this.theme=Xe(lt,this).getSystemTheme()}else this.isMinimized=!1,this.theme=Xe(lt,this).getSystemTheme();Xe(lt,this).saveUIState(),Ke(Rt,this,Zt).call(this)}}catch(e){Ke(Rt,this,Tt).call(this,e.message)}},t=[{key:"minimizeSDK",value:function(e){Xe(lt,this).minimizeSDK(e)}},{key:"maximizeSDK",value:function(e){Xe(lt,this).maximizeSDK(e)}},{key:"connectWallet",value:(S=Fe(We().mark((function e(t,n){var a,r;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t&&"string"==typeof t){e.next=3;break}throw new Error("Wallet address is required");case 3:if(58===t.length){e.next=5;break}throw new Error("Wallet address must be 58 characters long");case 5:if(/^[A-Z2-7]{58}$/.test(t)){e.next=7;break}throw new Error("Invalid Algorand wallet address format");case 7:if(n&&"string"==typeof n){e.next=9;break}throw new Error("Wallet mnemonic is required");case 9:if(25===n.trim().split(/\s+/).length){e.next=12;break}throw new Error("Mnemonic must contain 25 words");case 12:if(e.prev=12,("string"==typeof(a=o.Ay$.mnemonicToSecretKey(n)).addr?a.addr:null!==(r=a.addr)&&void 0!==r&&r.publicKey?o.Ay$.encodeAddress(a.addr.publicKey):String(a.addr||""))===t){e.next=17;break}throw new Error("Mnemonic does not match the provided wallet address");case 17:e.next=22;break;case 19:throw e.prev=19,e.t0=e.catch(12),new Error(e.t0.message||"Invalid mnemonic");case 22:return He(ct,this,a),this.account=t,He(Je,this,!0),He(qe,this,"mnemonic"),He(Qe,this,{type:"mnemonic",address:t}),c.emit("wallet:connected",{address:t,type:"mnemonic"}),Xe(nt,this)||Xe(lt,this).showSDKUI(),e.abrupt("return",{address:t,type:"mnemonic"});case 32:throw e.prev=32,e.t1=e.catch(0),console.error("Error connecting wallet:",e.t1.message),c.emit("wallet:connection:failed",{error:e.t1.message}),e.t1;case 37:case"end":return e.stop()}}),e,this,[[0,32],[12,19]])}))),function(e,t){return S.apply(this,arguments)})},{key:"disconnectWallet",value:(I=Fe(We().mark((function e(){return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Xe(Je,this)){e.next=2;break}throw new Error("No wallet is currently connected");case 2:return e.next=4,Ke(Rt,this,jt).call(this,!0);case 4:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"mintNFT",value:(b=Fe(We().mark((function e(t){var n,a,r,i,o,s,l,h,d;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,a=t.description,r=t.file,Ke(Rt,this,Ft).call(this,"mint an NFT"),"NFT"===Xe(bt,this)){e.next=4;break}throw new Error("This marketplace is configured for FT assets only.");case 4:if(i=m.sanitizeInput(n),o=m.sanitizeInput(a),(s=m.validateNFTName(i)).valid){e.next=9;break}throw new Error(s.message);case 9:if((l=m.validateNFTDescription(o)).valid){e.next=12;break}throw new Error(l.message);case 12:if(r){e.next=14;break}throw new Error("Media file is required.");case 14:if((h=m.validateFileType(r,Xe(Nt,this))).valid){e.next=17;break}throw new Error(h.message);case 17:return this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),e.prev=20,e.next=23,Ke(Rt,this,$t).call(this,{name:i,description:o,file:r});case 23:return d=e.sent,c.emit("nft:mint:success",d),e.abrupt("return",d);case 28:throw e.prev=28,e.t0=e.catch(20),c.emit("nft:mint:failed",{error:e.t0.message}),e.t0;case 32:return e.prev=32,this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),e.finish(32);case 37:case"end":return e.stop()}}),e,this,[[20,28,32,37]])}))),function(e){return b.apply(this,arguments)})},{key:"mintFT",value:(w=Fe(We().mark((function e(t){var n,a,r,i,o,s,l,h,d,u,g,p,y,f;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,a=t.description,r=t.decimals,i=t.totalSupply,o=t.file,s=void 0===o?null:o,Ke(Rt,this,Ft).call(this,"mint a fungible token"),"FT"===Xe(bt,this)){e.next=4;break}throw new Error("This marketplace is configured for NFT assets only.");case 4:if(l=m.sanitizeInput(n),h=m.sanitizeInput(a),(d=m.validateFTName(l)).valid){e.next=9;break}throw new Error(d.message);case 9:if((u=m.validateFTDescription(h)).valid){e.next=12;break}throw new Error(u.message);case 12:if((g=m.validateFTDecimals(r)).valid){e.next=15;break}throw new Error(g.message);case 15:if((p=m.validateFTTotalSupply(i)).valid){e.next=18;break}throw new Error(p.message);case 18:if(!s){e.next=22;break}if((y=m.validateFileType(s,["IMAGE"])).valid){e.next=22;break}throw new Error(y.message);case 22:return this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),e.prev=25,e.next=28,Ke(Rt,this,an).call(this,{name:l,description:h,decimals:Number(r),totalSupply:Number(i),file:s});case 28:return f=e.sent,c.emit("ft:mint:success",f),e.abrupt("return",f);case 33:throw e.prev=33,e.t0=e.catch(25),c.emit("ft:mint:failed",{error:e.t0.message}),e.t0;case 37:return e.prev=37,this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),e.finish(37);case 42:case"end":return e.stop()}}),e,this,[[25,33,37,42]])}))),function(e){return w.apply(this,arguments)})},{key:"getListedNFTs",value:(v=Fe(We().mark((function e(){var t,n,a=this;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ke(Rt,this,un).call(this,Xe(It,this));case 3:if(0!==(t=e.sent).length){e.next=6;break}return e.abrupt("return",[]);case 6:return e.next=8,Promise.all(t.map((function(e){return Ke(Rt,a,vn).call(a,e)})));case 8:return n=e.sent.filter(Boolean),e.abrupt("return",n.filter((function(e){return Ke(Rt,a,In).call(a,e)})));case 12:throw e.prev=12,e.t0=e.catch(0),console.error("Error fetching listed NFTS",e.t0.message),e.t0;case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return v.apply(this,arguments)})},{key:"getMarketplaces",value:(f=Fe(We().mark((function e(){var t,n,a,r,i,o,s,c,l,h,d=this;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ke(Rt,this,hn).call(this);case 3:t=e.sent,n={},a=Te(t),e.prev=6,a.s();case 8:if((r=a.n()).done){e.next=22;break}if(i=r.value,o=i.marketplace,s=i.assetId,c=i.price,l=i.seller,o){e.next=13;break}return e.abrupt("continue",20);case 13:n[o]||(n[o]={marketplace:o,namespace:o.startsWith("AMX")?o.slice(3):o,listingCount:0,totalListedValue:0,floorPrice:null,sellers:new Set,assetIds:[]}),(h=n[o]).listingCount+=1,h.totalListedValue+=c,h.floorPrice=null===h.floorPrice?c:Math.min(h.floorPrice,c),l&&h.sellers.add(l),h.assetIds.push(s);case 20:e.next=8;break;case 22:e.next=27;break;case 24:e.prev=24,e.t0=e.catch(6),a.e(e.t0);case 27:return e.prev=27,a.f(),e.finish(27);case 30:return e.abrupt("return",Object.values(n).map((function(e){var t;return{marketplace:e.marketplace,namespace:e.namespace,listingCount:e.listingCount,uniqueSellers:e.sellers.size,totalListedValue:e.totalListedValue,floorPrice:null!==(t=e.floorPrice)&&void 0!==t?t:0,avgPrice:e.listingCount?e.totalListedValue/e.listingCount:0,assetIds:e.assetIds,isCurrentMarketplace:e.marketplace===Xe(It,d)}})));case 33:throw e.prev=33,e.t1=e.catch(0),console.error("Error fetching marketplaces:",e.t1.message),e.t1;case 37:case"end":return e.stop()}}),e,this,[[0,33],[6,24,27,30]])}))),function(){return f.apply(this,arguments)})},{key:"getMarketplaceCount",value:(y=Fe(We().mark((function e(){var t;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getMarketplaces();case 2:return t=e.sent,e.abrupt("return",t.length);case 4:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"listingStatus",value:(p=Fe(We().mark((function e(t){var n,a,r,i,o=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:Xe(It,this),e.prev=1,e.next=4,Ke(Rt,this,mn).call(this,t,n);case 4:if(a=e.sent){e.next=7;break}return e.abrupt("return",{marketplace:n,assetId:String(t),exists:!1,listing:null});case 7:return e.abrupt("return",{marketplace:n,assetId:String(t),exists:!0,listing:a});case 10:if(e.prev=10,e.t0=e.catch(1),console.error("Error fetching listing status:",e.t0.message),!(null!==(r=e.t0.message)&&void 0!==r&&r.includes("not found")||null!==(i=e.t0.message)&&void 0!==i&&i.includes("does not exist")||404===e.t0.status)){e.next=15;break}return e.abrupt("return",{marketplace:n,assetId:String(t),exists:!1,listing:null});case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e){return p.apply(this,arguments)})},{key:"getMarketplaceStats",value:(g=Fe(We().mark((function e(){var t,n,a,r,i,o,s,c,l,h,d,u=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:Xe(It,this),e.prev=1,e.next=4,Ke(Rt,this,un).call(this,t);case 4:n=e.sent,a=n.map((function(e){return{assetId:e.assetId,price:e.price,seller:e.seller}})),r=0,i=null,o=new Set,s=Te(a);try{for(s.s();!(c=s.n()).done;)l=c.value,h=l.price,d=l.seller,r+=h,i=null===i?h:Math.min(i,h),d&&o.add(d)}catch(e){s.e(e)}finally{s.f()}return e.abrupt("return",{marketplace:t,namespace:t.startsWith("AMX")?t.slice(3):t,listingCount:a.length,uniqueSellers:o.size,totalListedValue:r,floorPrice:null!=i?i:0,avgPrice:a.length?r/a.length:0,listings:a});case 14:throw e.prev=14,e.t0=e.catch(1),console.error("Error fetching marketplace stats:",e.t0.message),e.t0;case 18:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(){return g.apply(this,arguments)})},{key:"getMarketplaceData",value:(u=Fe(We().mark((function e(){var t,n,a,r,i,o,s,c,l,h=this,d=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.length>0&&void 0!==d[0]?d[0]:Xe(It,this),e.prev=1,e.next=4,Ke(Rt,this,un).call(this,t);case 4:if(0!==(n=e.sent).length){e.next=7;break}throw new Error("Marketplace ".concat(t," not found"));case 7:return e.next=9,Promise.all(n.map((function(e){return Ke(Rt,h,vn).call(h,e)})));case 9:return a=e.sent.filter(Boolean),r=new Set,i=new Set,o=0,s=null,a.forEach((function(e){r.add(e.listing.seller),e.currentHolder&&i.add(e.currentHolder),o+=e.listing.price,s=null===s?e.listing.price:Math.min(s,e.listing.price)})),c=a[0],l=c&&1===Number(c.total)&&0===Number(c.decimals)?"NFT":"FT",e.abrupt("return",{marketplace:t,namespace:t.startsWith("AMX")?t.slice(3):t,network:this.network,status:"Active",assetType:l,listings:a,listingCount:a.length,uniqueSellers:r.size,uniqueHolders:i.size,totalListedValue:o,floorPrice:null!=s?s:0,avgPrice:a.length?o/a.length:0});case 20:throw e.prev=20,e.t0=e.catch(1),console.error("Error fetching marketplace data:",e.t0.message),e.t0;case 24:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(){return u.apply(this,arguments)})},{key:"getWalletAssets",value:(d=Fe(We().mark((function e(){var t,n,a,r,i,o,s,c,l,h=this,d=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=d.length>0&&void 0!==d[0]?d[0]:{}).accountId,a=t.marketplaceOnly,r=void 0!==a&&a,e.prev=1,n){e.next=8;break}if(Xe(Je,this)&&this.account){e.next=6;break}throw this.isMinimized&&this.maximizeSDK(!0),new Error("Wallet is not connected");case 6:e.next=9;break;case 8:m.validateRevenueWalletAddress(n);case 9:return i="".concat(Xe(ht,this),"/v2/accounts/").concat(n||this.account),e.next=12,fetch(i);case 12:if((o=e.sent).ok){e.next=15;break}throw new Error("Indexer fetch error: ".concat(o.status));case 15:return e.next=17,o.json();case 17:return s=e.sent,c=(s.account.assets||[]).filter((function(e){return e.amount>0})),e.next=21,Promise.all(c.map(function(){var e=Fe(We().mark((function e(t){var n,a,i,o,s,c,l,d,u,g,m,p;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t["asset-id"],a="".concat(Xe(ht,h),"/v2/assets/").concat(n),e.next=4,fetch(a);case 4:if((i=e.sent).ok){e.next=7;break}return e.abrupt("return",null);case 7:return e.next=9,i.json();case 9:if(o=e.sent,s=o.asset.params,c=Ke(Rt,h,bn).call(h,s),!r||Ke(Rt,h,In).call(h,s)){e.next=14;break}return e.abrupt("return",null);case 14:return l=Re(Re({},s),{},{assetId:n,balance:t.amount,assetType:c?"NFT":"FT"}),e.next=17,Ke(Rt,h,Sn).call(h,l,s);case 17:if(!r){e.next=22;break}return e.next=20,Ke(Rt,h,mn).call(h,n,Xe(It,h));case 20:(d=e.sent)&&(l.listing={seller:d.seller,price:d.price,marketplace:d.marketplace});case 22:return u="".concat(Xe(ht,h),"/v2/assets/").concat(n,"/balances?currency-greater-than=0"),e.next=25,fetch(u);case 25:if(!(g=e.sent).ok){e.next=32;break}return e.next=29,g.json();case 29:m=e.sent,(p=(m.balances||[]).find((function(e){return e.amount>0})))&&(l.currentHolder=p.address);case 32:return e.abrupt("return",l);case 33:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 21:return l=e.sent.filter(Boolean),e.abrupt("return",l);case 25:throw e.prev=25,e.t0=e.catch(1),console.error("Error fetching wallet assets:",e.t0.message),e.t0;case 29:case"end":return e.stop()}}),e,this,[[1,25]])}))),function(){return d.apply(this,arguments)})},{key:"getWalletNFTs",value:(h=Fe(We().mark((function e(){var t,n=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.getWalletAssets(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getAssetMetadata",value:(l=Fe(We().mark((function e(t){var n;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.assetId,e.abrupt("return",this.getNFTMetadata({assetId:n}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getNFTMetadata",value:(s=Fe(We().mark((function e(t){var n,a,r,i,o,s,c,l,h,d,u,g,m,p,y;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.assetId,e.prev=1,r="".concat(Xe(ht,this),"/v2/assets/").concat(n),e.next=5,fetch(r);case 5:if((i=e.sent).ok){e.next=8;break}throw new Error("Failed to fetch asset data: ".concat(i.status));case 8:return e.next=10,i.json();case 10:return o=e.sent,s=o.asset.params,c=Re(Re({},s),{},{assetId:n}),e.next=15,Ke(Rt,this,mn).call(this,n,Xe(It,this));case 15:if(e.t0=e.sent,e.t0){e.next=20;break}return e.next=19,Ke(Rt,this,yn).call(this,n);case 19:e.t0=e.sent;case 20:return(l=e.t0)&&(c.listing={seller:l.seller,price:l.price,marketplace:l.marketplace}),e.next=24,Ke(Rt,this,Cn).call(this,c,s);case 24:return h="".concat(Xe(ht,this),"/v2/assets/").concat(n,"/balances?currency-greater-than=0"),e.next=27,fetch(h);case 27:if(!(d=e.sent).ok){e.next=33;break}return e.next=31,d.json();case 31:(u=e.sent).balances&&u.balances.length>0&&(g=u.balances.find((function(e){return e.amount>0})))&&(c.currentHolder=g.address);case 33:return m="".concat(Xe(ht,this),"/v2/transactions?asset-id=").concat(n,"&tx-type=acfg"),e.next=36,fetch(m);case 36:if((p=e.sent).ok){e.next=39;break}throw new Error("Failed to fetch asset config transaction: ".concat(p.status));case 39:return e.next=41,p.json();case 41:return y=e.sent,c.transactionId=null===(a=y.transactions)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.id,e.abrupt("return",c);case 46:throw e.prev=46,e.t1=e.catch(1),console.error("Error fetching NFT metadata:",e.t1.message),e.t1;case 50:case"end":return e.stop()}}),e,this,[[1,46]])}))),function(e){return s.apply(this,arguments)})},{key:"getFTMetadata",value:(i=Fe(We().mark((function e(t){var n;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.assetId,e.abrupt("return",this.getNFTMetadata({assetId:n}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"listNFT",value:(r=Fe(We().mark((function e(t){var n,a,r,i,s,l,h,d,u,g,m,p,y,f,v,w,b,I,S,A,C;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.assetId,a=t.nftPrice,e.prev=1,this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),Xe(Je,this)&&this.account||Ke(Rt,this,Ft).call(this,"list an asset"),n&&a){e.next=8;break}throw new Error("Asset ID and price are required");case 8:if(!isNaN(n)&&!isNaN(a)){e.next=10;break}throw new Error("Asset ID and price must be a number.");case 10:return e.next=12,Xe(et,this).getAssetByID(n).do();case 12:if(r=e.sent,Ke(Rt,this,In).call(this,r.params)){e.next=15;break}throw new Error("This marketplace only supports ".concat(Xe(bt,this)," assets."));case 15:return i="".concat(Xe(ht,this),"/v2/accounts/").concat(this.account),e.next=18,fetch(i);case 18:if((s=e.sent).ok){e.next=21;break}throw new Error("Failed to fetch account assets: ".concat(s.status));case 21:return e.next=23,s.json();case 23:if(l=e.sent,h=(l.account.assets||[]).find((function(e){return e["asset-id"]===n&&e.amount>0}))){e.next=27;break}throw new Error("You do not hold this asset in your wallet.");case 27:return d="NFT"===Xe(bt,this)?1:Number(h.amount),e.next=30,Xe(et,this).getTransactionParams().do();case 30:return u=e.sent,g=Re(Re({},u),{},{flatFee:!0,fee:4e3}),m=ke(Xe(ft,this),Xe(It,this),n),p=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(vt,this),amount:1e5,suggestedParams:u}),y=Oe.methods.find((function(e){return"transferNFTToContractAndAddListing"===e.name})),f=o.Ay$.makeApplicationCallTxnFromObject({sender:this.account,appIndex:Xe(ft,this),onComplete:o.Ay$.OnApplicationComplete.NoOpOC,appArgs:[y.getSelector(),o.Ay$.ABIType.from("uint64").encode(BigInt(n)),o.Ay$.ABIType.from("string").encode(this.account),o.Ay$.ABIType.from("string").encode(Ce(a).toString()),o.Ay$.ABIType.from("string").encode(Xe(It,this))],boxes:[m],foreignAssets:[n],suggestedParams:g}),v=o.Ay$.makeAssetTransferTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(vt,this),amount:BigInt(d),assetIndex:n,suggestedParams:u}),w=[p,f,v],Xe(xt,this)>0&&(b=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(Et,this),amount:Ce(Xe(xt,this)),suggestedParams:u}),w.push(b)),o.Ay$.assignGroupID(w),e.next=42,Ke(Rt,this,Wt).call(this,w);case 42:return I=e.sent,e.next=45,Xe(et,this).sendRawTransaction(I).do();case 45:return S=e.sent,A=S.txid,e.next=49,o.Ay$.waitForConfirmation(Xe(et,this),A,10);case 49:return He(ut,this,null),He(mt,this,null),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),e.next=56,this.getNFTMetadata({assetId:n});case 56:return C=e.sent,c.emit("nft:list:success",{nft:C,transactionId:A}),e.abrupt("return",{nft:C,transactionId:A});case 61:throw e.prev=61,e.t0=e.catch(1),console.error("Error listing NFT:",e.t0.message),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),c.emit("nft:list:failed",{error:"Could not list NFT!"}),e.t0;case 69:case"end":return e.stop()}}),e,this,[[1,61]])}))),function(e){return r.apply(this,arguments)})},{key:"unlistNFT",value:(a=Fe(We().mark((function e(t){var n,a,r,i,s,l,h,d,u,g,m,p,y,f;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.assetId,e.prev=1,this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),Ke(Rt,this,Ft).call(this,"unlist an asset"),n){e.next=8;break}throw new Error("Asset ID is required.");case 8:if(!isNaN(n)){e.next=10;break}throw new Error("Asset ID must be a number.");case 10:return e.next=12,this.getNFTMetadata({assetId:n});case 12:if(a=e.sent,Ke(Rt,this,In).call(this,a)){e.next=15;break}throw new Error("This marketplace only supports ".concat(Xe(bt,this)," assets."));case 15:if(a.listing.marketplace===Xe(It,this)){e.next=17;break}throw new Error("Cannot un-list nft from other marketplace.");case 17:return e.next=19,Xe(et,this).getTransactionParams().do();case 19:return r=e.sent,i=Re(Re({},r),{},{flatFee:!0,fee:3e3}),s=ke(Xe(ft,this),Xe(It,this),n),l=o.Ay$.makeAssetTransferTxnWithSuggestedParamsFromObject({sender:this.account,receiver:this.account,amount:0,assetIndex:n,suggestedParams:r}),h=Oe.methods.find((function(e){return"transferNFTToSellerAndRemoveListing"===e.name})),d=o.Ay$.makeApplicationCallTxnFromObject({sender:this.account,appIndex:Xe(ft,this),onComplete:o.Ay$.OnApplicationComplete.NoOpOC,appArgs:[h.getSelector(),o.Ay$.ABIType.from("uint64").encode(BigInt(n)),o.Ay$.ABIType.from("string").encode(this.account),o.Ay$.ABIType.from("string").encode(Xe(It,this))],boxes:[s],foreignAssets:[n],suggestedParams:i}),u=[l,d],Xe(Bt,this)>0&&(g=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(Et,this),amount:Ce(Xe(Bt,this)),suggestedParams:r}),u.push(g)),o.Ay$.assignGroupID(u),e.next=30,Ke(Rt,this,Wt).call(this,u);case 30:return m=e.sent,e.next=33,Xe(et,this).sendRawTransaction(m).do();case 33:return p=e.sent,y=p.txid,e.next=37,o.Ay$.waitForConfirmation(Xe(et,this),y,10);case 37:return He(ut,this,null),He(mt,this,null),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),e.next=44,this.getNFTMetadata({assetId:n});case 44:return f=e.sent,c.emit("nft:buy:success",{nft:f,transactionId:y}),e.abrupt("return",{nft:f,transactionId:y});case 49:throw e.prev=49,e.t0=e.catch(1),console.error("Error un-listing NFT:",e.t0.message),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),c.emit("nft:unlist:failed",{error:"Could not unlist NFT!"}),e.t0;case 57:case"end":return e.stop()}}),e,this,[[1,49]])}))),function(e){return a.apply(this,arguments)})},{key:"buyNFT",value:(n=Fe(We().mark((function e(t){var n,a,r,i,s,l,h,d,u,g,m,p,y,f,v;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.assetId,e.prev=1,this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),Ke(Rt,this,Ft).call(this,"buy an asset"),n){e.next=8;break}throw new Error("Asset ID is required.");case 8:if(!isNaN(n)){e.next=10;break}throw new Error("Asset ID must be a number.");case 10:return e.next=12,this.getNFTMetadata({assetId:n});case 12:if(a=e.sent,Ke(Rt,this,In).call(this,a)){e.next=15;break}throw new Error("This marketplace only supports ".concat(Xe(bt,this)," assets."));case 15:if(a.listing.seller!==this.account){e.next=17;break}throw new Error("Seller cannot buy the listed nft.");case 17:if(a.listing.marketplace===Xe(It,this)){e.next=19;break}throw new Error("Cannot buy nft from other marketplace.");case 19:return e.next=21,Xe(et,this).getTransactionParams().do();case 21:return r=e.sent,i=Re(Re({},r),{},{flatFee:!0,fee:3e3}),s=ke(Xe(ft,this),Xe(It,this),n),l=o.Ay$.makeAssetTransferTxnWithSuggestedParamsFromObject({sender:this.account,receiver:this.account,amount:0,assetIndex:n,suggestedParams:r}),h=Oe.methods.find((function(e){return"transferNFTToReceiverAndRemoveListing"===e.name})),d=o.Ay$.makeApplicationCallTxnFromObject({sender:this.account,appIndex:Xe(ft,this),onComplete:o.Ay$.OnApplicationComplete.NoOpOC,appArgs:[h.getSelector(),o.Ay$.ABIType.from("uint64").encode(BigInt(n)),o.Ay$.ABIType.from("string").encode(a.listing.seller),o.Ay$.ABIType.from("string").encode(Xe(It,this))],boxes:[s],foreignAssets:[n],suggestedParams:i}),u=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:a.listing.seller,amount:Ce(a.listing.price),suggestedParams:r}),g=[l,d,u],Xe(kt,this)>0&&(m=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(Et,this),amount:Ce(Xe(kt,this)),suggestedParams:r}),g.push(m)),o.Ay$.assignGroupID(g),e.next=33,Ke(Rt,this,Wt).call(this,g);case 33:return p=e.sent,e.next=36,Xe(et,this).sendRawTransaction(p).do();case 36:return y=e.sent,f=y.txid,e.next=40,o.Ay$.waitForConfirmation(Xe(et,this),f,10);case 40:return He(ut,this,null),He(mt,this,null),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),e.next=47,this.getNFTMetadata({assetId:n});case 47:return v=e.sent,c.emit("nft:buy:success",{nft:v,transactionId:f}),e.abrupt("return",{nft:v,transactionId:f});case 52:throw e.prev=52,e.t0=e.catch(1),console.error("Error buying NFT:",e.t0.message),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),c.emit("nft:buy:failed",{error:"Could not buy NFT!"}),e.t0;case 60:case"end":return e.stop()}}),e,this,[[1,52]])}))),function(e){return n.apply(this,arguments)})}],t&&Ye(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,a,r,i,s,l,h,d,u,g,p,y,f,v,w,b,I,S}();function Tt(e){var t=oe();t.removeItem("walletconnect"),t.removeItem("DeflyWallet.Wallet"),t.removeItem("PeraWallet.Wallet"),!Xe(nt,this)&&re()?(alert(e),window.location.reload()):console.error("SDK validation failed:",e)}function Lt(){return Vt.apply(this,arguments)}function Vt(){return(Vt=Fe(We().mark((function e(){var t,n,a,i;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re()){e.next=2;break}return e.abrupt("return",null);case 2:if(Xe(Ue,this)){e.next=10;break}return e.next=5,Promise.all([Promise.all([r.e(263),r.e(532)]).then(r.bind(r,1899)),Promise.all([r.e(263),r.e(42),r.e(790)]).then(r.bind(r,2042))]);case 5:t=e.sent,s=2,n=function(e){if(Array.isArray(e))return e}(o=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(o,s)||Le(o,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=n[0].PeraWalletConnect,i=n[1].DeflyWalletConnect,He(Ue,this,{pera:new a,defly:new i});case 10:return e.abrupt("return",Xe(Ue,this));case 11:case"end":return e.stop()}var o,s}),e,this)})))).apply(this,arguments)}function Wt(e){return Gt.apply(this,arguments)}function Gt(){return(Gt=Fe(We().mark((function e(t){var n,a,r=this;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Xe(ct,this)){e.next=2;break}return e.abrupt("return",t.map((function(e){return e.signTxn(Xe(ct,r).sk)})));case 2:if(Xe(qe,this)){e.next=4;break}throw new Error("No signing method available. Connect with connectWallet(address, mnemonic) or a browser wallet.");case 4:return e.next=6,Ke(Rt,this,Lt).call(this);case 6:if(null!=(n=e.sent)&&n[Xe(qe,this)]){e.next=9;break}throw new Error("Browser wallet signing is unavailable in this environment.");case 9:return e.next=11,n[Xe(qe,this)].signTransaction([t.map((function(e){return{txn:e,signers:[r.account]}}))]);case 11:return a=e.sent,e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Ft(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"perform this action";if(!Xe(Je,this)||!this.account)throw!Xe(nt,this)&&this.isMinimized&&this.maximizeSDK(!0),new Error("Wallet is not connected. Connect a wallet to ".concat(e,"."))}function Yt(e){return(null==e?void 0:e.type)||(null==e?void 0:e.mimetype)||"application/octet-stream"}function Zt(){return zt.apply(this,arguments)}function zt(){return(zt=Fe(We().mark((function e(){var t=this;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Xe(lt,this).initUI({onWalletConnect:function(e){return Ke(Rt,t,Ht).call(t,e)},onMinimize:function(){return t.minimizeSDK()},onMaximize:function(){return t.maximizeSDK()},onLogout:function(){return Ke(Rt,t,jt).call(t)},onThemeToggle:function(){t.theme="light"===t.theme?"dark":"light",Xe(lt,t).saveUIState(),Xe(lt,t).applyTheme(),c.emit("theme:changed",{theme:t.theme})},onResetNFT:function(){return Xe(lt,t).resetNFTDetails()},onMintNFT:function(){return Ke(Rt,t,Jt).call(t)},onResetFT:function(){return Xe(lt,t).resetFTDetails()},onMintFT:function(){return Ke(Rt,t,tn).call(t)}}),Xe(lt,this).setupNFTInputValidation({getSupportedMediaFormats:function(){return Xe(Nt,t)},sanitizeInput:function(e){return m.sanitizeInput(e)},validateFileType:function(e){return m.validateFileType(e,Xe(Nt,t))}}),Xe(lt,this).setupFTInputValidation({sanitizeInput:function(e){return m.sanitizeInput(e)},validateFileType:function(e){return m.validateFileType(e,["IMAGE"])}}),e.next=5,Ke(Rt,this,Pt).call(this);case 5:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Pt(){return Xt.apply(this,arguments)}function Xt(){return(Xt=Fe(We().mark((function e(){var t,n,a,r,i,o,s,l;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re()){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,(t=oe()).getItem("walletconnect"),n=t.getItem("PeraWallet.Wallet"),a=t.getItem("DeflyWallet.Wallet"),r=null,i=null,e.next=11,Ke(Rt,this,Lt).call(this);case 11:if(o=e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!n){e.next=25;break}return e.prev=15,e.next=18,o.pera.reconnectSession();case 18:(s=e.sent)&&s.length>0&&(r="pera",i=s),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(15),console.log("Failed to reconnect to Pera wallet:",e.t0.message);case 25:if(i||!a){e.next=36;break}return e.prev=26,e.next=29,o.defly.reconnectSession();case 29:(l=e.sent)&&l.length>0&&(r="defly",i=l),e.next=36;break;case 33:e.prev=33,e.t1=e.catch(26),console.log("Failed to reconnect to Defly wallet:",e.t1.message);case 36:i&&i.length>0&&r?(He(Je,this,!0),this.account=i[0],He(qe,this,r),He(Qe,this,{address:this.account,walletType:r}),Xe(lt,this).showToast("Restored connection to ".concat(r," wallet"),"success"),Xe(nt,this)||Xe(lt,this).showSDKUI(),c.emit("wallet:connection:connected",{address:this.account})):Xe(nt,this)||Ke(Rt,this,Ut).call(this),e.next=45;break;case 39:e.prev=39,e.t2=e.catch(2),console.error("Failed to restore connection",e.t2),Xe(lt,this).showToast("Failed to restore connection!","error"),c.emit("wallet:connection:failed",{error:"Failed to restore connection"}),Xe(nt,this)||Ke(Rt,this,Ut).call(this);case 45:case"end":return e.stop()}}),e,this,[[2,39],[15,22],[26,33]])})))).apply(this,arguments)}function Ht(e){return Kt.apply(this,arguments)}function Kt(){return(Kt=Fe(We().mark((function e(t){var n,a,r,i,o,s;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Xe($e,this)){e.next=3;break}return Xe(lt,this).showToast("A wallet connection is already in progress.","warning"),e.abrupt("return");case 3:if(Xe(_e,this).includes(t)){e.next=6;break}return Xe(lt,this).showToast("Unsupported wallet selected.","error"),e.abrupt("return");case 6:if(Xe(lt,this).clearMessage(),He(qe,this,t),!Xe(nt,this)&&re()){e.next=10;break}throw new Error("Browser wallet connection requires UI. Use connectWallet(address, mnemonic) in headless mode.");case 10:return document.getElementById("algox-sdk-container").style.display="none",e.next=13,Ke(Rt,this,Lt).call(this);case 13:return n=e.sent,a=n[t],He($e,this,!0),e.prev=16,r=a.connect(),i=new Promise((function(e,t){return setTimeout((function(){return t(new Error("Wallet connection timed out."))}),3e4)})),e.next=21,Promise.race([r,i]);case 21:if((o=e.sent)&&0!==o.length){e.next=24;break}throw new Error("Wallet connection declined or no account returned.");case 24:He(Je,this,!0),this.account=o[0],He(Qe,this,{address:this.account,walletType:t}),Xe(nt,this)||Xe(lt,this).showSDKUI(),Xe(lt,this).showToast("Connected to ".concat(t," wallet"),"success"),c.emit("wallet:connection:connected",{address:this.account}),He($e,this,!1),e.next=70;break;case 33:if(e.prev=33,e.t0=e.catch(16),"Wallet connection timed out."!==e.t0.message){e.next=44;break}return e.next=38,a.disconnect();case 38:if(!a.killSession){e.next=41;break}return e.next=41,a.killSession();case 41:Xe(nt,this)?console.error("UI is disabled, skipping wallet connection UI"):window.location.reload(),e.next=70;break;case 44:if(console.error("Failed to connect wallet!",e.t0),He($e,this,!1),!e.t0.message||!e.t0.message.includes("Session currently connected")){e.next=66;break}return e.prev=47,e.next=50,a.reconnectSession();case 50:if(!((s=e.sent)&&s.length>0)){e.next=61;break}return He(Je,this,!0),this.account=s[0],He(qe,this,t),He(Qe,this,{address:this.account,walletType:t}),Xe(nt,this)?console.error("UI is disabled, skipping wallet connection UI"):(Xe(lt,this).showSDKUI(),Xe(lt,this).updateWalletAddressBar()),Xe(lt,this).showToast("Connected to existing ".concat(t," session"),"success"),c.emit("wallet:connection:connected",{address:this.account}),He($e,this,!1),e.abrupt("return");case 61:e.next=66;break;case 63:e.prev=63,e.t1=e.catch(47),console.error("Failed to reconnect to existing session:",e.t1);case 66:Xe(lt,this).showToast("Failed to connect wallet!","error"),c.emit("wallet:connection:failed",{error:"Failed to connect wallet!"}),He($e,this,!1),Xe(nt,this)?console.error("UI is disabled, skipping wallet connection UI"):(document.getElementById("algox-sdk-container").style.display="flex",Ke(Rt,this,Ut).call(this));case 70:case"end":return e.stop()}}),e,this,[[16,33],[47,63]])})))).apply(this,arguments)}function jt(){return Ot.apply(this,arguments)}function Ot(){return Ot=Fe(We().mark((function e(){var t,n,a,r,i=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]&&i[0],!this.processing){e.next=3;break}return e.abrupt("return");case 3:if(t||Xe(nt,this)||!re()||"undefined"==typeof confirm){e.next=6;break}if(confirm("Are you sure you want to logout?")){e.next=6;break}return e.abrupt("return");case 6:if(e.prev=6,!Xe(qe,this)||"mnemonic"===Xe(qe,this)){e.next=18;break}return e.next=10,Ke(Rt,this,Lt).call(this);case 10:if(n=e.sent,!(a=null==n?void 0:n[Xe(qe,this)])){e.next=18;break}return e.next=15,a.disconnect();case 15:if(!a.killSession){e.next=18;break}return e.next=18,a.killSession();case 18:(r=oe()).removeItem("walletconnect"),r.removeItem("DeflyWallet.Wallet"),r.removeItem("PeraWallet.Wallet"),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(6),console.error("Failed to disconnect wallet session:",e.t0);case 27:He(ct,this,null),c.emit("wallet:connection:disconnected",{address:this.account}),Xe(lt,this).showToast("Logged out successfully.","success"),Xe(nt,this)?(He(Je,this,!1),this.account=null,He(Qe,this,null),He(qe,this,null)):Ke(Rt,this,Ut).call(this);case 31:case"end":return e.stop()}}),e,this,[[6,24]])}))),Ot.apply(this,arguments)}function Ut(){He(Je,this,!1),this.account=null,He(Qe,this,null),He(qe,this,null),Xe(lt,this).resetToLoginUI()}function Jt(){return Qt.apply(this,arguments)}function Qt(){return(Qt=Fe(We().mark((function e(){var t,n,a,r,i,o,s,l,h;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.processing){e.next=2;break}return e.abrupt("return");case 2:if(t=m.sanitizeInput(document.getElementById("algox-mintx-nft-name").value),n=m.sanitizeInput(document.getElementById("algox-mintx-nft-description").value),a=document.getElementById("algox-mintx-nft-file"),(r=m.validateNFTName(t)).valid){e.next=9;break}return Xe(lt,this).showToast(r.message,"error"),e.abrupt("return");case 9:if((i=m.validateNFTDescription(n)).valid){e.next=13;break}return Xe(lt,this).showToast(i.message,"error"),e.abrupt("return");case 13:if(a.files.length){e.next=16;break}return Xe(lt,this).showToast("Please upload a file.","error"),e.abrupt("return");case 16:return Xe(nt,this)||(Xe(lt,this).updateMessage("Minting NFT... Please wait.","default"),Xe(lt,this).disableMintButton()),this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),e.prev=20,e.next=23,Ke(Rt,this,$t).call(this,{name:t,description:n,file:a.files[0]});case 23:return o=e.sent,s=o.transactionId,l=o.assetId,Xe(nt,this)||Xe(lt,this).updateMessage("NFT Minted! Transaction ID: ".concat(s),"pointer"),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),Xe(lt,this).showToast("NFT Minted Successfully! TxID: ".concat(s),"success"),Xe(nt,this)||(Xe(lt,this).showResetButton(),Xe(lt,this).enableMintButton()),e.next=34,this.getNFTMetadata({assetId:l});case 34:h=e.sent,c.emit("nft:mint:success",{transactionId:s,nft:h}),e.next=46;break;case 38:e.prev=38,e.t0=e.catch(20),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),Xe(nt,this)||Xe(lt,this).resetNFTDetails(),Xe(lt,this).showToast("Failed to mint NFT!","error"),c.emit("nft:mint:failed",{error:"Failed to mint NFT!"});case 46:case"end":return e.stop()}}),e,this,[[20,38]])})))).apply(this,arguments)}function $t(e){return _t.apply(this,arguments)}function _t(){return(_t=Fe(We().mark((function e(t){var n,a,r,i,o,s,c,l,h,d,u,g,m;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,a=t.description,r=t.file,Xe(Je,this)&&this.account){e.next=3;break}throw new Error("Wallet is not connected.");case 3:return i=null,o=null,s=0,e.prev=6,s=1,Xe(lt,this).updateLoadingMessage("Processing... Step 1: Uploading file to IPFS"),e.next=11,ve(r,Xe(At,this));case 11:return i=e.sent,s=2,Xe(lt,this).updateLoadingMessage("Processing... Step 2: Creating metadata"),e.next=16,ye(r);case 16:return c=e.sent,l={name:n,description:a,image:"ipfs://".concat(i),image_integrity:c,image_mimetype:Ke(Rt,this,Yt).call(this,r),decimals:0,standard:"arc3",minted_by:Xe(St,this),marketplace:Xe(It,this)},s=3,Xe(lt,this).updateLoadingMessage("Processing... Step 3: Hashing metadata"),h=JSON.stringify(l),e.next=23,me(h);case 23:return d=e.sent,s=4,Xe(lt,this).updateLoadingMessage("Processing... Step 4: Uploading metadata to IPFS"),e.next=28,be(l,Xe(At,this));case 28:return o=e.sent,s=5,Xe(lt,this).updateLoadingMessage("Processing... Open your wallet to continue"),e.next=33,Ke(Rt,this,qt).call(this,{metadataIpfsHash:o,assetName:n,metadataHashBuffer:d,total:1,decimals:0});case 33:return u=e.sent,g=u.txid,m=u.assetId,e.abrupt("return",{transactionId:g,assetId:m});case 39:if(e.prev=39,e.t0=e.catch(6),e.prev=41,!(s>=4)){e.next=51;break}if(!o){e.next=46;break}return e.next=46,Se(o,Xe(At,this));case 46:if(!i){e.next=49;break}return e.next=49,Se(i,Xe(At,this));case 49:e.next=55;break;case 51:if(!(s>=1)){e.next=55;break}if(!i){e.next=55;break}return e.next=55,Se(i,Xe(At,this));case 55:e.next=60;break;case 57:e.prev=57,e.t1=e.catch(41),console.error("Failed to cleanup IPFS files:",e.t1);case 60:throw e.t0;case 61:case"end":return e.stop()}}),e,this,[[6,39],[41,57]])})))).apply(this,arguments)}function qt(e){return en.apply(this,arguments)}function en(){return(en=Fe(We().mark((function e(t){var n,a,r,i,s,c,l,h,d,u,g,m,p,y,f,v,w,b;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.metadataIpfsHash,a=t.assetName,r=t.metadataHashBuffer,i=t.total,s=void 0===i?1:i,c=t.decimals,l=void 0===c?0:c,e.next=3,Xe(et,this).getTransactionParams().do();case 3:return h=e.sent,d="ipfs://".concat(n,"#arc3"),u=a&&"string"==typeof a&&a.length>0?a.substring(0,32).replace(/[^a-zA-Z0-9 _-]/g,""):"Unnamed Asset",g=o.Ay$.makeAssetCreateTxnWithSuggestedParamsFromObject({sender:this.account,total:BigInt(s),decimals:l,defaultFrozen:!1,unitName:Xe(It,this),assetName:u,assetURL:d,assetMetadataHash:r,suggestedParams:h}),m=[g],Xe(Dt,this)>0&&(p=o.Ay$.makePaymentTxnWithSuggestedParamsFromObject({sender:this.account,receiver:Xe(Et,this),amount:Ce(Xe(Dt,this)),suggestedParams:h}),m.push(p)),m.length>1&&o.Ay$.assignGroupID(m),e.next=12,Ke(Rt,this,Wt).call(this,m);case 12:return y=e.sent,e.next=15,Xe(et,this).sendRawTransaction(y).do();case 15:return f=e.sent,v=f.txid,e.next=19,o.Ay$.waitForConfirmation(Xe(et,this),v,10);case 19:return w=e.sent,b=Number(w.assetIndex),e.abrupt("return",{txid:v,assetId:b});case 22:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function tn(){return nn.apply(this,arguments)}function nn(){return(nn=Fe(We().mark((function e(){var t,n,a,r,i,o,s,l,h,d,u,g,p;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.processing){e.next=2;break}return e.abrupt("return");case 2:if(t=m.sanitizeInput(document.getElementById("algox-mintx-ft-name").value),n=m.sanitizeInput(document.getElementById("algox-mintx-ft-description").value),a=document.getElementById("algox-mintx-ft-decimals").value,r=document.getElementById("algox-mintx-ft-supply").value,i=document.getElementById("algox-mintx-ft-file"),(o=m.validateFTName(t)).valid){e.next=11;break}return Xe(lt,this).showToast(o.message,"error"),e.abrupt("return");case 11:if((s=m.validateFTDescription(n)).valid){e.next=15;break}return Xe(lt,this).showToast(s.message,"error"),e.abrupt("return");case 15:if((l=m.validateFTDecimals(a)).valid){e.next=19;break}return Xe(lt,this).showToast(l.message,"error"),e.abrupt("return");case 19:if((h=m.validateFTTotalSupply(r)).valid){e.next=23;break}return Xe(lt,this).showToast(h.message,"error"),e.abrupt("return");case 23:return Xe(nt,this)||(Xe(lt,this).updateFTMessage("Minting FT... Please wait.","default"),Xe(lt,this).disableFTMintButton()),this.processing=!0,Xe(lt,this).showLoadingOverlay("Processing..."),c.emit("sdk:processing:started",{processing:this.processing}),e.prev=27,e.next=30,Ke(Rt,this,an).call(this,{name:t,description:n,decimals:Number(a),totalSupply:Number(r),file:i.files.length?i.files[0]:null});case 30:return d=e.sent,u=d.transactionId,g=d.assetId,Xe(nt,this)||Xe(lt,this).updateFTMessage("FT Minted! Transaction ID: ".concat(u),"pointer"),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),Xe(lt,this).showToast("FT Minted Successfully! TxID: ".concat(u),"success"),Xe(nt,this)||(Xe(lt,this).showFTResetButton(),Xe(lt,this).enableFTMintButton()),e.next=41,this.getFTMetadata({assetId:g});case 41:p=e.sent,c.emit("ft:mint:success",{transactionId:u,ft:p}),e.next=53;break;case 45:e.prev=45,e.t0=e.catch(27),this.processing=!1,Xe(lt,this).hideLoadingOverlay(),c.emit("sdk:processing:stopped",{processing:this.processing}),Xe(nt,this)||Xe(lt,this).resetFTDetails(),Xe(lt,this).showToast("Failed to mint FT!","error"),c.emit("ft:mint:failed",{error:"Failed to mint FT!"});case 53:case"end":return e.stop()}}),e,this,[[27,45]])})))).apply(this,arguments)}function an(e){return rn.apply(this,arguments)}function rn(){return(rn=Fe(We().mark((function e(t){var n,a,r,i,o,s,c,l,h,d,u,g,m,p,y;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,a=t.description,r=t.decimals,i=t.totalSupply,o=t.file,Xe(Je,this)&&this.account){e.next=3;break}throw new Error("Wallet is not connected.");case 3:if(s=null,c=null,l=0,e.prev=6,h={name:n,description:a,decimals:r,standard:"arc3",minted_by:Xe(St,this),marketplace:Xe(It,this)},!o){e.next=20;break}return l=1,Xe(lt,this).updateLoadingMessage("Processing... Step 1: Uploading icon to IPFS"),e.next=13,ve(o,Xe(At,this));case 13:return s=e.sent,e.next=16,ye(o);case 16:d=e.sent,h.image="ipfs://".concat(s),h.image_integrity=d,h.image_mimetype=o.type;case 20:return l=2,Xe(lt,this).updateLoadingMessage("Processing... Step 2: Creating metadata"),l=3,Xe(lt,this).updateLoadingMessage("Processing... Step 3: Hashing metadata"),u=JSON.stringify(h),e.next=27,me(u);case 27:return g=e.sent,l=4,Xe(lt,this).updateLoadingMessage("Processing... Step 4: Uploading metadata to IPFS"),e.next=32,be(h,Xe(At,this));case 32:return c=e.sent,l=5,Xe(lt,this).updateLoadingMessage("Processing... Open your wallet to continue"),e.next=37,Ke(Rt,this,qt).call(this,{metadataIpfsHash:c,assetName:n,metadataHashBuffer:g,total:i,decimals:r});case 37:return m=e.sent,p=m.txid,y=m.assetId,e.abrupt("return",{transactionId:p,assetId:y});case 43:if(e.prev=43,e.t0=e.catch(6),e.prev=45,!(l>=4)){e.next=55;break}if(!c){e.next=50;break}return e.next=50,Se(c,Xe(At,this));case 50:if(!s){e.next=53;break}return e.next=53,Se(s,Xe(At,this));case 53:e.next=59;break;case 55:if(!(l>=1)){e.next=59;break}if(!s){e.next=59;break}return e.next=59,Se(s,Xe(At,this));case 59:e.next=64;break;case 61:e.prev=61,e.t1=e.catch(45),console.error("Failed to cleanup IPFS files:",e.t1);case 64:throw e.t0;case 65:case"end":return e.stop()}}),e,this,[[6,43],[45,61]])})))).apply(this,arguments)}function on(){return sn.apply(this,arguments)}function sn(){return(sn=Fe(We().mark((function e(){var t,n,a;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Xe(dt,this),"/v2/applications/").concat(Xe(ft,this),"/boxes"),e.next=3,fetch(t);case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch application boxes: ".concat(n.status));case 6:return e.next=8,n.json();case 8:return a=e.sent,e.abrupt("return",a.boxes||[]);case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function cn(e,t){return ln.apply(this,arguments)}function ln(){return(ln=Fe(We().mark((function e(t,n){var a,r;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=xe(t,n),e.next=3,Xe(et,this).getApplicationBoxByName(Xe(ft,this),a).do();case 3:return r=e.sent,e.abrupt("return",(i=r.value,o=void 0,s=void 0,c=void 0,l=void 0,h=void 0,d=void 0,u=void 0,g=void 0,s=new DataView(i.buffer,i.byteOffset,i.byteLength),c=(new TextDecoder).decode(i.slice(8,66)),l=68+s.getUint16(66,!1),h=(new TextDecoder).decode(i.slice(68,l)),o=Number(h),d=Number(o/1e6),g=(u=l+2)+s.getUint16(l,!1),{seller:c,price:d,marketplace:(new TextDecoder).decode(i.slice(u,g))}));case 5:case"end":return e.stop()}var i,o,s,c,l,h,d,u,g}),e,this)})))).apply(this,arguments)}function hn(){return dn.apply(this,arguments)}function dn(){return dn=Fe(We().mark((function e(){var t,n,a,r,i,o,s=this,c=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=Date.now(),!(!t&&Xe(ut,this)&&n-Xe(gt,this)<3e4)){e.next=4;break}return e.abrupt("return",Xe(ut,this));case 4:return a=[],e.prev=5,e.next=8,Ke(Rt,this,on).call(this);case 8:return r=e.sent,i=r.map((function(e){return Be(e.name)})).filter(Boolean),e.next=12,Promise.all(i.map(function(){var e=Fe(We().mark((function e(t){var n,a,r;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.marketplace,a=t.assetId,e.prev=1,e.next=4,Ke(Rt,s,cn).call(s,n,a);case 4:return r=e.sent,e.abrupt("return",{assetId:a,seller:r.seller,price:r.price,marketplace:n});case 8:return e.prev=8,e.t0=e.catch(1),console.warn("Failed to decode listing box:",e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()));case 12:o=e.sent.filter(Boolean),a.push.apply(a,function(e){if(Array.isArray(e))return Ve(e)}(l=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||Le(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(5),console.error("Error fetching all listings:",e.t0.message),e.t0;case 20:return He(ut,this,a),He(gt,this,n),e.abrupt("return",a);case 23:case"end":return e.stop()}var l}),e,this,[[5,16]])}))),dn.apply(this,arguments)}function un(e){return gn.apply(this,arguments)}function gn(){return gn=Fe(We().mark((function e(t){var n,a,r,i,o,s=this,c=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]&&c[1],a=Date.now(),!(!n&&Xe(mt,this)&&Xe(yt,this)===t&&a-Xe(pt,this)<3e4)){e.next=4;break}return e.abrupt("return",Xe(mt,this));case 4:return e.next=6,Ke(Rt,this,on).call(this);case 6:return r=e.sent,i=r.map((function(e){return Be(e.name)})).filter((function(e){return e&&e.marketplace===t})),e.next=10,Promise.all(i.map(function(){var e=Fe(We().mark((function e(n){var a,r;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.assetId,e.prev=1,e.next=4,Ke(Rt,s,cn).call(s,t,a);case 4:return r=e.sent,e.abrupt("return",{assetId:a,seller:r.seller,price:r.price,marketplace:t});case 8:return e.prev=8,e.t0=e.catch(1),console.warn("Failed to decode listing box:",e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()));case 10:return o=e.sent.filter(Boolean),He(mt,this,o),He(pt,this,a),He(yt,this,t),e.abrupt("return",o);case 15:case"end":return e.stop()}}),e,this)}))),gn.apply(this,arguments)}function mn(e){return pn.apply(this,arguments)}function pn(){return pn=Fe(We().mark((function e(t){var n,a,r=arguments;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:Xe(It,this),e.prev=1,e.next=4,Ke(Rt,this,cn).call(this,n,t);case 4:return a=e.sent,e.abrupt("return",{assetId:String(t),seller:a.seller,price:a.price,marketplace:n});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),pn.apply(this,arguments)}function yn(e){return fn.apply(this,arguments)}function fn(){return(fn=Fe(We().mark((function e(t){var n,a,r,i,o,s;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ke(Rt,this,on).call(this);case 2:n=e.sent,a=Te(n),e.prev=4,a.s();case 6:if((r=a.n()).done){e.next=23;break}if(i=r.value,(o=Be(i.name))&&o.assetId===String(t)){e.next=11;break}return e.abrupt("continue",21);case 11:return e.prev=11,e.next=14,Ke(Rt,this,cn).call(this,o.marketplace,t);case 14:return s=e.sent,e.abrupt("return",{assetId:String(t),seller:s.seller,price:s.price,marketplace:o.marketplace});case 18:e.prev=18,e.t0=e.catch(11),console.warn("Failed to read listing box value:",e.t0);case 21:e.next=6;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(4),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.abrupt("return",null);case 32:case"end":return e.stop()}}),e,this,[[4,25,28,31],[11,18]])})))).apply(this,arguments)}function vn(e){return wn.apply(this,arguments)}function wn(){return(wn=Fe(We().mark((function e(t){var n,a,r,i,o,s,c,l,h,d,u,g,m;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.assetId,a=t.seller,r=t.price,i=t.marketplace,o="".concat(Xe(ht,this),"/v2/assets/").concat(n),e.next=4,fetch(o);case 4:if((s=e.sent).ok){e.next=7;break}return e.abrupt("return",null);case 7:return e.next=9,s.json();case 9:return c=e.sent,l=c.asset.params,h=Re(Re({},l),{},{assetId:n,listing:{seller:a,price:r,marketplace:i}}),e.next=14,Ke(Rt,this,Cn).call(this,h,l);case 14:return d="".concat(Xe(ht,this),"/v2/assets/").concat(n,"/balances?currency-greater-than=0"),e.next=17,fetch(d);case 17:if(!(u=e.sent).ok){e.next=24;break}return e.next=21,u.json();case 21:g=e.sent,(m=(g.balances||[]).find((function(e){return e.amount>0})))&&(h.currentHolder=m.address);case 24:return e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function bn(e){return 1===Number(e.total)&&0===Number(e.decimals)}function In(e){return"NFT"===Xe(bt,this)?Ke(Rt,this,bn).call(this,e):!Ke(Rt,this,bn).call(this,e)}function Sn(e,t){return An.apply(this,arguments)}function An(){return(An=Fe(We().mark((function e(t,n){var a,r,i,o;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(a=n.url)&&a.startsWith("ipfs://")){e.next=3;break}return e.abrupt("return");case 3:return r=Ee(a,Xe(Ct,this)),e.prev=4,e.next=7,fetch(r);case 7:if((i=e.sent).ok){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,i.json();case 12:o=e.sent,(Ke(Rt,this,bn).call(this,n)||o.standard)&&(o.image&&o.image.startsWith("ipfs://")&&(o.image=Ee(o.image,Xe(Ct,this))),t.metadata=o),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),console.warn("IPFS metadata fetch failed for asset ".concat(t.assetId),e.t0);case 19:case"end":return e.stop()}}),e,this,[[4,16]])})))).apply(this,arguments)}function Cn(e,t){return En.apply(this,arguments)}function En(){return(En=Fe(We().mark((function e(t,n){var a,r,i,o;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(a=n.url)&&a.startsWith("ipfs://")){e.next=3;break}return e.abrupt("return");case 3:return r=Ee(a,Xe(Ct,this)),e.prev=4,e.next=7,fetch(r);case 7:if((i=e.sent).ok){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,i.json();case 12:o=e.sent,"NFT"===Xe(bt,this)?0===o.decimals&&o.image_integrity&&o.image_mimetype&&o.standard&&o.image&&o.image.startsWith("ipfs://")&&(o.image=Ee(o.image,Xe(Ct,this)),t.metadata=o):o.standard&&(o.image&&o.image.startsWith("ipfs://")&&(o.image=Ee(o.image,Xe(Ct,this))),t.metadata=o),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),console.warn("IPFS metadata fetch failed for asset ".concat(t.assetId),e.t0);case 19:case"end":return e.stop()}}),e,this,[[4,16]])})))).apply(this,arguments)}const xn=Mt;var kn=i.A;export{kn as default};