var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n),__async=(e,t,n)=>new Promise(((r,o)=>{var i=e=>{try{a(n.next(e))}catch(t){o(t)}},s=e=>{try{a(n.throw(e))}catch(t){o(t)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,s);a((n=n.apply(e,t)).next())}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TON_CONNECT_UI={})}(this,(function(e){var t,n,r,o,i,s,a,l,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var d,h,f,g={exports:{}};h=c,f=function(){var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var t,n=unescape(encodeURIComponent(e)),r=new Uint8Array(n.length);for(t=0;t>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function g(e,t,n,r,o){var i,s=0;for(i=0;i>>8)-1}function p(e,t,n,r){return g(e,t,n,r,16)}function m(e,t,n,r){return g(e,t,n,r,32)}function y(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,f=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,m=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,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=i,x=s,_=a,S=l,k=c,E=u,R=d,L=h,M=f,T=g,A=p,O=w,$=m,P=v,I=y,N=b,U=0;U<20;U+=2)C^=(o=($^=(o=(M^=(o=(k^=(o=C+$|0)<<7|o>>>25)+C|0)<<9|o>>>23)+k|0)<<13|o>>>19)+M|0)<<18|o>>>14,E^=(o=(x^=(o=(P^=(o=(T^=(o=E+x|0)<<7|o>>>25)+E|0)<<9|o>>>23)+T|0)<<13|o>>>19)+P|0)<<18|o>>>14,A^=(o=(R^=(o=(_^=(o=(I^=(o=A+R|0)<<7|o>>>25)+A|0)<<9|o>>>23)+I|0)<<13|o>>>19)+_|0)<<18|o>>>14,N^=(o=(O^=(o=(L^=(o=(S^=(o=N+O|0)<<7|o>>>25)+N|0)<<9|o>>>23)+S|0)<<13|o>>>19)+L|0)<<18|o>>>14,C^=(o=(S^=(o=(_^=(o=(x^=(o=C+S|0)<<7|o>>>25)+C|0)<<9|o>>>23)+x|0)<<13|o>>>19)+_|0)<<18|o>>>14,E^=(o=(k^=(o=(L^=(o=(R^=(o=E+k|0)<<7|o>>>25)+E|0)<<9|o>>>23)+R|0)<<13|o>>>19)+L|0)<<18|o>>>14,A^=(o=(T^=(o=(M^=(o=(O^=(o=A+T|0)<<7|o>>>25)+A|0)<<9|o>>>23)+O|0)<<13|o>>>19)+M|0)<<18|o>>>14,N^=(o=(I^=(o=(P^=(o=($^=(o=N+I|0)<<7|o>>>25)+N|0)<<9|o>>>23)+$|0)<<13|o>>>19)+P|0)<<18|o>>>14;C=C+i|0,x=x+s|0,_=_+a|0,S=S+l|0,k=k+c|0,E=E+u|0,R=R+d|0,L=L+h|0,M=M+f|0,T=T+g|0,A=A+p|0,O=O+w|0,$=$+m|0,P=P+v|0,I=I+y|0,N=N+b|0,e[0]=C>>>0&255,e[1]=C>>>8&255,e[2]=C>>>16&255,e[3]=C>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=L>>>0&255,e[29]=L>>>8&255,e[30]=L>>>16&255,e[31]=L>>>24&255,e[32]=M>>>0&255,e[33]=M>>>8&255,e[34]=M>>>16&255,e[35]=M>>>24&255,e[36]=T>>>0&255,e[37]=T>>>8&255,e[38]=T>>>16&255,e[39]=T>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=O>>>0&255,e[45]=O>>>8&255,e[46]=O>>>16&255,e[47]=O>>>24&255,e[48]=$>>>0&255,e[49]=$>>>8&255,e[50]=$>>>16&255,e[51]=$>>>24&255,e[52]=P>>>0&255,e[53]=P>>>8&255,e[54]=P>>>16&255,e[55]=P>>>24&255,e[56]=I>>>0&255,e[57]=I>>>8&255,e[58]=I>>>16&255,e[59]=I>>>24&255,e[60]=N>>>0&255,e[61]=N>>>8&255,e[62]=N>>>16&255,e[63]=N>>>24&255}(e,t,n,r)}function b(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,f=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,w=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,m=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,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=0;C<20;C+=2)i^=(o=(m^=(o=(f^=(o=(c^=(o=i+m|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+f|0)<<18|o>>>14,u^=(o=(s^=(o=(v^=(o=(g^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14,p^=(o=(d^=(o=(a^=(o=(y^=(o=p+d|0)<<7|o>>>25)+p|0)<<9|o>>>23)+y|0)<<13|o>>>19)+a|0)<<18|o>>>14,b^=(o=(w^=(o=(h^=(o=(l^=(o=b+w|0)<<7|o>>>25)+b|0)<<9|o>>>23)+l|0)<<13|o>>>19)+h|0)<<18|o>>>14,i^=(o=(l^=(o=(a^=(o=(s^=(o=i+l|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(c^=(o=(h^=(o=(d^=(o=u+c|0)<<7|o>>>25)+u|0)<<9|o>>>23)+d|0)<<13|o>>>19)+h|0)<<18|o>>>14,p^=(o=(g^=(o=(f^=(o=(w^=(o=p+g|0)<<7|o>>>25)+p|0)<<9|o>>>23)+w|0)<<13|o>>>19)+f|0)<<18|o>>>14,b^=(o=(y^=(o=(v^=(o=(m^=(o=b+y|0)<<7|o>>>25)+b|0)<<9|o>>>23)+m|0)<<13|o>>>19)+v|0)<<18|o>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=u>>>0&255,e[5]=u>>>8&255,e[6]=u>>>16&255,e[7]=u>>>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]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=f>>>0&255,e[25]=f>>>8&255,e[26]=f>>>16&255,e[27]=f>>>24&255,e[28]=g>>>0&255,e[29]=g>>>8&255,e[30]=g>>>16&255,e[31]=g>>>24&255}(e,t,n,r)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function x(e,t,n,r,o,i,s){var a,l,c=new Uint8Array(16),u=new Uint8Array(64);for(l=0;l<16;l++)c[l]=0;for(l=0;l<8;l++)c[l]=i[l];for(;o>=64;){for(y(u,c,s,C),l=0;l<64;l++)e[t+l]=n[r+l]^u[l];for(a=1,l=8;l<16;l++)a=a+(255&c[l])|0,c[l]=255&a,a>>>=8;o-=64,t+=64,r+=64}if(o>0)for(y(u,c,s,C),l=0;l=64;){for(y(l,a,o,C),s=0;s<64;s++)e[t+s]=l[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(y(l,a,o,C),s=0;s>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),l=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|l<<8),this.r[9]=l>>>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 R(e,t,n,r,o,i){var s=new E(i);return s.update(n,r,o),s.finish(e,t),0}function L(e,t,n,r,o,i){var s=new Uint8Array(16);return R(s,0,n,r,o,i),p(e,t,s,0)}function M(e,t,n,r,o){var i;if(n<32)return-1;for(k(e,0,t,0,n,r,o),R(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function T(e,t,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(S(s,0,32,r,o),0!==L(t,16,t,32,n-32,s))return-1;for(k(e,0,t,0,n,r,o),i=0;i<32;i++)e[i]=0;return 0}function A(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function O(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function $(e,t,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(e[i]^t[i]),e[i]^=r,t[i]^=r}function P(e,n){var r,o,i,s=t(),a=t();for(r=0;r<16;r++)a[r]=n[r];for(O(a),O(a),O(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,$(a,s,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return P(n,e),P(r,t),m(n,0,r,0)}function N(e){var t=new Uint8Array(32);return P(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function W(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function j(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function B(e,t,n){var r,o,i=0,s=0,a=0,l=0,c=0,u=0,d=0,h=0,f=0,g=0,p=0,w=0,m=0,v=0,y=0,b=0,C=0,x=0,_=0,S=0,k=0,E=0,R=0,L=0,M=0,T=0,A=0,O=0,$=0,P=0,I=0,N=n[0],U=n[1],W=n[2],j=n[3],B=n[4],H=n[5],K=n[6],D=n[7],F=n[8],V=n[9],q=n[10],z=n[11],Z=n[12],G=n[13],Y=n[14],Q=n[15];i+=(r=t[0])*N,s+=r*U,a+=r*W,l+=r*j,c+=r*B,u+=r*H,d+=r*K,h+=r*D,f+=r*F,g+=r*V,p+=r*q,w+=r*z,m+=r*Z,v+=r*G,y+=r*Y,b+=r*Q,s+=(r=t[1])*N,a+=r*U,l+=r*W,c+=r*j,u+=r*B,d+=r*H,h+=r*K,f+=r*D,g+=r*F,p+=r*V,w+=r*q,m+=r*z,v+=r*Z,y+=r*G,b+=r*Y,C+=r*Q,a+=(r=t[2])*N,l+=r*U,c+=r*W,u+=r*j,d+=r*B,h+=r*H,f+=r*K,g+=r*D,p+=r*F,w+=r*V,m+=r*q,v+=r*z,y+=r*Z,b+=r*G,C+=r*Y,x+=r*Q,l+=(r=t[3])*N,c+=r*U,u+=r*W,d+=r*j,h+=r*B,f+=r*H,g+=r*K,p+=r*D,w+=r*F,m+=r*V,v+=r*q,y+=r*z,b+=r*Z,C+=r*G,x+=r*Y,_+=r*Q,c+=(r=t[4])*N,u+=r*U,d+=r*W,h+=r*j,f+=r*B,g+=r*H,p+=r*K,w+=r*D,m+=r*F,v+=r*V,y+=r*q,b+=r*z,C+=r*Z,x+=r*G,_+=r*Y,S+=r*Q,u+=(r=t[5])*N,d+=r*U,h+=r*W,f+=r*j,g+=r*B,p+=r*H,w+=r*K,m+=r*D,v+=r*F,y+=r*V,b+=r*q,C+=r*z,x+=r*Z,_+=r*G,S+=r*Y,k+=r*Q,d+=(r=t[6])*N,h+=r*U,f+=r*W,g+=r*j,p+=r*B,w+=r*H,m+=r*K,v+=r*D,y+=r*F,b+=r*V,C+=r*q,x+=r*z,_+=r*Z,S+=r*G,k+=r*Y,E+=r*Q,h+=(r=t[7])*N,f+=r*U,g+=r*W,p+=r*j,w+=r*B,m+=r*H,v+=r*K,y+=r*D,b+=r*F,C+=r*V,x+=r*q,_+=r*z,S+=r*Z,k+=r*G,E+=r*Y,R+=r*Q,f+=(r=t[8])*N,g+=r*U,p+=r*W,w+=r*j,m+=r*B,v+=r*H,y+=r*K,b+=r*D,C+=r*F,x+=r*V,_+=r*q,S+=r*z,k+=r*Z,E+=r*G,R+=r*Y,L+=r*Q,g+=(r=t[9])*N,p+=r*U,w+=r*W,m+=r*j,v+=r*B,y+=r*H,b+=r*K,C+=r*D,x+=r*F,_+=r*V,S+=r*q,k+=r*z,E+=r*Z,R+=r*G,L+=r*Y,M+=r*Q,p+=(r=t[10])*N,w+=r*U,m+=r*W,v+=r*j,y+=r*B,b+=r*H,C+=r*K,x+=r*D,_+=r*F,S+=r*V,k+=r*q,E+=r*z,R+=r*Z,L+=r*G,M+=r*Y,T+=r*Q,w+=(r=t[11])*N,m+=r*U,v+=r*W,y+=r*j,b+=r*B,C+=r*H,x+=r*K,_+=r*D,S+=r*F,k+=r*V,E+=r*q,R+=r*z,L+=r*Z,M+=r*G,T+=r*Y,A+=r*Q,m+=(r=t[12])*N,v+=r*U,y+=r*W,b+=r*j,C+=r*B,x+=r*H,_+=r*K,S+=r*D,k+=r*F,E+=r*V,R+=r*q,L+=r*z,M+=r*Z,T+=r*G,A+=r*Y,O+=r*Q,v+=(r=t[13])*N,y+=r*U,b+=r*W,C+=r*j,x+=r*B,_+=r*H,S+=r*K,k+=r*D,E+=r*F,R+=r*V,L+=r*q,M+=r*z,T+=r*Z,A+=r*G,O+=r*Y,$+=r*Q,y+=(r=t[14])*N,b+=r*U,C+=r*W,x+=r*j,_+=r*B,S+=r*H,k+=r*K,E+=r*D,R+=r*F,L+=r*V,M+=r*q,T+=r*z,A+=r*Z,O+=r*G,$+=r*Y,P+=r*Q,b+=(r=t[15])*N,s+=38*(x+=r*W),a+=38*(_+=r*j),l+=38*(S+=r*B),c+=38*(k+=r*H),u+=38*(E+=r*K),d+=38*(R+=r*D),h+=38*(L+=r*F),f+=38*(M+=r*V),g+=38*(T+=r*q),p+=38*(A+=r*z),w+=38*(O+=r*Z),m+=38*($+=r*G),v+=38*(P+=r*Y),y+=38*(I+=r*Q),i=(r=(i+=38*(C+=r*U))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=c,e[5]=u,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=w,e[12]=m,e[13]=v,e[14]=y,e[15]=b}function H(e,t){B(e,t,t)}function K(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function D(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function F(e,n,r){var o,i,s=new Uint8Array(32),l=new Float64Array(80),c=t(),u=t(),d=t(),h=t(),f=t(),g=t();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,U(l,r),i=0;i<16;i++)u[i]=l[i],h[i]=c[i]=d[i]=0;for(c[0]=h[0]=1,i=254;i>=0;--i)$(c,u,o=s[i>>>3]>>>(7&i)&1),$(d,h,o),W(f,c,d),j(c,c,d),W(d,u,h),j(u,u,h),H(h,f),H(g,c),B(c,d,c),B(d,u,f),W(f,c,d),j(c,c,d),H(u,c),j(d,h,g),B(c,d,a),W(c,c,h),B(d,d,c),B(c,h,g),B(h,u,l),H(u,f),$(c,u,o),$(d,h,o);for(i=0;i<16;i++)l[i+16]=c[i],l[i+32]=d[i],l[i+48]=u[i],l[i+64]=h[i];var p=l.subarray(32),w=l.subarray(16);return K(p,p),B(w,w,p),P(e,w),0}function V(e,t){return F(e,t,o)}function q(e,t){return n(t,32),V(e,t)}function z(e,t,n){var o=new Uint8Array(32);return F(o,n,t),b(e,r,o,C)}E.prototype.blocks=function(e,t,n){for(var r,o,i,s,a,l,c,u,d,h,f,g,p,w,m,v,y,b,C,x=this.fin?0:2048,_=this.h[0],S=this.h[1],k=this.h[2],E=this.h[3],R=this.h[4],L=this.h[5],M=this.h[6],T=this.h[7],A=this.h[8],O=this.h[9],$=this.r[0],P=this.r[1],I=this.r[2],N=this.r[3],U=this.r[4],W=this.r[5],j=this.r[6],B=this.r[7],H=this.r[8],K=this.r[9];n>=16;)h=d=0,h+=(_+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*$,h+=(S+=8191&(r>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*K),h+=(k+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*H),h+=(E+=8191&(i>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*B),d=(h+=(R+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*j))>>>13,h&=8191,h+=(L+=a>>>1&8191)*(5*W),h+=(M+=8191&(a>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*U),h+=(T+=8191&(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*N),h+=(A+=8191&(c>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*I),f=d+=(h+=(O+=u>>>5|x)*(5*P))>>>13,f+=_*P,f+=S*$,f+=k*(5*K),f+=E*(5*H),d=(f+=R*(5*B))>>>13,f&=8191,f+=L*(5*j),f+=M*(5*W),f+=T*(5*U),f+=A*(5*N),d+=(f+=O*(5*I))>>>13,f&=8191,g=d,g+=_*I,g+=S*P,g+=k*$,g+=E*(5*K),d=(g+=R*(5*H))>>>13,g&=8191,g+=L*(5*B),g+=M*(5*j),g+=T*(5*W),g+=A*(5*U),p=d+=(g+=O*(5*N))>>>13,p+=_*N,p+=S*I,p+=k*P,p+=E*$,d=(p+=R*(5*K))>>>13,p&=8191,p+=L*(5*H),p+=M*(5*B),p+=T*(5*j),p+=A*(5*W),w=d+=(p+=O*(5*U))>>>13,w+=_*U,w+=S*N,w+=k*I,w+=E*P,d=(w+=R*$)>>>13,w&=8191,w+=L*(5*K),w+=M*(5*H),w+=T*(5*B),w+=A*(5*j),m=d+=(w+=O*(5*W))>>>13,m+=_*W,m+=S*U,m+=k*N,m+=E*I,d=(m+=R*P)>>>13,m&=8191,m+=L*$,m+=M*(5*K),m+=T*(5*H),m+=A*(5*B),v=d+=(m+=O*(5*j))>>>13,v+=_*j,v+=S*W,v+=k*U,v+=E*N,d=(v+=R*I)>>>13,v&=8191,v+=L*P,v+=M*$,v+=T*(5*K),v+=A*(5*H),y=d+=(v+=O*(5*B))>>>13,y+=_*B,y+=S*j,y+=k*W,y+=E*U,d=(y+=R*N)>>>13,y&=8191,y+=L*I,y+=M*P,y+=T*$,y+=A*(5*K),b=d+=(y+=O*(5*H))>>>13,b+=_*H,b+=S*B,b+=k*j,b+=E*W,d=(b+=R*U)>>>13,b&=8191,b+=L*N,b+=M*I,b+=T*P,b+=A*$,C=d+=(b+=O*(5*K))>>>13,C+=_*K,C+=S*H,C+=k*B,C+=E*j,d=(C+=R*W)>>>13,C&=8191,C+=L*U,C+=M*N,C+=T*I,C+=A*P,_=h=8191&(d=(d=((d+=(C+=O*$)>>>13)<<2)+d|0)+(h&=8191)|0),S=f+=d>>>=13,k=g&=8191,E=p&=8191,R=w&=8191,L=m&=8191,M=v&=8191,T=y&=8191,A=b&=8191,O=C&=8191,t+=16,n-=16;this.h[0]=_,this.h[1]=S,this.h[2]=k,this.h[3]=E,this.h[4]=R,this.h[5]=L,this.h[6]=M,this.h[7]=T,this.h[8]=A,this.h[9]=O},E.prototype.finish=function(e,t){var n,r,o,i,s=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,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[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),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;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 r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r=16&&(o=n-n%16,this.blocks(e,t,o),t+=o,n-=o),n){for(r=0;r=128;){for(x=0;x<16;x++)_=8*x+Z,T[x]=n[_+0]<<24|n[_+1]<<16|n[_+2]<<8|n[_+3],A[x]=n[_+4]<<24|n[_+5]<<16|n[_+6]<<8|n[_+7];for(x=0;x<80;x++)if(o=O,i=$,s=P,a=I,l=N,c=U,u=W,j,h=B,f=H,g=K,p=D,w=F,m=V,v=q,z,E=65535&(k=z),R=k>>>16,L=65535&(S=j),M=S>>>16,E+=65535&(k=(F>>>14|N<<18)^(F>>>18|N<<14)^(N>>>9|F<<23)),R+=k>>>16,L+=65535&(S=(N>>>14|F<<18)^(N>>>18|F<<14)^(F>>>9|N<<23)),M+=S>>>16,E+=65535&(k=F&V^~F&q),R+=k>>>16,L+=65535&(S=N&U^~N&W),M+=S>>>16,S=Y[2*x],E+=65535&(k=Y[2*x+1]),R+=k>>>16,L+=65535&S,M+=S>>>16,S=T[x%16],R+=(k=A[x%16])>>>16,L+=65535&S,M+=S>>>16,L+=(R+=(E+=65535&k)>>>16)>>>16,E=65535&(k=C=65535&E|R<<16),R=k>>>16,L=65535&(S=b=65535&L|(M+=L>>>16)<<16),M=S>>>16,E+=65535&(k=(B>>>28|O<<4)^(O>>>2|B<<30)^(O>>>7|B<<25)),R+=k>>>16,L+=65535&(S=(O>>>28|B<<4)^(B>>>2|O<<30)^(B>>>7|O<<25)),M+=S>>>16,R+=(k=B&H^B&K^H&K)>>>16,L+=65535&(S=O&$^O&P^$&P),M+=S>>>16,d=65535&(L+=(R+=(E+=65535&k)>>>16)>>>16)|(M+=L>>>16)<<16,y=65535&E|R<<16,E=65535&(k=p),R=k>>>16,L=65535&(S=a),M=S>>>16,R+=(k=C)>>>16,L+=65535&(S=b),M+=S>>>16,$=o,P=i,I=s,N=a=65535&(L+=(R+=(E+=65535&k)>>>16)>>>16)|(M+=L>>>16)<<16,U=l,W=c,j=u,O=d,H=h,K=f,D=g,F=p=65535&E|R<<16,V=w,q=m,z=v,B=y,x%16==15)for(_=0;_<16;_++)S=T[_],E=65535&(k=A[_]),R=k>>>16,L=65535&S,M=S>>>16,S=T[(_+9)%16],E+=65535&(k=A[(_+9)%16]),R+=k>>>16,L+=65535&S,M+=S>>>16,b=T[(_+1)%16],E+=65535&(k=((C=A[(_+1)%16])>>>1|b<<31)^(C>>>8|b<<24)^(C>>>7|b<<25)),R+=k>>>16,L+=65535&(S=(b>>>1|C<<31)^(b>>>8|C<<24)^b>>>7),M+=S>>>16,b=T[(_+14)%16],R+=(k=((C=A[(_+14)%16])>>>19|b<<13)^(b>>>29|C<<3)^(C>>>6|b<<26))>>>16,L+=65535&(S=(b>>>19|C<<13)^(C>>>29|b<<3)^b>>>6),M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,T[_]=65535&L|M<<16,A[_]=65535&E|R<<16;E=65535&(k=B),R=k>>>16,L=65535&(S=O),M=S>>>16,S=e[0],R+=(k=t[0])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[0]=O=65535&L|M<<16,t[0]=B=65535&E|R<<16,E=65535&(k=H),R=k>>>16,L=65535&(S=$),M=S>>>16,S=e[1],R+=(k=t[1])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[1]=$=65535&L|M<<16,t[1]=H=65535&E|R<<16,E=65535&(k=K),R=k>>>16,L=65535&(S=P),M=S>>>16,S=e[2],R+=(k=t[2])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[2]=P=65535&L|M<<16,t[2]=K=65535&E|R<<16,E=65535&(k=D),R=k>>>16,L=65535&(S=I),M=S>>>16,S=e[3],R+=(k=t[3])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[3]=I=65535&L|M<<16,t[3]=D=65535&E|R<<16,E=65535&(k=F),R=k>>>16,L=65535&(S=N),M=S>>>16,S=e[4],R+=(k=t[4])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[4]=N=65535&L|M<<16,t[4]=F=65535&E|R<<16,E=65535&(k=V),R=k>>>16,L=65535&(S=U),M=S>>>16,S=e[5],R+=(k=t[5])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[5]=U=65535&L|M<<16,t[5]=V=65535&E|R<<16,E=65535&(k=q),R=k>>>16,L=65535&(S=W),M=S>>>16,S=e[6],R+=(k=t[6])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[6]=W=65535&L|M<<16,t[6]=q=65535&E|R<<16,E=65535&(k=z),R=k>>>16,L=65535&(S=j),M=S>>>16,S=e[7],R+=(k=t[7])>>>16,L+=65535&S,M+=S>>>16,M+=(L+=(R+=(E+=65535&k)>>>16)>>>16)>>>16,e[7]=j=65535&L|M<<16,t[7]=z=65535&E|R<<16,Z+=128,r-=128}return r}function J(e,t,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[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(o,i,t,n),n%=128,r=0;r=0;--o)ee(e,t,r=n[o/8|0]>>(7&o)&1),X(t,e),X(e,e),ee(e,t,r)}function re(e,n){var r=[t(),t(),t(),t()];A(r[0],u),A(r[1],d),A(r[2],s),B(r[3],u,d),ne(e,r,n)}function oe(e,r,o){var i,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(r,32),J(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),te(e,a),i=0;i<32;i++)r[i+32]=e[i];return 0}var ie=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 se(e,t){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o>4)*ie[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*ie[o];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function ae(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;se(e,n)}function le(e,n,r,o){var i,s,a=new Uint8Array(64),l=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),d=[t(),t(),t(),t()];J(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var h=r+64;for(i=0;i>7&&j(e[0],i,e[0]),B(e[3],e[0],e[1]),0)}(f,o))return-1;for(a=0;a=0},e.sign.keyPair=function(){var e=new Uint8Array(me),t=new Uint8Array(ve);return oe(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(be(e),e.length!==ve)throw new Error("bad secret key size");for(var t=new Uint8Array(me),n=0;np.encodeUTF8(n),toObject(){try{return JSON.parse(p.encodeUTF8(n))}catch(e){return null}},toUint8Array:()=>n}}};function A(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function O(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let n=0;n=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),o=y.box.open(r,n,t,this.keyPair.secretKey);if(!o)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(o)}stringifyKeypair(){return{publicKey:A(this.keyPair.publicKey),secretKey:A(this.keyPair.secretKey)}}}function P(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(t){i(t)}}function a(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}class I extends Error{constructor(e,t){super(e,t),this.message=`${I.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,I.prototype)}get info(){return""}}I.prefix="[TON_CONNECT_SDK_ERROR]";class N extends I{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,N.prototype)}}class U extends I{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,U.prototype)}}class W extends I{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,W.prototype)}}class j extends I{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,j.prototype)}}class B extends I{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}}class H extends I{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,H.prototype)}}class K extends I{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,K.prototype)}}class D extends I{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,D.prototype)}}class F extends I{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,F.prototype)}}class V extends I{get info(){return"Storage was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment."}constructor(...e){super(...e),Object.setPrototypeOf(this,V.prototype)}}class q extends I{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,q.prototype)}}class z extends I{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,z.prototype)}}class Z extends I{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,Z.prototype)}}class G extends I{constructor(...e){super(...e),Object.setPrototypeOf(this,G.prototype)}}const Y={[b.UNKNOWN_ERROR]:G,[b.USER_REJECTS_ERROR]:H,[b.BAD_REQUEST_ERROR]:K,[b.UNKNOWN_APP_ERROR]:D,[b.MANIFEST_NOT_FOUND_ERROR]:W,[b.MANIFEST_CONTENT_ERROR]:U};const Q=new class{parseError(e){let t=G;return e.code in Y&&(t=Y[e.code]||G),new t(e.message)}};class J{isError(e){return"error"in e}}const X={[_.UNKNOWN_ERROR]:G,[_.USER_REJECTS_ERROR]:H,[_.BAD_REQUEST_ERROR]:K,[_.UNKNOWN_APP_ERROR]:D};const ee=new class extends J{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=G;throw e.error.code in X&&(t=X[e.error.code]||G),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class te{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return P(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return P(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return P(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e||null}))}}function ne(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function re(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function oe(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function ie(e,t){return P(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{var o,i;if(null===(o=null==t?void 0:t.signal)||void 0===o?void 0:o.aborted)return void r(new I("Delay aborted"));const s=setTimeout((()=>n()),e);null===(i=null==t?void 0:t.signal)||void 0===i||i.addEventListener("abort",(()=>{clearTimeout(s),r(new I("Delay aborted"))}))}))}))}function se(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",(()=>t.abort()),{once:!0}),t}function ae(e,t){var n,r;return P(this,void 0,void 0,(function*(){const o=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:10,i=null!==(r=null==t?void 0:t.delayMs)&&void 0!==r?r:200,s=se(null==t?void 0:t.signal);if("function"!=typeof e)throw new I("Expected a function, got "+typeof e);let a,l=0;for(;lP(this,void 0,void 0,(function*(){if(i=null!=a?a:null,null==s||s.abort(),s=se(a),s.signal.aborted)throw new I("Resource creation was aborted");r=null!=l?l:null;const c=e(s.signal,...l);o=c;const u=yield c;if(o!==c&&u!==n)throw yield t(u),new I("Resource creation was aborted by a new resource creation");return n=u,n}));return{create:a,current:()=>null!=n?n:null,dispose:()=>P(this,void 0,void 0,(function*(){try{const e=n;n=null;const r=o;o=null,null==s||s.abort(),yield Promise.allSettled([e?t(e):Promise.resolve(),r?t(yield r):Promise.resolve()])}catch(e){ce("Failed to dispose the resource",e)}})),recreate:e=>P(this,void 0,void 0,(function*(){const t=n,s=o,l=r,c=i;if(yield ie(e),t===n&&s===o&&l===r&&c===i)return yield a(i,...null!=l?l:[]);throw new I("Resource recreation was aborted by a new resource creation")}))}}(((e,t)=>P(this,void 0,void 0,(function*(){const n={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t};return yield function(e){return P(this,void 0,void 0,(function*(){return yield function(e,t){const n=null==t?void 0:t.timeout,r=se(null==t?void 0:t.signal);return new Promise(((t,o)=>{if(r.signal.aborted)return void o(new I("Operation aborted"));let i;void 0!==n&&(i=setTimeout((()=>{r.abort(),o(new I(`Timeout after ${n}ms`))}),n)),r.signal.addEventListener("abort",(()=>{clearTimeout(i),o(new I("Operation aborted"))}),{once:!0});const s={timeout:n,abort:r.signal};e(t,o,s).finally((()=>clearTimeout(i)))}))}(((t,n,r)=>P(this,void 0,void 0,(function*(){var o;const i=se(r.signal).signal;if(i.aborted)return void n(new I("Bridge connection aborted"));const s=new URL(ne(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const a=yield e.bridgeGatewayStorage.getLastEventId();if(a&&s.searchParams.append("last_event_id",a),i.aborted)return void n(new I("Bridge connection aborted"));const l=new EventSource(s.toString());l.onerror=r=>P(this,void 0,void 0,(function*(){if(i.aborted)return l.close(),void n(new I("Bridge connection aborted"));try{const n=yield e.errorHandler(l,r);n!==l&&l.close(),n&&n!==l&&t(n)}catch(o){l.close(),n(o)}})),l.onopen=()=>{if(i.aborted)return l.close(),void n(new I("Bridge connection aborted"));t(l)},l.onmessage=t=>{if(i.aborted)return l.close(),void n(new I("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",(()=>{l.close(),n(new I("Bridge connection aborted"))}))}))),{timeout:e.openingDeadlineMS,signal:e.signal})}))}(n)}))),(e=>P(this,void 0,void 0,(function*(){e.close()})))),this.bridgeGatewayStorage=new te(e,t)}get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}registerSession(e){return P(this,void 0,void 0,(function*(){yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS)}))}send(e,t,n,r){var o;return P(this,void 0,void 0,(function*(){const i={};"number"==typeof r?i.ttl=r:(i.ttl=null==r?void 0:r.ttl,i.signal=null==r?void 0:r.signal,i.attempts=null==r?void 0:r.attempts);const s=new URL(ne(this.bridgeUrl,this.postPath));s.searchParams.append("client_id",this.sessionId),s.searchParams.append("to",t),s.searchParams.append("ttl",((null==i?void 0:i.ttl)||this.defaultTtl).toString()),s.searchParams.append("topic",n);const a=T.encode(e);yield ae((e=>P(this,void 0,void 0,(function*(){const t=yield this.post(s,a,e.signal);if(!t.ok)throw new I(`Bridge send failed, status ${t.status}`)}))),{attempts:null!==(o=null==i?void 0:i.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:null==i?void 0:i.signal})}))}pause(){this.eventSource.dispose().catch((e=>ce(`Bridge pause failed, ${e}`)))}unPause(){return P(this,void 0,void 0,(function*(){yield this.eventSource.recreate(0)}))}close(){return P(this,void 0,void 0,(function*(){yield this.eventSource.dispose().catch((e=>ce(`Bridge close failed, ${e}`)))}))}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return P(this,void 0,void 0,(function*(){const r=yield fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new I(`Bridge send failed, status ${r.status}`);return r}))}errorsHandler(e,t){return P(this,void 0,void 0,(function*(){if(this.isConnecting)ce("Bridge error",JSON.stringify(t));else{if(!this.isReady){if(this.isClosed)return e.close(),le(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new I("Bridge error, unknown state")}try{this.errorsListener(t)}catch(n){}}}))}messagesHandler(e){return P(this,void 0,void 0,(function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{t=JSON.parse(e.data)}catch(n){throw new I(`Bridge message parse failed, message ${n.data}`)}this.listener(t)}))}}function de(e){return!("connectEvent"in e)}class he{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return P(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!de(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return P(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return P(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new $(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new $(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new I("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new I("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new I("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new I("Trying to read HTTP connection source while injected connection is stored");if(!de(e))throw new I("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new I("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new I("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return P(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type}))}storeLastWalletEventId(e){return P(this,void 0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!de(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return P(this,void 0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}class fe{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new he(e)}static fromStorage(e){return P(this,void 0,void 0,(function*(){const t=new he(e),n=yield t.getHttpConnection();return de(n)?new fe(e,n.connectionSource):new fe(e,{bridgeUrl:n.session.bridgeUrl})}))}connect(e,t){var n;const r=se(null==t?void 0:t.signal);null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=r,this.closeGateways();const o=new $;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then((()=>P(this,void 0,void 0,(function*(){r.signal.aborted||(yield ae((e=>this.openGateways(o,{openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==e?void 0:e.signal})),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:r.signal}))}))));const i="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(i,e)}restoreConnection(e){var t,n;return P(this,void 0,void 0,(function*(){const r=se(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o)return;if(r.signal.aborted)return;const i=null!==(n=null==e?void 0:e.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS;if(de(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:i,signal:null==r?void 0:r.signal});if(Array.isArray(this.walletConnectionSource))throw new I("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(le("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ue(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!r.signal.aborted){this.listeners.forEach((e=>e(o.connectEvent)));try{yield ae((e=>this.gateway.registerSession({openingDeadlineMS:i,signal:e.signal})),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:r.signal})}catch(s){return void(yield this.disconnect({signal:r.signal}))}}}))}sendRequest(e,t){const n={};return"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal,n.attempts=null==t?void 0:t.attempts),new Promise(((t,r)=>P(this,void 0,void 0,(function*(){var o;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new I("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),le("Send http-bridge request:",Object.assign(Object.assign({},e),{id:i}));const s=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:i})),O(this.session.walletPublicKey));try{yield this.gateway.send(s,this.session.walletPublicKey,e.method,{attempts:null==n?void 0:n.attempts,signal:null==n?void 0:n.signal}),null===(o=null==n?void 0:n.onRequestSent)||void 0===o||o.call(n),this.pendingRequests.set(i.toString(),t)}catch(a){r(a)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return P(this,void 0,void 0,(function*(){return new Promise((t=>P(this,void 0,void 0,(function*(){let n=!1,r=null;const o=()=>{n||(n=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=se(null==e?void 0:e.signal);r=setTimeout((()=>{t.abort()}),this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:t.signal,attempts:1})}catch(i){le("Disconnect error:",i),n||this.removeBridgeAndSession().then(t)}finally{r&&clearTimeout(r),o()}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return P(this,void 0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,n){return P(this,void 0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(le("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);yield e.close()}))}gatewayListener(e){return P(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(T.decode(e.message).toUint8Array(),O(e.from)));if(le("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),n=this.pendingRequests.get(e);return n?(n(t),void this.pendingRequests.delete(e)):void le(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void ce(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const n=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(le("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return P(this,void 0,void 0,(function*(){throw new I(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return P(this,void 0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const n=e.payload.items.find((e=>"ton_addr"===e.name)),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})}))}removeBridgeAndSession(){return P(this,void 0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return re(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}generateRegularUniversalLink(e,t){const n=new URL(e);return n.searchParams.append("v",2..toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(t)),n.toString()}generateTGUniversalLink(e,t){const n="tonconnect-"+oe(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),r=this.convertToDirectLink(e),o=new URL(r);return o.searchParams.append("startapp",n),o.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return P(this,void 0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways.map((e=>e.close().catch((e=>console.error(e))))),this.pendingGateways=this.walletConnectionSource.map((t=>{const n=new ue(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(e=>{console.error(e)}));return n.setListener((e=>this.pendingGatewaysListener(n,t.bridgeUrl,e))),n})),void(yield Promise.allSettled(this.pendingGateways.map((e=>ae((n=>this.pendingGateways.some((t=>t===e))?e.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:n.signal}):e.close()),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:null==t?void 0:t.signal})))))):(this.gateway&&(le("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ue(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal}))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function ge(e,t){return pe(e,[t])}function pe(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}class we{constructor(){this.storage={}}static getInstance(){return we.instance||(we.instance=new we),we.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!==(t=n[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}function me(){if("undefined"!=typeof window)return window}function ve(){var e;const t=null===(e=me())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function ye(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new I("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return we.getInstance()}class be{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=be.window;if(!be.isWindowContainsWallet(n,t))throw new F;this.connectionStorage=new he(e),this.injectedWallet=n[t].tonconnect}static fromStorage(e){return P(this,void 0,void 0,(function*(){const t=new he(e),n=yield t.getInjectedConnection();return new be(e,n.jsBridgeKey)}))}static isWalletInjected(e){return be.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!be.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=me();if(!e)return[];try{return Object.keys(e)}catch(t){return[]}}().filter((([e,t])=>function(e){try{return!(!ge(e,"tonconnect")||!ge(e.tonconnect,"walletInfo"))&&pe(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(t){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms})))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return P(this,void 0,void 0,(function*(){try{le("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();le("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEach((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return P(this,void 0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(n){le(n),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){var n;return P(this,void 0,void 0,(function*(){const r={};"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),le("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:o}));const i=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:o}));return i.then((e=>le("Wallet message received:",e))),null===(n=null==r?void 0:r.onRequestSent)||void 0===n||n.call(r),i}))}_connect(e,t){return P(this,void 0,void 0,(function*(){try{le(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const n=yield this.injectedWallet.connect(e,t);le("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(n)))}catch(n){le("Injected Provider connect error:",n);const e={event:"connect_error",payload:{code:0,message:null==n?void 0:n.toString()}};this.listeners.forEach((t=>t(e)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{le("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}be.window=me();class Ce{constructor(){this.localStorage=ye()}getItem(e){return P(this,void 0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return P(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return P(this,void 0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function xe(e){return Se(e)&&e.injected}function _e(e){return xe(e)&&e.embedded}function Se(e){return"jsBridgeKey"in e}function ke(e){return"bridgeUrl"in e}const Ee=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class Re{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return P(this,void 0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return P(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter(_e);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return P(this,void 0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new q("Wrong wallets list format, wallets list must be an array.");const n=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));n.length&&(ce(`Wallet(s) ${n.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(n){ce(n),e=Ee}let t=[];try{t=be.getCurrentlyInjectedWallets()}catch(n){ce(n)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((n=>{if("sse"===n.type&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===n.type){const e=n.key;t.jsBridgeKey=e,t.injected=be.isWalletInjected(e),t.embedded=be.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((n=>{const r=e.find((e=>e.name===n)),o=t.find((e=>e.name===n));return Object.assign(Object.assign({},r&&Object.assign({},r)),o&&Object.assign({},o))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const n=t.find((e=>"sse"===e.type));if(n&&(!("url"in n)||!n.url||!e.universal_url))return!1;const r=t.find((e=>"js"===e.type));return!!(!r||"key"in r&&r.key)}}class Le extends I{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,Le.prototype)}}function Me(e,t){const n=e.includes("SendTransaction"),r=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!n&&!r)throw new Le("Wallet doesn't support SendTransaction feature.");if(r&&void 0!==r.maxMessages){if(r.maxMessagese(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var n,r;const o={};if("object"==typeof t&&"tonProof"in t&&(o.request=t),"object"==typeof t&&("openingDeadlineMS"in t||"signal"in t||"request"in t)&&(o.request=null==t?void 0:t.request,o.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,o.signal=null==t?void 0:t.signal),this.connected)throw new j;const i=se(null==o?void 0:o.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)throw new I("Connection was aborted");return null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=this.createProvider(e),i.signal.addEventListener("abort",(()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null})),this.provider.connect(this.createConnectRequest(null==o?void 0:o.request),{openingDeadlineMS:null==o?void 0:o.openingDeadlineMS,signal:i.signal})}restoreConnection(e){var t,n;return P(this,void 0,void 0,(function*(){const r=se(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return;const[o,i]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(r.signal.aborted)return;let s=null;try{switch(o){case"http":s=yield fe.fromStorage(this.dappSettings.storage);break;case"injected":s=yield be.fromStorage(this.dappSettings.storage);break;default:if(!i)return;s=this.createProvider(i)}}catch(a){return yield this.bridgeConnectionStorage.removeConnection(),null==s||s.closeConnection(),void(s=null)}if(r.signal.aborted)null==s||s.closeConnection();else{if(s)return null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this)),r.signal.addEventListener("abort",(()=>{null==s||s.closeConnection(),s=null})),yield ae((t=>P(this,void 0,void 0,(function*(){return null==s?void 0:s.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal})}))),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:null==e?void 0:e.signal});ce("Provider is not restored")}}))}sendTransaction(e,t){return P(this,void 0,void 0,(function*(){const n={};"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal);const r=se(null==n?void 0:n.signal);if(r.signal.aborted)throw new I("Transaction sending was aborted");this.checkConnection(),Me(this.wallet.device.features,{requiredMessagesNumber:e.messages.length});const{validUntil:o}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{e.hidden?this.pauseConnection():this.unPauseConnection().catch((e=>ce("Cannot unpause connection",e)))}))}catch(t){ce("Cannot subscribe to the document.visibilitychange: ",t)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new be(this.dappSettings.storage,e.jsBridgeKey):new fe(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected()}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),n=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new I("ton_addr connection item was not found");const r={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};n&&(r.connectItems={tonProof:n}),this.wallet=r}onWalletConnectError(e){const t=Q.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),console.debug(t),t instanceof W||t instanceof U)throw console.error(t),t}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new B}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}Te.walletsList=new Re,Te.isWalletInjected=e=>be.isWalletInjected(e),Te.isInsideWalletBrowser=e=>be.isInsideWalletBrowser(e);const Ae=81,Oe=128;function $e(e,t=!1){const{wc:n,hex:r}=function(e){if(!e.includes(":"))throw new z(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new z(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new z(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if(64!==(null==r?void 0:r.length))throw new z(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:Ie(r)}}(e);let o=Ae;t&&(o|=Oe);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const s=new Uint8Array(36);return s.set(i),s.set(function(e){const t=4129;let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let o of r){let e=128;for(;e>0;)n<<=1,o&e&&(n+=1),e>>=1,n>65535&&(n&=65535,n^=t)}return new Uint8Array([Math.floor(n/256),n%256])}(i),34),T.encode(s).replace(/\+/g,"-").replace(/\//g,"_")}const Pe={};for(let Ou=0;Ou<=255;Ou++){let e=Ou.toString(16);e.length<2&&(e="0"+e),Pe[e]=Ou}function Ie(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new Z("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;oe===t};let Be=vt;const He=1,Ke=2,De={owned:null,cleanups:null,context:null,owner:null},Fe={};var Ve=null;let qe,ze=null,Ze=null,Ge=null,Ye=null,Qe=0;function Je(e,t){const n=Ze,r=Ve,o=0===e.length,i=o?De:{owned:null,cleanups:null,context:null,owner:void 0===t?r:t},s=o?e:()=>e((()=>st((()=>xt(i)))));Ve=i,Ze=null;try{return mt(s,!0)}finally{Ze=n,Ve=r}}function Xe(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},je,t):je).equals||void 0};return[ht.bind(n),e=>("function"==typeof e&&(e=e(n.value)),ft(n,e))]}function et(e,t,n){gt(pt(e,t,!0,He))}function tt(e,t,n){gt(pt(e,t,!1,He))}function nt(e,t,n){Be=yt;const r=pt(e,t,!1,He);r.user=!0,Ye?Ye.push(r):gt(r)}function rt(e,t,n){n=n?Object.assign({},je,n):je;const r=pt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,gt(r),ht.bind(r)}function ot(e,t,n){let r,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=Fe,l=null,c=!1,u="initialValue"in i,d="function"==typeof r&&rt(r);const h=new Set,[f,g]=(i.storage||Xe)(i.initialValue),[p,w]=Xe(void 0),[m,v]=Xe(void 0,{equals:!1}),[y,b]=Xe(u?"ready":"unresolved");if(Ne.context){let e;l=`${Ne.context.id}${Ne.context.count++}`,"initial"===i.ssrLoadFrom?a=i.initialValue:Ne.load&&(e=Ne.load(l))&&(a=e[0])}function C(e,t,n,r){return s===e&&(s=null,u=!0,e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(r,{value:t}))),a=Fe,function(e,t){mt((()=>{void 0===t&&g((()=>e)),b(void 0!==t?"errored":"ready"),w(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,n)),t}function x(){const e=qe,t=f(),n=p();if(void 0!==n&&!s)throw n;return Ze&&!Ze.user&&e&&et((()=>{m(),s&&(e.resolved||h.has(e)||(e.increment(),h.add(e)))})),t}function _(e=!0){if(!1!==e&&c)return;c=!1;const t=d?d():r;if(null==t||!1===t)return void C(s,st(f));const n=a!==Fe?a:st((()=>o(t,{value:f(),refetching:e})));return"object"==typeof n&&n&&"then"in n?(s=n,c=!0,queueMicrotask((()=>c=!1)),mt((()=>{b(u?"refreshing":"pending"),v()}),!1),n.then((e=>C(n,e,void 0,t)),(e=>C(n,void 0,_t(e),t)))):(C(s,n,void 0,t),n)}return Object.defineProperties(x,{state:{get:()=>y()},error:{get:()=>p()},loading:{get(){const e=y();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return x();const e=p();if(e&&!s)throw e;return f()}}}),d?et((()=>_(!1))):_(!1),[x,{refetch:_,mutate:g}]}function it(e){return mt(e,!1)}function st(e){if(null===Ze)return e();const t=Ze;Ze=null;try{return e()}finally{Ze=t}}function at(e){return null===Ve||(null===Ve.cleanups?Ve.cleanups=[e]:Ve.cleanups.push(e)),e}function lt(){return Ze}function ct(e,t){const n=Symbol("context");return{id:n,Provider:Rt(n),defaultValue:e}}function ut(e){let t;return void 0!==(t=kt(Ve,e.id))?t:e.defaultValue}function dt(e){const t=rt(e),n=rt((()=>Et(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function ht(){const e=ze;if(this.sources&&(this.state||e))if(this.state===He||e)gt(this);else{const e=Ge;Ge=null,mt((()=>bt(this)),!1),Ge=e}if(Ze){const e=this.observers?this.observers.length:0;Ze.sources?(Ze.sources.push(this),Ze.sourceSlots.push(e)):(Ze.sources=[this],Ze.sourceSlots=[e]),this.observers?(this.observers.push(Ze),this.observerSlots.push(Ze.sources.length-1)):(this.observers=[Ze],this.observerSlots=[Ze.sources.length-1])}return this.value}function ft(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&mt((()=>{for(let t=0;t1e6)throw Ge=[],new Error}),!1)),t}function gt(e){if(!e.fn)return;xt(e);const t=Ve,n=Ze,r=Qe;Ze=Ve=e,function(e,t,n){let r;try{r=e.fn(t)}catch(o){e.pure&&(e.state=He,e.owned&&e.owned.forEach(xt),e.owned=null),St(o)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?ft(e,r):e.value=r,e.updatedAt=n)}(e,e.value,r),Ze=n,Ve=t}function pt(e,t,n,r=He,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ve,context:null,pure:n};return null===Ve||Ve!==De&&(Ve.owned?Ve.owned.push(i):Ve.owned=[i]),i}function wt(e){const t=ze;if(0===e.state||t)return;if(e.state===Ke||t)return bt(e);if(e.suspense&&st(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=n[r]).state===He||t)gt(e);else if(e.state===Ke||t){const t=Ge;Ge=null,mt((()=>bt(e,n[0])),!1),Ge=t}}function mt(e,t){if(Ge)return e();let n=!1;t||(Ge=[]),Ye?n=!0:Ye=[],Qe++;try{const t=e();return function(e){Ge&&(vt(Ge),Ge=null);if(e)return;const t=Ye;Ye=null,t.length&&mt((()=>Be(t)),!1)}(n),t}catch(r){n||(Ye=null),Ge=null,St(r)}}function vt(e){for(let t=0;tn=st((()=>(Ve.context={[e]:t.value},dt((()=>t.children)))))),void 0),n}}const Lt=Symbol("fallback");function Mt(e){for(let t=0;te(t||{})))}function At(){return!0}const Ot={get:(e,t,n)=>t===Ue?n:e.get(t),has:(e,t)=>t===Ue||e.has(t),set:At,deleteProperty:At,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:At,deleteProperty:At}),ownKeys:e=>e.keys()};function $t(e){return(e="function"==typeof e?e():e)?e:{}}function Pt(...e){let t=!1;for(let r=0;r=0;n--){const r=$t(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in $t(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n=0;r--)if(e[r]){const t=Object.getOwnPropertyDescriptors(e[r]);for(const r in t)r in n||Object.defineProperty(n,r,{enumerable:!0,get(){for(let t=e.length-1;t>=0;t--){const n=(e[t]||{})[r];if(void 0!==n)return n}}})}return n}function It(e,...t){const n=new Set(t.flat());if(Ue in e){const r=t.map((t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter((t=>t in e))},Ot)));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!n.has(e)))},Ot)),r}const r=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(r).filter((e=>!n.has(e)))),t.map((t=>{const n={};for(let o=0;oe[i],set:()=>!0,enumerable:!0})}return n}))}function Nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return rt(function(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return at((()=>Mt(i))),()=>{let l,c,u=e()||[];return u[We],st((()=>{let e,t,h,f,g,p,w,m,v,y=u.length;if(0===y)0!==s&&(Mt(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Lt],o[0]=Je((e=>(i[0]=e,n.fallback()))),s=1);else if(0===s){for(o=new Array(y),c=0;c=p&&m>=p&&r[w]===u[m];w--,m--)h[m]=o[w],f[m]=i[w],a&&(g[m]=a[w]);for(e=new Map,t=new Array(m+1),c=m;c>=p;c--)v=u[c],l=e.get(v),t[c]=void 0===l?-1:l,e.set(v,c);for(l=p;l<=w;l++)v=r[l],c=e.get(v),void 0!==c&&-1!==c?(h[c]=o[l],f[c]=i[l],a&&(g[c]=a[l]),c=t[c],e.set(v,c)):i[l]();for(c=p;ce.each),e.children,t||void 0))}function Ut(e){let t=!1;const n=e.keyed,r=rt((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return rt((()=>{const o=r();if(o){const r=e.children,i="function"==typeof r&&r.length>0;return t=n||i,i?st((()=>r(o))):r}return e.fallback}),void 0,void 0)}function Wt(e){let t=!1,n=!1;const r=dt((()=>e.children)),o=rt((()=>{let e=r();Array.isArray(e)||(e=[e]);for(let t=0;te[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return rt((()=>{const[r,i,s]=o();if(r<0)return e.fallback;const a=s.children,l="function"==typeof a&&a.length>0;return t=n||l,l?st((()=>a(i))):a}),void 0,void 0)}function jt(e){return e}const Bt=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),Ht=new Set(["innerHTML","textContent","innerText","children"]),Kt=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Dt=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),Ft=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Vt=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),qt={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const zt="_$DX_DELEGATE";function Zt(e,t,n){const r=document.createElement("template");r.innerHTML=e;let o=r.content.firstChild;return n&&(o=o.firstChild),o}function Gt(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Yt(e,t){null==t?e.removeAttribute("class"):e.className=t}function Qt(e,t={},n,r){const o={};return r||tt((()=>o.children=on(e,t.children,o.children))),tt((()=>t.ref&&t.ref(e))),tt((()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if("children"===s)continue;o[s]=nn(e,s,null,o[s],n,i)}for(const s in t){if("children"===s){r||on(e,t.children);continue}const a=t[s];o[s]=nn(e,s,a,o[s],n,i)}}(e,t,n,!0,o,!0))),o}function Jt(e,t,n){return st((()=>e(t,n)))}function Xt(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return on(e,t,r,n);tt((r=>on(e,t(),r,n)),r)}function en(e){let t,n;return Ne.context&&(t=Ne.registry.get(n=function(){const e=Ne.context;return`${e.id}${e.count++}`}()))?(Ne.completed&&Ne.completed.add(t),Ne.registry.delete(n),t):e.cloneNode(!0)}function tn(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;or.call(e,n[1],t))}else e.addEventListener(t,n)}(e,o,n,i),i&&function(e,t=window.document){const n=t[zt]||(t[zt]=new Set);for(let r=0,o=e.length;rt.toUpperCase())))]=n;else{const r=o&&t.indexOf(":")>-1&&qt[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Gt(e,Kt[t]||t,n)}var c;return n}function rn(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document}),Ne.registry&&!Ne.done&&(Ne.done=!0,document.querySelectorAll("[id^=pl-]").forEach((t=>{for(;t&&8!==t.nodeType&&t.nodeValue!=="pl-"+e;){let e=t.nextSibling;t.remove(),t=e}t&&t.remove()})));n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(void 0!==o?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function on(e,t,n,r,o){for(Ne.context&&!n&&(n=[...e.childNodes]);"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,s=void 0!==r;if(e=s&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if(Ne.context)return n;if("number"===i&&(t=t.toString()),s){let o=n[0];o&&3===o.nodeType?o.data=t:o=document.createTextNode(t),n=ln(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i){if(Ne.context)return n;n=ln(e,n,r)}else{if("function"===i)return tt((()=>{let o=t();for(;"function"==typeof o;)o=o();n=on(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(sn(i,t,n,o))return tt((()=>n=on(e,i,n,r,!0))),()=>n;if(Ne.context){if(!i.length)return n;for(let e=0;er-a){const o=t[s];for(;a=0;i--){const s=t[i];if(o!==s){const t=s.parentNode===e;r||i?t&&s.remove():t?e.replaceChild(o,s):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}const cn="http://www.w3.org/2000/svg";function un(e,t=!1){return t?document.createElementNS(cn,e):document.createElement(e)}function dn(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function o(){if(Ne.context){const[t,n]=Xe(!1);return queueMicrotask((()=>n(!0))),()=>t()&&e.children}return()=>e.children}if(r instanceof HTMLHeadElement){const[e,t]=Xe(!1),n=()=>t(!0);Je((t=>Xt(r,(()=>e()?t():o()()),null))),at((()=>{Ne.context?queueMicrotask(n):n()}))}else{const i=un(e.isSVG?"g":"div",e.isSVG),s=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get:()=>n.parentNode,configurable:!0}),Xt(s,o()),r.appendChild(i),e.ref&&e.ref(i),at((()=>r.removeChild(i)))}return n}function hn(e){const[t,n]=It(e,["component"]),r=rt((()=>t.component));return rt((()=>{const e=r();switch(typeof e){case"function":return st((()=>e(n)));case"string":const t=Vt.has(e),r=Ne.context?en():un(e,t);return Qt(r,n,t),r}}))}var fn=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(fn||{});let gn={data:""},pn=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||gn,wn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,mn=/\/\*[^]*?\*\/| +/g,vn=/\n+/g,yn=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?yn(s,i):i+"{"+yn(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=yn(s,t?t.replace(/([^,])+/g,(e=>i.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=yn.p?yn.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},bn={},Cn=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+Cn(e[n]);return t}return e},xn=(e,t,n,r,o)=>{let i=Cn(e),s=bn[i]||(bn[i]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(i));if(!bn[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=wn.exec(e.replace(mn,""));)t[4]?r.shift():t[3]?(n=t[3].replace(vn," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(vn," ").trim();return r[0]})(e);bn[s]=yn(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&bn.g?bn.g:null;return n&&(bn.g=bn[s]),l=bn[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d},_n=(e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":yn(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),"");function Sn(e){let t=this||{},n=e.call?e(t.p):e;return xn(n.unshift?n.raw?_n(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,pn(t.target),t.g,t.o,t.k)}Sn.bind({g:1});let kn=Sn.bind({k:1});const En=ct();function Rn(e){return Tt(En.Provider,{value:e.theme,get children(){return e.children}})}function Ln(){return ut(En)}function Mn(e){let t=this||{};return(...n)=>{const r=r=>{const o=Pt(r,{theme:ut(En)}),i=Pt(o,{get class(){const e=o.class,r="class"in o&&/^go[0-9]+/.test(e);return[e,Sn.apply({target:t.target,o:r,p:o,g:t.g},n)].filter(Boolean).join(" ")}}),[s,a]=It(i,["as","theme"]),l=a,c=s.as||e;let u;return"function"==typeof c?u=c(l):1==t.g?(u=document.createElement(c),Qt(u,l)):u=hn(Pt({component:c},l)),u};return r.class=e=>st((()=>Sn.apply({target:t.target,p:e,g:t.g},n))),r}}const Tn=new Proxy(Mn,{get:(e,t)=>e(t)});function An(){const e=Mn.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const On="tc-root",$n="tc-disable-scroll",Pn="tc-using-mouse",In=()=>{document.body.addEventListener("mousedown",(()=>document.body.classList.add(Pn))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove(Pn)}));return Tt(An` ${On} * { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; } ${On} img { -webkit-user-select: none; -webkit-touch-callout: none; } ${On} *:focus { outline: #08f auto 2px; } ${On} li { list-style: none; } ${On} button { outline: none; } body.${$n} { position: fixed; overflow-y: scroll; right: 0; left: 0; } body.${Pn} ${On} *:focus { outline: none; } `,{})};function Nn(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function Un(e){return e.toString()+"px"}var Wn={exports:{}};!function(e,t){!function(n,r){var o="function",i="undefined",s="object",a="string",l="major",c="model",u="name",d="type",h="vendor",f="version",g="architecture",p="console",w="mobile",m="tablet",v="smarttv",y="wearable",b="embedded",C="Amazon",x="Apple",_="ASUS",S="BlackBerry",k="Browser",E="Chrome",R="Firefox",L="Google",M="Huawei",T="LG",A="Microsoft",O="Motorola",$="Opera",P="Samsung",I="Sharp",N="Sony",U="Xiaomi",W="Zebra",j="Facebook",B="Chromium OS",H="Mac OS",K=function(e){for(var t={},n=0;n0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):r:this[l[0]]=u?l[1].call(this,u,l[2]):r:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):r):this[l]=u||r;d+=2}},z=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var o=0;o2&&(e[c]="iPad",e[d]=m),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,q.call(e,v,b.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,q.call(e,v,b.os),C&&!e[u]&&y&&"Unknown"!=y.platform&&(e[u]=y.platform.replace(/chrome os/i,B).replace(/macos/i,H)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===a&&e.length>350?V(e,350):e,this},this.setUA(v),this};Y.VERSION="1.0.35",Y.BROWSER=K([u,f,l]),Y.CPU=K([g]),Y.DEVICE=K([c,h,d,p,w,v,m,y,b]),Y.ENGINE=Y.OS=K([u,f]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Q=typeof n!==i&&(n.jQuery||n.Zepto);if(Q&&!Q.ua){var J=new Y;Q.ua=J.getResult(),Q.ua.get=function(){return J.getUA()},Q.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var n in t)Q.ua[n]=t[n]}}}("object"==typeof window?window:c)}(Wn,Wn.exports);const jn=Wn.exports,Bn=class{constructor(){__publicField(this,"storage",{})}static getInstance(){return Bn.instance||(Bn.instance=new Bn),Bn.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!=(t=n[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let Hn=Bn;__publicField(Hn,"instance");class Kn extends I{constructor(...e){super(...e),Object.setPrototypeOf(this,Kn.prototype)}}function Dn(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch(t){}}function Fn(e,t="_self"){Dn("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Vn(e){Fn(e,"_blank")}function qn(e,t){const n=setTimeout((()=>{Xn("safari")||Jn("android")&&Xn("firefox")||t()}),200);window.addEventListener("blur",(()=>clearTimeout(n)),{once:!0}),Fn(e,"_self")}function zn(e){return __async(this,null,(function*(){yield new Promise((e=>requestAnimationFrame(e))),e()}))}function Zn(e){"complete"!==document.readyState?window.addEventListener("load",(()=>zn((()=>Zn(e)))),{once:!0}):e.forEach((e=>{(new window.Image).src=e}))}function Gn(){if("undefined"!=typeof window)return window}function Yn(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new Kn("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Hn.getInstance()}function Qn(){var e,t,n;const r=(new jn).getResult(),o=null==(e=r.os.name)?void 0:e.toLowerCase();let i;switch(!0){case"ipad"===(null==(t=r.device.model)?void 0:t.toLowerCase()):i="ipad";break;case"ios"===o:i="ios";break;case"android"===o:i="android";break;case"mac os"===o:i="macos";break;case"linux"===o:i="linux";break;case null==o?void 0:o.includes("windows"):i="windows"}const s=null==(n=r.browser.name)?void 0:n.toLowerCase();let a;switch(!0){case"chrome"===s:a="chrome";break;case"firefox"===s:a="firefox";break;case null==s?void 0:s.includes("safari"):a="safari";break;case null==s?void 0:s.includes("opera"):a="opera"}return{os:i,browser:a}}function Jn(...e){return e.includes(Qn().os)}function Xn(...e){return e.includes(Qn().browser)}function er(e,t){return t+new URL(e).search}class tr{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=Yn()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class nr{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=Yn()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class rr{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=Yn()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[or,ir]=Xe({status:"closed",closeReason:null}),sr=rt((()=>"opened"===or().status)),[ar,lr]=Xe({status:"closed",closeReason:null}),cr=rt((()=>"opened"===ar().status)),ur=rt((()=>{const e=ar();return"opened"===e.status?e.walletInfo:null}));let dr="undefined"!=typeof window?new rr:void 0;const[hr,fr]=Xe((null==dr?void 0:dr.getLastSelectedWalletInfo())||null),gr=e=>{dr||(dr=new rr),e?dr.setLastSelectedWalletInfo(e):dr.removeLastSelectedWalletInfo(),fr(e)},[pr,wr]=Xe(null),mr={common:{close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},walletItem:{walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal:{loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}},vr={en:yr({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},walletItem:{walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueIn:"Continue in {{ name }}…",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru:yr(mr)};function yr(e){const t=n=>{Object.entries(n).forEach((([r,o])=>{if("object"==typeof o&&o)return t(o);if("string"==typeof o){if("$"===o[0]){const t=o.slice(1).split(".");let i=e;t.forEach((e=>{if(!(e in i))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);i=i[e]})),n[r]=i}"\\$"===o.slice(0,2)&&(n[r]=o.slice(1))}}))};return t(e),e}const br=ct(),Cr=Symbol("store-raw"),xr=Symbol("store-node"),_r=Symbol("store-name");function Sr(e,t){let n=e[Ue];if(!n&&(Object.defineProperty(e,Ue,{value:n=new Proxy(e,Ar)}),!Array.isArray(e))){const t=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=t.length;o!0,deleteProperty:()=>!0,ownKeys:function(e){return Mr(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==Ue&&t!==xr&&t!==_r?(delete n.value,delete n.writable,n.get=()=>e[Ue][t],n):n}};function Or(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;void 0===n?delete e[t]:e[t]=n;let s,a=Rr(e);(s=Lr(a,t,o))&&s.$((()=>n)),Array.isArray(e)&&e.length!==i&&(s=Lr(a,"length",i))&&s.$(e.length),(s=a._)&&s.$()}function $r(e,t){const n=Object.keys(t);for(let r=0;r1){r=t.shift();const i=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o1)return void Pr(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let i=t[0];"function"==typeof i&&(i=i(o,n),i===o)||void 0===r&&null==i||(i=Er(i),void 0===r||kr(o)&&kr(i)&&!Array.isArray(i)?$r(o,i):Or(e,r,i))}function Ir(...[e,t]){const n=Er(e||{}),r=Array.isArray(n);return[Sr(n),function(...e){it((()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=Er(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;nt,isMergeableObject:zr})}const[Gr,Yr]=Ir({theme:fn.LIGHT,colors:Nr,borderRadius:"m"}),Qr={[fn.LIGHT]:Nr,[fn.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Jr={[fn.LIGHT]:void 0,[fn.DARK]:void 0};function Xr(e,t){t&&(Jr[fn.DARK]=Zr(t[fn.DARK],Jr[fn.DARK]),Jr[fn.LIGHT]=Zr(t[fn.LIGHT],Jr[fn.LIGHT])),Yr({theme:e,colors:Zr(Jr[e],Qr[e])})}const eo=Tn.div` background-color: ${e=>e.theme.colors.background.secondary}; `,to=e=>{let t;const[n,r]=Xe(null);return nt((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener("load",(()=>r(t))),()=>t.removeEventListener("load",(()=>r(t))))})),[Tt(Ut,{get when(){return n()},get children(){return n()}}),Tt(Ut,{get when(){return!n()},get children(){return Tt(eo,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let no={};try{no=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=ho(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=ho(r),e=e.substr(n+1)}let r=function(e){let t={};if(!e.length)return t;let n,r,o,i,s=e.split("&");for(n=0;ni?1:-1;return 0}(oo,"6.1")>=0?uo("web_app_open_tg_link",{path_full:r}):Vn("https://t.me"+r)}function co(){try{const e=Gn();return!!e&&(null!=e.parent&&e!==e.parent)}catch(Au){return!1}}function uo(e,t){try{const n=Gn();if(!n)throw new Kn("Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)Dn("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)Dn("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!co())throw new Kn("Can't post event to TMA");{const r="*",o=JSON.stringify({eventType:e,eventData:t});Dn("postEvent",e,t),n.parent.postMessage(o,r)}}}catch(Au){!function(...t){try{console.error("[TON_CONNECT_UI]",...t)}catch(e){}}(`Can't post event to parent window: ${Au}`)}}function ho(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(Au){return e}}const fo={mobile:440,tablet:1020};function go(e){const t=Gn();if(!t)return"desktop"===e;if(io("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>fo.tablet;case"tablet":return n>fo.mobile;default:return n<=fo.mobile||Jn("ios","android","ipad")}}function po(e){switch(e){case"mobile":return`@media (max-width: ${fo.mobile}px)`;case"tablet":return`@media (max-width: ${fo.tablet}px) (min-width: ${fo.mobile}px)`;default:return`@media (min-width: ${fo.tablet}px)`}}const wo="@media (hover: none)",mo="@media not all and (hover: none)",vo={m:"100vh",s:"8px",none:"0"},yo={s:.02,m:.04},bo=Tn.button` display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; justify-content: ${e=>e.leftIcon||e.rightIcon?"space-between":"unset"}; background-color: ${e=>"flat"===e.appearance?"transparent":"secondary"===e.appearance?e.theme.colors.background.tint:Nn(e.theme.colors.accent,.12)}; color: ${e=>"secondary"===e.appearance?e.theme.colors.text.primary:e.theme.colors.accent}; padding: ${e=>"flat"===e.appearance?"0":"9px 16px"}; padding-left: ${e=>e.leftIcon&&"flat"!==e.appearance?"12px":"16px"}; padding-right: ${e=>e.rightIcon&&"flat"!==e.appearance?"12px":"16px"}; border: none; border-radius: ${e=>vo[e.theme.borderRadius]}; cursor: ${e=>e.disabled?"not-allowed":"pointer"}; font-size: 14px; font-weight: 590; line-height: 18px; transition: transform 0.125s ease-in-out; ${mo} { &:hover { transform: ${e=>e.disabled?"unset":`scale(${1+yo[e.scale]})`}; } } &:active { transform: ${e=>e.disabled?"unset":`scale(${1-yo[e.scale]})`}; } ${wo} { &:active { transform: ${e=>e.disabled?"unset":`scale(${1-2*yo[e.scale]})`}; } } `;function Co(e){const t=st((()=>Object.keys(e).filter((e=>e.startsWith("data-"))))),[n]=It(e,t);return n}const xo=e=>{const t=Co(e);return Tt(bo,Pt({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:t=>{var n;return null==(n=e.onClick)?void 0:n.call(e,t)},onMouseEnter:t=>{var n;return null==(n=e.onMouseEnter)?void 0:n.call(e,t)},onMouseLeave:t=>{var n;return null==(n=e.onMouseLeave)?void 0:n.call(e,t)},ref(t){const n=e.ref;"function"==typeof n?n(t):e.ref=t},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[rt((()=>e.leftIcon)),rt((()=>e.children)),rt((()=>e.rightIcon))]}}))};var _o={exports:{}};!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r{requestAnimationFrame(e)}))}const Eo=e=>{let t,n=!0;const[r,o]=Xe(),[i,s]=Xe(),a=dt((()=>e.children)),{onBeforeEnter:l,onEnter:c,onAfterEnter:u,onBeforeExit:d,onExit:h,onAfterExit:f}=e,g=rt((()=>{const t=e.name||"s";return{enterActiveClass:e.enterActiveClass||t+"-enter-active",enterClass:e.enterClass||t+"-enter",enterToClass:e.enterToClass||t+"-enter-to",exitActiveClass:e.exitActiveClass||t+"-exit-active",exitClass:e.exitClass||t+"-exit",exitToClass:e.exitToClass||t+"-exit-to"}}));function p(t,a){if(!n||e.appear){let n=function(l){!t||l&&l.target!==t||(t.removeEventListener("transitionend",n),t.removeEventListener("animationend",n),t.classList.remove(...h),t.classList.remove(...f),it((()=>{r()!==t&&o(t),i()===t&&s(void 0)})),u&&u(t),"inout"===e.mode&&w(t,a))};const d=g().enterClass.split(" "),h=g().enterActiveClass.split(" "),f=g().enterToClass.split(" ");l&&l(t),t.classList.add(...d),t.classList.add(...h),ko((()=>{t.classList.remove(...d),t.classList.add(...f),c&&c(t,(()=>n())),(!c||c.length<2)&&(t.addEventListener("transitionend",n),t.addEventListener("animationend",n))}))}a&&!e.mode?s(t):o(t)}function w(t,n){const i=g().exitClass.split(" "),s=g().exitActiveClass.split(" "),a=g().exitToClass.split(" ");if(!n.parentNode)return l();function l(i){i&&i.target!==n||(n.removeEventListener("transitionend",l),n.removeEventListener("animationend",l),n.classList.remove(...s),n.classList.remove(...a),r()===n&&o(void 0),f&&f(n),"outin"===e.mode&&p(t,n))}d&&d(n),n.classList.add(...i),n.classList.add(...s),ko((()=>{n.classList.remove(...i),n.classList.add(...a)})),h&&h(n,(()=>l())),(!h||h.length<2)&&(n.addEventListener("transitionend",l),n.addEventListener("animationend",l))}return et((r=>{for(t=a();"function"==typeof t;)t=t();return st((()=>(t&&t!==r&&("outin"!==e.mode?p(t,r):n&&o(t)),r&&r!==t&&"inout"!==e.mode&&w(t,r),n=!1,t)))})),[r,i]};function Ro(e){const{top:t,bottom:n,left:r,right:o,width:i,height:s}=e.getBoundingClientRect(),a=e.parentNode.getBoundingClientRect();return{top:t-a.top,bottom:n,left:r-a.left,right:o,width:i,height:s}}const Lo=e=>{const t=dt((()=>e.children)),n=rt((()=>{const t=e.name||"s";return{enterActiveClass:e.enterActiveClass||t+"-enter-active",enterClass:e.enterClass||t+"-enter",enterToClass:e.enterToClass||t+"-enter-to",exitActiveClass:e.exitActiveClass||t+"-exit-active",exitClass:e.exitClass||t+"-exit",exitToClass:e.exitToClass||t+"-exit-to",moveClass:e.moveClass||t+"-move"}})),{onBeforeEnter:r,onEnter:o,onAfterEnter:i,onBeforeExit:s,onExit:a,onAfterExit:l}=e,[c,u]=Xe();let d=[],h=!0;return et((()=>{const e=t(),c=[...e],f=new Set(e),g=new Set(d),p=n().enterClass.split(" "),w=n().enterActiveClass.split(" "),m=n().enterToClass.split(" "),v=n().exitClass.split(" "),y=n().exitActiveClass.split(" "),b=n().exitToClass.split(" ");for(let t=0;t{n.classList.remove(...p),n.classList.add(...m),o&&o(n,(()=>e())),(!o||o.length<2)&&(n.addEventListener("transitionend",e),n.addEventListener("animationend",e))}))}}for(let t=0;tt!==e)),u(d))};c.splice(t,0,e),s&&s(e),e.classList.add(...v),e.classList.add(...y),ko((()=>{e.classList.remove(...v),e.classList.add(...b)})),a&&a(e,(()=>n())),(!a||a.length<2)&&(e.addEventListener("transitionend",n),e.addEventListener("animationend",n))}}d=c,u(c)})),nt((e=>{const t=c();return t.forEach((t=>{let n;(n=e.get(t))?n.new&&(n.new=!1,n.newPos=Ro(t)):e.set(t,n={pos:Ro(t),new:!h}),n.new&&t.addEventListener("transitionend",(()=>{n.new=!1,t.parentNode&&(n.newPos=Ro(t))}),{once:!0}),n.newPos&&(n.pos=n.newPos),n.newPos=Ro(t)})),h?(h=!1,e):(t.forEach((t=>{const n=e.get(t),r=n.pos,o=n.newPos,i=r.left-o.left,s=r.top-o.top;if(i||s){n.moved=!0;const e=t.style;e.transform=`translate(${i}px,${s}px)`,e.transitionDuration="0s"}})),document.body.offsetHeight,t.forEach((t=>{const r=e.get(t);if(r.moved){let e=function(n){n&&n.target!==t||!t.parentNode||n&&!/transform$/.test(n.propertyName)||(t.removeEventListener("transitionend",e),t.classList.remove(...i))};r.moved=!1;const o=t.style,i=n().moveClass.split(" ");t.classList.add(...i),o.transform=o.transitionDuration="",t.addEventListener("transitionend",e)}})),e)}),new Map),c};const Mo="androidBackHandler",To={[Mo]:!0},Ao=Zt('',0,!0),Oo={left:0,top:90,right:180,bottom:270},$o=e=>{const t=Ln();return Tt(Tn("svg")` transform: rotate(${e=>Oo[e.svgDirection]}deg); transition: transform 0.1s ease-in-out; `,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return e.direction||"left"},get children(){const n=Ao.cloneNode(!0);return tt((()=>Gt(n,"fill",e.fill||t.colors.icon.secondary))),n}})},Po=Zt(''),Io=e=>{const t=Ln();return(()=>{const n=Po.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.secondary))),n})()},No=Tn.button` padding: 0; display: flex; justify-content: center; align-items: center; width: 32px; height: 32px; border-radius: 50%; background-color: ${e=>e.theme.colors.background.tint}; border: none; cursor: pointer; transition: transform 0.125s ease-in-out; ${mo} { &:hover { transform: scale(1.04); } } &:active { transform: scale(0.96); } ${wo} { &:active { transform: scale(0.92); } } `,Uo=e=>{const t=Co(e),n=()=>e.icon||"close";return Tt(No,Pt({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[Tt(Ut,{get when(){return!!e.children},get children(){return e.children}}),Tt(Ut,{get when(){return!e.children},get children(){return Tt(Wt,{get children(){return[Tt(jt,{get when(){return"close"===n()},get children(){return Tt(Io,{get fill(){return e.fill}})}}),Tt(jt,{get when(){return"arrow"===n()},get children(){return Tt($o,{get fill(){return e.fill}})}}),Tt(jt,{get when(){return"question"===n()},get children(){return Tt(as,{get fill(){return e.fill}})}}),Tt(jt,{get when(){return"string"!=typeof n()},get children(){return n()}})]}})}})]}}))},Wo={m:"24px",s:"16px",none:"0"},jo=Tn.div` display: flex; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); padding: 20px 0; overflow-y: auto; ${po("mobile")} { padding-bottom: 0; } `,Bo=Sn` box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); width: fit-content; margin: auto; ${po("mobile")} { width: 100%; height: fit-content; margin: auto 0 0 0; } `,Ho=Tn.div` position: relative; min-height: 100px; width: 416px; padding: 44px 56px 24px; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); background-color: ${e=>e.theme.colors.background.primary}; border-radius: ${e=>Wo[e.theme.borderRadius]}; ${po("mobile")} { width: 100%; } `,Ko=Tn(Uo)` position: absolute; right: 16px; top: 16px; `,Do=Tn.div` display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 16px 18px; border-radius: 0 0 ${e=>Wo[e.theme.borderRadius]} ${e=>Wo[e.theme.borderRadius]}; `,Fo=Tn(Uo)` background-color: ${e=>Nn(e.theme.colors.icon.secondary,.12)}; `;class Vo{constructor(){__publicField(this,"currentTime",0)}}const qo=class{constructor(){__publicField(this,"currentTime",0),__publicField(this,"playbackRate",1),__publicField(this,"startTime",null),__publicField(this,"timeline",new Vo),__publicField(this,"finished",Promise.resolve(this)),__publicField(this,"effect",null),__publicField(this,"id",""),__publicField(this,"pending",!1),__publicField(this,"playState","finished"),__publicField(this,"replaceState","active"),__publicField(this,"ready",Promise.resolve(this)),__publicField(this,"oncancel",null),__publicField(this,"onfinish",null),__publicField(this,"onremove",null)}static create(){return qo._instance||(!function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(Au){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),qo._instance=new qo),qo._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let zo=qo;function Zo(e,t,n){return"animate"in e?e.animate(t,n):zo.create()}__publicField(zo,"_instance",null);const Go=Zt("
"),Yo=function(e,t){const n=n=>{var r;return!e.contains(n.target)&&(null==(r=t())?void 0:r())};document.body.addEventListener("click",n),at((()=>document.body.removeEventListener("click",n)))},Qo=function(e,t){const n=e=>{var n,r;"Escape"===e.key&&(null==(n=document.activeElement)||n.blur(),null==(r=t())||r())};document.body.addEventListener("keydown",n),at((()=>document.body.removeEventListener("keydown",n)))},Jo=function(e,t){const{isEnabled:n,onClose:r}=t();if(!n)return;if(!("android"===Qn().os))return;window.history.pushState(To,"");const o=e=>{e.preventDefault(),r()};window.addEventListener("popstate",o,{once:!0}),at((()=>{window.removeEventListener("popstate",o),zn((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[Mo])&&window.history.back()}))}))},Xo=e=>{const t=Ln(),n=Co(e);return nt((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Un(-document.documentElement.scrollTop),document.body.classList.add($n)):(document.body.classList.remove($n),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),Tt(Eo,{onBeforeEnter:e=>{const t=go("mobile")?200:100;Zo(e,[{opacity:0},{opacity:1}],{duration:t}),go("mobile")&&Zo(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const n=go("mobile")?200:100,r=Zo(e,[{opacity:1},{opacity:0}],{duration:n});if(go("mobile")){const o=Zo(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return Tt(Ut,{get when(){return e.opened},get children(){return Tt(jo,Pt({"data-tc-modal":"true"},n,{get children(){const n=Go.cloneNode(!0);return Jt(Jo,n,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),Jt(Qo,n,(()=>()=>e.onClose())),Jt(Yo,n,(()=>()=>e.onClose())),Xt(n,Tt(Ho,{get class(){return e.class},get children(){return[Tt(Ko,{icon:"close",onClick:()=>e.onClose()}),rt((()=>e.children))]}}),null),Xt(n,Tt(Ut,{get when(){return e.onClickQuestion},get children(){return Tt(Do,{get children(){return[Tt(is,{}),Tt(Fo,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),tt((()=>Yt(n,So(Bo,Sn` border-radius: ${Wo[t.borderRadius]}; background-color: ${t.colors.background.tint}; ${po("mobile")} { border-radius: ${Wo[t.borderRadius]} ${Wo[t.borderRadius]} 0 0; } `)))),n}}))}})}})},ei={m:"22px",s:"12px",none:"0"},ti={m:"18px",s:"8px",none:"0"},ni=Tn.div` display: grid; grid-template: 1fr / 1fr 1fr; width: fit-content; justify-items: center; gap: 4px; position: relative; padding: 4px; border-radius: ${e=>ei[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.secondary}; `,ri=Tn.div` position: absolute; top: 4px; left: 4px; height: calc(100% - 8px); width: calc(50% - 4px); border-radius: ${e=>ti[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.segment}; transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; transition: transform 0.13s ease-in-out; `,oi=Tn.input` display: none; `,ii=Tn.label` padding: 9px 12px; z-index: 1; cursor: ${e=>e.isActive?"default":"pointer"}; transition: transform 0.13s ease-in-out; &:hover { transform: ${e=>e.isActive?"none":"scale(1.025)"}; } > * { ${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`} } `,si={m:"16px",s:"12px",none:"0"},ai={m:"12px",s:"8px",none:"0"},li=Tn.div` width: 52px; height: 52px; background: transparent; position: absolute; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; transition: transform 0.125s ease-in-out; `,ci=Tn.button` display: flex; align-items: center; position: relative; background-color: ${e=>e.theme.colors.background.qr}; border-radius: ${e=>si[e.theme.borderRadius]}; padding: ${Un(24)} 0; height: ${Un(304)}; width: 100%; overflow: hidden; cursor: pointer; border: none; ${mo} { &:hover { ${li.class} { transform: scale(1.04); } } } &:active { ${li.class} { transform: scale(0.96); } } ${wo} { &:active { ${li.class} { transform: scale(0.92); } } } `,ui=Tn.div` position: relative; width: fit-content; margin: 0 auto; > div:first-child { display: flex; align-items: center; justify-content: center; } rect { fill: transparent; } path { fill: ${e=>e.theme.colors.constant.black}; } `,di=Tn.div` position: absolute; width: ${Un(60)}; height: ${Un(60)}; background: ${e=>e.theme.colors.background.qr}; display: flex; align-items: center; justify-content: center; `,hi=Tn(to)` width: ${e=>Un(e.size)}; height: ${e=>Un(e.size)}; border-radius: ${e=>ai[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.qr}; `,fi=Tn.div` position: absolute; bottom: 14px; left: 50%; transform: translate(-50%, 0); display: flex; gap: 6px; align-items: center; border-radius: 18px; min-width: 126px; padding: 9px 16px 9px 10px; filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); background-color: ${e=>e.theme.colors.background.segment}; `;var gi={exports:{}};!function(e,t){var n=function(){var e=function(e,t){var n=e,r=u[t],o=null,i=0,s=null,a=[],l={},c=function(e,t){o=function(e){for(var t=new Array(e),n=0;n=7&&g(e),null==s&&(s=m(n,r,a)),w(s,t)},d=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||i<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(o[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},h=function(){for(var e=8;e>r&1);o[Math.floor(r/3)][r%3+i-8-3]=s}for(r=0;r<18;r+=1){s=!e&&1==(t>>r&1);o[r%3+i-8-3][Math.floor(r/3)]=s}},p=function(e,t){for(var n=r<<3|t,s=y.getBCHTypeInfo(n),a=0;a<15;a+=1){var l=!e&&1==(s>>a&1);a<6?o[a][8]=l:a<8?o[a+1][8]=l:o[i-15+a][8]=l}for(a=0;a<15;a+=1){l=!e&&1==(s>>a&1);a<8?o[8][i-a-1]=l:a<9?o[8][15-a-1+1]=l:o[8][15-a-1]=l}o[i-8][8]=!e},w=function(e,t){for(var n=-1,r=i-1,s=7,a=0,l=y.getMaskFunction(t),c=i-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var u=0;u<2;u+=1)if(null==o[r][c-u]){var d=!1;a>>s&1)),l(r,c-u)&&(d=!d),o[r][c-u]=d,-1==(s-=1)&&(a+=1,s=7)}if((r+=n)<0||i<=r){r-=n,n=-n;break}}},m=function(e,t,n){for(var r=x.getRSBlocks(e,t),o=_(),i=0;i8*a)throw"code length overflow. ("+o.getLengthInBits()+">"+8*a+")";for(o.getLengthInBits()+4<=8*a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*a||(o.put(236,8),o.getLengthInBits()>=8*a));)o.put(17,8);return function(e,t){for(var n=0,r=0,o=0,i=new Array(t.length),s=new Array(t.length),a=0;a=0?h.getAt(f):0}}var g=0;for(u=0;ur)&&(e=r,t=n)}return t}())},l.createTableTag=function(e,t){e=e||2;var n="";n+='',n+="";for(var r=0;r";for(var o=0;o';n+=""}return n+="",n+="
"},l.createSvgTag=function(e,t,n,r){var o={};"object"==typeof arguments[0]&&(e=(o=arguments[0]).cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var i,s,a,c,u=l.getModuleCount()*e+2*t,d="";for(c="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+=''+v(r.text)+"":"",d+=n.text?''+v(n.text)+"":"",d+='',d+='":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t};return l.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,o,i,s=1*l.getModuleCount()+2*e,a=e,c=s-e,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},h="";for(t=0;t=c?d[i]:u[i];h+="\n"}return s%2&&e>0?h.substring(0,h.length-s-1)+Array(s+1).join("▀"):h.substring(0,h.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,s=l.getModuleCount()*e+2*t,a=t,c=s-t,u=Array(e+1).join("██"),d=Array(e+1).join(" "),h="",f="";for(n=0;n>>8),t.push(255&s)):t.push(r)}}return t}};var t,n,r,o,i,s=1,a=2,l=4,c=8,u={L:1,M:0,Q:3,H:2},d=0,h=1,f=2,g=3,p=4,w=5,m=6,v=7,y=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,r=7973,i=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(o={}).getBCHTypeInfo=function(e){for(var t=e<<10;i(t)-i(n)>=0;)t^=n<=0;)t^=r<5&&(n+=3+i-5)}for(r=0;r=256;)t-=255;return e[t]}};return r}();function C(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},S=function(e){var t=s,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(var t=n,r=0;r+2>>8&255)+(255&r),e.put(r,13),n+=2}if(n>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o0&&(t+=","),t+=e[n];return t+="]"}};return t},M=function(e){var t=e,n=0,r=0,o=0,i={read:function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(n);if(n+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(r=r<<6|s(e.charCodeAt(0)),o+=6)}var i=r>>>o-8&255;return o-=8,i}},s=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return i},T=function(e,t,n){for(var r=function(e,t){var n=e,r=t,o=new Array(e*t),i={setPixel:function(e,t,r){o[t*n+e]=r},write:function(e){e.writeString("GIF87a"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=s(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")}},s=function(e){for(var t=1<>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<>>=8-c,u=0,c=0;u|=e<0&&l.writeByte(u)}});h.write(t,r);var f=0,g=String.fromCharCode(o[f]);for(f+=1;f=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,s=0;s>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},e.exports=n}(gi);const pi=gi.exports;function wi(e){return __async(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Kn("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(Au){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const mi=Zt("
"),vi=e=>{let t,n,r;const[o,i]=Xe(!1),[s,a]=Xe(48);nt((()=>{const o=pi(0,"L");o.addData(e.sourceUrl),o.make(),t.innerHTML=o.createSvgTag(4,0);const i=t.firstElementChild.clientWidth,s=Math.round(256/i*1e5)/1e5;if(r){const e=4*Math.ceil(60/(4*s)),t=Un(4*Math.ceil((i-e)/8));r.style.top=t,r.style.left=t,r.style.height=Un(e),r.style.width=Un(e),a(Math.round(48/s))}n.style.transform=`scale(${s})`}));let l=null;return Tt(ci,{get class(){return e.class},onClick:()=>{i(!0),wi(e.sourceUrl),null!=l&&clearTimeout(l),l=setTimeout((()=>i(!1)),1500)},get children(){return[Tt(ui,{ref(e){"function"==typeof n?n(e):n=e},get children(){return[(()=>{const e=mi.cloneNode(!0);return"function"==typeof t?Jt(t,e):t=e,e})(),Tt(Ut,{get when(){return e.imageUrl},get children(){return Tt(di,{ref(e){"function"==typeof r?r(e):r=e},get children(){return Tt(hi,{get src(){return e.imageUrl},alt:"",get size(){return s()}})}})}})]}}),Tt(Eo,{onBeforeEnter:e=>{Zo(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{Zo(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return Tt(Ut,{get when(){return o()&&!e.disableCopy},get children(){return Tt(fi,{get children(){return[Tt(Gi,{size:"xs"}),Tt(Si,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),Tt(Ut,{get when(){return!e.disableCopy},get children(){return Tt(li,{get children(){return Tt(As,{})}})}})]}})};var yi=(e,t,n)=>{const r=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==r?r:n},bi=(e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[n,r]=Xe(t),[o,i]=Ir(e);return[(e,t,r)=>{const i=yi(o[n()],e,r||"");return"function"==typeof i?i(t):"string"==typeof i?((e,t,n=/{{(.*?)}}/g)=>e.replace(n,((e,n)=>yi(t,n,""))))(i,t||{}):i},{add(e,t){i(e,(e=>Object.assign(e||{},t)))},locale:e=>e?r(e):n(),dict:e=>yi(o,e)}]},Ci=ct({}),xi=()=>ut(Ci);const _i=Tn.div` font-style: normal; font-weight: ${e=>e.fontWeight}; font-size: ${e=>e.fontSize}; line-height: ${e=>e.lineHeight}; color: ${e=>e.color}; `,Si=e=>{const t=Ln(),[n]=xi();let r;const o=Pt({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return nt((()=>{r&&"unset"!==o.cursor&&"pointer"!==getComputedStyle(r).cursor&&(r.style.cursor="default")})),Tt(_i,{get fontSize(){return o.fontSize},get fontWeight(){return o.fontWeight},get lineHeight(){return o.lineHeight},get color(){return e.color||t.colors.text.primary},get class(){return o.class},ref(e){"function"==typeof r?r(e):r=e},"data-tc-text":"true",get children(){var e;return rt((()=>!!o.translationKey))()?n(o.translationKey,o.translationValues,null==(e=o.children)?void 0:e.toString()):o.children}})},ki=Tn.div` position: relative; &::after { content: ''; display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border: 0.5px solid rgba(0, 0, 0, 0.08); border-radius: inherit; } `,Ei=Tn(to)` width: 100%; height: 100%; border-radius: inherit; `,Ri=e=>Tt(ki,{get class(){return e.class},get children(){return Tt(Ei,{get src(){return e.src}})}}),Li={m:"16px",s:"12px",none:"0"},Mi={m:"6px",s:"6px",none:"0"},Ti=Tn.button` position: relative; cursor: pointer; border: none; background-color: unset; padding: 8px 4px; width: 92px; display: flex; flex-direction: column; align-items: center; transition: transform 0.125s ease-in-out; ${mo} { &:hover { transform: scale(1.04); } } &:active { transform: scale(0.96); } ${po("mobile")} { padding: 8px 4px; width: 82px; } ${wo} { &:active { transform: scale(0.92); } } `,Ai=Tn(Ri)` width: 60px; height: 60px; border-radius: ${e=>Li[e.theme.borderRadius]}; margin-bottom: 8px; `,Oi=Tn(to)` position: absolute; right: 10px; top: 50px; width: 24px; height: 24px; border-radius: ${e=>Mi[e.theme.borderRadius]}; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); `,$i=Tn(Si)` max-width: 90px; font-weight: 590; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; ${po("mobile")} { max-width: 80px; } `,Pi=Tn(Si)` font-weight: 510; max-width: 90px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary}; ${po("mobile")} { max-width: 80px; } `,Ii=e=>Tt(Ti,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[rt((()=>rt((()=>"string"==typeof e.icon))()?Tt(Ai,{get src(){return e.icon}}):e.icon)),rt((()=>rt((()=>!!e.badgeUrl))()&&Tt(Oi,{get src(){return e.badgeUrl}}))),Tt($i,{get children(){return e.name}}),rt((()=>rt((()=>!!e.secondLine))()&&Tt(Pi,{get colorPrimary(){var t;return null==(t=e.secondLineColorPrimary)||t},get children(){return e.secondLine}})))]}}),Ni=Tn.h1` font-style: normal; font-weight: 700; font-size: 20px; line-height: 28px; text-align: center; color: ${e=>e.theme.colors.text.primary}; margin-top: 0; margin-bottom: 0; cursor: default; `,Ui=e=>{const[t]=xi();return Tt(Ni,{get class(){return e.class},"data-tc-h1":"true",get children(){var n;return rt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},Wi=Tn.h2` font-style: normal; font-weight: 510; font-size: 16px; line-height: 22px; text-align: center; color: ${e=>e.theme.colors.text.secondary}; margin-top: 0; margin-bottom: 32px; cursor: default; `,ji=e=>{const[t]=xi();return Tt(Wi,{get class(){return e.class},"data-tc-h2":"true",get children(){var n;return rt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},Bi=Tn.h3` font-style: normal; font-weight: 590; font-size: 16px; line-height: 20px; color: ${e=>e.theme.colors.text.primary}; margin-top: 0; margin-bottom: 0; cursor: default; `,Hi=e=>{const[t]=xi();return Tt(Bi,{"data-tc-h3":"true",get class(){return e.class},get children(){var n;return rt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},Ki=Zt(''),Di=e=>{const t=Ln(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=Ki.cloneNode(!0),t=e.firstChild;return tt((r=>{const o=n(),i=n();return o!==r._v$&&Gt(e,"fill",r._v$=o),i!==r._v$2&&Gt(t,"fill",r._v$2=i),r}),{_v$:void 0,_v$2:void 0}),e})()},Fi=Zt(''),Vi=e=>{const t=Ln();return(()=>{const n=Fi.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.primary))),n})()},qi=Zt(''),zi=Zt(''),Zi=Zt(''),Gi=e=>{const t=Ln(),n=()=>e.size||"s",r=()=>e.fill||t.colors.icon.success;return rt((()=>{const o=rt((()=>"xs"===n()));return()=>o()?(()=>{const n=qi.cloneNode(!0),o=n.firstChild.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$&&Gt(n,"class",s._v$=a),l!==s._v$2&&Gt(o,"fill",s._v$2=l),c!==s._v$3&&Gt(i,"stroke",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),n})():(()=>{const o=rt((()=>"s"===n()));return()=>o()?(()=>{const n=zi.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$4&&Gt(n,"class",s._v$4=a),l!==s._v$5&&Gt(o,"fill",s._v$5=l),c!==s._v$6&&Gt(i,"fill",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),n})():(()=>{const n=Zi.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$7&&Gt(n,"class",s._v$7=a),l!==s._v$8&&Gt(o,"fill",s._v$8=l),c!==s._v$9&&Gt(i,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),n})()})()})())},Yi=Zt(''),Qi=Zt(''),Ji=Zt(''),Xi=e=>{const t=Ln(),n=()=>e.size||"m",r=()=>e.fill||t.colors.icon.error;return rt((()=>{const o=rt((()=>"m"===n()));return()=>o()?(()=>{const n=Yi.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$&&Gt(n,"class",s._v$=a),l!==s._v$2&&Gt(o,"fill",s._v$2=l),c!==s._v$3&&Gt(i,"fill",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),n})():(()=>{const o=rt((()=>"s"===n()));return()=>o()?(()=>{const n=Qi.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$4&&Gt(n,"class",s._v$4=a),l!==s._v$5&&Gt(o,"fill",s._v$5=l),c!==s._v$6&&Gt(i,"stroke",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),n})():(()=>{const n=Ji.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return tt((s=>{const a=e.class,l=r(),c=t.colors.constant.white;return a!==s._v$7&&Gt(n,"class",s._v$7=a),l!==s._v$8&&Gt(o,"fill",s._v$8=l),c!==s._v$9&&Gt(i,"fill",s._v$9=c),s}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),n})()})()})())},es=Zt(''),ts=Zt(''),ns=Zt(''),rs=e=>{const t=Ln(),n=()=>e.size||"xs",r=()=>e.fill||t.colors.icon.tertiary,o=Sn` animation: ${kn` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `} 1s linear infinite; `;return rt((()=>{const t=rt((()=>"xs"===n()));return()=>t()?(()=>{const t=es.cloneNode(!0),n=t.firstChild;return tt((i=>{const s=So(o,e.class),a=r();return s!==i._v$&&Gt(t,"class",i._v$=s),a!==i._v$2&&Gt(n,"fill",i._v$2=a),i}),{_v$:void 0,_v$2:void 0}),t})():(()=>{const t=rt((()=>"s"===n()));return()=>t()?(()=>{const t=ts.cloneNode(!0),n=t.firstChild;return tt((i=>{const s=So(o,e.class),a=r();return s!==i._v$3&&Gt(t,"class",i._v$3=s),a!==i._v$4&&Gt(n,"fill",i._v$4=a),i}),{_v$3:void 0,_v$4:void 0}),t})():(()=>{const t=ns.cloneNode(!0),n=t.firstChild;return tt((i=>{const s=So(o,e.class),a=r();return s!==i._v$5&&Gt(t,"class",i._v$5=s),a!==i._v$6&&Gt(n,"stroke",i._v$6=a),i}),{_v$5:void 0,_v$6:void 0}),t})()})()})())},os=Zt(''),is=()=>{const e=Ln();return(()=>{const t=os.cloneNode(!0),n=t.firstChild.nextSibling.nextSibling;return tt((()=>Gt(n,"fill",e.theme===fn.DARK?e.colors.constant.white:e.colors.constant.black))),t})()},ss=Zt(''),as=e=>{const t=Ln();return(()=>{const n=ss.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.secondary))),n})()},ls=Zt(''),cs=e=>{const t=Ln();return(()=>{const n=ls.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.primary))),n})()},us=Zt(''),ds=e=>{const t=Ln();return(()=>{const n=us.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.primary))),n})()},hs=Zt(''),fs=e=>{const t=Ln();return(()=>{const n=hs.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.primary))),n})()},gs=Zt(''),ps=e=>{const t=Ln();return(()=>{const n=gs.cloneNode(!0),r=n.firstChild.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.accent))),n})()},ws=Zt(''),ms=e=>{const t=Ln();return(()=>{const n=ws.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.accent))),n})()},vs=Zt(''),ys=e=>{const t=Ln();return(()=>{const n=vs.cloneNode(!0),r=n.firstChild.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.accent))),n})()},bs=Zt(''),Cs=e=>{const t=Ln();return(()=>{const n=bs.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.icon.secondary;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},xs=Zt(''),_s=e=>{const t=Ln();return(()=>{const n=xs.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.icon.secondary;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},Ss=Zt(''),ks=e=>{const t=Ln();return(()=>{const n=Ss.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.icon.secondary;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},Es=Zt(''),Rs=e=>{const t=Ln();return(()=>{const n=Es.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.constant.white;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},Ls=Zt(''),Ms=e=>{const t=Ln();return(()=>{const n=Ls.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.icon.secondary;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},Ts=Zt(''),As=e=>{const t=Ln(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=Ts.cloneNode(!0),t=e.firstChild;return tt((r=>{const o=n(),i=n();return o!==r._v$&&Gt(e,"fill",r._v$=o),i!==r._v$2&&Gt(t,"fill",r._v$2=i),r}),{_v$:void 0,_v$2:void 0}),e})()},Os=Zt(''),$s=e=>{const t=Ln();return(()=>{const n=Os.cloneNode(!0),r=n.firstChild;return tt((()=>Gt(r,"fill",e.fill||t.colors.icon.secondary))),n})()},Ps={m:"16px",s:"12px",none:"0"},Is={m:"6px",s:"6px",none:"0"},Ns=Tn.div` width: 60px; height: 60px; padding: 8px; margin-bottom: 8px; border-radius: ${e=>Ps[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.tint}; display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 4px; `,Us=Tn(Ri)` width: 20px; height: 20px; border-radius: ${e=>Is[e.theme.borderRadius]}; `,Ws=e=>Tt(Ii,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return Tt(Ns,{get children(){return Tt(Nt,{each:[0,1,2,3],children:t=>Tt(Us,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),js="telegram-wallet",Bs="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",Hs="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",Ks=e=>{const[t]=xi();return rt((()=>{const n=rt((()=>e.wallet.appName===js));return()=>n()?Tt(Ii,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return Hs},onClick:()=>e.onClick()}):Tt(Ii,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return(()=>{if(e.wallet.appName!==js)return"isPreferred"in e.wallet&&e.wallet.isPreferred?t("walletItem.recent",{},"Recent"):xe(e.wallet)?t("walletItem.installed",{},"Installed"):"Tonkeeper"===e.wallet.name?t("walletItem.popular",{},"Popular"):void 0})()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},Ds=Tn.div` width: 100%; overflow-y: auto; max-height: ${e=>e.maxHeight}; scrollbar-width: none; &&::-webkit-scrollbar { display: none; } &&::-webkit-scrollbar-track { background: transparent; } &&::-webkit-scrollbar-thumb { display: none; } `,Fs=Tn.div` height: 1px; margin: 0 -24px; width: calc(100% + 48px); opacity: 0.08; background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; transition: background 0.15s ease-in-out; ${po("mobile")} { width: 100%; margin: 0; } `,[Vs,qs]=Xe((null==(l=Gn())?void 0:l.innerHeight)||0);Gn()&&window.addEventListener("resize",(()=>qs(window.innerHeight)));const[zs,Zs]=Xe(go("mobile")),Gs=()=>Zs(go("mobile"));Gn()&&(window.addEventListener("resize",(()=>Gs())),window.addEventListener("load",(()=>Gs()),{once:!0}));const Ys=e=>{const[t,n]=Xe(!1),r=()=>void 0!==e.maxHeight?`${e.maxHeight}px`:Vs()-(zs()?150:200)+"px";return[Tt(Fs,{get isShown(){return t()}}),Tt(Ds,{get maxHeight(){return r()},onScroll:e=>{n(e.target.scrollTop>0)},get class(){return e.class},get children(){return e.children}})]},Qs=Tn.a` display: block; text-decoration: unset; `,Js=e=>Tt(Qs,Pt({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},(()=>e.blank?{rel:"noreferrer noopener"}:{}),{get children(){return e.children}})),Xs=ct(),ea=Zt(''),ta=e=>{const t=Ln();return(()=>{const n=ea.cloneNode(!0),r=n.firstChild;return tt((o=>{const i=e.class,s=e.fill||t.colors.icon.primary;return i!==o._v$&&Gt(n,"class",o._v$=i),s!==o._v$2&&Gt(r,"fill",o._v$2=s),o}),{_v$:void 0,_v$2:void 0}),n})()},na=Zt(''),ra=e=>{const t=Ln(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const e=na.cloneNode(!0),t=e.firstChild,r=t.nextSibling;return tt((e=>{const o=n(),i=n();return o!==e._v$&&Gt(t,"fill",e._v$=o),i!==e._v$2&&Gt(r,"fill",e._v$2=i),e}),{_v$:void 0,_v$2:void 0}),e})()},oa={m:"8px",s:"4px",none:"0"},ia={m:"16px",s:"8px",none:"0"},sa=Tn.div` width: 256px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); border-radius: ${e=>ia[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.primary} color: ${e=>e.theme.colors.text.primary} `,aa=Tn.ul` background-color: ${e=>e.theme.colors.background.primary}; padding: 8px; `,la=Tn.button` display: flex; align-items: center; gap: 8px; height: 40px; padding-left: 8px; width: 100%; background-color: ${e=>e.theme.colors.background.primary}; border: none; border-radius: ${e=>oa[e.theme.borderRadius]}; cursor: pointer; transition: background-color, transform 0.1s ease-in-out; &:hover { background-color: ${e=>e.theme.colors.background.secondary}; } &:active { transform: scale(0.96); } `,ca=Zt("
  • "),ua=e=>Tt(Si,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),da={m:"16px",s:"8px",none:"0"},ha=Tn.div` width: 256px; padding: 12px 16px; display: flex; gap: 9px; background-color: ${e=>e.theme.colors.background.primary}; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); border-radius: ${e=>da[e.theme.borderRadius]}; `,fa=Tn.div` width: 192px; > h3 { font-size: 15px; } `,ga=Tn(Si)` margin-top: 4px; color: ${e=>e.theme.colors.text.secondary}; `,pa=e=>{const t=Co(e);return Tt(ha,Pt({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[Tt(fa,{get children(){return[Tt(Hi,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),Tt(Ut,{get when(){return e.text},get children(){return Tt(ga,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),rt((()=>e.icon))]}}))},wa=Tn(rs)` align-self: center; `,ma=e=>{const t=ut(Xs),[n]=xi();return Tt(pa,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}}},get class(){return e.class},get icon(){return Tt(wa,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},va=Tn(Xi)` margin-top: 2px; `,ya=e=>Tt(pa,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return Tt(va,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),ba=Tn(Gi)` margin-top: 2px; `,Ca=e=>Tt(pa,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return Tt(ba,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),xa=Sn` transform: translateY(-8px); margin-bottom: 12px; `,_a={timeout:4500},[Sa,ka]=Xe(null);function Ea(e){const{timeout:t}=__spreadValues(__spreadValues({},_a),e),[n,r]=Xe([]),[o,i]=Xe([]);return nt(function(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return n=>{let s;if(r){s=Array(e.length);for(let t=0;tt(s,o,n)));return o=s,a}}(pr,(e=>{var n;if(!e||!e.showNotification)return;if(Sa()===e)return;if("confirm-transaction"===(null==(n=Sa())?void 0:n.name)&&"confirm-transaction"===e.name)return;ka(e),r((e=>e.filter((e=>"confirm-transaction"!==e.action))));const o={action:e.name};r((e=>[...e,o]));const s=setTimeout((()=>{r((e=>e.filter((e=>e!==o)))),i((e=>e.filter((e=>e!==s))))}),t);i((e=>[...e,s]))}))),at((()=>{o().forEach((e=>clearTimeout(e)))})),n}const Ra=Zt('
    '),La=Tn(xo)` background-color: ${e=>e.theme.colors.connectButton.background}; color: ${e=>e.theme.colors.connectButton.foreground}; box-shadow: ${e=>`0 4px 24px ${Nn(e.theme.colors.constant.black,.16)}`}; padding: 8px 16px 8px 12px; display: flex; align-items: center; gap: 4px; height: 40px; `,Ma=Tn(La)` padding: 12px 16px; min-width: 148px; justify-content: center; background-color: ${e=>e.theme.colors.background.primary}; `,Ta=Tn(xo)` min-width: 148px; height: 40px; background-color: ${e=>e.theme.colors.background.primary}; color: ${e=>e.theme.colors.connectButton.foreground}; box-shadow: ${e=>`0 4px 24px ${Nn(e.theme.colors.constant.black,.16)}`}; display: flex; align-items: center; justify-content: center; `,Aa=Tn(rs)` height: 18px; width: 18px; `,Oa=Tn.div` width: fit-content; display: flex; flex-direction: column; align-items: flex-end; `,$a=Tn((t=>{const n=ut(Xs),[r,o]=Xe(!1),i=()=>__async(this,null,(function*(){const t=$e(n.account.address,n.account.chain===e.CHAIN.TESTNET);yield wi(t),o(!0),setTimeout((()=>o(!1)),1e3)}));return Tt(sa,{ref(e){const n=t.ref;"function"==typeof n?n(e):t.ref=e},get class(){return t.class},"data-tc-dropdown":"true",get children(){return Tt(aa,{get children(){return[(()=>{const e=ca.cloneNode(!0);return Xt(e,Tt(la,{onClick:()=>i(),get children(){return[Tt(ta,{}),Tt(Ut,{get when(){return!r()},get children(){return Tt(ua,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),Tt(Ut,{get when(){return r()},get children(){return Tt(ua,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),e})(),(()=>{const e=ca.cloneNode(!0);return Xt(e,Tt(la,{onClick:()=>(n.disconnect(),void t.onClose()),get children(){return[Tt(ra,{}),Tt(ua,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),e})()]}})}})}))` box-sizing: border-box; overflow: hidden; margin-top: 12px; `,Pa=Tn((e=>{const t=Ea();return(()=>{const n=Ra.cloneNode(!0);return Xt(n,Tt(Lo,{onBeforeEnter:e=>{Zo(e,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(e,t)=>{Zo(e,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(t)},get children(){return Tt(Nt,{get each(){return t()},children:e=>Tt(Wt,{get children(){return[Tt(jt,{get when(){return"transaction-sent"===e.action},get children(){return Tt(Ca,{class:xa})}}),Tt(jt,{get when(){return"transaction-canceled"===e.action},get children(){return Tt(ya,{class:xa})}}),Tt(jt,{get when(){return"confirm-transaction"===e.action},get children(){return Tt(ma,{class:xa})}})]}})})}})),tt((()=>Yt(n,e.class))),n})()}))` > div:first-child { margin-top: 20px; } `;function Ia(e){return e.split("-")[0]}function Na(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,a=function(e){return["top","bottom"].includes(Ia(e))?"x":"y"}(t),l="y"===a?"height":"width";const c=r[l]/2-o[l]/2,u="x"===a;let d;switch(Ia(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:s};break;case"left":d={x:r.x-o.width,y:s};break;default:d={x:r.x,y:r.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":d[a]-=c*(n&&u?-1:1);break;case"end":d[a]+=c*(n&&u?-1:1)}return d}const Ua=(e,t,n)=>__async(this,null,(function*(){const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=yield null==s.isRTL?void 0:s.isRTL(t);if("production"!=={}.NODE_ENV){if(null==s&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=yield s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Na(c,r,l),h=r,f={},g=0;for(let n=0;n50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(h=y.placement),y.rects&&(c=!0===y.rects?yield s.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=Na(c,h,l))),n=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}}));function Wa(e){return __spreadProps(__spreadValues({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function ja(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ba(e){return ja(e).getComputedStyle(e)}function Ha(e){return qa(e)?(e.nodeName||"").toLowerCase():""}let Ka;function Da(){if(Ka)return Ka;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ka=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),Ka):navigator.userAgent}function Fa(e){return e instanceof ja(e).HTMLElement}function Va(e){return e instanceof ja(e).Element}function qa(e){return e instanceof ja(e).Node}function za(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof ja(e).ShadowRoot||e instanceof ShadowRoot}function Za(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ba(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ga(e){return["table","td","th"].includes(Ha(e))}function Ya(e){const t=/firefox/i.test(Da()),n=Ba(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Qa(){return!/^((?!chrome|android).)*safari/i.test(Da())}function Ja(e){return["html","body","#document"].includes(Ha(e))}const Xa=Math.min,el=Math.max,tl=Math.round,nl={x:1,y:1};function rl(e){const t=!Va(e)&&e.contextElement?e.contextElement:Va(e)?e:null;if(!t)return nl;const n=t.getBoundingClientRect(),r=Ba(t);if("border-box"!==r.boxSizing)return Fa(t)?{x:t.offsetWidth>0&&tl(n.width)/t.offsetWidth||1,y:t.offsetHeight>0&&tl(n.height)/t.offsetHeight||1}:nl;let o=n.width/parseFloat(r.width),i=n.height/parseFloat(r.height);return o&&Number.isFinite(o)||(o=1),i&&Number.isFinite(i)||(i=1),{x:o,y:i}}function ol(e,t,n,r){var o,i,s,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let c=nl;t&&(r?Va(r)&&(c=rl(r)):c=rl(e));const u=Va(e)?ja(e):window,d=!Qa()&&n,h=(l.left+(d&&null!=(o=null==(i=u.visualViewport)?void 0:i.offsetLeft)?o:0))/c.x,f=(l.top+(d&&null!=(s=null==(a=u.visualViewport)?void 0:a.offsetTop)?s:0))/c.y,g=l.width/c.x,p=l.height/c.y;return{width:g,height:p,top:f,right:h+g,bottom:f+p,left:h,x:h,y:f}}function il(e){return((qa(e)?e.ownerDocument:e.document)||window.document).documentElement}function sl(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function al(e){return ol(il(e)).left+sl(e).scrollLeft}function ll(e,t,n){const r=Fa(t),o=il(t),i=ol(e,!0,"fixed"===n,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Ha(t)||Za(o))&&(s=sl(t)),Fa(t)){const e=ol(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=al(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}function cl(e){if("html"===Ha(e))return e;const t=e.assignedSlot||e.parentNode||(za(e)?e.host:null)||il(e);return za(t)?t.host:t}function ul(e){return Fa(e)&&"fixed"!==Ba(e).position?e.offsetParent:null}function dl(e){const t=ja(e);let n=ul(e);for(;n&&Ga(n)&&"static"===Ba(n).position;)n=ul(n);return n&&("html"===Ha(n)||"body"===Ha(n)&&"static"===Ba(n).position&&!Ya(n))?t:n||function(e){let t=cl(e);for(;Fa(t)&&!Ja(t);){if(Ya(t))return t;t=cl(t)}return null}(e)||t}function hl(e){const t=cl(e);return Ja(t)?e.ownerDocument.body:Fa(t)&&Za(t)?t:hl(t)}function fl(e,t){var n;void 0===t&&(t=[]);const r=hl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=ja(r);return o?t.concat(i,i.visualViewport||[],Za(r)?r:[]):t.concat(r,fl(r))}function gl(e,t,n){return"viewport"===t?Wa(function(e,t){const n=ja(e),r=il(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=Qa();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n)):Va(t)?function(e,t){const n=ol(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Fa(e)?rl(e):{x:1,y:1},s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{top:c,left:l,right:l+s,bottom:c+a,x:l,y:c,width:s,height:a}}(t,n):Wa(function(e){var t;const n=il(e),r=sl(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=el(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=el(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+al(e);const l=-r.scrollTop;return"rtl"===Ba(o||n).direction&&(a+=el(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(il(e)))}const pl={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=fl(e).filter((e=>Va(e)&&"body"!==Ha(e))),o=null;const i="fixed"===Ba(e).position;let s=i?cl(e):e;for(;Va(s)&&!Ja(s);){const e=Ba(s),t=Ya(s);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==s)),s=cl(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=gl(t,n,o);return e.top=el(r.top,e.top),e.right=Xa(r.right,e.right),e.bottom=Xa(r.bottom,e.bottom),e.left=el(r.left,e.left),e}),gl(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Fa(n),i=il(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==Ha(n)||Za(i))&&(s=sl(n)),Fa(n))){const e=ol(n);a=rl(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Va,getDimensions:function(e){if(Fa(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ol(e);return{width:t.width,height:t.height}},getOffsetParent:dl,getDocumentElement:il,getScale:rl,getElementRects(e){return __async(this,null,(function*(){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||dl,i=this.getDimensions;return{reference:ll(t,yield o(n),r),floating:__spreadValues({x:0,y:0},yield i(n))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Ba(e).direction};function wl(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:a=!1}=r,l=o&&!a,c=l||i?[...Va(e)?fl(e):e.contextElement?fl(e.contextElement):[],...fl(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));let u,d=null;if(s){let r=!0;d=new ResizeObserver((()=>{r||n(),r=!1})),Va(e)&&!a&&d.observe(e),Va(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let h=a?ol(e):null;return a&&function t(){const r=ol(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}const ml=(e,t,n)=>{const r=new Map,o=__spreadValues({platform:pl},n),i=__spreadProps(__spreadValues({},o.platform),{_c:r});return Ua(e,t,__spreadProps(__spreadValues({},o),{platform:i}))};const vl=Zt(''),yl=()=>{const t=Ln(),n=ut(br),r=ut(Xs),[o,i]=Xe(!1),[s,a]=Xe(n.account),[l,c]=Xe(!n.account);let u;const[d,h]=Xe(),[f,g]=Xe(),p=function(e,t,n){let r=()=>{var e;return null!=(e=null==n?void 0:n.placement)?e:"bottom"},o=()=>{var e;return null!=(e=null==n?void 0:n.strategy)?e:"absolute"},[i,s]=Xe({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[a,l]=Xe();nt((()=>{let e=a();if(e)throw e.value}));let c=rt((()=>(e(),t(),{})));function u(){let i=e(),a=t();if(i&&a){let e=c();ml(i,a,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then((t=>{e===c()&&s(t)}),(e=>{l(e)}))}}return nt((()=>{let i=e(),s=t();if(null==n||n.middleware,r(),o(),i&&s)if(null!=n&&n.whileElementsMounted){let e=n.whileElementsMounted(i,s,u);e&&at(e)}else u()})),{get x(){return i().x},get y(){return i().y},get placement(){return i().placement},get strategy(){return i().strategy},get middlewareData(){return i().middlewareData},update:u}}(f,d,{whileElementsMounted:wl,placement:"bottom-end"});r.connectionRestored.then((()=>c(!1)));const w=n.onStatusChange((e=>{if(!e)return i(!1),a(null),void c(!1);a(e.account),c(!1)})),m=e=>{if(!s()||!o())return;const t=f().contains(e.target),n=u.contains(e.target);t||n||i(!1)};var v;return v=()=>{document.body.addEventListener("click",m)},nt((()=>st(v))),at((()=>{document.body.removeEventListener("click",m),w()})),Tt(hn,{component:On,get children(){return[Tt(Ut,{get when(){return l()},get children(){return Tt(Ta,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return Tt(Aa,{})}})}}),Tt(Ut,{get when(){return!l()},get children(){return[Tt(Ut,{get when(){return!s()},get children(){return Tt(La,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[Tt(Vi,{get fill(){return t.colors.connectButton.foreground}}),Tt(Si,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return t.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),Tt(Ut,{get when(){return s()},get children(){return Tt(Oa,{get children(){return[Tt(Ma,{onClick:()=>i((e=>!e)),ref:g,"data-tc-dropdown-button":"true",scale:"s",get children(){return[Tt(Si,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const t=s();if(t){const n=$e(t.address,t.chain===e.CHAIN.TESTNET);return n.slice(0,4)+"…"+n.slice(-4)}return""})()}}),Tt($o,{direction:"bottom"})]}}),Tt(dn,{get children(){const e=st((()=>document.importNode(vl,!0)));return Jt(h,e),e.style.setProperty("z-index","999"),e._$owner=Ve,Xt(e,Tt(Eo,{onBeforeEnter:e=>{Zo(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{Zo(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return Tt(Ut,{get when(){return o()},get children(){return Tt($a,{get hidden(){return!o()},onClose:()=>i(!1),ref(e){"function"==typeof u?u(e):u=e}})}})}}),null),Xt(e,Tt(Pa,{}),null),tt((t=>{var n,r;const o=p.strategy,i=`${null!=(n=p.y)?n:0}px`,s=`${null!=(r=p.x)?r:0}px`;return o!==t._v$&&e.style.setProperty("position",t._v$=o),i!==t._v$2&&e.style.setProperty("top",t._v$2=i),s!==t._v$3&&e.style.setProperty("left",t._v$3=s),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}})]}})}})]}})]}})},bl=Tn(Xo)` padding-left: 24px; padding-right: 24px; padding-top: 18px; padding-bottom: 0; ${po("mobile")} { padding-left: 0; padding-right: 0; min-height: 364px; } `,Cl=Tn(Ui)` margin-top: 12px; ${po("mobile")} { padding: 0 10px; } `,xl=Tn.div` margin: 30px 0; width: 100%; display: flex; justify-content: center; ${po("mobile")} { height: 160px; align-items: center; } `;Tn(Si)` min-width: 84px; text-align: center; font-weight: 590; `,Tn((e=>{const t="tabBar"+Math.floor(1e4*Math.random());return Tt(ni,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[Tt(ri,{get right(){return 1===e.selectedTabIndex}}),Tt(ii,{get isActive(){return 0===e.selectedTabIndex},get children(){return[Tt(oi,{type:"radio",name:t,get checked(){return 0===e.selectedTabIndex},onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,0)}}),rt((()=>e.tab1))]}}),Tt(ii,{get isActive(){return 1===e.selectedTabIndex},get children(){return[Tt(oi,{type:"radio",get checked(){return 1===e.selectedTabIndex},name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,1)}}),rt((()=>e.tab2))]}})]}})}))` margin: 0 auto 22px; `;const[_l,Sl]=Ir({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function kl(e){return"jsBridgeKey"in e?__spreadProps(__spreadValues({},e),{injected:Te.isWalletInjected(e.jsBridgeKey),embedded:Te.isInsideWalletBrowser(e.jsBridgeKey)}):e}function El(e,t){var n,r,o,i;return t?((null==(n=t.includeWallets)?void 0:n.length)&&(r="name",o=e,i=t.includeWallets.map(kl),e=o.map((e=>{const t=i.find((t=>t[r]===e[r]));return i=i.filter((t=>t[r]!==e[r])),void 0===t?e:t})).concat(i)),e):e}function Rl(e){return e.platforms.some((e=>["macos","linux","windows"].includes(e)))}function Ll(e){return e.platforms.some((e=>["ios","android"].includes(e)))}function Ml(e){return e.platforms.some((e=>["chrome","firefox","safari"].includes(e)))}function Tl(e,t){return!!t&&(e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase())}const Al=Tn.div` display: flex; flex-direction: column; align-items: center; `,Ol=Tn(Ui)` margin-bottom: 18px; `;Tn.div` height: 1px; margin: 0 -24px; width: calc(100% + 48px); opacity: 0.12; background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; transition: background 0.15s ease-in-out; ${po("mobile")} { width: 100%; } `;const $l=Tn.ul` display: grid; grid-template-columns: repeat(auto-fit, 92px); grid-template-rows: auto; align-content: flex-start; justify-content: center; row-gap: 8px; width: 100%; padding: 0 0 16px; align-self: flex-start; max-width: 400px; margin: 0 auto; > li { display: block; height: fit-content; } ${po("mobile")} { grid-template-columns: repeat(auto-fit, 82px); } `;Tn(xo)` display: block; margin: 0 auto 1px; font-size: 15px; `;const Pl=Tn(Uo)` position: absolute; top: 16px; left: 16px; `,Il=Tn(Ks)` height: 100%; `,Nl=Zt("
  • "),Ul=e=>Tt(Al,{"data-tc-wallets-modal-list":"true",get children(){return[Tt(Pl,{icon:"arrow",onClick:()=>e.onBack()}),Tt(Ol,{translationKey:"walletModal.wallets",children:"Wallets"}),Tt(Ys,{get maxHeight(){return zs()?void 0:510},get children(){return Tt($l,{get children(){return Tt(Nt,{get each(){return zs()?e.walletsList.filter(Ll):e.walletsList},children:t=>(()=>{const n=Nl.cloneNode(!0);return Xt(n,Tt(Il,{wallet:t,onClick:()=>e.onSelect(t)})),n})()})}})}})]}}),Wl={m:"16px",s:"12px",none:"0"},jl={m:"6px",s:"6px",none:"0"},Bl=Tn.div` display: flex; flex-direction: column; `,Hl=Tn.div` flex: 1; margin-top: ${e=>e.qr?"0":"18px"}; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 232px; `,Kl=Tn(vi)` margin-bottom: 24px; `,Dl=Tn(Ui)` max-width: 288px; margin: 0 auto 2px; `,Fl=Tn(ji)` max-width: 288px; text-align: center; margin: 0 auto 20px; `,Vl=Tn(Uo)` position: absolute; top: 16px; left: 16px; `,ql=Tn.div` display: flex; justify-content: center; gap: 8px; padding-bottom: 16px; `,zl=Tn(ql)` padding-bottom: 0; `,Zl=Tn(xo)` margin-bottom: 24px; `,Gl=Tn(rs)` margin-bottom: 18px; margin-top: 2px; `,Yl=Tn(Xi)` margin-bottom: 16px; `,Ql=Tn(ji)` color: ${e=>e.theme.colors.text.secondary}; text-align: center; margin-bottom: 20px; `,Jl=Tn(xo)` margin-top: -8px; margin-bottom: 24px; width: 100%; padding: 12px 12px 12px 20px; border-radius: ${e=>Wl[e.theme.borderRadius]}; font-size: 16px; line-height: 20px; `,Xl=Tn(to)` width: 32px; height: 32px; border-radius: ${e=>jl[e.theme.borderRadius]}; `,ec=e=>{const[t]=xi();return rt((()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())}))};function tc(e,t){let n;n="string"==typeof t?t:so()?t.twaReturnUrl||t.returnStrategy:"none";const r=function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",n);if(!re(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+oe(o)}function nc(e,t){t=__spreadValues({},t);const n=function(e){const t=new URL(e);t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start");return t.toString()}(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),so())io("ios","android")?(t.returnStrategy="back",t.twaReturnUrl=void 0,lo(tc(r.toString(),t))):io("macos","tdesktop")||io("weba")?lo(tc(r.toString(),t)):io("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,lo(tc(r.toString(),t))):Vn(tc(r.toString(),t));else if(Jn("ios")){"back"===t.returnStrategy&&(Xn("safari")?t.returnStrategy="back":Xn("chrome")?t.returnStrategy="googlechrome://":Xn("firefox")?t.returnStrategy="firefox://":Xn("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Xn("chrome"),n=Xn("firefox");if((e||n)&&!t.forceRedirect){const e=tc(r.toString(),t.returnStrategy);qn(oc(e),(()=>Vn(e)))}else{Vn(tc(r.toString(),t.returnStrategy))}}else if(Jn("android")){t.returnStrategy="none";const e=Xn("chrome"),n=Xn("firefox");if((e||n)&&!t.forceRedirect){const e=tc(r.toString(),t.returnStrategy);qn(oc(e),(()=>Vn(e)))}else{Vn(tc(r.toString(),t.returnStrategy))}}else if(Jn("ipad")){"back"===t.returnStrategy&&(Xn("safari")?t.returnStrategy="back":Xn("chrome")?t.returnStrategy="googlechrome://":Xn("firefox")?t.returnStrategy="firefox://":Xn("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Xn("chrome"),n=Xn("firefox");if((e||n)&&!t.forceRedirect){const e=tc(r.toString(),t.returnStrategy);qn(oc(e),(()=>Vn(e)))}else{Vn(tc(r.toString(),t.returnStrategy))}}else if(Jn("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)Vn(tc(r.toString(),t));else{const e=tc(r.toString(),t);qn(oc(e),(()=>Vn(e)))}else Vn(tc(r.toString(),t))}function rc(e,t,n,r){if(n=__spreadValues({},n),so())if(io("ios","android")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link");const t=tc(e,n.returnStrategy);lo(t,(()=>{r("universal-link"),Vn(t)}))}else if(io("macos","tdesktop")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve");const o=tc(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),qn(er(o,t),(()=>{r("universal-link"),Vn(o)}))):(r("universal-link"),Vn(o))}else if(io("weba")){"back"===n.returnStrategy&&(Xn("safari")?n.returnStrategy=location.href:Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=tc(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),qn(er(o,t),(()=>{r("universal-link"),Vn(o)}))):(r("universal-link"),Vn(o))}else if(io("web")){"back"===n.returnStrategy&&(Xn("safari")?n.returnStrategy=location.href:Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=tc(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),qn(er(o,t),(()=>{r("universal-link"),Vn(o)}))):(r("universal-link"),Vn(o))}else{r("universal-link");Vn(tc(e,n.returnStrategy))}else if(Jn("ios"))"back"===n.returnStrategy&&(Xn("safari")?n.returnStrategy="none":Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xn("chrome")?(r("universal-link"),Fn(tc(e,n.returnStrategy),"_self")):(r("universal-link"),Vn(tc(e,n.returnStrategy)));else if(Jn("android"))"back"===n.returnStrategy&&(Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Vn(tc(e,n.returnStrategy));else if(Jn("ipad"))"back"===n.returnStrategy&&(Xn("safari")?n.returnStrategy="none":Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xn("chrome")?(r("universal-link"),Fn(tc(e,n.returnStrategy),"_self")):(r("universal-link"),Vn(tc(e,n.returnStrategy)));else if(Jn("macos","windows","linux")){"back"===n.returnStrategy&&(Xn("safari")?n.returnStrategy="none":Xn("chrome")?n.returnStrategy="googlechrome://":Xn("firefox")?n.returnStrategy="firefox://":Xn("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=tc(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),qn(er(o,t),(()=>{r("universal-link"),Vn(o)}))):(r("universal-link"),Vn(o))}else r("universal-link"),Vn(tc(e,n.returnStrategy))}function oc(e){const t=new URL(e),[,n,r]=t.pathname.split("/");return`tg://resolve?domain=${n}&appname=${r}&startapp=${t.searchParams.get("startapp")}`}const ic=e=>{const[t,n]=Xe("mobile"),[r,o]=Xe(!1),[i,s]=Xe(),[a,l]=Xe(!0),c=ut(br);at(c.onStatusChange((()=>{}),(()=>{e.wallet.appName!==js&&o(!0)})));const u=()=>{s(c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))};nt((()=>{"extension"!==st(t)&&(Ll(e.wallet)||Rl(e.wallet))&&u()}));const d=()=>{o(!1),"extension"===t()&&u(),n("mobile"),gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:"qrcode"}))},h=()=>{o(!1),"extension"===t()&&u(),n("desktop");const r=!a();l(!1),rc(i(),e.wallet.deepLink,{returnStrategy:_l.returnStrategy,forceRedirect:r},(t=>{gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:t}))}))},f=()=>{const t=!a();l(!1),gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:"universal-link"})),nc(i(),{returnStrategy:_l.returnStrategy,twaReturnUrl:_l.twaReturnUrl,forceRedirect:t})},g=()=>{o(!1),n("extension"),xe(e.wallet)&&(gr(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Ll(e.wallet)?d():Ml(e.wallet)?g():h(),Tt(Bl,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[Tt(Ut,{get when(){return!e.backDisabled},get children(){return Tt(Vl,{icon:"arrow",onClick:()=>e.onBackClick()})}}),Tt(Dl,{get children(){return e.wallet.name}}),Tt(Ut,{get when(){return"mobile"===t()},get children(){return Tt(Fl,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",rt((()=>e.wallet.name)),"’s camera"]}})}}),Tt(Hl,{get qr(){return"mobile"===t()},get children(){return Tt(Wt,{get children(){return[Tt(jt,{get when(){return"mobile"===t()},get children(){return Tt(Kl,{disableCopy:!1,get sourceUrl(){return tc(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),Tt(jt,{get when(){return r()},get children(){return[Tt(Yl,{size:"s"}),Tt(Ql,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),Tt(ql,{get children(){return Tt(xo,{get leftIcon(){return Tt(ps,{})},get onClick(){return"extension"===t()?g:h},get children(){return Tt(ec,{translationKey:"common.retry",children:"Retry"})}})}})]}}),Tt(jt,{get when(){return"extension"===t()},get children(){return[Tt(Ut,{get when(){return xe(e.wallet)},get children(){return[Tt(Gl,{size:"s"}),Tt(Ql,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",rt((()=>e.wallet.name))," browser extension…"]}}),Tt(ql,{get children(){return Tt(xo,{get leftIcon(){return Tt(ps,{})},onClick:g,get children(){return Tt(ec,{translationKey:"common.retry",children:"Retry"})}})}})]}}),Tt(Ut,{get when(){return!xe(e.wallet)},get children(){return[Tt(Ql,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",rt((()=>e.wallet.name))," browser extension"]}}),Tt(ql,{get children(){return Tt(Js,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return Tt(xo,{get rightIcon(){return Tt(ms,{})},onClick:g,get children(){return Tt(ec,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",rt((()=>e.wallet.name))]}})}})}})}})]}})]}}),Tt(jt,{get when(){return"desktop"===t()},get children(){return[Tt(rs,{size:"m"}),Tt(Ql,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",rt((()=>e.wallet.name))," on desktop…"]}}),Tt(ql,{get children(){return[Tt(xo,{get leftIcon(){return Tt(ps,{})},onClick:h,get children(){return Tt(ec,{translationKey:"common.retry",children:"Retry"})}}),Tt(Js,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return Tt(xo,{get rightIcon(){return Tt(ms,{})},get children(){return Tt(ec,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",rt((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),Tt(Ut,{get when(){return e.wallet.appName===js},get children(){return Tt(Jl,{get rightIcon(){return Tt(Xl,{get src(){return Hs}})},scale:"s",onClick:f,get children(){return Tt(ec,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),Tt(Ut,{get when(){return e.wallet.appName!==js},get children(){return Tt(zl,{get children(){return[Tt(Ut,{get when(){return rt((()=>"mobile"!==t()))()&&Ll(e.wallet)},get children(){return Tt(Zl,{appearance:"secondary",get leftIcon(){return Tt(ds,{})},onClick:d,get children(){return Tt(ec,{translationKey:"common.mobile",children:"Mobile"})}})}}),Tt(Ut,{get when(){return rt((()=>"extension"!==t()))()&&Ml(e.wallet)},get children(){return Tt(Zl,{appearance:"secondary",get leftIcon(){return Tt(cs,{})},onClick:g,get children(){return Tt(ec,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),Tt(Ut,{get when(){return rt((()=>"desktop"!==t()))()&&Rl(e.wallet)},get children(){return Tt(Zl,{appearance:"secondary",get leftIcon(){return Tt(fs,{})},onClick:h,get children(){return Tt(ec,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},sc=Tn.div``,ac=Tn(Uo)` position: absolute; top: 16px; left: 16px; `,lc=Tn(Ui)` margin-bottom: 18px; `,cc=Tn.div` padding: 16px 0; display: flex; flex-direction: column; align-items: center; `,uc=Sn` margin-bottom: 12px; `,dc=Tn(Hi)` text-align: center; margin-bottom: 4px; `,hc=Tn(Si)` text-align: center; max-width: 352px; color: ${e=>e.theme.colors.text.secondary}; `,fc=Tn.div` padding: 16px 24px 24px; display: flex; align-items: center; justify-content: center; gap: 8px; `,gc="https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1",pc=e=>Tt(sc,{"data-tc-wallets-modal-info":"true",get children(){return[Tt(ac,{icon:"arrow",onClick:()=>e.onBackClick()}),Tt(lc,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),Tt(Ys,{get children(){return[Tt(cc,{get children(){return[Tt(Cs,{class:uc}),Tt(dc,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),Tt(hc,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),Tt(cc,{get children(){return[Tt(_s,{class:uc}),Tt(dc,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),Tt(hc,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),Tt(cc,{get children(){return[Tt(ks,{class:uc}),Tt(dc,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),Tt(hc,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),Tt(fc,{get children(){return Tt(Js,{get href(){return gc},blank:!0,get children(){return Tt(xo,{get rightIcon(){return Tt(ys,{})},get children(){return Tt(ec,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),wc=Tn.div``,mc=Tn.div` flex: 1; margin-top: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 232px; `,vc=Tn(Ui)` max-width: 262px; margin: 0 auto 8px; `,yc=Tn(Uo)` position: absolute; top: 16px; left: 16px; `,bc=Tn.div` padding: 16px; display: flex; align-items: center; gap: 12px; border-top: 0.5px solid ${e=>Nn(e.theme.colors.icon.secondary,.2)}; `,Cc=Tn(to)` width: 36px; height: 36px; border-radius: 10px; `,xc=Tn(Js)` margin-left: auto; `,_c=Tn(rs)` margin-bottom: 18px; margin-top: 2px; `,Sc=Tn(Xi)` margin-bottom: 16px; `,kc=Tn(ji)` color: ${e=>e.theme.colors.text.secondary}; text-align: center; margin-bottom: 20px; `,Ec=Tn.div` display: flex; justify-content: center; gap: 8px; padding-bottom: 16px; `,Rc=Tn(Ui)` margin-bottom: 2px; padding: 0 64px; `,Lc=Tn(ji)` margin-bottom: 20px; padding: 0 64px; min-height: 44px; `,Mc=Tn.div` padding: 0 24px 24px; `,Tc=e=>[Tt(Rc,{get children(){return e.walletInfo.name}}),Tt(Lc,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",rt((()=>e.walletInfo.name)),"’s camera"]}}),Tt(Mc,{get children(){return Tt(vi,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return tc(e.universalLink,"none")},disableCopy:!0})}})],Ac=e=>{const t=Ln(),[n,r]=Xe(!0),[o,i]=Xe(!1),[s,a]=Xe(!1),l=ut(br),c=l.onStatusChange((()=>{}),(()=>{a(!0)})),u=rt((()=>l.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))),d=()=>{if(re(u()))return gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:"universal-link"})),void nc(u(),{returnStrategy:_l.returnStrategy,twaReturnUrl:_l.twaReturnUrl,forceRedirect:!0});a(!1);const t=!n();r(!1),rc(u(),e.wallet.deepLink,{returnStrategy:_l.returnStrategy,forceRedirect:t},(t=>{gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:t}))}))},h=()=>{a(!1),i(!0),gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:"qrcode"}))},f=()=>{o()?(i(!1),gr(__spreadProps(__spreadValues({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return at(c),d(),Tt(wc,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[Tt(Ut,{get when(){return!e.backDisabled||o()},get children(){return Tt(yc,{icon:"arrow",onClick:f})}}),Tt(Ut,{get when(){return o()},get children(){return Tt(Tc,{get universalLink(){return u()},get walletInfo(){return e.wallet}})}}),Tt(Ut,{get when(){return!o()},get children(){return[Tt(vc,{get children(){return e.wallet.name}}),Tt(mc,{get children(){return[Tt(Ut,{get when(){return s()},get children(){return[Tt(Sc,{size:"s"}),Tt(kc,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),Tt(Ec,{get children(){return[Tt(xo,{get leftIcon(){return Tt(ps,{})},onClick:d,get children(){return Tt(ec,{translationKey:"common.retry",children:"Retry"})}}),Tt(xo,{get leftIcon(){return Tt($s,{get fill(){return t.colors.accent}})},onClick:h,get children(){return Tt(ec,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),Tt(Ut,{get when(){return!s()},get children(){return[Tt(_c,{size:"s"}),Tt(kc,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",rt((()=>e.wallet.name)),"…"]}}),Tt(Ec,{get children(){return[Tt(xo,{get leftIcon(){return Tt(ps,{})},onClick:d,get children(){return Tt(ec,{translationKey:"common.retry",children:"Retry"})}}),Tt(xo,{get leftIcon(){return Tt($s,{get fill(){return t.colors.accent}})},onClick:h,get children(){return Tt(ec,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),Tt(bc,{get children(){return[Tt(Cc,{get src(){return e.wallet.imageUrl}}),Tt(Hi,{get children(){return e.wallet.name}}),Tt(xc,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return Tt(xo,{get children(){return Tt(ec,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},Oc={m:"16px",s:"12px",none:"0"},$c={m:"6px",s:"6px",none:"0"},Pc=Tn.ul` display: flex; justify-content: space-between; margin: 0 auto; width: fit-content; max-width: 100%; min-width: 100%; height: fit-content; overflow-x: auto; overflow-y: hidden; padding: 0 13px 24px; &&::-webkit-scrollbar { display: none; } -ms-overflow-style: none; scrollbar-width: none; > li { height: fit-content; } `,Ic=Tn.li` width: 82px; min-width: 82px; height: 124px; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; text-align: center; cursor: pointer; transition: transform 0.1s ease-in-out; ${mo} { &:hover { transform: scale(1.04); } } &:active { transform: scale(0.96); } ${wo} { &:active { transform: scale(0.92); } } `,Nc=Tn.div` width: 1px; margin: 0 10px; height: 24px; position: relative; top: 26px; background-color: ${e=>e.theme.colors.icon.secondary}; opacity: 0.2; `,Uc=Tn.div` width: 60px; height: 60px; border-radius: ${e=>Oc[e.theme.borderRadius]}; display: flex; align-items: center; justify-content: center; background-color: ${e=>e.theme.colors.background.tint}; margin-bottom: 8px; `,Wc=Tn(Ui)` margin-top: 38px; margin-bottom: 4px; padding: 0 24px; `,jc=Tn(ji)` margin-bottom: 24px; padding: 0 24px; min-height: 44px; `;Tn(xo)` display: block; margin: 0 auto; `;const Bc=Tn(xo)` margin: 0 24px 24px; width: calc(100% - 48px); border-radius: ${e=>Oc[e.theme.borderRadius]}; padding: 14px 16px 14px 14px; background-color: ${e=>e.theme.colors.telegramButton}; color: ${e=>e.theme.colors.constant.white}; font-weight: 590; font-size: 16px; line-height: 20px; `,Hc=Tn(to)` border-radius: ${e=>$c[e.theme.borderRadius]}; width: 24px; height: 24px; `,Kc=Tn(Uo)` position: absolute; top: 16px; left: 16px; `,Dc=Tn(Ui)` margin-bottom: 2px; padding: 0 64px; `,Fc=Tn(ji)` margin-bottom: 20px; padding: 0 64px; `,Vc=Tn.div` padding: 0 24px 24px; `,qc=e=>[Tt(Dc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),Tt(Fc,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),Tt(Vc,{get children(){return Tt(vi,{get imageUrl(){return Bs},get sourceUrl(){return tc(e.universalLink,"none")},disableCopy:!0})}})],zc=Zt("
  • "),Zc=Zt('
    '),Gc=e=>{const[t,n]=Xe(!1),[r,o]=Xe(!0),i=_l.connector,s=()=>e.walletsList.filter((e=>Ll(e)&&e.appName!==js)),a=()=>s().length>7,l=()=>i.connect([...new Set(e.walletsList.filter(ke).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest);gr({openMethod:"universal-link"});const[c,u]=Xe(void 0),d=()=>__async(this,null,(function*(){void 0!==c()&&clearTimeout(c()),yield wi(l());const e=setTimeout((()=>u(void 0)),1500);u(e)})),h=()=>{const e=!r();o(!1),rc(l(),void 0,{returnStrategy:_l.returnStrategy,forceRedirect:e},(e=>{gr({openMethod:e})}))},f=()=>{const t=e.walletsList.find((e=>e.appName===js));if(!t||!ke(t))throw new Kn("@wallet bot not found in the wallets list");const n=i.connect({bridgeUrl:t.bridgeUrl,universalLink:t.universalLink},e.additionalRequest),s=!r();o(!1),nc(n,{returnStrategy:_l.returnStrategy,twaReturnUrl:_l.twaReturnUrl,forceRedirect:s})},g=()=>{n(!0),gr({openMethod:"qrcode"})},p=()=>{n(!1),gr({openMethod:"universal-link"})};return(()=>{const n=Zc.cloneNode(!0);return Xt(n,Tt(Ut,{get when(){return t()},get children(){return[Tt(Kc,{icon:"arrow",onClick:p}),Tt(qc,{get universalLink(){return l()}})]}}),null),Xt(n,Tt(Ut,{get when(){return!t()},get children(){return[Tt(Kc,{get icon(){return Tt($s,{})},onClick:g}),Tt(Wc,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),Tt(jc,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),Tt(Bc,{get leftIcon(){return Tt(Rs,{})},get rightIcon(){return Tt(Hc,{get src(){return Hs}})},onClick:f,scale:"s",get children(){return Tt(ec,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),Tt(Pc,{get children(){return[Tt(Nt,{get each(){return rt((()=>!!a()))()?s().slice(0,4):s()},children:t=>(()=>{const n=zc.cloneNode(!0);return Xt(n,Tt(Ii,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),n})()}),Tt(Ut,{get when(){return a()},get children(){const t=zc.cloneNode(!0);return Xt(t,Tt(Ws,{labelLine1:"View all",labelLine2:"wallets",get images(){return s().slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})),t}}),Tt(Nc,{children:" "}),Tt(Ic,{onClick:h,get children(){return[Tt(Uc,{get children(){return Tt(Di,{})}}),Tt(Si,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),Tt(Ic,{onClick:d,get children(){return[Tt(Uc,{get children(){return rt((()=>void 0!==c()))()?Tt(Ms,{}):Tt(As,{})}}),Tt(Si,{fontWeight:590,get translationKey(){return void 0!==c()?"common.copied":"common.copyLink"},get children(){return void 0!==c()?"Copied":"Copy Link"}})]}})]}})]}}),null),n})()},Yc={m:"16px",s:"8px",none:"0"},Qc={m:"8px",s:"4px",none:"0"},Jc=Tn.div` display: flex; flex-direction: column; align-items: center; padding-bottom: 16px; `,Xc=Tn(ji)` max-width: 320px; margin-top: 2px; margin-bottom: 20px; `,eu=Tn(ji)` margin-bottom: 16px; `,tu=Tn(vi)` margin-bottom: 24px; `,nu=Tn.ul` display: flex; `;Tn.div` display: flex; gap: 16px; width: 100%; `,Tn(xo)` position: relative; font-size: 16px; line-height: 20px; width: 100%; padding: 0 16px; height: 56px; border-radius: ${e=>Yc[e.theme.borderRadius]}; &:hover { ${e=>e.disableEventsAnimation?"transform: unset;":""} } &:active { ${e=>e.disableEventsAnimation?"transform: unset;":""} } `,Tn.ul` position: absolute; bottom: 100%; left: 0; margin: 0; padding: 8px; width: 188px; transform: translateY(-16px); background-color: ${e=>e.theme.colors.background.primary}; border-radius: ${e=>Yc[e.theme.borderRadius]}; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); `,Tn.li` padding: 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: ${e=>Qc[e.theme.borderRadius]}; transition: background-color, transform 0.1s ease-in-out; &:hover { background-color: ${e=>e.theme.colors.background.secondary}; } &:active { transform: scale(0.96); } `,Tn(to)` width: 24px; height: 24px; border-radius: 6px; `,Tn.div` margin-top: 23px; margin-bottom: 1px; width: 100%; display: flex; justify-content: center; align-items: center; `,Tn(Si)` color: ${e=>e.theme.colors.text.secondary}; font-size: 16px; `;const ru=Zt("
  • "),ou=e=>{const[t,n]=Xe(!1),r=_l.connector;gr({openMethod:"qrcode"});const o=rt((()=>r.connect([...new Set(e.walletsList.filter(ke).map((e=>e.bridgeUrl))).values()].map((e=>({bridgeUrl:e}))),e.additionalRequest)));return Tt(Jc,{onClick:()=>n(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[Tt(Ui,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),Tt(Xc,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),Tt(tu,{get sourceUrl(){return tc(o(),"none")},get disableCopy(){return t()},get imageUrl(){return Bs}}),Tt(eu,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),Tt(nu,{get children(){return[Tt(Nt,{get each(){return e.walletsList.slice(0,3)},children:t=>(()=>{const n=ru.cloneNode(!0);return Xt(n,Tt(Ks,{wallet:t,onClick:()=>e.onSelect(t)})),n})()}),Tt(Ws,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})]}})]}})},iu=()=>{const{locale:e}=xi()[1];nt((()=>e(_l.language))),nt((()=>{sr()&&Gs()}));const t=ut(br),n=ut(Xs),[r]=ot((()=>n.getWallets())),[o,i]=Xe(null),[s,a]=Xe("universal"),[l,c]=Xe(!1),u=rt((()=>{if("ready"!==r.state)return null;let e=El(r(),_l.walletsListConfiguration);const t=e.filter(xe),n=e.filter((e=>!xe(e)));e=(t||[]).concat(n);const o=_l.preferredWalletAppName,i=e.find((e=>Tl(e,o))),s=e.filter((e=>Tl(e,o))).length>=2;o&&i&&!s&&(e=[__spreadProps(__spreadValues({},i),{isPreferred:!0})].concat(e.filter((e=>!Tl(e,o)))));const a=e.find((e=>Tl(e,js)));return a&&(e=[a].concat(e.filter((e=>!Tl(e,js))))),e})),d=()=>{var e;return"loading"===(null==(e=_l.connectRequestParameters)?void 0:e.state)},h=rt((()=>{var e;if(!d())return null==(e=_l.connectRequestParameters)?void 0:e.value})),f=e=>{ir({status:"closed",closeReason:e}),i(null),c(!1)};return at(t.onStatusChange((e=>{e&&f("wallet-selected")}))),Tt(bl,{get opened(){return sr()},get enableAndroidBackHandler(){return _l.enableAndroidBackHandler},onClose:()=>f("action-cancelled"),onClickQuestion:()=>c((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[Tt(Ut,{get when(){return l()},get children(){return Tt(pc,{onBackClick:()=>c(!1)})}}),Tt(Ut,{get when(){return!l()},get children(){return[Tt(Ut,{get when(){return d()||!u()},get children(){return[Tt(Cl,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),Tt(xl,{get children(){return Tt(rs,{size:"m"})}})]}}),Tt(Ut,{get when(){return rt((()=>!d()))()&&u()},get children(){return Tt(Wt,{get children(){return[Tt(jt,{get when(){return o()},get children(){return Tt(hn,{get component(){return zs()?Ac:ic},get wallet(){return o()},get additionalRequest(){return h()},onBackClick:()=>i(null)})}}),Tt(jt,{get when(){return"universal"===s()},get children(){return Tt(hn,{get component(){return zs()?Gc:ou},onSelect:i,get walletsList(){return u()},get additionalRequest(){return h()},onSelectAllWallets:()=>a("all-wallets")})}}),Tt(jt,{get when(){return"all-wallets"===s()},get children(){return Tt(Ul,{get walletsList(){return u()},onBack:()=>a("universal"),onSelect:i})}})]}})}})]}})]}})},su=Tn.div` display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; `,au=Tn(Ui)` margin-top: 16px; `,lu=Tn(Si)` font-weight: 510; font-size: 16px; line-height: 20px; text-align: center; max-width: 250px; color: ${e=>e.theme.colors.text.secondary}; `,cu=Tn(xo)` min-width: 112px; margin-top: 32px; `,uu=Tn(rs)` height: 16px; width: 16px; `,du=Tn(xo)` margin-top: 32px; `,hu=e=>{const t=Co(e),n=ut(Xs),[r,o]=Xe(!0),[i,s]=Xe(!1);let a,l;nt((()=>{const e=pr();s(!!e&&"sent"in e&&e.sent)})),(null==n?void 0:n.wallet)&&"universalLink"in n.wallet&&("universal-link"===n.wallet.openMethod||re(n.wallet.universalLink)&&so())&&(a=n.wallet.universalLink),(null==n?void 0:n.wallet)&&"deepLink"in n.wallet&&("custom-deeplink"===n.wallet.openMethod||re(n.wallet.deepLink)&&so())&&(l=n.wallet.deepLink);const c=()=>{const e=pr(),t="returnStrategy"in e?e.returnStrategy:_l.returnStrategy,n=!r();o(!1),re(a)?nc(a,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:_l.twaReturnUrl,forceRedirect:n}):rc(a,l,{returnStrategy:t,forceRedirect:n},(()=>{}))};return Tt(su,Pt(t,{get children(){return[rt((()=>e.icon)),Tt(au,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),Tt(lu,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),Tt(Ut,{get when(){return!i()&&("open-wallet"===e.showButton&&a||"open-wallet"!==e.showButton)},get children(){return Tt(cu,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return Tt(uu,{})}})}}),Tt(Ut,{get when(){return i()},get children(){return[Tt(Ut,{get when(){return"open-wallet"!==e.showButton},get children(){return Tt(du,{onClick:()=>e.onClose(),get children(){return Tt(ec,{translationKey:"common.close",children:"Close"})}})}}),Tt(Ut,{get when(){return"open-wallet"===e.showButton&&a},get children(){return Tt(du,{onClick:c,get children(){return Tt(ec,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},fu=e=>{const t=ut(Xs),[n]=xi();return Tt(hu,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return Tt(rs,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},gu=e=>Tt(hu,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return Tt(Xi,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),pu=e=>Tt(hu,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return Tt(Gi,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),wu=()=>Tt(Xo,{get opened(){var e;return rt((()=>null!==pr()))()&&!0===(null==(e=pr())?void 0:e.openModal)},get enableAndroidBackHandler(){return _l.enableAndroidBackHandler},onClose:()=>wr(null),"data-tc-actions-modal-container":"true",get children(){return Tt(Wt,{get children(){return[Tt(jt,{get when(){return"transaction-sent"===pr().name},get children(){return Tt(pu,{onClose:()=>wr(null)})}}),Tt(jt,{get when(){return"transaction-canceled"===pr().name},get children(){return Tt(gu,{onClose:()=>wr(null)})}}),Tt(jt,{get when(){return"confirm-transaction"===pr().name},get children(){return Tt(fu,{onClose:()=>wr(null)})}})]}})}}),mu=()=>{const{locale:e}=xi()[1];nt((()=>e(_l.language))),nt((()=>{cr()&&Gs()}));const t=ut(br),[n,r]=Xe(!1),o=()=>{var e;return"loading"===(null==(e=_l.connectRequestParameters)?void 0:e.state)},i=rt((()=>{var e;if(!o())return null==(e=_l.connectRequestParameters)?void 0:e.value})),s=e=>{lr({status:"closed",closeReason:e}),r(!1)};return at(t.onStatusChange((e=>{e&&s("wallet-selected")}))),Tt(bl,{get opened(){return cr()},get enableAndroidBackHandler(){return _l.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>r((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[Tt(Ut,{get when(){return n()},get children(){return Tt(pc,{onBackClick:()=>r(!1)})}}),Tt(Ut,{get when(){return!n()},get children(){return[Tt(Ut,{get when(){return o()},get children(){return[Tt(Cl,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),Tt(xl,{get children(){return Tt(rs,{size:"m"})}})]}}),Tt(Ut,{get when(){return!o()},get children(){return Tt(hn,{get component(){return zs()?Ac:ic},get wallet(){return ur()},get additionalRequest(){return i()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},vu=e=>{const t=bi(vr,_l.language);return customElements.define(On,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),Tt(Ci.Provider,{value:t,get children(){return Tt(Xs.Provider,{get value(){return e.tonConnectUI},get children(){return Tt(br.Provider,{get value(){return _l.connector},get children(){return[Tt(In,{}),Tt(Rn,{theme:Gr,get children(){return[Tt(Ut,{get when(){return _l.buttonRootId},get children(){return Tt(dn,{get mount(){return document.getElementById(_l.buttonRootId)},get children(){return Tt(yl,{})}})}}),Tt(hn,{component:On,get children(){return[Tt(iu,{}),Tt(mu,{}),Tt(wu,{})]}})]}})]}})}})}})},yu=()=>{setTimeout((()=>ir({status:"opened",closeReason:null})))},bu=e=>{setTimeout((()=>ir({status:"closed",closeReason:e})))},Cu=e=>{setTimeout((()=>lr({status:"opened",closeReason:null,walletInfo:e})))},xu=e=>{setTimeout((()=>lr({status:"closed",closeReason:e})))},_u=e=>{setTimeout((()=>wr(e)))},Su=()=>{setTimeout((()=>wr(null)))},ku=()=>hr(),Eu=()=>gr(null),Ru=(e,t)=>function(e,t,n,r={}){let o;return Je((r=>{o=r,t===document?e():Xt(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}((()=>Tt(vu,{tonConnectUI:t})),document.getElementById(e));class Lu{constructor(e){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"state",or()),this.connector=e.connector,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,nt((()=>{const e=or();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return __async(this,null,(function*(){const e=(yield this.connector.getWallets()).find(_e);return e?this.connectEmbeddedWallet(e):this.openWalletsModal()}))}close(){bu("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{gr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=_l.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openWalletsModal(){return __async(this,null,(function*(){return so()&&ao(),yu(),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}class Mu{constructor(e){__publicField(this,"connector"),__publicField(this,"consumers",[]),this.connector=e.connector,nt((()=>{const e=pr();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}class Tu{constructor(e){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"state",ar()),this.connector=e.connector,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,nt((()=>{const e=ar();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(e){return __async(this,null,(function*(){const t=El(yield this.connector.getWallets(),_l.walletsListConfiguration),n=t.find(_e);if(!!n)return this.connectEmbeddedWallet(n);const r=t.filter(ke).find((t=>Tl(t,e)));if(!!r)return this.openSingleWalletModal(r);throw new Kn(`Trying to open modal window with unknown wallet "${e}".`)}))}close(){xu("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{gr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=_l.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openSingleWalletModal(e){return __async(this,null,(function*(){return so()&&ao(),Cu(e),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}e.BadRequestError=K,e.FetchWalletsError=q,e.LocalstorageNotFoundError=V,e.ParseHexError=Z,e.THEME=fn,e.TonConnect=Te,e.TonConnectError=I,e.TonConnectUI=class{constructor(e){if(__publicField(this,"walletInfoStorage",new tr),__publicField(this,"preferredWalletStorage",new nr),__publicField(this,"walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__publicField(this,"walletsList"),__publicField(this,"connectRequestParametersCallback"),__publicField(this,"connector"),__publicField(this,"modal"),__publicField(this,"singleWalletModal"),__publicField(this,"transactionModal"),__publicField(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Kn("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new Te({manifestUrl:e.manifestUrl})}this.modal=new Lu({connector:this.connector,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new Tu({connector:this.connector,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new Mu({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return Zn((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=new Promise((e=>__async(this,null,(function*(){yield this.connector.restoreConnection(),this.connector.connected||this.walletInfoStorage.removeWalletInfo(),e(this.connector.connected)}))))),this.uiOptions=Zr(e,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();Sl({connector:this.connector,preferredWalletAppName:n}),Ru(t,this)}static getWallets(){return Te.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?__spreadValues(__spreadValues({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,n,r,o,i,s,a;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(n=e.uiPreferences)?void 0:n.theme)?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),Xr(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Xr(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?fn.LIGHT:fn.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?fn.DARK:fn.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Xr))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(s=e.uiPreferences.colorsSet,Jr[fn.DARK]=Zr(s[fn.DARK],Jr[fn.DARK]),Jr[fn.LIGHT]=Zr(s[fn.LIGHT],Jr[fn.LIGHT]),Yr((e=>({colors:Zr(Jr[e.theme],Qr[e.theme])})))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(a=e.uiPreferences.borderRadius,Yr({borderRadius:a})),Sl((t=>{var n,r;const o=Zr(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(r=e.actionsConfiguration)?void 0:r.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),Er(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o}))}setConnectRequestParameters(e){var t;Sl({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return __async(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>__async(this,null,(function*(){if(t){const n=yield this.getSelectedWalletInfo(t);e(__spreadValues(__spreadValues({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return __async(this,null,(function*(){return this.modal.open()}))}closeModal(){this.modal.close()}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return __async(this,null,(function*(){return this.singleWalletModal.open(e)}))}closeSingleWalletModal(){this.singleWalletModal.close()}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return __async(this,null,(function*(){const e=(yield this.getWallets()).find(_e);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return Su(),Eu(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return __async(this,null,(function*(){if(!this.connected)throw new Kn("Connect wallet to send a transaction.");so()&&ao();const{notifications:n,modals:r,returnStrategy:o,twaReturnUrl:i,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(t);_u({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!1});const a=()=>{l.signal.aborted||(_u({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)&&(re(this.walletInfo.universalLink)?nc(this.walletInfo.universalLink,{returnStrategy:o,twaReturnUrl:i||_l.twaReturnUrl,forceRedirect:!1}):rc(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:o,forceRedirect:!1},(()=>{}))))},l=new AbortController,c=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(c(),e||l.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,signal:l.signal},a);return _u({name:"transaction-sent",showNotification:n.includes("success"),openModal:r.includes("success")}),t}catch(Au){throw _u({name:"transaction-canceled",showNotification:n.includes("error"),openModal:r.includes("error")}),Au instanceof I?Au:(console.error(Au),new Kn("Unhandled error:"+Au))}finally{c()}}))}connectEmbeddedWallet(e){return __async(this,null,(function*(){const t=t=>{gr(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=_l.connectRequestParameters;return"loading"===(null==n?void 0:n.state)?this.connectRequestParametersCallback=t:t(null==n?void 0:n.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return __async(this,null,(function*(){const e=new AbortController;yu();const t=this.onModalStateChange((n=>{const{status:r,closeReason:o}=n;"opened"!==r&&(t(),"action-cancelled"===o&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,signal:e.signal})}))}waitForWalletConnection(e){return __async(this,null,(function*(){return new Promise(((t,n)=>{const{ignoreErrors:r=!1,signal:o=null}=e;if(o&&o.aborted)return n(new Kn("Wallet was not connected"));const i=e=>__async(this,null,(function*(){if(e)s(),t(e);else{if(r)return;s(),n(new Kn("Wallet was not connected"))}})),s=this.onStatusChange((e=>i(e)),(e=>(e=>{r||(s(),n(e))})(e)));o&&o.addEventListener("abort",(()=>{s(),n(new Kn("Wallet was not connected"))}),{once:!0})}))}))}waitForSendTransaction(e,t){return __async(this,null,(function*(){return new Promise(((n,r)=>{const{transaction:o,signal:i}=e;if(i.aborted)return r(new Kn("Transaction was not sent"));const s=e=>__async(this,null,(function*(){n(e)}));this.connector.sendTransaction(o,{onRequestSent:t,signal:i}).then((e=>s(e))).catch((e=>(e=>{r(e)})(e))),i.addEventListener("abort",(()=>{r(new Kn("Transaction was not sent"))}),{once:!0})}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>__async(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),Sl({preferredWalletAppName:e})}getSelectedWalletInfo(e){return __async(this,null,(function*(){let t,n=ku();if(!n)return null;if("name"in n)t=n;else{const r=El(yield this.walletsList,_l.walletsListConfiguration).find((t=>Tl(t,e.device.appName)));if(!r)throw new Kn(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=__spreadValues(__spreadValues({},r),n)}return t}))}updateWalletInfo(e){return __async(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const n=this.walletInfoStorage.getWalletInfo();this.walletInfo=n||((yield this.walletsList).find((t=>Tl(t,e.device.appName)))||null)}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Kn(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r,o,i,s;const a=["before","success","error"];let l=a;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?a:e.notifications);let c=["before"];(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(c="all"===this.actionsConfiguration.modals?a:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?a:e.modals);const u=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",d=(null==e?void 0:e.twaReturnUrl)||(null==(i=this.actionsConfiguration)?void 0:i.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(s=this.actionsConfiguration)?void 0:s.skipRedirectToWallet)||"ios";return so()&&(h="never"),{notifications:l,modals:c,returnStrategy:u,twaReturnUrl:d,skipRedirectToWallet:h}}},e.TonConnectUIError=Kn,e.UnknownAppError=D,e.UnknownError=G,e.UserRejectsError=H,e.WalletAlreadyConnectedError=j,e.WalletNotConnectedError=B,e.WalletNotInjectedError=F,e.WalletsListManager=Re,e.WrongAddressError=z,e.encodeTelegramUrlParameters=oe,e.isTelegramUrl=re,e.isWalletInfoCurrentlyEmbedded=_e,e.isWalletInfoCurrentlyInjected=xe,e.isWalletInfoInjectable=Se,e.isWalletInfoInjected=function(e){return"jsBridgeKey"in e},e.isWalletInfoRemote=ke,e.toUserFriendlyAddress=$e,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); //# sourceMappingURL=tonconnect-ui.min.js.map