@tonconnect/ui 0.0.16 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -67
- package/dist/tonconnect-ui.min.js +486 -253
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.d.ts +37 -47
- package/lib/index.js +5624 -4319
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +5000 -3695
- package/lib/index.umd.js.map +1 -1
- package/package.json +3 -4
|
@@ -1,68 +1,78 @@
|
|
|
1
|
-
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(exports){"use strict";class TonConnectError extends Error{constructor(e,t){e&&(e=TonConnectError.prefix+" "+e),super(e,t),Object.setPrototypeOf(this,TonConnectError.prototype)}}TonConnectError.prefix="[TON_CONNECT_SDK_ERROR]";class DappMetadataError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,DappMetadataError.prototype)}}class ManifestContentErrorError extends TonConnectError{constructor(e){super(e||""+ManifestContentErrorError.additionalMessage),Object.setPrototypeOf(this,ManifestContentErrorError.prototype)}}ManifestContentErrorError.additionalMessage="\nPassed `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";class ManifestNotFoundError extends TonConnectError{constructor(e){super(e||""+ManifestNotFoundError.additionalMessage),Object.setPrototypeOf(this,ManifestNotFoundError.prototype)}}ManifestNotFoundError.additionalMessage="\nManifest 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";class WalletAlreadyConnectedError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,WalletAlreadyConnectedError.prototype)}}class WalletNotConnectedError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,WalletNotConnectedError.prototype)}}class WalletNotSupportFeatureError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}function isWalletConnectionSourceJS(e){return"jsBridgeKey"in e}class UserRejectsError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,UserRejectsError.prototype)}}class BadRequestError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,BadRequestError.prototype)}}class UnknownAppError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,UnknownAppError.prototype)}}class WalletNotInjectedError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,WalletNotInjectedError.prototype)}}class LocalstorageNotFoundError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,LocalstorageNotFoundError.prototype)}}class FetchWalletsError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,FetchWalletsError.prototype)}}class WrongAddressError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,WrongAddressError.prototype)}}class ParseHexError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,ParseHexError.prototype)}}class UnknownError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,UnknownError.prototype)}}var CONNECT_EVENT_ERROR_CODES,CONNECT_EVENT_ERROR_CODES2,CONNECT_ITEM_ERROR_CODES,CONNECT_ITEM_ERROR_CODES2,SEND_TRANSACTION_ERROR_CODES,SEND_TRANSACTION_ERROR_CODES2,CHAIN,CHAIN2;CONNECT_EVENT_ERROR_CODES2=CONNECT_EVENT_ERROR_CODES||(CONNECT_EVENT_ERROR_CODES={}),CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",CONNECT_EVENT_ERROR_CODES2[CONNECT_EVENT_ERROR_CODES2.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",CONNECT_ITEM_ERROR_CODES2=CONNECT_ITEM_ERROR_CODES||(CONNECT_ITEM_ERROR_CODES={}),CONNECT_ITEM_ERROR_CODES2[CONNECT_ITEM_ERROR_CODES2.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",CONNECT_ITEM_ERROR_CODES2[CONNECT_ITEM_ERROR_CODES2.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",SEND_TRANSACTION_ERROR_CODES2=SEND_TRANSACTION_ERROR_CODES||(SEND_TRANSACTION_ERROR_CODES={}),SEND_TRANSACTION_ERROR_CODES2[SEND_TRANSACTION_ERROR_CODES2.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",SEND_TRANSACTION_ERROR_CODES2[SEND_TRANSACTION_ERROR_CODES2.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",SEND_TRANSACTION_ERROR_CODES2[SEND_TRANSACTION_ERROR_CODES2.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",SEND_TRANSACTION_ERROR_CODES2[SEND_TRANSACTION_ERROR_CODES2.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",SEND_TRANSACTION_ERROR_CODES2[SEND_TRANSACTION_ERROR_CODES2.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",CHAIN2=CHAIN||(CHAIN={}),CHAIN2.MAINNET="-239",CHAIN2.TESTNET="-3";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getAugmentedNamespace(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 naclUtil={exports:{}},module2,root,f;module2=naclUtil,root=commonjsGlobal,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<n.length;t++)r[t]=n.charCodeAt(t);return r},e.encodeUTF8=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(n.join("")))},"undefined"==typeof atob?void 0!==Buffer.from?(e.encodeBase64=function(e){return Buffer.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new Buffer(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,"base64"),0))}):(e.encodeBase64=function(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(String.fromCharCode(e[t]));return btoa(n.join(""))},e.decodeBase64=function(e){t(e);var n,r=atob(e),o=new Uint8Array(r.length);for(n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}),e},module2.exports?module2.exports=f():(root.nacl||(root.nacl={}),root.nacl.util=f());const nacl$1=naclUtil.exports;function encodeUint8Array(e,t){const n=nacl$1.encodeBase64(e);return t?encodeURIComponent(n):n}function decodeToUint8Array(e,t){return t&&(e=decodeURIComponent(e)),nacl$1.decodeBase64(e)}function encode(e,t=!1){let n;return e instanceof Uint8Array?n=e:("string"!=typeof e&&(e=JSON.stringify(e)),n=nacl$1.decodeUTF8(e)),encodeUint8Array(n,t)}function decode(e,t=!1){const n=decodeToUint8Array(e,t);return{toString:()=>nacl$1.encodeUTF8(n),toObject(){try{return JSON.parse(nacl$1.encodeUTF8(n))}catch(e){return null}},toUint8Array:()=>n}}const Base64={encode:encode,decode:decode};function concatUint8Arrays(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function splitToUint8Arrays(e,t){if(t>=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}function toHexString(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function hexToByteArray(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;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}function isNode$1(){return"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(__viteBrowserExternal$1);!function(e){!function(e){var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},r=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),s=t([1]),a=t([56129,1]),l=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function p(e,t,n,r,o){var i,s=0;for(i=0;i<o;i++)s|=e[t+i]^n[r+i];return(1&s-1>>>8)-1}function g(e,t,n,r){return p(e,t,n,r,16)}function m(e,t,n,r){return p(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,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,C=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,v=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,E=i,b=s,S=a,x=l,_=c,T=u,O=d,R=f,A=h,N=p,$=g,M=m,L=y,P=w,k=C,I=v,B=0;B<20;B+=2)E^=(o=(L^=(o=(A^=(o=(_^=(o=E+L|0)<<7|o>>>25)+E|0)<<9|o>>>23)+_|0)<<13|o>>>19)+A|0)<<18|o>>>14,T^=(o=(b^=(o=(P^=(o=(N^=(o=T+b|0)<<7|o>>>25)+T|0)<<9|o>>>23)+N|0)<<13|o>>>19)+P|0)<<18|o>>>14,$^=(o=(O^=(o=(S^=(o=(k^=(o=$+O|0)<<7|o>>>25)+$|0)<<9|o>>>23)+k|0)<<13|o>>>19)+S|0)<<18|o>>>14,I^=(o=(M^=(o=(R^=(o=(x^=(o=I+M|0)<<7|o>>>25)+I|0)<<9|o>>>23)+x|0)<<13|o>>>19)+R|0)<<18|o>>>14,E^=(o=(x^=(o=(S^=(o=(b^=(o=E+x|0)<<7|o>>>25)+E|0)<<9|o>>>23)+b|0)<<13|o>>>19)+S|0)<<18|o>>>14,T^=(o=(_^=(o=(R^=(o=(O^=(o=T+_|0)<<7|o>>>25)+T|0)<<9|o>>>23)+O|0)<<13|o>>>19)+R|0)<<18|o>>>14,$^=(o=(N^=(o=(A^=(o=(M^=(o=$+N|0)<<7|o>>>25)+$|0)<<9|o>>>23)+M|0)<<13|o>>>19)+A|0)<<18|o>>>14,I^=(o=(k^=(o=(P^=(o=(L^=(o=I+k|0)<<7|o>>>25)+I|0)<<9|o>>>23)+L|0)<<13|o>>>19)+P|0)<<18|o>>>14;E=E+i|0,b=b+s|0,S=S+a|0,x=x+l|0,_=_+c|0,T=T+u|0,O=O+d|0,R=R+f|0,A=A+h|0,N=N+p|0,$=$+g|0,M=M+m|0,L=L+y|0,P=P+w|0,k=k+C|0,I=I+v|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=b>>>0&255,e[5]=b>>>8&255,e[6]=b>>>16&255,e[7]=b>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=_>>>0&255,e[17]=_>>>8&255,e[18]=_>>>16&255,e[19]=_>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=R>>>0&255,e[29]=R>>>8&255,e[30]=R>>>16&255,e[31]=R>>>24&255,e[32]=A>>>0&255,e[33]=A>>>8&255,e[34]=A>>>16&255,e[35]=A>>>24&255,e[36]=N>>>0&255,e[37]=N>>>8&255,e[38]=N>>>16&255,e[39]=N>>>24&255,e[40]=$>>>0&255,e[41]=$>>>8&255,e[42]=$>>>16&255,e[43]=$>>>24&255,e[44]=M>>>0&255,e[45]=M>>>8&255,e[46]=M>>>16&255,e[47]=M>>>24&255,e[48]=L>>>0&255,e[49]=L>>>8&255,e[50]=L>>>16&255,e[51]=L>>>24&255,e[52]=P>>>0&255,e[53]=P>>>8&255,e[54]=P>>>16&255,e[55]=P>>>24&255,e[56]=k>>>0&255,e[57]=k>>>8&255,e[58]=k>>>16&255,e[59]=k>>>24&255,e[60]=I>>>0&255,e[61]=I>>>8&255,e[62]=I>>>16&255,e[63]=I>>>24&255}(e,t,n,r)}function w(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,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,C=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,v=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,E=0;E<20;E+=2)i^=(o=(y^=(o=(h^=(o=(c^=(o=i+y|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+h|0)<<18|o>>>14,u^=(o=(s^=(o=(w^=(o=(p^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+p|0)<<13|o>>>19)+w|0)<<18|o>>>14,g^=(o=(d^=(o=(a^=(o=(C^=(o=g+d|0)<<7|o>>>25)+g|0)<<9|o>>>23)+C|0)<<13|o>>>19)+a|0)<<18|o>>>14,v^=(o=(m^=(o=(f^=(o=(l^=(o=v+m|0)<<7|o>>>25)+v|0)<<9|o>>>23)+l|0)<<13|o>>>19)+f|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=(f^=(o=(d^=(o=u+c|0)<<7|o>>>25)+u|0)<<9|o>>>23)+d|0)<<13|o>>>19)+f|0)<<18|o>>>14,g^=(o=(p^=(o=(h^=(o=(m^=(o=g+p|0)<<7|o>>>25)+g|0)<<9|o>>>23)+m|0)<<13|o>>>19)+h|0)<<18|o>>>14,v^=(o=(C^=(o=(w^=(o=(y^=(o=v+C|0)<<7|o>>>25)+v|0)<<9|o>>>23)+y|0)<<13|o>>>19)+w|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]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=v>>>0&255,e[13]=v>>>8&255,e[14]=v>>>16&255,e[15]=v>>>24&255,e[16]=d>>>0&255,e[17]=d>>>8&255,e[18]=d>>>16&255,e[19]=d>>>24&255,e[20]=f>>>0&255,e[21]=f>>>8&255,e[22]=f>>>16&255,e[23]=f>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>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 v(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<o;l++)e[t+l]=n[r+l]^u[l];return 0}function E(e,t,n,r,o){var i,s,a=new Uint8Array(16),l=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=r[s];for(;n>=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<n;s++)e[t+s]=l[s];return 0}function b(e,t,n,r,o){var i=new Uint8Array(32);w(i,r,o,C);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=r[a+16];return E(e,t,n,s,i)}function S(e,t,n,r,o,i,s){var a=new Uint8Array(32);w(a,i,s,C);for(var l=new Uint8Array(8),c=0;c<8;c++)l[c]=i[c+16];return v(e,t,n,r,o,l,a)}var x=function(e){var t,n,r,o,i,s,a,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),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 _(e,t,n,r,o,i){var s=new x(i);return s.update(n,r,o),s.finish(e,t),0}function T(e,t,n,r,o,i){var s=new Uint8Array(16);return _(s,0,n,r,o,i),g(e,t,s,0)}function O(e,t,n,r,o){var i;if(n<32)return-1;for(S(e,0,t,0,n,r,o),_(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function R(e,t,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(b(s,0,32,r,o),0!==T(t,16,t,32,n-32,s))return-1;for(S(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 N(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 M(e,n){var r,o,i,s=t(),a=t();for(r=0;r<16;r++)a[r]=n[r];for(N(a),N(a),N(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 L(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return M(n,e),M(r,t),m(n,0,r,0)}function P(e){var t=new Uint8Array(32);return M(t,e),1&t[0]}function k(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function I(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function U(e,t,n){var r,o,i=0,s=0,a=0,l=0,c=0,u=0,d=0,f=0,h=0,p=0,g=0,m=0,y=0,w=0,C=0,v=0,E=0,b=0,S=0,x=0,_=0,T=0,O=0,R=0,A=0,N=0,$=0,M=0,L=0,P=0,k=0,I=n[0],B=n[1],U=n[2],D=n[3],W=n[4],j=n[5],K=n[6],H=n[7],F=n[8],V=n[9],q=n[10],G=n[11],z=n[12],Y=n[13],Q=n[14],J=n[15];i+=(r=t[0])*I,s+=r*B,a+=r*U,l+=r*D,c+=r*W,u+=r*j,d+=r*K,f+=r*H,h+=r*F,p+=r*V,g+=r*q,m+=r*G,y+=r*z,w+=r*Y,C+=r*Q,v+=r*J,s+=(r=t[1])*I,a+=r*B,l+=r*U,c+=r*D,u+=r*W,d+=r*j,f+=r*K,h+=r*H,p+=r*F,g+=r*V,m+=r*q,y+=r*G,w+=r*z,C+=r*Y,v+=r*Q,E+=r*J,a+=(r=t[2])*I,l+=r*B,c+=r*U,u+=r*D,d+=r*W,f+=r*j,h+=r*K,p+=r*H,g+=r*F,m+=r*V,y+=r*q,w+=r*G,C+=r*z,v+=r*Y,E+=r*Q,b+=r*J,l+=(r=t[3])*I,c+=r*B,u+=r*U,d+=r*D,f+=r*W,h+=r*j,p+=r*K,g+=r*H,m+=r*F,y+=r*V,w+=r*q,C+=r*G,v+=r*z,E+=r*Y,b+=r*Q,S+=r*J,c+=(r=t[4])*I,u+=r*B,d+=r*U,f+=r*D,h+=r*W,p+=r*j,g+=r*K,m+=r*H,y+=r*F,w+=r*V,C+=r*q,v+=r*G,E+=r*z,b+=r*Y,S+=r*Q,x+=r*J,u+=(r=t[5])*I,d+=r*B,f+=r*U,h+=r*D,p+=r*W,g+=r*j,m+=r*K,y+=r*H,w+=r*F,C+=r*V,v+=r*q,E+=r*G,b+=r*z,S+=r*Y,x+=r*Q,_+=r*J,d+=(r=t[6])*I,f+=r*B,h+=r*U,p+=r*D,g+=r*W,m+=r*j,y+=r*K,w+=r*H,C+=r*F,v+=r*V,E+=r*q,b+=r*G,S+=r*z,x+=r*Y,_+=r*Q,T+=r*J,f+=(r=t[7])*I,h+=r*B,p+=r*U,g+=r*D,m+=r*W,y+=r*j,w+=r*K,C+=r*H,v+=r*F,E+=r*V,b+=r*q,S+=r*G,x+=r*z,_+=r*Y,T+=r*Q,O+=r*J,h+=(r=t[8])*I,p+=r*B,g+=r*U,m+=r*D,y+=r*W,w+=r*j,C+=r*K,v+=r*H,E+=r*F,b+=r*V,S+=r*q,x+=r*G,_+=r*z,T+=r*Y,O+=r*Q,R+=r*J,p+=(r=t[9])*I,g+=r*B,m+=r*U,y+=r*D,w+=r*W,C+=r*j,v+=r*K,E+=r*H,b+=r*F,S+=r*V,x+=r*q,_+=r*G,T+=r*z,O+=r*Y,R+=r*Q,A+=r*J,g+=(r=t[10])*I,m+=r*B,y+=r*U,w+=r*D,C+=r*W,v+=r*j,E+=r*K,b+=r*H,S+=r*F,x+=r*V,_+=r*q,T+=r*G,O+=r*z,R+=r*Y,A+=r*Q,N+=r*J,m+=(r=t[11])*I,y+=r*B,w+=r*U,C+=r*D,v+=r*W,E+=r*j,b+=r*K,S+=r*H,x+=r*F,_+=r*V,T+=r*q,O+=r*G,R+=r*z,A+=r*Y,N+=r*Q,$+=r*J,y+=(r=t[12])*I,w+=r*B,C+=r*U,v+=r*D,E+=r*W,b+=r*j,S+=r*K,x+=r*H,_+=r*F,T+=r*V,O+=r*q,R+=r*G,A+=r*z,N+=r*Y,$+=r*Q,M+=r*J,w+=(r=t[13])*I,C+=r*B,v+=r*U,E+=r*D,b+=r*W,S+=r*j,x+=r*K,_+=r*H,T+=r*F,O+=r*V,R+=r*q,A+=r*G,N+=r*z,$+=r*Y,M+=r*Q,L+=r*J,C+=(r=t[14])*I,v+=r*B,E+=r*U,b+=r*D,S+=r*W,x+=r*j,_+=r*K,T+=r*H,O+=r*F,R+=r*V,A+=r*q,N+=r*G,$+=r*z,M+=r*Y,L+=r*Q,P+=r*J,v+=(r=t[15])*I,s+=38*(b+=r*U),a+=38*(S+=r*D),l+=38*(x+=r*W),c+=38*(_+=r*j),u+=38*(T+=r*K),d+=38*(O+=r*H),f+=38*(R+=r*F),h+=38*(A+=r*V),p+=38*(N+=r*q),g+=38*($+=r*G),m+=38*(M+=r*z),y+=38*(L+=r*Y),w+=38*(P+=r*Q),C+=38*(k+=r*J),i=(r=(i+=38*(E+=r*B))+(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)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),C=(r=C+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+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)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),C=(r=C+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+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]=f,e[8]=h,e[9]=p,e[10]=g,e[11]=m,e[12]=y,e[13]=w,e[14]=C,e[15]=v}function D(e,t){U(e,t,t)}function W(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)D(o,o),2!==r&&4!==r&&U(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function j(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)D(o,o),1!==r&&U(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function K(e,n,r){var o,i,s=new Uint8Array(32),l=new Float64Array(80),c=t(),u=t(),d=t(),f=t(),h=t(),p=t();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,k(l,r),i=0;i<16;i++)u[i]=l[i],f[i]=c[i]=d[i]=0;for(c[0]=f[0]=1,i=254;i>=0;--i)$(c,u,o=s[i>>>3]>>>(7&i)&1),$(d,f,o),I(h,c,d),B(c,c,d),I(d,u,f),B(u,u,f),D(f,h),D(p,c),U(c,d,c),U(d,u,h),I(h,c,d),B(c,c,d),D(u,c),B(d,f,p),U(c,d,a),I(c,c,f),U(d,d,c),U(c,f,p),U(f,u,l),D(u,h),$(c,u,o),$(d,f,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]=f[i];var g=l.subarray(32),m=l.subarray(16);return W(g,g),U(m,m,g),M(e,m),0}function H(e,t){return K(e,t,o)}function F(e,t){return n(t,32),H(e,t)}function V(e,t,n){var o=new Uint8Array(32);return K(o,n,t),w(e,r,o,C)}x.prototype.blocks=function(e,t,n){for(var r,o,i,s,a,l,c,u,d,f,h,p,g,m,y,w,C,v,E,b=this.fin?0:2048,S=this.h[0],x=this.h[1],_=this.h[2],T=this.h[3],O=this.h[4],R=this.h[5],A=this.h[6],N=this.h[7],$=this.h[8],M=this.h[9],L=this.r[0],P=this.r[1],k=this.r[2],I=this.r[3],B=this.r[4],U=this.r[5],D=this.r[6],W=this.r[7],j=this.r[8],K=this.r[9];n>=16;)f=d=0,f+=(S+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*L,f+=(x+=8191&(r>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*K),f+=(_+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*j),f+=(T+=8191&(i>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*W),d=(f+=(O+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,f&=8191,f+=(R+=a>>>1&8191)*(5*U),f+=(A+=8191&(a>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*B),f+=(N+=8191&(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*I),f+=($+=8191&(c>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*k),h=d+=(f+=(M+=u>>>5|b)*(5*P))>>>13,h+=S*P,h+=x*L,h+=_*(5*K),h+=T*(5*j),d=(h+=O*(5*W))>>>13,h&=8191,h+=R*(5*D),h+=A*(5*U),h+=N*(5*B),h+=$*(5*I),d+=(h+=M*(5*k))>>>13,h&=8191,p=d,p+=S*k,p+=x*P,p+=_*L,p+=T*(5*K),d=(p+=O*(5*j))>>>13,p&=8191,p+=R*(5*W),p+=A*(5*D),p+=N*(5*U),p+=$*(5*B),g=d+=(p+=M*(5*I))>>>13,g+=S*I,g+=x*k,g+=_*P,g+=T*L,d=(g+=O*(5*K))>>>13,g&=8191,g+=R*(5*j),g+=A*(5*W),g+=N*(5*D),g+=$*(5*U),m=d+=(g+=M*(5*B))>>>13,m+=S*B,m+=x*I,m+=_*k,m+=T*P,d=(m+=O*L)>>>13,m&=8191,m+=R*(5*K),m+=A*(5*j),m+=N*(5*W),m+=$*(5*D),y=d+=(m+=M*(5*U))>>>13,y+=S*U,y+=x*B,y+=_*I,y+=T*k,d=(y+=O*P)>>>13,y&=8191,y+=R*L,y+=A*(5*K),y+=N*(5*j),y+=$*(5*W),w=d+=(y+=M*(5*D))>>>13,w+=S*D,w+=x*U,w+=_*B,w+=T*I,d=(w+=O*k)>>>13,w&=8191,w+=R*P,w+=A*L,w+=N*(5*K),w+=$*(5*j),C=d+=(w+=M*(5*W))>>>13,C+=S*W,C+=x*D,C+=_*U,C+=T*B,d=(C+=O*I)>>>13,C&=8191,C+=R*k,C+=A*P,C+=N*L,C+=$*(5*K),v=d+=(C+=M*(5*j))>>>13,v+=S*j,v+=x*W,v+=_*D,v+=T*U,d=(v+=O*B)>>>13,v&=8191,v+=R*I,v+=A*k,v+=N*P,v+=$*L,E=d+=(v+=M*(5*K))>>>13,E+=S*K,E+=x*j,E+=_*W,E+=T*D,d=(E+=O*U)>>>13,E&=8191,E+=R*B,E+=A*I,E+=N*k,E+=$*P,S=f=8191&(d=(d=((d+=(E+=M*L)>>>13)<<2)+d|0)+(f&=8191)|0),x=h+=d>>>=13,_=p&=8191,T=g&=8191,O=m&=8191,R=y&=8191,A=w&=8191,N=C&=8191,$=v&=8191,M=E&=8191,t+=16,n-=16;this.h[0]=S,this.h[1]=x,this.h[2]=_,this.h[3]=T,this.h[4]=O,this.h[5]=R,this.h[6]=A,this.h[7]=N,this.h[8]=$,this.h[9]=M},x.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},x.prototype.update=function(e,t,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r<o;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(e,t,o),t+=o,n-=o),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};var q=O,G=R;var z=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,n,r){for(var o,i,s,a,l,c,u,d,f,h,p,g,m,y,w,C,v,E,b,S,x,_,T,O,R,A,N=new Int32Array(16),$=new Int32Array(16),M=e[0],L=e[1],P=e[2],k=e[3],I=e[4],B=e[5],U=e[6],D=e[7],W=t[0],j=t[1],K=t[2],H=t[3],F=t[4],V=t[5],q=t[6],G=t[7],Y=0;r>=128;){for(b=0;b<16;b++)S=8*b+Y,N[b]=n[S+0]<<24|n[S+1]<<16|n[S+2]<<8|n[S+3],$[b]=n[S+4]<<24|n[S+5]<<16|n[S+6]<<8|n[S+7];for(b=0;b<80;b++)if(o=M,i=L,s=P,a=k,l=I,c=B,u=U,D,f=W,h=j,p=K,g=H,m=F,y=V,w=q,G,T=65535&(_=G),O=_>>>16,R=65535&(x=D),A=x>>>16,T+=65535&(_=(F>>>14|I<<18)^(F>>>18|I<<14)^(I>>>9|F<<23)),O+=_>>>16,R+=65535&(x=(I>>>14|F<<18)^(I>>>18|F<<14)^(F>>>9|I<<23)),A+=x>>>16,T+=65535&(_=F&V^~F&q),O+=_>>>16,R+=65535&(x=I&B^~I&U),A+=x>>>16,T+=65535&(_=z[2*b+1]),O+=_>>>16,R+=65535&(x=z[2*b]),A+=x>>>16,x=N[b%16],O+=(_=$[b%16])>>>16,R+=65535&x,A+=x>>>16,R+=(O+=(T+=65535&_)>>>16)>>>16,T=65535&(_=E=65535&T|O<<16),O=_>>>16,R=65535&(x=v=65535&R|(A+=R>>>16)<<16),A=x>>>16,T+=65535&(_=(W>>>28|M<<4)^(M>>>2|W<<30)^(M>>>7|W<<25)),O+=_>>>16,R+=65535&(x=(M>>>28|W<<4)^(W>>>2|M<<30)^(W>>>7|M<<25)),A+=x>>>16,O+=(_=W&j^W&K^j&K)>>>16,R+=65535&(x=M&L^M&P^L&P),A+=x>>>16,d=65535&(R+=(O+=(T+=65535&_)>>>16)>>>16)|(A+=R>>>16)<<16,C=65535&T|O<<16,T=65535&(_=g),O=_>>>16,R=65535&(x=a),A=x>>>16,O+=(_=E)>>>16,R+=65535&(x=v),A+=x>>>16,L=o,P=i,k=s,I=a=65535&(R+=(O+=(T+=65535&_)>>>16)>>>16)|(A+=R>>>16)<<16,B=l,U=c,D=u,M=d,j=f,K=h,H=p,F=g=65535&T|O<<16,V=m,q=y,G=w,W=C,b%16==15)for(S=0;S<16;S++)x=N[S],T=65535&(_=$[S]),O=_>>>16,R=65535&x,A=x>>>16,x=N[(S+9)%16],T+=65535&(_=$[(S+9)%16]),O+=_>>>16,R+=65535&x,A+=x>>>16,v=N[(S+1)%16],T+=65535&(_=((E=$[(S+1)%16])>>>1|v<<31)^(E>>>8|v<<24)^(E>>>7|v<<25)),O+=_>>>16,R+=65535&(x=(v>>>1|E<<31)^(v>>>8|E<<24)^v>>>7),A+=x>>>16,v=N[(S+14)%16],O+=(_=((E=$[(S+14)%16])>>>19|v<<13)^(v>>>29|E<<3)^(E>>>6|v<<26))>>>16,R+=65535&(x=(v>>>19|E<<13)^(E>>>29|v<<3)^v>>>6),A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,N[S]=65535&R|A<<16,$[S]=65535&T|O<<16;T=65535&(_=W),O=_>>>16,R=65535&(x=M),A=x>>>16,x=e[0],O+=(_=t[0])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[0]=M=65535&R|A<<16,t[0]=W=65535&T|O<<16,T=65535&(_=j),O=_>>>16,R=65535&(x=L),A=x>>>16,x=e[1],O+=(_=t[1])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[1]=L=65535&R|A<<16,t[1]=j=65535&T|O<<16,T=65535&(_=K),O=_>>>16,R=65535&(x=P),A=x>>>16,x=e[2],O+=(_=t[2])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[2]=P=65535&R|A<<16,t[2]=K=65535&T|O<<16,T=65535&(_=H),O=_>>>16,R=65535&(x=k),A=x>>>16,x=e[3],O+=(_=t[3])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[3]=k=65535&R|A<<16,t[3]=H=65535&T|O<<16,T=65535&(_=F),O=_>>>16,R=65535&(x=I),A=x>>>16,x=e[4],O+=(_=t[4])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[4]=I=65535&R|A<<16,t[4]=F=65535&T|O<<16,T=65535&(_=V),O=_>>>16,R=65535&(x=B),A=x>>>16,x=e[5],O+=(_=t[5])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[5]=B=65535&R|A<<16,t[5]=V=65535&T|O<<16,T=65535&(_=q),O=_>>>16,R=65535&(x=U),A=x>>>16,x=e[6],O+=(_=t[6])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[6]=U=65535&R|A<<16,t[6]=q=65535&T|O<<16,T=65535&(_=G),O=_>>>16,R=65535&(x=D),A=x>>>16,x=e[7],O+=(_=t[7])>>>16,R+=65535&x,A+=x>>>16,A+=(R+=(O+=(T+=65535&_)>>>16)>>>16)>>>16,e[7]=D=65535&R|A<<16,t[7]=G=65535&T|O<<16,Y+=128,r-=128}return r}function Q(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,Y(o,i,t,n),n%=128,r=0;r<n;r++)s[r]=t[a-n+r];for(s[n]=128,s[(n=256-128*(n<112?1:0))-9]=0,h(s,n-8,a/536870912|0,a<<3),Y(o,i,s,n),r=0;r<8;r++)h(e,8*r,o[r],i[r]);return 0}function J(e,n){var r=t(),o=t(),i=t(),s=t(),a=t(),l=t(),u=t(),d=t(),f=t();B(r,e[1],e[0]),B(f,n[1],n[0]),U(r,r,f),I(o,e[0],e[1]),I(f,n[0],n[1]),U(o,o,f),U(i,e[3],n[3]),U(i,i,c),U(s,e[2],n[2]),I(s,s,s),B(a,o,r),B(l,s,i),I(u,s,i),I(d,o,r),U(e[0],a,l),U(e[1],d,u),U(e[2],u,l),U(e[3],a,d)}function X(e,t,n){var r;for(r=0;r<4;r++)$(e[r],t[r],n)}function Z(e,n){var r=t(),o=t(),i=t();W(i,n[2]),U(r,n[0],i),U(o,n[1],i),M(e,o),e[31]^=P(r)<<7}function ee(e,t,n){var r,o;for(A(e[0],i),A(e[1],s),A(e[2],s),A(e[3],i),o=255;o>=0;--o)X(e,t,r=n[o/8|0]>>(7&o)&1),J(t,e),J(e,e),X(e,t,r)}function te(e,n){var r=[t(),t(),t(),t()];A(r[0],u),A(r[1],d),A(r[2],s),U(r[3],u,d),ee(e,r,n)}function ne(e,r,o){var i,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(r,32),Q(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,te(a,s),Z(e,a),i=0;i<32;i++)r[i+32]=e[i];return 0}var re=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o<i;++o)t[o]+=n-16*t[r]*re[o-(r-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[r]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*re[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*re[o];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function ie(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;oe(e,n)}function se(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()];Q(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(i=0;i<r;i++)e[64+i]=n[i];for(i=0;i<32;i++)e[32+i]=a[32+i];for(Q(c,e.subarray(32),r+32),ie(c),te(d,c),Z(e,d),i=32;i<64;i++)e[i]=o[i];for(Q(l,e,r+64),ie(l),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=c[i];for(i=0;i<32;i++)for(s=0;s<32;s++)u[i+s]+=l[i]*a[s];return oe(e.subarray(32),u),f}function ae(e,n,r,o){var a,c=new Uint8Array(32),u=new Uint8Array(64),d=[t(),t(),t(),t()],h=[t(),t(),t(),t()];if(r<64)return-1;if(function(e,n){var r=t(),o=t(),a=t(),c=t(),u=t(),d=t(),h=t();return A(e[2],s),k(e[1],n),D(a,e[1]),U(c,a,l),B(a,a,e[2]),I(c,e[2],c),D(u,c),D(d,u),U(h,d,u),U(r,h,a),U(r,r,c),j(r,r),U(r,r,a),U(r,r,c),U(r,r,c),U(e[0],r,c),D(o,e[0]),U(o,o,c),L(o,a)&&U(e[0],e[0],f),D(o,e[0]),U(o,o,c),L(o,a)?-1:(P(e[0])===n[31]>>7&&B(e[0],i,e[0]),U(e[3],e[0],e[1]),0)}(h,o))return-1;for(a=0;a<r;a++)e[a]=n[a];for(a=0;a<32;a++)e[a+32]=o[a];if(Q(u,e,r),ie(u),ee(d,h,u),te(h,n.subarray(32)),J(d,h),Z(c,d),r-=64,m(n,0,c,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=n[a+64];return r}var le=16,ce=64,ue=32,de=64;function fe(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function he(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:S,crypto_stream:b,crypto_stream_salsa20_xor:v,crypto_stream_salsa20:E,crypto_onetimeauth:_,crypto_onetimeauth_verify:T,crypto_verify_16:g,crypto_verify_32:m,crypto_secretbox:O,crypto_secretbox_open:R,crypto_scalarmult:K,crypto_scalarmult_base:H,crypto_box_beforenm:V,crypto_box_afternm:q,crypto_box:function(e,t,n,r,o,i){var s=new Uint8Array(32);return V(s,o,i),q(e,t,n,r,s)},crypto_box_open:function(e,t,n,r,o,i){var s=new Uint8Array(32);return V(s,o,i),G(e,t,n,r,s)},crypto_box_keypair:F,crypto_hash:Q,crypto_sign:se,crypto_sign_keypair:ne,crypto_sign_open:ae,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:le,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ce,crypto_sign_PUBLICKEYBYTES:ue,crypto_sign_SECRETKEYBYTES:de,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:l,L:re,pack25519:M,unpack25519:k,M:U,A:I,S:D,Z:B,pow2523:j,add:J,set25519:A,modL:oe,scalarmult:ee,scalarbase:te},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){he(e,t,n),fe(n,t);for(var r=new Uint8Array(32+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+32]=e[i];return O(o,r,r.length,t,n),o.subarray(le)},e.secretbox.open=function(e,t,n){he(e,t,n),fe(n,t);for(var r=new Uint8Array(le+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+le]=e[i];return r.length<32||0!==R(o,r,r.length,t,n)?null:o.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=le,e.scalarMult=function(e,t){if(he(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return K(n,e,t),n},e.scalarMult.base=function(e){if(he(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox(t,n,i)},e.box.before=function(e,t){he(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return V(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox.open(t,n,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return F(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(he(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(he(e,t),t.length!==de)throw new Error("bad secret key size");var n=new Uint8Array(ce+e.length);return se(n,e,e.length,t),n},e.sign.open=function(e,t){if(he(e,t),t.length!==ue)throw new Error("bad public key size");var n=new Uint8Array(e.length),r=ae(n,e,e.length,t);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},e.sign.detached=function(t,n){for(var r=e.sign(t,n),o=new Uint8Array(ce),i=0;i<o.length;i++)o[i]=r[i];return o},e.sign.detached.verify=function(e,t,n){if(he(e,t,n),t.length!==ce)throw new Error("bad signature size");if(n.length!==ue)throw new Error("bad public key size");var r,o=new Uint8Array(ce+e.length),i=new Uint8Array(ce+e.length);for(r=0;r<ce;r++)o[r]=t[r];for(r=0;r<e.length;r++)o[r+ce]=e[r];return ae(i,o,o.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(ue),t=new Uint8Array(de);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(ue),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(he(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(ue),n=new Uint8Array(de),r=0;r<32;r++)n[r]=e[r];return ne(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=ue,e.sign.secretKeyLength=de,e.sign.seedLength=32,e.sign.signatureLength=ce,e.hash=function(e){he(e);var t=new Uint8Array(64);return Q(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return he(e,t),0!==e.length&&0!==t.length&&(e.length===t.length&&0===p(e,0,t,0,e.length))},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,n){var r,o=new Uint8Array(n);for(r=0;r<n;r+=65536)t.getRandomValues(o.subarray(r,r+Math.min(n-r,65536)));for(r=0;r<n;r++)e[r]=o[r];pe(o)}))}else void 0!==commonjsRequire&&(t=require$$0)&&t.randomBytes&&e.setPRNG((function(e,n){var r,o=t.randomBytes(n);for(r=0;r<n;r++)e[r]=o[r];pe(o)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})}(naclFast);const nacl=naclFast.exports;if(isNode$1())try{eval("global.crypto = require('crypto').webcrypto")}catch(err){}class SessionCrypto{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=toHexString(this.keyPair.publicKey)}createKeypair(){return nacl.box.keyPair()}createKeypairFromString(e){return{publicKey:hexToByteArray(e.publicKey),secretKey:hexToByteArray(e.secretKey)}}createNonce(){const e=new Uint8Array(this.nonceLength);return crypto.getRandomValues(e)}encrypt(e,t){const n=(new TextEncoder).encode(e),r=this.createNonce();return concatUint8Arrays(r,nacl.box(n,r,t,this.keyPair.secretKey))}decrypt(e,t){const[n,r]=splitToUint8Arrays(e,this.nonceLength),o=nacl.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:toHexString(this.keyPair.publicKey),secretKey:toHexString(this.keyPair.secretKey)}}}const connectEventErrorsCodes={[CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:ManifestNotFoundError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:ManifestContentErrorError};class ConnectErrorsParser{parseError(e){let t=UnknownError;return e.code in connectEventErrorsCodes&&(t=connectEventErrorsCodes[e.code]||UnknownError),new t(e.message)}}const connectErrorsParser=new ConnectErrorsParser;class RpcParser{isError(e){return"error"in e}}const sendTransactionErrors={[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SendTransactionParser extends RpcParser{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=UnknownError;throw e.error.code in sendTransactionErrors&&(t=sendTransactionErrors[e.error.code]||UnknownError),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}}const sendTransactionParser=new SendTransactionParser;var __awaiter$7=globalThis&&globalThis.__awaiter||function(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 HttpBridgeGatewayStorage{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway"}storeLastEventId(e){return __awaiter$7(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return __awaiter$7(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return __awaiter$7(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e||null}))}}function removeUrlLastSlash(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function addPathToUrl(e,t){return removeUrlLastSlash(e)+"/"+t}var __awaiter$6=globalThis&&globalThis.__awaiter||function(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())}))};if(isNode$1())try{eval("global.EventSource = require('eventsource')"),eval("global.fetch = require('node-fetch')")}catch(err){console.error(err)}class BridgeGateway{constructor(e,t,n,r,o){this.bridgeUrl=t,this.sessionId=n,this.listener=r,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.isClosed=!1,this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(e)}registerSession(){return __awaiter$6(this,void 0,void 0,(function*(){const e=new URL(addPathToUrl(this.bridgeUrl,this.ssePath));e.searchParams.append("client_id",this.sessionId);const t=yield this.bridgeGatewayStorage.getLastEventId();return t&&e.searchParams.append("last_event_id",t),this.eventSource=new EventSource(e.toString()),new Promise(((e,t)=>{this.eventSource.onerror=t,this.eventSource.onopen=()=>{this.eventSource.onerror=this.errorsHandler.bind(this),this.eventSource.onmessage=this.messagesHandler.bind(this),e()}}))}))}send(e,t,n){return __awaiter$6(this,void 0,void 0,(function*(){const r=new URL(addPathToUrl(this.bridgeUrl,this.postPath));r.searchParams.append("client_id",this.sessionId),r.searchParams.append("to",t),r.searchParams.append("ttl",(n||this.defaultTtl).toString()),yield fetch(r,{method:"post",body:Base64.encode(e)})}))}close(){var e;this.isClosed=!0,null===(e=this.eventSource)||void 0===e||e.close()}errorsHandler(e){var t,n;if(!this.isClosed){if((null===(t=this.eventSource)||void 0===t?void 0:t.readyState)===EventSource.CLOSED)return this.eventSource.close(),void this.registerSession();if((null===(n=this.eventSource)||void 0===n?void 0:n.readyState)===EventSource.CONNECTING)return void console.debug("[TON_CONNET_SDK_ERROR]: Bridge error",JSON.stringify(e));this.errorsListener(e)}}messagesHandler(e){return __awaiter$6(this,void 0,void 0,(function*(){if(e.data!==this.heartbeatMessage&&(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),!this.isClosed)){let n;try{n=JSON.parse(e.data)}catch(t){throw new TonConnectError(`Bridge message parse failed, message ${t.data}`)}this.listener(n)}}))}}var __awaiter$5=globalThis&&globalThis.__awaiter||function(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 BridgeConnectionStorage{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return __awaiter$5(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,walletConnectionSource:e.session.walletConnectionSource},n={type:"http",connectEvent:e.connectEvent,session:t};return this.storage.setItem(this.storeKey,JSON.stringify(n))}))}removeConnection(){return __awaiter$5(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return __awaiter$5(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;const n=new SessionCrypto(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,session:{sessionCrypto:n,walletConnectionSource:t.session.walletConnectionSource,walletPublicKey:t.session.walletPublicKey}}}))}getHttpConnection(){return __awaiter$5(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return e}))}getInjectedConnection(){return __awaiter$5(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return __awaiter$5(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type}))}}const PROTOCOL_VERSION=2;var __awaiter$4=globalThis&&globalThis.__awaiter||function(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 BridgeProvider{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="https://connect.ton.org",this.pendingRequests=new Map,this.nextRequestId=0,this.session=null,this.bridge=null,this.pendingBridges=[],this.listeners=[],this.connectionStorage=new BridgeConnectionStorage(e)}static fromStorage(e){return __awaiter$4(this,void 0,void 0,(function*(){const t=new BridgeConnectionStorage(e),n=yield t.getHttpConnection();return new BridgeProvider(e,n.session.walletConnectionSource)}))}connect(e){this.closeBridges();const t=new SessionCrypto;let n={universalLink:this.standardUniversalLink,bridgeUrl:""};return Array.isArray(this.walletConnectionSource)?(this.pendingBridges=this.walletConnectionSource.map((e=>new BridgeGateway(this.storage,e,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)))),this.pendingBridges.forEach((e=>e.registerSession()))):(n=this.walletConnectionSource,this.bridge=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),this.bridge.registerSession()),this.session={sessionCrypto:t,walletConnectionSource:n},this.generateUniversalLink(n.universalLink,e)}restoreConnection(){return __awaiter$4(this,void 0,void 0,(function*(){if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");this.closeBridges();const e=yield this.connectionStorage.getHttpConnection();e&&(this.session=e.session,this.bridge=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,e.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.bridge.registerSession(),this.listeners.forEach((t=>t(e.connectEvent))))}))}sendRequest(e){return new Promise(((t,n)=>{const r=this.nextRequestId;if(this.nextRequestId++,!this.bridge||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const o=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:r})),hexToByteArray(this.session.walletPublicKey));this.bridge.send(o,this.session.walletPublicKey).catch(n),this.pendingRequests.set(r.toString(),t)}))}closeConnection(){this.closeBridges(),this.listeners=[],this.session=null,this.bridge=null}disconnect(){return this.closeBridges(),this.listeners=[],this.removeBridgeAndSession()}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pendingGatewaysListener(e,t){return __awaiter$4(this,void 0,void 0,(function*(){if(this.pendingBridges.includes(e))return this.closeBridges(),this.session.walletConnectionSource.bridgeUrl=e.bridgeUrl,this.bridge=e,this.gatewayListener(t);e.close()}))}gatewayListener(e){return __awaiter$4(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(e.message).toUint8Array(),hexToByteArray(e.from)));if(!("event"in t)){const e=t.id.toString(),n=this.pendingRequests.get(e);if(!n)throw new TonConnectError(`Response id ${e} doesn't match any request's id`);return n(t),void this.pendingRequests.delete(e)}"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(yield this.removeBridgeAndSession()),this.listeners.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return __awaiter$4(this,void 0,void 0,(function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return __awaiter$4(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,connectEvent:r})}))}removeBridgeAndSession(){return __awaiter$4(this,void 0,void 0,(function*(){this.session=null,this.bridge=null,yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){const n=new URL(e);return n.searchParams.append("v",PROTOCOL_VERSION.toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(t)),n.toString()}closeBridges(e){var t;null===(t=this.bridge)||void 0===t||t.close(),this.pendingBridges.filter((t=>t!==e)).forEach((e=>e.close())),this.pendingBridges=[]}}function getWindow$1(){if("undefined"!=typeof window)return window}function getWebPageManifest(){var e;const t=null===(e=getWindow$1())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}var __awaiter$3=globalThis&&globalThis.__awaiter||function(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 InjectedProvider{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(n,t))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(e),this.injectedWallet=n[t].tonconnect}static fromStorage(e){return __awaiter$3(this,void 0,void 0,(function*(){const t=new BridgeConnectionStorage(e),n=yield t.getInjectedConnection();return new InjectedProvider(e,n.jsBridgeKey)}))}static isWalletInjected(e){return InjectedProvider.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!InjectedProvider.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(PROTOCOL_VERSION,e)}restoreConnection(){return __awaiter$3(this,void 0,void 0,(function*(){try{const e=yield this.injectedWallet.restoreConnection();"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 this.closeAllListeners(),this.injectedWallet.disconnect(),this.connectionStorage.removeConnection()}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){return __awaiter$3(this,void 0,void 0,(function*(){return this.injectedWallet.send(Object.assign(Object.assign({},e),{id:"0"}))}))}_connect(e,t){return __awaiter$3(this,void 0,void 0,(function*(){try{const n=yield this.injectedWallet.connect(e,t);"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(n)))}catch(n){console.debug(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=>{this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey})}}InjectedProvider.window=getWindow$1();var __awaiter$2=globalThis&&globalThis.__awaiter||function(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 DefaultStorage{constructor(){const e=getWindow$1();if(!(null==e?void 0:e.localStorage))throw new LocalstorageNotFoundError;this.window=e}getItem(e){return __awaiter$2(this,void 0,void 0,(function*(){return Promise.resolve(this.window.localStorage.getItem(e))}))}removeItem(e){return __awaiter$2(this,void 0,void 0,(function*(){return this.window.localStorage.removeItem(e),Promise.resolve()}))}setItem(e,t){return this.window.localStorage.setItem(e,t),Promise.resolve()}}function isWalletInfoInjected(e){return"jsBridgeKey"in e}var __awaiter$1=globalThis&&globalThis.__awaiter||function(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 WalletsListManager{constructor(e){this.walletsListCache=null,this.walletsListSource="https://raw.githubusercontent.com/ton-connect/wallets-list/main/wallets.json",e&&(this.walletsListSource=e)}getWallets(){return __awaiter$1(this,void 0,void 0,(function*(){return this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.catch((()=>this.walletsListCache=null))),this.walletsListCache}))}getEmbeddedWallet(){return __awaiter$1(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter((e=>isWalletInfoInjected(e)&&e.embedded));return 1!==e.length?null:e[0]}))}fetchWalletsList(){return __awaiter$1(this,void 0,void 0,(function*(){try{const e=yield fetch(this.walletsListSource),t=yield e.json();if(!Array.isArray(t)||!t.every((e=>this.isCorrectWalletConfigDTO(e))))throw new FetchWalletsError("Wrong wallets list format");return this.walletConfigDTOListToWalletConfigList(t)}catch(e){throw new FetchWalletsError(e)}}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns};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=InjectedProvider.isWalletInjected(e),t.embedded=InjectedProvider.isInsideWalletBrowser(e)}})),t}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e)||!("image"in e)||!("about_url"in e))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)}}var __awaiter=globalThis&&globalThis.__awaiter||function(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())}))},__rest=globalThis&&globalThis.__rest||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<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class TonConnect{constructor(e){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||getWebPageManifest(),storage:(null==e?void 0:e.storage)||new DefaultStorage},this.walletsList=new WalletsListManager(null==e?void 0:e.walletsListSource),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage)}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(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;if(this.connected)throw new WalletAlreadyConnectedError;return null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=this.createProvider(e),this.provider.connect(this.createConnectRequest(t))}restoreConnection(){return __awaiter(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);switch(e){case"http":this.provider=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":this.provider=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(!t)return;this.provider=yield this.createProvider(t)}return this.provider.listen(this.walletEventsListener.bind(this)),this.provider.restoreConnection()}))}sendTransaction(e){return __awaiter(this,void 0,void 0,(function*(){this.checkConnection(),this.checkFeatureSupport("SendTransaction");const{validUntil:t}=e,n=__rest(e,["validUntil"]),r=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},n),{valid_until:t})));return sendTransactionParser.isError(r)?sendTransactionParser.parseAndThrowError(r):sendTransactionParser.convertFromRpcResponse(r)}))}disconnect(){return __awaiter(this,void 0,void 0,(function*(){if(!this.connected)throw new WalletNotConnectedError;yield this.provider.disconnect(),this.onWalletDisconnected()}))}createProvider(e){let t;return t=!Array.isArray(e)&&isWalletConnectionSourceJS(e)?new InjectedProvider(this.dappSettings.storage,e.jsBridgeKey):new BridgeProvider(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 TonConnectError("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}};n&&(r.connectItems={tonProof:n}),this.wallet=r}onWalletConnectError(e){const t=connectErrorsParser.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),console.debug(t),t instanceof ManifestNotFoundError||t instanceof ManifestContentErrorError)throw console.error(t),t}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}checkFeatureSupport(e){var t;if(!(null===(t=this.wallet)||void 0===t?void 0:t.device.features.includes(e)))throw new WalletNotSupportFeatureError}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}}}TonConnect.walletsList=new WalletsListManager,TonConnect.isWalletInjected=e=>InjectedProvider.isWalletInjected(e),TonConnect.isInsideWalletBrowser=e=>InjectedProvider.isInsideWalletBrowser(e);const bounceableTag=17,testOnlyTag=128;function toUserFriendlyAddress(e,t=!1){const{wc:n,hex:r}=parseHexAddress(e);let o=bounceableTag;t&&(o|=testOnlyTag);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(crc16(i),34),Base64.encode(s).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(e){if(!e.includes(":"))throw new WrongAddressError(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new WrongAddressError(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new WrongAddressError(`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 WrongAddressError(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:hexToBytes(r)}}function crc16(e){let t=0;const n=new Uint8Array(e.length+2);n.set(e);for(let r of n){let e=128;for(;e>0;)t<<=1,r&e&&(t+=1),e>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}const toByteMap={};for(let r=0;r<=255;r++){let e=r.toString(16);e.length<2&&(e="0"+e),toByteMap[e]=r}function hexToBytes(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new ParseHexError("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o<n;o++){const t=2*o,n=e.substring(t,t+2);if(!toByteMap.hasOwnProperty(n))throw new ParseHexError("Invalid hex character: "+n);r[o]=toByteMap[n]}return r}const sharedConfig={};function setHydrateContext(e){sharedConfig.context=e}const equalFn=(e,t)=>e===t,$PROXY=Symbol("solid-proxy"),$TRACK=Symbol("solid-track"),signalOptions={equals:equalFn};let runEffects=runQueue;const STALE=1,PENDING=2,UNOWNED={owned:null,cleanups:null,context:null,owner:null},NO_INIT={};var Owner=null;let Transition$1=null,Listener=null,Updates=null,Effects=null,ExecCount=0,SuspenseContext;function createRoot(e,t){const n=Listener,r=Owner,o=0===e.length,i=o?UNOWNED:{owned:null,cleanups:null,context:null,owner:t||r},s=o?e:()=>e((()=>untrack((()=>cleanNode(i)))));Owner=i,Listener=null;try{return runUpdates(s,!0)}finally{Listener=n,Owner=r}}function createSignal(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},signalOptions,t):signalOptions).equals||void 0};return[readSignal.bind(n),e=>("function"==typeof e&&(e=e(n.value)),writeSignal(n,e))]}function createComputed(e,t,n){updateComputation(createComputation(e,t,!0,STALE))}function createRenderEffect(e,t,n){updateComputation(createComputation(e,t,!1,STALE))}function createEffect(e,t,n){runEffects=runUserEffects;const r=createComputation(e,t,!1,STALE);r.user=!0,Effects?Effects.push(r):updateComputation(r)}function createMemo(e,t,n){n=n?Object.assign({},signalOptions,n):signalOptions;const r=createComputation(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,updateComputation(r),readSignal.bind(r)}function createResource(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=NO_INIT,l=null,c=!1,u="initialValue"in i,d="function"==typeof r&&createMemo(r);const f=new Set,[h,p]=(i.storage||createSignal)(i.initialValue),[g,m]=createSignal(void 0),[y,w]=createSignal(void 0,{equals:!1}),[C,v]=createSignal(u?"ready":"unresolved");if(sharedConfig.context){let e;l=`${sharedConfig.context.id}${sharedConfig.context.count++}`,"initial"===i.ssrLoadFrom?a=i.initialValue:sharedConfig.load&&(e=sharedConfig.load(l))&&(a=e[0])}function E(e,t,n,r){return s===e&&(s=null,u=!0,e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(r,{value:t}))),a=NO_INIT,b(t,n)),t}function b(e,t){runUpdates((()=>{t||p((()=>e)),v(t?"errored":"ready"),m(t);for(const e of f.keys())e.decrement();f.clear()}),!1)}function S(){const e=SuspenseContext,t=h(),n=g();if(n&&!s)throw n;return Listener&&!Listener.user&&e&&createComputed((()=>{y(),s&&(e.resolved||f.has(e)||(e.increment(),f.add(e)))})),t}function x(e=!0){if(!1!==e&&c)return;c=!1;const t=d?d():r;if(null==t||!1===t)return void E(s,untrack(h));const n=a!==NO_INIT?a:untrack((()=>o(t,{value:h(),refetching:e})));return"object"==typeof n&&n&&"then"in n?(s=n,c=!0,queueMicrotask((()=>c=!1)),runUpdates((()=>{v(u?"refreshing":"pending"),w()}),!1),n.then((e=>E(n,e,void 0,t)),(e=>E(n,void 0,castError(e),t)))):(E(s,n,void 0,t),n)}return Object.defineProperties(S,{state:{get:()=>C()},error:{get:()=>g()},loading:{get(){const e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return S();const e=g();if(e&&!s)throw e;return h()}}}),d?createComputed((()=>x(!1))):x(!1),[S,{refetch:x,mutate:p}]}function batch(e){return runUpdates(e,!1)}function untrack(e){const t=Listener;Listener=null;try{return e()}finally{Listener=t}}function on(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;t<e.length;t++)s[t]=e[t]()}else s=e();if(i)return void(i=!1);const a=untrack((()=>t(s,o,n)));return o=s,a}}function onMount(e){createEffect((()=>untrack(e)))}function onCleanup(e){return null===Owner||(null===Owner.cleanups?Owner.cleanups=[e]:Owner.cleanups.push(e)),e}function getListener(){return Listener}function createContext(e,t){const n=Symbol("context");return{id:n,Provider:createProvider(n),defaultValue:e}}function useContext(e){let t;return void 0!==(t=lookup(Owner,e.id))?t:e.defaultValue}function children(e){const t=createMemo(e),n=createMemo((()=>resolveChildren(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function readSignal(){const e=Transition$1;if(this.sources&&(this.state||e))if(this.state===STALE||e)updateComputation(this);else{const e=Updates;Updates=null,runUpdates((()=>lookUpstream(this)),!1),Updates=e}if(Listener){const e=this.observers?this.observers.length:0;Listener.sources?(Listener.sources.push(this),Listener.sourceSlots.push(e)):(Listener.sources=[this],Listener.sourceSlots=[e]),this.observers?(this.observers.push(Listener),this.observerSlots.push(Listener.sources.length-1)):(this.observers=[Listener],this.observerSlots=[Listener.sources.length-1])}return this.value}function writeSignal(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&runUpdates((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=Transition$1&&Transition$1.running;r&&Transition$1.disposed.has(n),(r&&!n.tState||!r&&!n.state)&&(n.pure?Updates.push(n):Effects.push(n),n.observers&&markDownstream(n)),r||(n.state=STALE)}if(Updates.length>1e6)throw Updates=[],new Error}),!1)),t}function updateComputation(e){if(!e.fn)return;cleanNode(e);const t=Owner,n=Listener,r=ExecCount;Listener=Owner=e,runComputation(e,e.value,r),Listener=n,Owner=t}function runComputation(e,t,n){let r;try{r=e.fn(t)}catch(err){e.pure&&(e.state=STALE),handleError(err)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?writeSignal(e,r):e.value=r,e.updatedAt=n)}function createComputation(e,t,n,r=STALE,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Owner,context:null,pure:n};return null===Owner||Owner!==UNOWNED&&(Owner.owned?Owner.owned.push(i):Owner.owned=[i]),i}function runTop(e){const t=Transition$1;if(0===e.state||t)return;if(e.state===PENDING||t)return lookUpstream(e);if(e.suspense&&untrack(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ExecCount);)(e.state||t)&&n.push(e);for(let r=n.length-1;r>=0;r--)if((e=n[r]).state===STALE||t)updateComputation(e);else if(e.state===PENDING||t){const t=Updates;Updates=null,runUpdates((()=>lookUpstream(e,n[0])),!1),Updates=t}}function runUpdates(e,t){if(Updates)return e();let n=!1;t||(Updates=[]),Effects?n=!0:Effects=[],ExecCount++;try{const t=e();return completeUpdates(n),t}catch(err){Updates||(Effects=null),handleError(err)}}function completeUpdates(e){if(Updates&&(runQueue(Updates),Updates=null),e)return;const t=Effects;Effects=null,t.length&&runUpdates((()=>runEffects(t)),!1)}function runQueue(e){for(let t=0;t<e.length;t++)runTop(e[t])}function runUserEffects(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:runTop(r)}for(sharedConfig.context&&setHydrateContext(),t=0;t<n;t++)runTop(e[t])}function lookUpstream(e,t){const n=Transition$1;e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];o.sources&&(o.state===STALE||n?o!==t&&runTop(o):(o.state===PENDING||n)&&lookUpstream(o,t))}}function markDownstream(e){const t=Transition$1;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];r.state&&!t||(r.state=PENDING,r.pure?Updates.push(r):Effects.push(r),r.observers&&markDownstream(r))}}function cleanNode(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)cleanNode(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function castError(e){return e instanceof Error||"string"==typeof e?e:new Error("Unknown error")}function handleError(e){throw e=castError(e)}function lookup(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:lookup(e.owner,t):void 0}function resolveChildren(e){if("function"==typeof e&&!e.length)return resolveChildren(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=resolveChildren(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function createProvider(e,t){return function(t){let n;return createRenderEffect((()=>n=untrack((()=>(Owner.context={[e]:t.value},children((()=>t.children)))))),void 0),n}}const FALLBACK=Symbol("fallback");function dispose(e){for(let t=0;t<e.length;t++)e[t]()}function mapArray(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return onCleanup((()=>dispose(i))),()=>{let l,c,u=e()||[];return u[$TRACK],untrack((()=>{let e,t,f,h,p,g,m,y,w,C=u.length;if(0===C)0!==s&&(dispose(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[FALLBACK],o[0]=createRoot((e=>(i[0]=e,n.fallback()))),s=1);else if(0===s){for(o=new Array(C),c=0;c<C;c++)r[c]=u[c],o[c]=createRoot(d);s=C}else{for(f=new Array(C),h=new Array(C),a&&(p=new Array(C)),g=0,m=Math.min(s,C);g<m&&r[g]===u[g];g++);for(m=s-1,y=C-1;m>=g&&y>=g&&r[m]===u[y];m--,y--)f[y]=o[m],h[y]=i[m],a&&(p[y]=a[m]);for(e=new Map,t=new Array(y+1),c=y;c>=g;c--)w=u[c],l=e.get(w),t[c]=void 0===l?-1:l,e.set(w,c);for(l=g;l<=m;l++)w=r[l],c=e.get(w),void 0!==c&&-1!==c?(f[c]=o[l],h[c]=i[l],a&&(p[c]=a[l]),c=t[c],e.set(w,c)):i[l]();for(c=g;c<C;c++)c in f?(o[c]=f[c],i[c]=h[c],a&&(a[c]=p[c],a[c](c))):o[c]=createRoot(d);o=o.slice(0,s=C),r=u.slice(0)}return o}));function d(e){if(i[c]=e,a){const[e,n]=createSignal(c);return a[c]=n,t(u[c],e)}return t(u[c])}}}function createComponent(e,t){return untrack((()=>e(t||{})))}function trueFn(){return!0}const propTraps={get:(e,t,n)=>t===$PROXY?n:e.get(t),has:(e,t)=>t===$PROXY||e.has(t),set:trueFn,deleteProperty:trueFn,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:trueFn,deleteProperty:trueFn}),ownKeys:e=>e.keys()};function resolveSource(e){return(e="function"==typeof e?e():e)?e:{}}function mergeProps(...e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];t=t||!!n&&$PROXY in n,e[r]="function"==typeof n?(t=!0,createMemo(n)):n}if(t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=resolveSource(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in resolveSource(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(resolveSource(e[n])));return[...new Set(t)]}},propTraps);const n={};for(let r=e.length-1;r>=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 splitProps(e,...t){const n=new Set(t.flat());if($PROXY 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))},propTraps)));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)))},propTraps)),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;o<t.length;o++){const i=t[o];i in e&&Object.defineProperty(n,i,r[i]?r[i]:{get:()=>e[i],set:()=>!0,enumerable:!0})}return n}))}function For(e){const t="fallback"in e&&{fallback:()=>e.fallback};return createMemo(mapArray((()=>e.each),e.children,t||void 0))}function Show(e){let t=!1;const n=e.keyed,r=createMemo((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return createMemo((()=>{const o=r();if(o){const r=e.children,i="function"==typeof r&&r.length>0;return t=n||i,i?untrack((()=>r(o))):r}return e.fallback}),void 0,void 0)}function Switch(e){let t=!1,n=!1;const r=children((()=>e.children)),o=createMemo((()=>{let e=r();Array.isArray(e)||(e=[e]);for(let t=0;t<e.length;t++){const r=e[t].when;if(r)return n=!!e[t].keyed,[t,r,e[t]]}return[-1]}),void 0,{equals:(e,n)=>e[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return createMemo((()=>{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?untrack((()=>a(i))):a}),void 0,void 0)}function Match(e){return e}const booleans=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Properties=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...booleans]),ChildProperties=new Set(["innerHTML","textContent","innerText","children"]),Aliases=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),PropAliases=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),DelegatedEvents=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),SVGElements=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"]),SVGNamespace={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function reconcileArrays(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;)if(t[s]!==n[a]){for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const t=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],t)}else if(i===a)for(;s<o;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=a;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[s]);if(null!=r)if(a<r&&r<i){let l,u=s,d=1;for(;++u<o&&u<i&&null!=(l=c.get(t[u]))&&l===r+d;)d++;if(d>r-a){const o=t[s];for(;a<r;)e.insertBefore(n[a++],o)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}const $$EVENTS="_$DX_DELEGATE";function render(e,t,n,r={}){let o;return createRoot((r=>{o=r,t===document?e():insert(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function template$1(e,t,n){const r=document.createElement("template");r.innerHTML=e;let o=r.content.firstChild;return n&&(o=o.firstChild),o}function delegateEvents(e,t=window.document){const n=t[$$EVENTS]||(t[$$EVENTS]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,eventHandler))}}function setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function setAttributeNS(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function className(e,t){null==t?e.removeAttribute("class"):e.className=t}function addEventListener(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n)}function classList(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(toggleClassKey(e,r,!1),delete n[r])}for(i=0,s=r.length;i<s;i++){const o=r[i],s=!!t[o];o&&"undefined"!==o&&n[o]!==s&&s&&(toggleClassKey(e,o,!0),n[o]=s)}return n}function style(e,t,n){if(!t)return n?setAttribute(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function spread(e,t={},n,r){const o={};return r||createRenderEffect((()=>o.children=insertExpression(e,t.children,o.children))),createRenderEffect((()=>t.ref&&t.ref(e))),createRenderEffect((()=>assign(e,t,n,!0,o,!0))),o}function use(e,t,n){return untrack((()=>e(t,n)))}function insert(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return insertExpression(e,t,r,n);createRenderEffect((r=>insertExpression(e,t(),r,n)),r)}function assign(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if("children"===s)continue;o[s]=assignProp(e,s,null,o[s],n,i)}for(const s in t){if("children"===s){r||insertExpression(e,t.children);continue}const a=t[s];o[s]=assignProp(e,s,a,o[s],n,i)}}function getNextElement(e){let t,n;return sharedConfig.context&&(t=sharedConfig.registry.get(n=getHydrationKey()))?(sharedConfig.completed&&sharedConfig.completed.add(t),sharedConfig.registry.delete(n),t):e.cloneNode(!0)}function toPropertyName(e){return e.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))}function toggleClassKey(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function assignProp(e,t,n,r,o,i){let s,a,l;if("style"===t)return style(e,n,r);if("classList"===t)return classList(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r),n&&e.addEventListener(o,n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=DelegatedEvents.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(addEventListener(e,o,n,i),i&&delegateEvents([o]))}else if((l=ChildProperties.has(t))||!o&&(PropAliases[t]||(a=Properties.has(t)))||(s=e.nodeName.includes("-")))"class"===t||"className"===t?className(e,n):!s||a||l?e[PropAliases[t]||t]=n:e[toPropertyName(t)]=n;else{const r=o&&t.indexOf(":")>-1&&SVGNamespace[t.split(":")[0]];r?setAttributeNS(e,r,t,n):setAttribute(e,Aliases[t]||t,n)}return n}function eventHandler(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}),sharedConfig.registry&&!sharedConfig.done&&(sharedConfig.done=!0,document.querySelectorAll("[id^=pl-]").forEach((e=>e.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 insertExpression(e,t,n,r,o){for(sharedConfig.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(sharedConfig.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=cleanChildren(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i){if(sharedConfig.context)return n;n=cleanChildren(e,n,r)}else{if("function"===i)return createRenderEffect((()=>{let o=t();for(;"function"==typeof o;)o=o();n=insertExpression(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(normalizeIncomingArray(i,t,n,o))return createRenderEffect((()=>n=insertExpression(e,i,n,r,!0))),()=>n;if(sharedConfig.context){if(!i.length)return n;for(let e=0;e<i.length;e++)if(i[e].parentNode)return n=i}if(0===i.length){if(n=cleanChildren(e,n,r),s)return n}else a?0===n.length?appendNodes(e,i,r):reconcileArrays(e,n,i):(n&&cleanChildren(e),appendNodes(e,i));n=i}else if(t instanceof Node){if(sharedConfig.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=cleanChildren(e,n,r,t);cleanChildren(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function normalizeIncomingArray(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let s=t[i],a=n&&n[i];if(s instanceof Node)e.push(s);else if(null==s||!0===s||!1===s);else if(Array.isArray(s))o=normalizeIncomingArray(e,s,a)||o;else if("function"==typeof s)if(r){for(;"function"==typeof s;)s=s();o=normalizeIncomingArray(e,Array.isArray(s)?s:[s],Array.isArray(a)?a:[a])||o}else e.push(s),o=!0;else{const t=String(s);a&&3===a.nodeType&&a.data===t?e.push(a):e.push(document.createTextNode(t))}}return o}function appendNodes(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function cleanChildren(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=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]}function getHydrationKey(){const e=sharedConfig.context;return`${e.id}${e.count++}`}const SVG_NAMESPACE="http://www.w3.org/2000/svg";function createElement(e,t=!1){return t?document.createElementNS(SVG_NAMESPACE,e):document.createElement(e)}function Portal(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function o(){if(sharedConfig.context){const[t,n]=createSignal(!1);return queueMicrotask((()=>n(!0))),()=>t()&&e.children}return()=>e.children}if(r instanceof HTMLHeadElement){const[e,t]=createSignal(!1),n=()=>t(!0);createRoot((t=>insert(r,(()=>e()?t():o()()),null))),onCleanup((()=>{sharedConfig.context?queueMicrotask(n):n()}))}else{const i=createElement(e.isSVG?"g":"div",e.isSVG),s=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get:()=>n.parentNode,configurable:!0}),insert(s,o()),r.appendChild(i),e.ref&&e.ref(i),onCleanup((()=>r.removeChild(i)))}return n}function Dynamic(e){const[t,n]=splitProps(e,["component"]),r=createMemo((()=>t.component));return createMemo((()=>{const e=r();switch(typeof e){case"function":return untrack((()=>e(n)));case"string":const t=SVGElements.has(e),r=sharedConfig.context?getNextElement():createElement(e,t);return spread(r,n,t),r}}))}const[walletsModalOpen,setWalletsModalOpen]=createSignal(!1),[lastSelectedWalletInfo,setLastSelectedWalletInfo]=createSignal(null),[action,setAction]=createSignal(null);let e={data:""},t=t=>"object"==typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n=/\n+/g,o=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];"@"==s[0]?"i"==s[1]?n=s+" "+a+";":r+="f"==s[1]?o(a,s):s+"{"+o(a,"k"==s[1]?"":t)+"}":"object"==typeof a?r+=o(a,t?t.replace(/([^,])+/g,(e=>s.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):s):null!=a&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=o.p?o.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},c={},s=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+s(e[n]);return t}return e},i=(e,t,r,i,u)=>{let d=s(e),f=c[d]||(c[d]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(d));if(!c[f]){let t=d!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n," ").trim();return o[0]})(e);c[f]=o(u?{["@keyframes "+f]:t}:t,r?"":"."+f)}let h=r&&c.g?c.g:null;return r&&(c.g=c[f]),p=c[f],g=t,m=i,(y=h)?g.data=g.data.replace(y,p):-1===g.data.indexOf(p)&&(g.data=m?p+g.data:g.data+p),f;var p,g,m,y},p=(e,t,n)=>e.reduce(((e,r,i)=>{let s=t[i];if(s&&s.call){let e=s(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;s=t?"."+t:e&&"object"==typeof e?e.props?"":o(e,""):!1===e?"":e}return e+r+(null==s?"":s)}),"");function u(e){let n=this||{},r=e.call?e(n.p):e;return i(r.unshift?r.raw?p(r,[].slice.call(arguments,1),n.p):r.reduce(((e,t)=>Object.assign(e,t&&t.call?t(n.p):t)),{}):r,t(n.target),n.g,n.o,n.k)}u.bind({g:1});let h=u.bind({k:1});const ThemeContext=createContext();function ThemeProvider(e){return createComponent(ThemeContext.Provider,{value:e.theme,get children(){return e.children}})}function useTheme(){return useContext(ThemeContext)}function makeStyled(e){let t=this||{};return(...n)=>{const r=r=>{const o=mergeProps(r,{theme:useContext(ThemeContext)}),i=mergeProps(o,{get class(){const e=o.class,r="class"in o&&/^go[0-9]+/.test(e);return[e,u.apply({target:t.target,o:r,p:o,g:t.g},n)].filter(Boolean).join(" ")}}),[s,a]=splitProps(i,["as","theme"]),l=a,c=s.as||e;let d;return"function"==typeof c?d=c(l):1==t.g?(d=document.createElement(c),spread(d,l)):d=Dynamic(mergeProps({component:c},l)),d};return r.class=e=>untrack((()=>u.apply({target:t.target,p:e,g:t.g},n))),r}}const styled=new Proxy(makeStyled,{get:(e,t)=>e(t)});function createGlobalStyles(){const e=makeStyled.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const common$1={close:"Close"},button$1={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications$1={confirm:{header:"Confirm action in your wallet"},transactionSent:{header:"Transaction sent",text:"Your transaction has been sent to the network and will be processed in a few seconds."},transactionCanceled:{header:"Action cancelled",text:"The action was canceled because there were no expected changes in the blockchain."}},walletModal$1={loading:"Wallets list is loading",selectWalletModal:{connectWallet:"Connect a Wallet",selectWallet:"Choose your preferred wallet from the options to get started.",learnMore:"Learn more"},qrCodeModal:{connectWith:"Connect with {{ name }}",scan:"Scan QR code with your phone’s or {{ name }}’s camera.",openWallet:"Open {{ name }}",openExtension:"Open Extension",dontHave:"Don't have {{ name }}?",get:"GET"}},actionModal$1={confirmTransaction:{header:"Confirm action in your wallet",text:"Checking after confirmation usually takes some time."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},en={common:common$1,button:button$1,notifications:notifications$1,walletModal:walletModal$1,actionModal:actionModal$1},common={close:"Закрыть"},button={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications={confirm:{header:"Подтвердите действие в своём кошельке"},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция отправлена в сеть и будет обработана через несколько секунд."},transactionCanceled:{header:"Действие отменено",text:"Действие прервано потому что в блокчейне нет ожидаемых изменений."}},walletModal={loading:"Список кошельков загружается",selectWalletModal:{connectWallet:"Подключите кошелёк",selectWallet:"Выберите свой кошелёк из предложенных ниже.",learnMore:"Подробнее"},qrCodeModal:{connectWith:"Подключиться с помощью {{ name }}",scan:"Отсканируйте QR-код камерой телефона или приложения {{ name }}.",openWallet:"Открыть {{ name }}",openExtension:"Открыть расширение",dontHave:"У вас нет {{ name }}?",get:"Скачать"}},actionModal={confirmTransaction:{header:"Подтвердите действие в своём кошельке",text:"Отправка транзакции после подтверждения обычно занимает некоторое время."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},ru={common:common,button:button,notifications:notifications,walletModal:walletModal,actionModal:actionModal},i18nDictionary={en:parseDictionary(en),ru:parseDictionary(ru)};function parseDictionary(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 ConnectorContext=createContext(),$RAW=Symbol("store-raw"),$NODE=Symbol("store-node"),$NAME=Symbol("store-name");function wrap$1(e,t){let n=e[$PROXY];if(!n&&(Object.defineProperty(e,$PROXY,{value:n=new Proxy(e,proxyTraps$1)}),!Array.isArray(e))){const t=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=t.length;o<i;o++){const i=t[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(n)})}}return n}function isWrappable(e){let t;return null!=e&&"object"==typeof e&&(e[$PROXY]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function unwrap(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[$RAW])return n;if(!isWrappable(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=unwrap(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let a=0,l=n.length;a<l;a++)i=n[a],s[i].get||(o=e[i],(r=unwrap(o,t))!==o&&(e[i]=r))}return e}function getDataNodes(e){let t=e[$NODE];return t||Object.defineProperty(e,$NODE,{value:t={}}),t}function getDataNode(e,t,n){return e[t]||(e[t]=createDataNode(n))}function proxyDescriptor$1(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==$PROXY&&t!==$NODE&&t!==$NAME?(delete n.value,delete n.writable,n.get=()=>e[$PROXY][t],n):n}function trackSelf(e){if(getListener()){const t=getDataNodes(e);(t._||(t._=createDataNode()))()}}function ownKeys(e){return trackSelf(e),Reflect.ownKeys(e)}function createDataNode(e){const[t,n]=createSignal(e,{equals:!1,internal:!0});return t.$=n,t}const proxyTraps$1={get(e,t,n){if(t===$RAW)return e;if(t===$PROXY)return n;if(t===$TRACK)return trackSelf(e),n;const r=getDataNodes(e),o=r.hasOwnProperty(t);let i=o?r[t]():e[t];if(t===$NODE||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!getListener()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=getDataNode(r,t,i)())}return isWrappable(i)?wrap$1(i):i},has(e,t){return t===$RAW||t===$PROXY||t===$TRACK||t===$NODE||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:ownKeys,getOwnPropertyDescriptor:proxyDescriptor$1};function setProperty(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=getDataNodes(e);(s=getDataNode(a,t,o))&&s.$((()=>n)),Array.isArray(e)&&e.length!==i&&(s=getDataNode(a,"length",i))&&s.$(e.length),(s=a._)&&s.$()}function mergeStoreNode(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];setProperty(e,o,t[o])}}function updateArray(e,t){if("function"==typeof t&&(t=t(e)),t=unwrap(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&setProperty(e,n,r)}setProperty(e,"length",r)}else mergeStoreNode(e,t)}function updatePath(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)updatePath(e,[r[o]].concat(t),n);return}if(s&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&updatePath(e,[o].concat(t),n);return}if(s&&"object"===i){const{from:o=0,to:i=e.length-1,by:s=1}=r;for(let r=o;r<=i;r+=s)updatePath(e,[r].concat(t),n);return}if(t.length>1)return void updatePath(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=unwrap(i),void 0===r||isWrappable(o)&&isWrappable(i)&&!Array.isArray(i)?mergeStoreNode(o,i):setProperty(e,r,i))}function createStore(...[e,t]){const n=unwrap(e||{}),r=Array.isArray(n);return[wrap$1(n),function(...e){batch((()=>{r&&1===e.length?updateArray(n,e[0]):updatePath(n,e)}))}]}var THEME=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(THEME||{});const defaultLightColorsSet={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#31A6F5",foreground:"#FFFFFF"},accent:"#31A6F5",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A"},background:{primary:"#FFFFFF",secondary:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#7A8999"}},defaultDarkColorsSet={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#31A6F5",foreground:"#FFFFFF"},accent:"#E5E5EA",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A"},background:{primary:"#121214",secondary:"#18181A"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}};var isMergeableObject=function(e){return isNonNullObject(e)&&!isSpecial(e)};function isNonNullObject(e){return!!e&&"object"==typeof e}function isSpecial(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||isReactElement(e)}var canUseSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified(e,t){return!1!==t.clone&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,n){return e.concat(t).map((function(e){return cloneUnlessOtherwiseSpecified(e,n)}))}function getMergeFunction(e,t){if(!t.customMerge)return deepmerge;var n=t.customMerge(e);return"function"==typeof n?n:deepmerge}function getEnumerableOwnPropertySymbols(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}function getKeys(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e))}function propertyIsOnObject(e,t){try{return t in e}catch(n){return!1}}function propertyIsUnsafe(e,t){return propertyIsOnObject(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function mergeObject(e,t,n){var r={};return n.isMergeableObject(e)&&getKeys(e).forEach((function(t){r[t]=cloneUnlessOtherwiseSpecified(e[t],n)})),getKeys(t).forEach((function(o){propertyIsUnsafe(e,o)||(propertyIsOnObject(e,o)&&n.isMergeableObject(t[o])?r[o]=getMergeFunction(o,n)(e[o],t[o],n):r[o]=cloneUnlessOtherwiseSpecified(t[o],n))})),r}function deepmerge(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||defaultArrayMerge,n.isMergeableObject=n.isMergeableObject||isMergeableObject,n.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):mergeObject(e,t,n):cloneUnlessOtherwiseSpecified(t,n)}deepmerge.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return deepmerge(e,n,t)}),{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;
|
|
2
|
-
|
|
3
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
|
-
* Released under the MIT License.
|
|
7
|
-
*/
|
|
8
|
-
function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject(e){var t,n;return!1!==isObject(e)&&(void 0===(t=e.constructor)||!1!==isObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function mergeOptions(e,t){if(!e)return t;return cjs(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:isPlainObject})}const[themeState,setThemeState]=createStore({theme:THEME.LIGHT,colors:defaultLightColorsSet,borderRadius:"m"}),themeColorsMappingDefault={[THEME.LIGHT]:defaultLightColorsSet,[THEME.DARK]:defaultDarkColorsSet},themeCustomColors={[THEME.LIGHT]:void 0,[THEME.DARK]:void 0};function setTheme(e,t){t&&(themeCustomColors[THEME.DARK]=mergeOptions(t[THEME.DARK],themeCustomColors[THEME.DARK]),themeCustomColors[THEME.LIGHT]=mergeOptions(t[THEME.LIGHT],themeCustomColors[THEME.LIGHT])),setThemeState({theme:e,colors:mergeOptions(themeCustomColors[e],themeColorsMappingDefault[e])})}function setBorderRadius(e){setThemeState({borderRadius:e})}function setColors(e){themeCustomColors[THEME.DARK]=mergeOptions(e[THEME.DARK],themeCustomColors[THEME.DARK]),themeCustomColors[THEME.LIGHT]=mergeOptions(e[THEME.LIGHT],themeCustomColors[THEME.LIGHT]),setThemeState((e=>({colors:mergeOptions(themeCustomColors[e.theme],themeColorsMappingDefault[e.theme])})))}const GlobalStyles=()=>{document.body.addEventListener("mousedown",(()=>document.body.classList.add("using-mouse"))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove("using-mouse")}));return createComponent(createGlobalStyles`
|
|
9
|
-
* {
|
|
1
|
+
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){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(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 r,o,i,s={exports:{}};o=t,i=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<n.length;t++)r[t]=n.charCodeAt(t);return r},e.encodeUTF8=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(n.join("")))},"undefined"==typeof atob?void 0!==Buffer.from?(e.encodeBase64=function(e){return Buffer.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new Buffer(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,"base64"),0))}):(e.encodeBase64=function(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(String.fromCharCode(e[t]));return btoa(n.join(""))},e.decodeBase64=function(e){t(e);var n,r=atob(e),o=new Uint8Array(r.length);for(n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}),e},(r=s).exports?r.exports=i():(o.nacl||(o.nacl={}),o.nacl.util=i());const a=s.exports;function l(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var c={exports:{}};const u=n(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));!function(e){!function(e){var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},r=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),s=t([1]),a=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function y(e,t,n,r,o){var i,s=0;for(i=0;i<o;i++)s|=e[t+i]^n[r+i];return(1&s-1>>>8)-1}function m(e,t,n,r){return y(e,t,n,r,16)}function v(e,t,n,r){return y(e,t,n,r,32)}function w(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,y=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,w=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,x=i,C=s,_=a,S=l,E=c,R=u,L=d,A=h,O=f,k=g,T=p,P=y,M=m,N=v,$=w,j=b,I=0;I<20;I+=2)x^=(o=(M^=(o=(O^=(o=(E^=(o=x+M|0)<<7|o>>>25)+x|0)<<9|o>>>23)+E|0)<<13|o>>>19)+O|0)<<18|o>>>14,R^=(o=(C^=(o=(N^=(o=(k^=(o=R+C|0)<<7|o>>>25)+R|0)<<9|o>>>23)+k|0)<<13|o>>>19)+N|0)<<18|o>>>14,T^=(o=(L^=(o=(_^=(o=($^=(o=T+L|0)<<7|o>>>25)+T|0)<<9|o>>>23)+$|0)<<13|o>>>19)+_|0)<<18|o>>>14,j^=(o=(P^=(o=(A^=(o=(S^=(o=j+P|0)<<7|o>>>25)+j|0)<<9|o>>>23)+S|0)<<13|o>>>19)+A|0)<<18|o>>>14,x^=(o=(S^=(o=(_^=(o=(C^=(o=x+S|0)<<7|o>>>25)+x|0)<<9|o>>>23)+C|0)<<13|o>>>19)+_|0)<<18|o>>>14,R^=(o=(E^=(o=(A^=(o=(L^=(o=R+E|0)<<7|o>>>25)+R|0)<<9|o>>>23)+L|0)<<13|o>>>19)+A|0)<<18|o>>>14,T^=(o=(k^=(o=(O^=(o=(P^=(o=T+k|0)<<7|o>>>25)+T|0)<<9|o>>>23)+P|0)<<13|o>>>19)+O|0)<<18|o>>>14,j^=(o=($^=(o=(N^=(o=(M^=(o=j+$|0)<<7|o>>>25)+j|0)<<9|o>>>23)+M|0)<<13|o>>>19)+N|0)<<18|o>>>14;x=x+i|0,C=C+s|0,_=_+a|0,S=S+l|0,E=E+c|0,R=R+u|0,L=L+d|0,A=A+h|0,O=O+f|0,k=k+g|0,T=T+p|0,P=P+y|0,M=M+m|0,N=N+v|0,$=$+w|0,j=j+b|0,e[0]=x>>>0&255,e[1]=x>>>8&255,e[2]=x>>>16&255,e[3]=x>>>24&255,e[4]=C>>>0&255,e[5]=C>>>8&255,e[6]=C>>>16&255,e[7]=C>>>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]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=R>>>0&255,e[21]=R>>>8&255,e[22]=R>>>16&255,e[23]=R>>>24&255,e[24]=L>>>0&255,e[25]=L>>>8&255,e[26]=L>>>16&255,e[27]=L>>>24&255,e[28]=A>>>0&255,e[29]=A>>>8&255,e[30]=A>>>16&255,e[31]=A>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=P>>>0&255,e[45]=P>>>8&255,e[46]=P>>>16&255,e[47]=P>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=$>>>0&255,e[57]=$>>>8&255,e[58]=$>>>16&255,e[59]=$>>>24&255,e[60]=j>>>0&255,e[61]=j>>>8&255,e[62]=j>>>16&255,e[63]=j>>>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,y=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,w=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,x=0;x<20;x+=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=(w^=(o=p+d|0)<<7|o>>>25)+p|0)<<9|o>>>23)+w|0)<<13|o>>>19)+a|0)<<18|o>>>14,b^=(o=(y^=(o=(h^=(o=(l^=(o=b+y|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=(y^=(o=p+g|0)<<7|o>>>25)+p|0)<<9|o>>>23)+y|0)<<13|o>>>19)+f|0)<<18|o>>>14,b^=(o=(w^=(o=(v^=(o=(m^=(o=b+w|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 x=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(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(w(u,c,s,x),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(w(u,c,s,x),l=0;l<o;l++)e[t+l]=n[r+l]^u[l];return 0}function _(e,t,n,r,o){var i,s,a=new Uint8Array(16),l=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=r[s];for(;n>=64;){for(w(l,a,o,x),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(w(l,a,o,x),s=0;s<n;s++)e[t+s]=l[s];return 0}function S(e,t,n,r,o){var i=new Uint8Array(32);b(i,r,o,x);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=r[a+16];return _(e,t,n,s,i)}function E(e,t,n,r,o,i,s){var a=new Uint8Array(32);b(a,i,s,x);for(var l=new Uint8Array(8),c=0;c<8;c++)l[c]=i[c+16];return C(e,t,n,r,o,l,a)}var R=function(e){var t,n,r,o,i,s,a,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),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 L(e,t,n,r,o,i){var s=new R(i);return s.update(n,r,o),s.finish(e,t),0}function A(e,t,n,r,o,i){var s=new Uint8Array(16);return L(s,0,n,r,o,i),m(e,t,s,0)}function O(e,t,n,r,o){var i;if(n<32)return-1;for(E(e,0,t,0,n,r,o),L(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function k(e,t,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(S(s,0,32,r,o),0!==A(t,16,t,32,n-32,s))return-1;for(E(e,0,t,0,n,r,o),i=0;i<32;i++)e[i]=0;return 0}function T(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function P(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 M(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 N(e,n){var r,o,i,s=t(),a=t();for(r=0;r<16;r++)a[r]=n[r];for(P(a),P(a),P(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,M(a,s,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function $(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return N(n,e),N(r,t),v(n,0,r,0)}function j(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function I(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function U(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function W(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,y=0,m=0,v=0,w=0,b=0,x=0,C=0,_=0,S=0,E=0,R=0,L=0,A=0,O=0,k=0,T=0,P=0,M=0,N=0,$=0,j=n[0],I=n[1],U=n[2],W=n[3],B=n[4],K=n[5],D=n[6],F=n[7],q=n[8],H=n[9],V=n[10],z=n[11],G=n[12],Y=n[13],Q=n[14],J=n[15];i+=(r=t[0])*j,s+=r*I,a+=r*U,l+=r*W,c+=r*B,u+=r*K,d+=r*D,h+=r*F,f+=r*q,g+=r*H,p+=r*V,y+=r*z,m+=r*G,v+=r*Y,w+=r*Q,b+=r*J,s+=(r=t[1])*j,a+=r*I,l+=r*U,c+=r*W,u+=r*B,d+=r*K,h+=r*D,f+=r*F,g+=r*q,p+=r*H,y+=r*V,m+=r*z,v+=r*G,w+=r*Y,b+=r*Q,x+=r*J,a+=(r=t[2])*j,l+=r*I,c+=r*U,u+=r*W,d+=r*B,h+=r*K,f+=r*D,g+=r*F,p+=r*q,y+=r*H,m+=r*V,v+=r*z,w+=r*G,b+=r*Y,x+=r*Q,C+=r*J,l+=(r=t[3])*j,c+=r*I,u+=r*U,d+=r*W,h+=r*B,f+=r*K,g+=r*D,p+=r*F,y+=r*q,m+=r*H,v+=r*V,w+=r*z,b+=r*G,x+=r*Y,C+=r*Q,_+=r*J,c+=(r=t[4])*j,u+=r*I,d+=r*U,h+=r*W,f+=r*B,g+=r*K,p+=r*D,y+=r*F,m+=r*q,v+=r*H,w+=r*V,b+=r*z,x+=r*G,C+=r*Y,_+=r*Q,S+=r*J,u+=(r=t[5])*j,d+=r*I,h+=r*U,f+=r*W,g+=r*B,p+=r*K,y+=r*D,m+=r*F,v+=r*q,w+=r*H,b+=r*V,x+=r*z,C+=r*G,_+=r*Y,S+=r*Q,E+=r*J,d+=(r=t[6])*j,h+=r*I,f+=r*U,g+=r*W,p+=r*B,y+=r*K,m+=r*D,v+=r*F,w+=r*q,b+=r*H,x+=r*V,C+=r*z,_+=r*G,S+=r*Y,E+=r*Q,R+=r*J,h+=(r=t[7])*j,f+=r*I,g+=r*U,p+=r*W,y+=r*B,m+=r*K,v+=r*D,w+=r*F,b+=r*q,x+=r*H,C+=r*V,_+=r*z,S+=r*G,E+=r*Y,R+=r*Q,L+=r*J,f+=(r=t[8])*j,g+=r*I,p+=r*U,y+=r*W,m+=r*B,v+=r*K,w+=r*D,b+=r*F,x+=r*q,C+=r*H,_+=r*V,S+=r*z,E+=r*G,R+=r*Y,L+=r*Q,A+=r*J,g+=(r=t[9])*j,p+=r*I,y+=r*U,m+=r*W,v+=r*B,w+=r*K,b+=r*D,x+=r*F,C+=r*q,_+=r*H,S+=r*V,E+=r*z,R+=r*G,L+=r*Y,A+=r*Q,O+=r*J,p+=(r=t[10])*j,y+=r*I,m+=r*U,v+=r*W,w+=r*B,b+=r*K,x+=r*D,C+=r*F,_+=r*q,S+=r*H,E+=r*V,R+=r*z,L+=r*G,A+=r*Y,O+=r*Q,k+=r*J,y+=(r=t[11])*j,m+=r*I,v+=r*U,w+=r*W,b+=r*B,x+=r*K,C+=r*D,_+=r*F,S+=r*q,E+=r*H,R+=r*V,L+=r*z,A+=r*G,O+=r*Y,k+=r*Q,T+=r*J,m+=(r=t[12])*j,v+=r*I,w+=r*U,b+=r*W,x+=r*B,C+=r*K,_+=r*D,S+=r*F,E+=r*q,R+=r*H,L+=r*V,A+=r*z,O+=r*G,k+=r*Y,T+=r*Q,P+=r*J,v+=(r=t[13])*j,w+=r*I,b+=r*U,x+=r*W,C+=r*B,_+=r*K,S+=r*D,E+=r*F,R+=r*q,L+=r*H,A+=r*V,O+=r*z,k+=r*G,T+=r*Y,P+=r*Q,M+=r*J,w+=(r=t[14])*j,b+=r*I,x+=r*U,C+=r*W,_+=r*B,S+=r*K,E+=r*D,R+=r*F,L+=r*q,A+=r*H,O+=r*V,k+=r*z,T+=r*G,P+=r*Y,M+=r*Q,N+=r*J,b+=(r=t[15])*j,s+=38*(C+=r*U),a+=38*(_+=r*W),l+=38*(S+=r*B),c+=38*(E+=r*K),u+=38*(R+=r*D),d+=38*(L+=r*F),h+=38*(A+=r*q),f+=38*(O+=r*H),g+=38*(k+=r*V),p+=38*(T+=r*z),y+=38*(P+=r*G),m+=38*(M+=r*Y),v+=38*(N+=r*Q),w+=38*($+=r*J),i=(r=(i+=38*(x+=r*I))+(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)),y=(r=y+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)),w=(r=w+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)),y=(r=y+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)),w=(r=w+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]=y,e[12]=m,e[13]=v,e[14]=w,e[15]=b}function K(e,t){B(e,t,t)}function D(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)K(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function F(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)K(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function q(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,I(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)M(c,u,o=s[i>>>3]>>>(7&i)&1),M(d,h,o),U(f,c,d),W(c,c,d),U(d,u,h),W(u,u,h),K(h,f),K(g,c),B(c,d,c),B(d,u,f),U(f,c,d),W(c,c,d),K(u,c),W(d,h,g),B(c,d,a),U(c,c,h),B(d,d,c),B(c,h,g),B(h,u,l),K(u,f),M(c,u,o),M(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),y=l.subarray(16);return D(p,p),B(y,y,p),N(e,y),0}function H(e,t){return q(e,t,o)}function V(e,t){return n(t,32),H(e,t)}function z(e,t,n){var o=new Uint8Array(32);return q(o,n,t),b(e,r,o,x)}R.prototype.blocks=function(e,t,n){for(var r,o,i,s,a,l,c,u,d,h,f,g,p,y,m,v,w,b,x,C=this.fin?0:2048,_=this.h[0],S=this.h[1],E=this.h[2],R=this.h[3],L=this.h[4],A=this.h[5],O=this.h[6],k=this.h[7],T=this.h[8],P=this.h[9],M=this.r[0],N=this.r[1],$=this.r[2],j=this.r[3],I=this.r[4],U=this.r[5],W=this.r[6],B=this.r[7],K=this.r[8],D=this.r[9];n>=16;)h=d=0,h+=(_+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*M,h+=(S+=8191&(r>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*D),h+=(E+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*K),h+=(R+=8191&(i>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*B),d=(h+=(L+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*W))>>>13,h&=8191,h+=(A+=a>>>1&8191)*(5*U),h+=(O+=8191&(a>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*I),h+=(k+=8191&(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*j),h+=(T+=8191&(c>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*$),f=d+=(h+=(P+=u>>>5|C)*(5*N))>>>13,f+=_*N,f+=S*M,f+=E*(5*D),f+=R*(5*K),d=(f+=L*(5*B))>>>13,f&=8191,f+=A*(5*W),f+=O*(5*U),f+=k*(5*I),f+=T*(5*j),d+=(f+=P*(5*$))>>>13,f&=8191,g=d,g+=_*$,g+=S*N,g+=E*M,g+=R*(5*D),d=(g+=L*(5*K))>>>13,g&=8191,g+=A*(5*B),g+=O*(5*W),g+=k*(5*U),g+=T*(5*I),p=d+=(g+=P*(5*j))>>>13,p+=_*j,p+=S*$,p+=E*N,p+=R*M,d=(p+=L*(5*D))>>>13,p&=8191,p+=A*(5*K),p+=O*(5*B),p+=k*(5*W),p+=T*(5*U),y=d+=(p+=P*(5*I))>>>13,y+=_*I,y+=S*j,y+=E*$,y+=R*N,d=(y+=L*M)>>>13,y&=8191,y+=A*(5*D),y+=O*(5*K),y+=k*(5*B),y+=T*(5*W),m=d+=(y+=P*(5*U))>>>13,m+=_*U,m+=S*I,m+=E*j,m+=R*$,d=(m+=L*N)>>>13,m&=8191,m+=A*M,m+=O*(5*D),m+=k*(5*K),m+=T*(5*B),v=d+=(m+=P*(5*W))>>>13,v+=_*W,v+=S*U,v+=E*I,v+=R*j,d=(v+=L*$)>>>13,v&=8191,v+=A*N,v+=O*M,v+=k*(5*D),v+=T*(5*K),w=d+=(v+=P*(5*B))>>>13,w+=_*B,w+=S*W,w+=E*U,w+=R*I,d=(w+=L*j)>>>13,w&=8191,w+=A*$,w+=O*N,w+=k*M,w+=T*(5*D),b=d+=(w+=P*(5*K))>>>13,b+=_*K,b+=S*B,b+=E*W,b+=R*U,d=(b+=L*I)>>>13,b&=8191,b+=A*j,b+=O*$,b+=k*N,b+=T*M,x=d+=(b+=P*(5*D))>>>13,x+=_*D,x+=S*K,x+=E*B,x+=R*W,d=(x+=L*U)>>>13,x&=8191,x+=A*I,x+=O*j,x+=k*$,x+=T*N,_=h=8191&(d=(d=((d+=(x+=P*M)>>>13)<<2)+d|0)+(h&=8191)|0),S=f+=d>>>=13,E=g&=8191,R=p&=8191,L=y&=8191,A=m&=8191,O=v&=8191,k=w&=8191,T=b&=8191,P=x&=8191,t+=16,n-=16;this.h[0]=_,this.h[1]=S,this.h[2]=E,this.h[3]=R,this.h[4]=L,this.h[5]=A,this.h[6]=O,this.h[7]=k,this.h[8]=T,this.h[9]=P},R.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},R.prototype.update=function(e,t,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r<o;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(e,t,o),t+=o,n-=o),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};var G=O,Y=k;var Q=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function J(e,t,n,r){for(var o,i,s,a,l,c,u,d,h,f,g,p,y,m,v,w,b,x,C,_,S,E,R,L,A,O,k=new Int32Array(16),T=new Int32Array(16),P=e[0],M=e[1],N=e[2],$=e[3],j=e[4],I=e[5],U=e[6],W=e[7],B=t[0],K=t[1],D=t[2],F=t[3],q=t[4],H=t[5],V=t[6],z=t[7],G=0;r>=128;){for(C=0;C<16;C++)_=8*C+G,k[C]=n[_+0]<<24|n[_+1]<<16|n[_+2]<<8|n[_+3],T[C]=n[_+4]<<24|n[_+5]<<16|n[_+6]<<8|n[_+7];for(C=0;C<80;C++)if(o=P,i=M,s=N,a=$,l=j,c=I,u=U,W,h=B,f=K,g=D,p=F,y=q,m=H,v=V,z,R=65535&(E=z),L=E>>>16,A=65535&(S=W),O=S>>>16,R+=65535&(E=(q>>>14|j<<18)^(q>>>18|j<<14)^(j>>>9|q<<23)),L+=E>>>16,A+=65535&(S=(j>>>14|q<<18)^(j>>>18|q<<14)^(q>>>9|j<<23)),O+=S>>>16,R+=65535&(E=q&H^~q&V),L+=E>>>16,A+=65535&(S=j&I^~j&U),O+=S>>>16,S=Q[2*C],R+=65535&(E=Q[2*C+1]),L+=E>>>16,A+=65535&S,O+=S>>>16,S=k[C%16],L+=(E=T[C%16])>>>16,A+=65535&S,O+=S>>>16,A+=(L+=(R+=65535&E)>>>16)>>>16,R=65535&(E=x=65535&R|L<<16),L=E>>>16,A=65535&(S=b=65535&A|(O+=A>>>16)<<16),O=S>>>16,R+=65535&(E=(B>>>28|P<<4)^(P>>>2|B<<30)^(P>>>7|B<<25)),L+=E>>>16,A+=65535&(S=(P>>>28|B<<4)^(B>>>2|P<<30)^(B>>>7|P<<25)),O+=S>>>16,L+=(E=B&K^B&D^K&D)>>>16,A+=65535&(S=P&M^P&N^M&N),O+=S>>>16,d=65535&(A+=(L+=(R+=65535&E)>>>16)>>>16)|(O+=A>>>16)<<16,w=65535&R|L<<16,R=65535&(E=p),L=E>>>16,A=65535&(S=a),O=S>>>16,L+=(E=x)>>>16,A+=65535&(S=b),O+=S>>>16,M=o,N=i,$=s,j=a=65535&(A+=(L+=(R+=65535&E)>>>16)>>>16)|(O+=A>>>16)<<16,I=l,U=c,W=u,P=d,K=h,D=f,F=g,q=p=65535&R|L<<16,H=y,V=m,z=v,B=w,C%16==15)for(_=0;_<16;_++)S=k[_],R=65535&(E=T[_]),L=E>>>16,A=65535&S,O=S>>>16,S=k[(_+9)%16],R+=65535&(E=T[(_+9)%16]),L+=E>>>16,A+=65535&S,O+=S>>>16,b=k[(_+1)%16],R+=65535&(E=((x=T[(_+1)%16])>>>1|b<<31)^(x>>>8|b<<24)^(x>>>7|b<<25)),L+=E>>>16,A+=65535&(S=(b>>>1|x<<31)^(b>>>8|x<<24)^b>>>7),O+=S>>>16,b=k[(_+14)%16],L+=(E=((x=T[(_+14)%16])>>>19|b<<13)^(b>>>29|x<<3)^(x>>>6|b<<26))>>>16,A+=65535&(S=(b>>>19|x<<13)^(x>>>29|b<<3)^b>>>6),O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,k[_]=65535&A|O<<16,T[_]=65535&R|L<<16;R=65535&(E=B),L=E>>>16,A=65535&(S=P),O=S>>>16,S=e[0],L+=(E=t[0])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[0]=P=65535&A|O<<16,t[0]=B=65535&R|L<<16,R=65535&(E=K),L=E>>>16,A=65535&(S=M),O=S>>>16,S=e[1],L+=(E=t[1])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[1]=M=65535&A|O<<16,t[1]=K=65535&R|L<<16,R=65535&(E=D),L=E>>>16,A=65535&(S=N),O=S>>>16,S=e[2],L+=(E=t[2])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[2]=N=65535&A|O<<16,t[2]=D=65535&R|L<<16,R=65535&(E=F),L=E>>>16,A=65535&(S=$),O=S>>>16,S=e[3],L+=(E=t[3])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[3]=$=65535&A|O<<16,t[3]=F=65535&R|L<<16,R=65535&(E=q),L=E>>>16,A=65535&(S=j),O=S>>>16,S=e[4],L+=(E=t[4])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[4]=j=65535&A|O<<16,t[4]=q=65535&R|L<<16,R=65535&(E=H),L=E>>>16,A=65535&(S=I),O=S>>>16,S=e[5],L+=(E=t[5])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[5]=I=65535&A|O<<16,t[5]=H=65535&R|L<<16,R=65535&(E=V),L=E>>>16,A=65535&(S=U),O=S>>>16,S=e[6],L+=(E=t[6])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[6]=U=65535&A|O<<16,t[6]=V=65535&R|L<<16,R=65535&(E=z),L=E>>>16,A=65535&(S=W),O=S>>>16,S=e[7],L+=(E=t[7])>>>16,A+=65535&S,O+=S>>>16,O+=(A+=(L+=(R+=65535&E)>>>16)>>>16)>>>16,e[7]=W=65535&A|O<<16,t[7]=z=65535&R|L<<16,G+=128,r-=128}return r}function Z(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,J(o,i,t,n),n%=128,r=0;r<n;r++)s[r]=t[a-n+r];for(s[n]=128,s[(n=256-128*(n<112?1:0))-9]=0,p(s,n-8,a/536870912|0,a<<3),J(o,i,s,n),r=0;r<8;r++)p(e,8*r,o[r],i[r]);return 0}function X(e,n){var r=t(),o=t(),i=t(),s=t(),a=t(),l=t(),c=t(),u=t(),h=t();W(r,e[1],e[0]),W(h,n[1],n[0]),B(r,r,h),U(o,e[0],e[1]),U(h,n[0],n[1]),B(o,o,h),B(i,e[3],n[3]),B(i,i,d),B(s,e[2],n[2]),U(s,s,s),W(a,o,r),W(l,s,i),U(c,s,i),U(u,o,r),B(e[0],a,l),B(e[1],u,c),B(e[2],c,l),B(e[3],a,u)}function ee(e,t,n){var r;for(r=0;r<4;r++)M(e[r],t[r],n)}function te(e,n){var r=t(),o=t(),i=t();D(i,n[2]),B(r,n[0],i),B(o,n[1],i),N(e,o),e[31]^=j(r)<<7}function ne(e,t,n){var r,o;for(T(e[0],i),T(e[1],s),T(e[2],s),T(e[3],i),o=255;o>=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()];T(r[0],h),T(r[1],f),T(r[2],s),B(r[3],h,f),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),Z(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<i;++o)t[o]+=n-16*t[r]*ie[o-(r-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[r]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>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()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var h=r+64;for(i=0;i<r;i++)e[64+i]=n[i];for(i=0;i<32;i++)e[32+i]=a[32+i];for(Z(c,e.subarray(32),r+32),ae(c),re(d,c),te(e,d),i=32;i<64;i++)e[i]=o[i];for(Z(l,e,r+64),ae(l),i=0;i<64;i++)u[i]=0;for(i=0;i<32;i++)u[i]=c[i];for(i=0;i<32;i++)for(s=0;s<32;s++)u[i+s]+=l[i]*a[s];return se(e.subarray(32),u),h}function ce(e,n,r,o){var a,l=new Uint8Array(32),u=new Uint8Array(64),d=[t(),t(),t(),t()],h=[t(),t(),t(),t()];if(r<64)return-1;if(function(e,n){var r=t(),o=t(),a=t(),l=t(),u=t(),d=t(),h=t();return T(e[2],s),I(e[1],n),K(a,e[1]),B(l,a,c),W(a,a,e[2]),U(l,e[2],l),K(u,l),K(d,u),B(h,d,u),B(r,h,a),B(r,r,l),F(r,r),B(r,r,a),B(r,r,l),B(r,r,l),B(e[0],r,l),K(o,e[0]),B(o,o,l),$(o,a)&&B(e[0],e[0],g),K(o,e[0]),B(o,o,l),$(o,a)?-1:(j(e[0])===n[31]>>7&&W(e[0],i,e[0]),B(e[3],e[0],e[1]),0)}(h,o))return-1;for(a=0;a<r;a++)e[a]=n[a];for(a=0;a<32;a++)e[a+32]=o[a];if(Z(u,e,r),ae(u),ne(d,h,u),re(h,n.subarray(32)),X(d,h),te(l,d),r-=64,v(n,0,l,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=n[a+64];return r}var ue=32,de=24,he=16,fe=32,ge=32,pe=de,ye=64,me=32,ve=64;function we(e,t){if(e.length!==ue)throw new Error("bad key size");if(t.length!==de)throw new Error("bad nonce size")}function be(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function xe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:b,crypto_stream_xor:E,crypto_stream:S,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:_,crypto_onetimeauth:L,crypto_onetimeauth_verify:A,crypto_verify_16:m,crypto_verify_32:v,crypto_secretbox:O,crypto_secretbox_open:k,crypto_scalarmult:q,crypto_scalarmult_base:H,crypto_box_beforenm:z,crypto_box_afternm:G,crypto_box:function(e,t,n,r,o,i){var s=new Uint8Array(32);return z(s,o,i),G(e,t,n,r,s)},crypto_box_open:function(e,t,n,r,o,i){var s=new Uint8Array(32);return z(s,o,i),Y(e,t,n,r,s)},crypto_box_keypair:V,crypto_hash:Z,crypto_sign:le,crypto_sign_keypair:oe,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:ue,crypto_secretbox_NONCEBYTES:de,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:he,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:fe,crypto_box_SECRETKEYBYTES:ge,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:pe,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ye,crypto_sign_PUBLICKEYBYTES:me,crypto_sign_SECRETKEYBYTES:ve,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ie,pack25519:N,unpack25519:I,M:B,A:U,S:K,Z:W,pow2523:F,add:X,set25519:T,modL:se,scalarmult:ne,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){be(e,t,n),we(n,t);for(var r=new Uint8Array(32+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+32]=e[i];return O(o,r,r.length,t,n),o.subarray(he)},e.secretbox.open=function(e,t,n){be(e,t,n),we(n,t);for(var r=new Uint8Array(he+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+he]=e[i];return r.length<32||0!==k(o,r,r.length,t,n)?null:o.subarray(32)},e.secretbox.keyLength=ue,e.secretbox.nonceLength=de,e.secretbox.overheadLength=he,e.scalarMult=function(e,t){if(be(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return q(n,e,t),n},e.scalarMult.base=function(e){if(be(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox(t,n,i)},e.box.before=function(e,t){be(e,t),function(e,t){if(e.length!==fe)throw new Error("bad public key size");if(t.length!==ge)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return z(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox.open(t,n,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(fe),t=new Uint8Array(ge);return V(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(be(e),e.length!==ge)throw new Error("bad secret key size");var t=new Uint8Array(fe);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=fe,e.box.secretKeyLength=ge,e.box.sharedKeyLength=32,e.box.nonceLength=pe,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(be(e,t),t.length!==ve)throw new Error("bad secret key size");var n=new Uint8Array(ye+e.length);return le(n,e,e.length,t),n},e.sign.open=function(e,t){if(be(e,t),t.length!==me)throw new Error("bad public key size");var n=new Uint8Array(e.length),r=ce(n,e,e.length,t);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},e.sign.detached=function(t,n){for(var r=e.sign(t,n),o=new Uint8Array(ye),i=0;i<o.length;i++)o[i]=r[i];return o},e.sign.detached.verify=function(e,t,n){if(be(e,t,n),t.length!==ye)throw new Error("bad signature size");if(n.length!==me)throw new Error("bad public key size");var r,o=new Uint8Array(ye+e.length),i=new Uint8Array(ye+e.length);for(r=0;r<ye;r++)o[r]=t[r];for(r=0;r<e.length;r++)o[r+ye]=e[r];return ce(i,o,o.length,n)>=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;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(be(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(me),n=new Uint8Array(ve),r=0;r<32;r++)n[r]=e[r];return oe(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=me,e.sign.secretKeyLength=ve,e.sign.seedLength=32,e.sign.signatureLength=ye,e.hash=function(e){be(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return be(e,t),0!==e.length&&0!==t.length&&(e.length===t.length&&0===y(e,0,t,0,e.length))},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,n){var r,o=new Uint8Array(n);for(r=0;r<n;r+=65536)t.getRandomValues(o.subarray(r,r+Math.min(n-r,65536)));for(r=0;r<n;r++)e[r]=o[r];xe(o)}))}else void 0!==l&&(t=u)&&t.randomBytes&&e.setPRNG((function(e,n){var r,o=t.randomBytes(n);for(r=0;r<n;r++)e[r]=o[r];xe(o)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})}(c);const d=c.exports;var h,f,g,p,y,m,v,w,b,x,C,_;(f=h||(h={}))[f.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",f[f.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",f[f.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",f[f.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",f[f.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",f[f.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",f[f.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(p=g||(g={}))[p.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",p[p.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(m=y||(y={}))[m.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",m[m.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",m[m.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",m[m.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",m[m.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(w=v||(v={}))[w.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",w[w.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",w[w.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",w[w.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",w[w.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(x=b||(b={}))[x.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",x[x.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",x[x.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",x[x.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(_=C||(C={})).MAINNET="-239",_.TESTNET="-3";const S={encode:function(e,t=!1){let n;return e instanceof Uint8Array?n=e:("string"!=typeof e&&(e=JSON.stringify(e)),n=a.decodeUTF8(e)),function(e,t){const n=a.encodeBase64(e);return t?encodeURIComponent(n):n}(n,t)},decode:function(e,t=!1){const n=function(e,t){return t&&(e=decodeURIComponent(e)),a.decodeBase64(e)}(e,t);return{toString:()=>a.encodeUTF8(n),toObject(){try{return JSON.parse(a.encodeUTF8(n))}catch(e){return null}},toUint8Array:()=>n}}};function E(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function R(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;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}class L{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=E(this.keyPair.publicKey)}createKeypair(){return d.box.keyPair()}createKeypairFromString(e){return{publicKey:R(e.publicKey),secretKey:R(e.secretKey)}}createNonce(){return d.randomBytes(this.nonceLength)}encrypt(e,t){const n=(new TextEncoder).encode(e),r=this.createNonce();return function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(r,d.box(n,r,t,this.keyPair.secretKey))}decrypt(e,t){const[n,r]=function(e,t){if(t>=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),o=d.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:E(this.keyPair.publicKey),secretKey:E(this.keyPair.secretKey)}}}function A(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 O extends Error{constructor(e,t){super(e,t),this.message=`${O.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,O.prototype)}get info(){return""}}O.prefix="[TON_CONNECT_SDK_ERROR]";class k extends O{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,k.prototype)}}class T extends O{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,T.prototype)}}class P extends O{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,P.prototype)}}class M extends O{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,M.prototype)}}class N extends O{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,N.prototype)}}class $ extends O{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,$.prototype)}}class j extends O{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,j.prototype)}}class I extends O{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,I.prototype)}}class U extends O{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,U.prototype)}}class W extends O{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,W.prototype)}}class B extends O{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}}class K extends O{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,K.prototype)}}class D extends O{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,D.prototype)}}class F extends O{constructor(...e){super(...e),Object.setPrototypeOf(this,F.prototype)}}const q={[h.UNKNOWN_ERROR]:F,[h.USER_REJECTS_ERROR]:$,[h.BAD_REQUEST_ERROR]:j,[h.UNKNOWN_APP_ERROR]:I,[h.MANIFEST_NOT_FOUND_ERROR]:P,[h.MANIFEST_CONTENT_ERROR]:T};const H=new class{parseError(e){let t=F;return e.code in q&&(t=q[e.code]||F),new t(e.message)}};class V{isError(e){return"error"in e}}const z={[y.UNKNOWN_ERROR]:F,[y.USER_REJECTS_ERROR]:$,[y.BAD_REQUEST_ERROR]:j,[y.UNKNOWN_APP_ERROR]:I};const G=new class extends V{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=F;throw e.error.code in z&&(t=z[e.error.code]||F),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class Y{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return A(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return A(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return A(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e||null}))}}function Q(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}class J{constructor(e,t,n,r,o){this.bridgeUrl=t,this.sessionId=n,this.listener=r,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.isClosed=!1,this.bridgeGatewayStorage=new Y(e,t)}registerSession(){return A(this,void 0,void 0,(function*(){const e=new URL(Q(this.bridgeUrl,this.ssePath));e.searchParams.append("client_id",this.sessionId);const t=yield this.bridgeGatewayStorage.getLastEventId();if(!this.isClosed)return t&&e.searchParams.append("last_event_id",t),this.eventSource=new EventSource(e.toString()),new Promise(((e,t)=>{this.eventSource.onerror=t,this.eventSource.onopen=()=>{this.eventSource.onerror=this.errorsHandler.bind(this),this.eventSource.onmessage=this.messagesHandler.bind(this),e()}}))}))}send(e,t,n,r){return A(this,void 0,void 0,(function*(){const o=new URL(Q(this.bridgeUrl,this.postPath));o.searchParams.append("client_id",this.sessionId),o.searchParams.append("to",t),o.searchParams.append("ttl",(r||this.defaultTtl).toString()),o.searchParams.append("topic",n),yield fetch(o,{method:"post",body:S.encode(e)})}))}pause(){var e;null===(e=this.eventSource)||void 0===e||e.close()}unPause(){return this.registerSession()}close(){var e;this.isClosed=!0,null===(e=this.eventSource)||void 0===e||e.close()}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}errorsHandler(e){var t,n;if(!this.isClosed){if((null===(t=this.eventSource)||void 0===t?void 0:t.readyState)===EventSource.CLOSED)return this.eventSource.close(),void this.registerSession();if((null===(n=this.eventSource)||void 0===n?void 0:n.readyState)===EventSource.CONNECTING)return void console.debug("[TON_CONNET_SDK_ERROR]: Bridge error",JSON.stringify(e));this.errorsListener(e)}}messagesHandler(e){return A(this,void 0,void 0,(function*(){if(e.data!==this.heartbeatMessage&&(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),!this.isClosed)){let n;try{n=JSON.parse(e.data)}catch(t){throw new O(`Bridge message parse failed, message ${t.data}`)}this.listener(n)}}))}}class Z{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return A(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(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))}))}removeConnection(){return A(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return A(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;const n=new L(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:n,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}))}getHttpConnection(){return A(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new O("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new O("Trying to read HTTP connection source while injected connection is stored");return e}))}getInjectedConnection(){return A(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new O("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new O("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return A(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 A(this,void 0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type)return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return A(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return A(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return A(this,void 0,void 0,(function*(){const e=yield this.getConnection();return e&&e.nextRpcRequestId||0}))}}function X(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(t){}}class ee{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.connectionStorage=new Z(e)}static fromStorage(e){return A(this,void 0,void 0,(function*(){const t=new Z(e),n=yield t.getHttpConnection();return new ee(e,{bridgeUrl:n.session.bridgeUrl})}))}connect(e){this.closeGateways();const t=new L;let n="",r=this.standardUniversalLink;return Array.isArray(this.walletConnectionSource)?(this.pendingGateways=this.walletConnectionSource.map((e=>{const n=new J(this.storage,e.bridgeUrl,t.sessionId,(()=>{}),(e=>{console.error(e)}));return n.setListener((t=>this.pendingGatewaysListener(n,e.bridgeUrl,t))),n})),this.pendingGateways.forEach((e=>e.registerSession()))):(n=this.walletConnectionSource.bridgeUrl,this.walletConnectionSource.universalLink&&(r=this.walletConnectionSource.universalLink),this.gateway=new J(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),this.gateway.registerSession()),this.session={sessionCrypto:t,bridgeUrl:n},this.generateUniversalLink(r,e)}restoreConnection(){return A(this,void 0,void 0,(function*(){if(Array.isArray(this.walletConnectionSource))throw new O("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");this.closeGateways();const e=yield this.connectionStorage.getHttpConnection();e&&(this.session=e.session,this.gateway=new J(this.storage,this.walletConnectionSource.bridgeUrl,e.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession(),this.listeners.forEach((t=>t(e.connectEvent))))}))}sendRequest(e,t){return new Promise(((n,r)=>A(this,void 0,void 0,(function*(){if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new O("Trying to send bridge request without session");const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),X("Send http-bridge request:",Object.assign(Object.assign({},e),{id:o}));const i=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:o})),R(this.session.walletPublicKey));this.gateway.send(i,this.session.walletPublicKey,e.method).catch(r),this.pendingRequests.set(o.toString(),n),null==t||t()}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(){return A(this,void 0,void 0,(function*(){return new Promise((e=>A(this,void 0,void 0,(function*(){let t=!1;const n=()=>{t=!0,this.removeBridgeAndSession().then(e)};try{yield this.sendRequest({method:"disconnect",params:[]},n)}catch(r){console.debug(r),t||this.removeBridgeAndSession().then(e)}}))))}))}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 A(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 A(this,void 0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);e.close()}))}gatewayListener(e){return A(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(S.decode(e.message).toUint8Array(),R(e.from)));if(X("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 X(`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 function(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(t){}}(`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&&(yield this.removeBridgeAndSession()),n.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return A(this,void 0,void 0,(function*(){throw new O(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return A(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 A(this,void 0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(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()}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 te(e,t){return ne(e,[t])}function ne(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}function re(){if("undefined"!=typeof window)return window}function oe(){var e;const t=null===(e=re())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}class ie{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=ie.window;if(!ie.isWindowContainsWallet(n,t))throw new U;this.connectionStorage=new Z(e),this.injectedWallet=n[t].tonconnect}static fromStorage(e){return A(this,void 0,void 0,(function*(){const t=new Z(e),n=yield t.getInjectedConnection();return new ie(e,n.jsBridgeKey)}))}static isWalletInjected(e){return ie.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!ie.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return Object.entries(this.window).filter((([e,t])=>function(e){try{return!(!te(e,"tonconnect")||!te(e.tonconnect,"walletInfo"))&&ne(e.tonconnect.walletInfo,["name","image","about_url"])}catch(t){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.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})))}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 A(this,void 0,void 0,(function*(){try{X("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();X("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 A(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){X(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){return A(this,void 0,void 0,(function*(){const n=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),X("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:n}));const r=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:n}));return r.then((e=>X("Wallet message received:",e))),null==t||t(),r}))}_connect(e,t){return A(this,void 0,void 0,(function*(){try{X(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const n=yield this.injectedWallet.connect(e,t);X("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(n)))}catch(n){X(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=>{X("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})}}ie.window=re();class se{constructor(){const e=re();if(!(null==e?void 0:e.localStorage))throw new W;this.window=e}getItem(e){return A(this,void 0,void 0,(function*(){return Promise.resolve(this.window.localStorage.getItem(e))}))}removeItem(e){return A(this,void 0,void 0,(function*(){return this.window.localStorage.removeItem(e),Promise.resolve()}))}setItem(e,t){return this.window.localStorage.setItem(e,t),Promise.resolve()}}function ae(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function le(e){return ae(e)&&e.embedded}function ce(e){return"bridgeUrl"in e}class ue{constructor(e){this.walletsListCache=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets.json",e&&(this.walletsListSource=e)}getWallets(){return A(this,void 0,void 0,(function*(){return this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.catch((()=>this.walletsListCache=null))),this.walletsListCache}))}getEmbeddedWallet(){return A(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter(le);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return A(this,void 0,void 0,(function*(){try{const e=yield fetch(this.walletsListSource),t=yield e.json();if(!Array.isArray(t)||!t.every((e=>this.isCorrectWalletConfigDTO(e))))throw new B("Wrong wallets list format");const n=ie.getCurrentlyInjectedWallets();return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),n)}catch(e){throw new B(e)}}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns};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=ie.isWalletInjected(e),t.embedded=ie.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))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 de extends O{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,de.prototype)}}function he(e,t){const n=e.includes("SendTransaction"),r=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!n&&!r)throw new de("Wallet doesn't support SendTransaction feature.");if(r&&void 0!==r.maxMessages){if(r.maxMessages<t.requiredMessagesNumber)throw new de(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${r.maxMessages}, but ${t.requiredMessagesNumber} is required.`)}else!function(...e){try{console.warn("[TON_CONNECT_SDK]",...e)}catch(t){}}("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}class fe{constructor(e){if(this.walletsList=new ue,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||oe(),storage:(null==e?void 0:e.storage)||new se},this.walletsList=new ue(null==e?void 0:e.walletsListSource),!this.dappSettings.manifestUrl)throw new k("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new Z(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(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;if(this.connected)throw new M;return null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=this.createProvider(e),this.provider.connect(this.createConnectRequest(t))}restoreConnection(){return A(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);try{switch(e){case"http":this.provider=yield ee.fromStorage(this.dappSettings.storage);break;case"injected":this.provider=yield ie.fromStorage(this.dappSettings.storage);break;default:if(!t)return;this.provider=yield this.createProvider(t)}}catch(n){return yield this.bridgeConnectionStorage.removeConnection(),void(this.provider=null)}return this.provider.listen(this.walletEventsListener.bind(this)),this.provider.restoreConnection()}))}sendTransaction(e){return A(this,void 0,void 0,(function*(){this.checkConnection(),he(this.wallet.device.features,{requiredMessagesNumber:e.messages.length});const{validUntil:t}=e,n=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<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["validUntil"]),r=e.from||this.account.address,o=e.network||this.account.chain,i=yield this.provider.sendRequest(G.convertToRpcRequest(Object.assign(Object.assign({},n),{valid_until:t,from:r,network:o})));return G.isError(i)?G.parseAndThrowError(i):G.convertFromRpcResponse(i)}))}disconnect(){return A(this,void 0,void 0,(function*(){if(!this.connected)throw new N;yield this.provider.disconnect(),this.onWalletDisconnected()}))}pauseConnection(){var e;"http"===(null===(e=this.provider)||void 0===e?void 0:e.type)&&this.provider.pause()}unPauseConnection(){var e;return"http"!==(null===(e=this.provider)||void 0===e?void 0:e.type)?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const e=function(){if("undefined"!=typeof document)return document}();if(e)try{e.addEventListener("visibilitychange",(()=>{e.hidden?this.pauseConnection():this.unPauseConnection()}))}catch(t){console.error("Cannot subscribe to the document.visibilitychange: ",t)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new ie(this.dappSettings.storage,e.jsBridgeKey):new ee(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 O("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=H.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),console.debug(t),t instanceof P||t instanceof T)throw console.error(t),t}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new N}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}}}fe.walletsList=new ue,fe.isWalletInjected=e=>ie.isWalletInjected(e),fe.isInsideWalletBrowser=e=>ie.isInsideWalletBrowser(e);const ge=17,pe=128;function ye(e,t=!1){const{wc:n,hex:r}=function(e){if(!e.includes(":"))throw new K(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new K(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new K(`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 K(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:ve(r)}}(e);let o=ge;t&&(o|=pe);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),S.encode(s).replace(/\+/g,"-").replace(/\//g,"_")}const me={};for(let Ea=0;Ea<=255;Ea++){let e=Ea.toString(16);e.length<2&&(e="0"+e),me[e]=Ea}function ve(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new D("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o<n;o++){const t=2*o,n=e.substring(t,t+2);if(!me.hasOwnProperty(n))throw new D("Invalid hex character: "+n);r[o]=me[n]}return r}const we={};const be=Symbol("solid-proxy"),xe=Symbol("solid-track"),Ce={equals:(e,t)=>e===t};let _e=tt;const Se=1,Ee=2,Re={owned:null,cleanups:null,context:null,owner:null},Le={};var Ae=null;let Oe,ke=null,Te=null,Pe=null,Me=null,Ne=0;function $e(e,t){const n=Te,r=Ae,o=0===e.length,i=o?Re:{owned:null,cleanups:null,context:null,owner:void 0===t?r:t},s=o?e:()=>e((()=>Fe((()=>it(i)))));Ae=i,Te=null;try{return et(s,!0)}finally{Te=n,Ae=r}}function je(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Ce,t):Ce).equals||void 0};return[Ye.bind(n),e=>("function"==typeof e&&(e=e(n.value)),Qe(n,e))]}function Ie(e,t,n){Je(Ze(e,t,!0,Se))}function Ue(e,t,n){Je(Ze(e,t,!1,Se))}function We(e,t,n){_e=nt;const r=Ze(e,t,!1,Se);r.user=!0,Me?Me.push(r):Je(r)}function Be(e,t,n){n=n?Object.assign({},Ce,n):Ce;const r=Ze(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Je(r),Ye.bind(r)}function Ke(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=Le,l=null,c=!1,u="initialValue"in i,d="function"==typeof r&&Be(r);const h=new Set,[f,g]=(i.storage||je)(i.initialValue),[p,y]=je(void 0),[m,v]=je(void 0,{equals:!1}),[w,b]=je(u?"ready":"unresolved");if(we.context){let e;l=`${we.context.id}${we.context.count++}`,"initial"===i.ssrLoadFrom?a=i.initialValue:we.load&&(e=we.load(l))&&(a=e[0])}function x(e,t,n,r){return s===e&&(s=null,u=!0,e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(r,{value:t}))),a=Le,function(e,t){et((()=>{void 0===t&&g((()=>e)),b(void 0!==t?"errored":"ready"),y(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,n)),t}function C(){const e=Oe,t=f(),n=p();if(void 0!==n&&!s)throw n;return Te&&!Te.user&&e&&Ie((()=>{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 x(s,Fe(f));const n=a!==Le?a:Fe((()=>o(t,{value:f(),refetching:e})));return"object"==typeof n&&n&&"then"in n?(s=n,c=!0,queueMicrotask((()=>c=!1)),et((()=>{b(u?"refreshing":"pending"),v()}),!1),n.then((e=>x(n,e,void 0,t)),(e=>x(n,void 0,st(e),t)))):(x(s,n,void 0,t),n)}return Object.defineProperties(C,{state:{get:()=>w()},error:{get:()=>p()},loading:{get(){const e=w();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return C();const e=p();if(e&&!s)throw e;return f()}}}),d?Ie((()=>_(!1))):_(!1),[C,{refetch:_,mutate:g}]}function De(e){return et(e,!1)}function Fe(e){if(null===Te)return e();const t=Te;Te=null;try{return e()}finally{Te=t}}function qe(e){return null===Ae||(null===Ae.cleanups?Ae.cleanups=[e]:Ae.cleanups.push(e)),e}function He(){return Te}function Ve(e,t){const n=Symbol("context");return{id:n,Provider:ut(n),defaultValue:e}}function ze(e){let t;return void 0!==(t=lt(Ae,e.id))?t:e.defaultValue}function Ge(e){const t=Be(e),n=Be((()=>ct(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function Ye(){const e=ke;if(this.sources&&(this.state||e))if(this.state===Se||e)Je(this);else{const e=Pe;Pe=null,et((()=>rt(this)),!1),Pe=e}if(Te){const e=this.observers?this.observers.length:0;Te.sources?(Te.sources.push(this),Te.sourceSlots.push(e)):(Te.sources=[this],Te.sourceSlots=[e]),this.observers?(this.observers.push(Te),this.observerSlots.push(Te.sources.length-1)):(this.observers=[Te],this.observerSlots=[Te.sources.length-1])}return this.value}function Qe(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&et((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=ke&&ke.running;r&&ke.disposed.has(n),(r&&!n.tState||!r&&!n.state)&&(n.pure?Pe.push(n):Me.push(n),n.observers&&ot(n)),r||(n.state=Se)}if(Pe.length>1e6)throw Pe=[],new Error}),!1)),t}function Je(e){if(!e.fn)return;it(e);const t=Ae,n=Te,r=Ne;Te=Ae=e,function(e,t,n){let r;try{r=e.fn(t)}catch(o){e.pure&&(e.state=Se,e.owned&&e.owned.forEach(it),e.owned=null),at(o)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Qe(e,r):e.value=r,e.updatedAt=n)}(e,e.value,r),Te=n,Ae=t}function Ze(e,t,n,r=Se,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ae,context:null,pure:n};return null===Ae||Ae!==Re&&(Ae.owned?Ae.owned.push(i):Ae.owned=[i]),i}function Xe(e){const t=ke;if(0===e.state||t)return;if(e.state===Ee||t)return rt(e);if(e.suspense&&Fe(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ne);)(e.state||t)&&n.push(e);for(let r=n.length-1;r>=0;r--)if((e=n[r]).state===Se||t)Je(e);else if(e.state===Ee||t){const t=Pe;Pe=null,et((()=>rt(e,n[0])),!1),Pe=t}}function et(e,t){if(Pe)return e();let n=!1;t||(Pe=[]),Me?n=!0:Me=[],Ne++;try{const t=e();return function(e){Pe&&(tt(Pe),Pe=null);if(e)return;const t=Me;Me=null,t.length&&et((()=>_e(t)),!1)}(n),t}catch(r){n||(Me=null),Pe=null,at(r)}}function tt(e){for(let t=0;t<e.length;t++)Xe(e[t])}function nt(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Xe(r)}var r;for(we.context&&(we.context=r),t=0;t<n;t++)Xe(e[t])}function rt(e,t){const n=ke;e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];o.sources&&(o.state===Se||n?o!==t&&Xe(o):(o.state===Ee||n)&&rt(o,t))}}function ot(e){const t=ke;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];r.state&&!t||(r.state=Ee,r.pure?Pe.push(r):Me.push(r),r.observers&&ot(r))}}function it(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)it(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function st(e){return e instanceof Error||"string"==typeof e?e:new Error("Unknown error")}function at(e){throw e=st(e)}function lt(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:lt(e.owner,t):void 0}function ct(e){if("function"==typeof e&&!e.length)return ct(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=ct(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ut(e,t){return function(t){let n;return Ue((()=>n=Fe((()=>(Ae.context={[e]:t.value},Ge((()=>t.children)))))),void 0),n}}const dt=Symbol("fallback");function ht(e){for(let t=0;t<e.length;t++)e[t]()}function ft(e,t){return Fe((()=>e(t||{})))}function gt(){return!0}const pt={get:(e,t,n)=>t===be?n:e.get(t),has:(e,t)=>t===be||e.has(t),set:gt,deleteProperty:gt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:gt,deleteProperty:gt}),ownKeys:e=>e.keys()};function yt(e){return(e="function"==typeof e?e():e)?e:{}}function mt(...e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];t=t||!!n&&be in n,e[r]="function"==typeof n?(t=!0,Be(n)):n}if(t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=yt(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in yt(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(yt(e[n])));return[...new Set(t)]}},pt);const n={};for(let r=e.length-1;r>=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 vt(e,...t){const n=new Set(t.flat());if(be 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))},pt)));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)))},pt)),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;o<t.length;o++){const i=t[o];i in e&&Object.defineProperty(n,i,r[i]?r[i]:{get:()=>e[i],set:()=>!0,enumerable:!0})}return n}))}function wt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Be(function(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return qe((()=>ht(i))),()=>{let l,c,u=e()||[];return u[xe],Fe((()=>{let e,t,h,f,g,p,y,m,v,w=u.length;if(0===w)0!==s&&(ht(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[dt],o[0]=$e((e=>(i[0]=e,n.fallback()))),s=1);else if(0===s){for(o=new Array(w),c=0;c<w;c++)r[c]=u[c],o[c]=$e(d);s=w}else{for(h=new Array(w),f=new Array(w),a&&(g=new Array(w)),p=0,y=Math.min(s,w);p<y&&r[p]===u[p];p++);for(y=s-1,m=w-1;y>=p&&m>=p&&r[y]===u[m];y--,m--)h[m]=o[y],f[m]=i[y],a&&(g[m]=a[y]);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<=y;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;c<w;c++)c in h?(o[c]=h[c],i[c]=f[c],a&&(a[c]=g[c],a[c](c))):o[c]=$e(d);o=o.slice(0,s=w),r=u.slice(0)}return o}));function d(e){if(i[c]=e,a){const[e,n]=je(c);return a[c]=n,t(u[c],e)}return t(u[c])}}}((()=>e.each),e.children,t||void 0))}function bt(e){let t=!1;const n=e.keyed,r=Be((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return Be((()=>{const o=r();if(o){const r=e.children,i="function"==typeof r&&r.length>0;return t=n||i,i?Fe((()=>r(o))):r}return e.fallback}),void 0,void 0)}function xt(e){let t=!1,n=!1;const r=Ge((()=>e.children)),o=Be((()=>{let e=r();Array.isArray(e)||(e=[e]);for(let t=0;t<e.length;t++){const r=e[t].when;if(r)return n=!!e[t].keyed,[t,r,e[t]]}return[-1]}),void 0,{equals:(e,n)=>e[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return Be((()=>{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?Fe((()=>a(i))):a}),void 0,void 0)}function Ct(e){return e}const _t=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"]),St=new Set(["innerHTML","textContent","innerText","children"]),Et=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Rt=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),Lt=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),At=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"]),Ot={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const kt="_$DX_DELEGATE";function Tt(e,t,n){const r=document.createElement("template");r.innerHTML=e;let o=r.content.firstChild;return n&&(o=o.firstChild),o}function Pt(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Mt(e,t){null==t?e.removeAttribute("class"):e.className=t}function Nt(e,t={},n,r){const o={};return r||Ue((()=>o.children=Kt(e,t.children,o.children))),Ue((()=>t.ref&&t.ref(e))),Ue((()=>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]=Wt(e,s,null,o[s],n,i)}for(const s in t){if("children"===s){r||Kt(e,t.children);continue}const a=t[s];o[s]=Wt(e,s,a,o[s],n,i)}}(e,t,n,!0,o,!0))),o}function $t(e,t,n){return Fe((()=>e(t,n)))}function jt(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return Kt(e,t,r,n);Ue((r=>Kt(e,t(),r,n)),r)}function It(e){let t,n;return we.context&&(t=we.registry.get(n=function(){const e=we.context;return`${e.id}${e.count++}`}()))?(we.completed&&we.completed.add(t),we.registry.delete(n),t):e.cloneNode(!0)}function Ut(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Wt(e,t,n,r,o,i){let s,a,l;if("style"===t)return function(e,t,n){if(!t)return n?Pt(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Ut(e,r,!1),delete n[r])}for(i=0,s=r.length;i<s;i++){const o=r[i],s=!!t[o];o&&"undefined"!==o&&n[o]!==s&&s&&(Ut(e,o,!0),n[o]=s)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r),n&&e.addEventListener(o,n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=Lt.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(function(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n)}(e,o,n,i),i&&function(e,t=window.document){const n=t[kt]||(t[kt]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Bt))}}([o]))}else if((l=St.has(t))||!o&&(Rt[t]||(a=_t.has(t)))||(s=e.nodeName.includes("-")))"class"===t||"className"===t?Mt(e,n):!s||a||l?e[Rt[t]||t]=n:e[(c=t,c.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase())))]=n;else{const r=o&&t.indexOf(":")>-1&&Ot[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Pt(e,Et[t]||t,n)}var c;return n}function Bt(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}),we.registry&&!we.done&&(we.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 Kt(e,t,n,r,o){for(we.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(we.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=qt(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i){if(we.context)return n;n=qt(e,n,r)}else{if("function"===i)return Ue((()=>{let o=t();for(;"function"==typeof o;)o=o();n=Kt(e,o,n,r)})),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(Dt(i,t,n,o))return Ue((()=>n=Kt(e,i,n,r,!0))),()=>n;if(we.context){if(!i.length)return n;for(let e=0;e<i.length;e++)if(i[e].parentNode)return n=i}if(0===i.length){if(n=qt(e,n,r),s)return n}else a?0===n.length?Ft(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;)if(t[s]!==n[a]){for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const t=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],t)}else if(i===a)for(;s<o;)c&&c.has(t[s])||t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=a;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[s]);if(null!=r)if(a<r&&r<i){let l,u=s,d=1;for(;++u<o&&u<i&&null!=(l=c.get(t[u]))&&l===r+d;)d++;if(d>r-a){const o=t[s];for(;a<r;)e.insertBefore(n[a++],o)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}else s++,a++}(e,n,i):(n&&qt(e),Ft(e,i));n=i}else if(t instanceof Node){if(we.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=qt(e,n,r,t);qt(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function Dt(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let s=t[i],a=n&&n[i];if(s instanceof Node)e.push(s);else if(null==s||!0===s||!1===s);else if(Array.isArray(s))o=Dt(e,s,a)||o;else if("function"==typeof s)if(r){for(;"function"==typeof s;)s=s();o=Dt(e,Array.isArray(s)?s:[s],Array.isArray(a)?a:[a])||o}else e.push(s),o=!0;else{const t=String(s);a&&3===a.nodeType&&a.data===t?e.push(a):e.push(document.createTextNode(t))}}return o}function Ft(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function qt(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=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 Ht="http://www.w3.org/2000/svg";function Vt(e,t=!1){return t?document.createElementNS(Ht,e):document.createElement(e)}function zt(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function o(){if(we.context){const[t,n]=je(!1);return queueMicrotask((()=>n(!0))),()=>t()&&e.children}return()=>e.children}if(r instanceof HTMLHeadElement){const[e,t]=je(!1),n=()=>t(!0);$e((t=>jt(r,(()=>e()?t():o()()),null))),qe((()=>{we.context?queueMicrotask(n):n()}))}else{const i=Vt(e.isSVG?"g":"div",e.isSVG),s=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get:()=>n.parentNode,configurable:!0}),jt(s,o()),r.appendChild(i),e.ref&&e.ref(i),qe((()=>r.removeChild(i)))}return n}function Gt(e){const[t,n]=vt(e,["component"]),r=Be((()=>t.component));return Be((()=>{const e=r();switch(typeof e){case"function":return Fe((()=>e(n)));case"string":const t=At.has(e),r=we.context?It():Vt(e,t);return Nt(r,n,t),r}}))}const[Yt,Qt]=je(!1),[Jt,Zt]=je(null),[Xt,en]=je(null);let tn={data:""},nn=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||tn,rn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,on=/\/\*[^]*?\*\/| +/g,sn=/\n+/g,an=(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]?an(s,i):i+"{"+an(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=an(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+=an.p?an.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},ln={},cn=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+cn(e[n]);return t}return e},un=(e,t,n,r,o)=>{let i=cn(e),s=ln[i]||(ln[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!ln[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=rn.exec(e.replace(on,""));)t[4]?r.shift():t[3]?(n=t[3].replace(sn," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(sn," ").trim();return r[0]})(e);ln[s]=an(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&ln.g?ln.g:null;return n&&(ln.g=ln[s]),l=ln[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},dn=(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?"":an(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),"");function hn(e){let t=this||{},n=e.call?e(t.p):e;return un(n.unshift?n.raw?dn(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,nn(t.target),t.g,t.o,t.k)}hn.bind({g:1});let fn=hn.bind({k:1});const gn=Ve();function pn(e){return ft(gn.Provider,{value:e.theme,get children(){return e.children}})}function yn(){return ze(gn)}function mn(e){let t=this||{};return(...n)=>{const r=r=>{const o=mt(r,{theme:ze(gn)}),i=mt(o,{get class(){const e=o.class,r="class"in o&&/^go[0-9]+/.test(e);return[e,hn.apply({target:t.target,o:r,p:o,g:t.g},n)].filter(Boolean).join(" ")}}),[s,a]=vt(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),Nt(u,l)):u=Gt(mt({component:c},l)),u};return r.class=e=>Fe((()=>hn.apply({target:t.target,p:e,g:t.g},n))),r}}const vn=new Proxy(mn,{get:(e,t)=>e(t)});function wn(){const e=mn.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const bn={common:{close:"Закрыть",get:"Скачать",learnMore:"Подробнее",openExtension:"Расширение",copyLink:"Копировать ссылку",copied:"Скопировано!",yourWallet:"вашем кошельке"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},walletModal:{loading:"Список кошельков загружается",qrCode:"QR-код",wallets:"Кошельки",universalQRModal:{scanQR:"Отсканируйте код ниже с помощью камеры в вашем TON-кошельке.",openWallet:"Открыть кошелёк",openInstalledWallet:"Открыть кошелёк",dontHave:"Подробнее о TON кошельках"},desktopSelectWalletModal:{selectWallet:"Выберите кошелёк для подключения."},mobileSelectWalletModal:{connectWallet:"Подключите кошелёк",selectWallet:"$walletModal.desktopSelectWalletModal.selectWallet",installedWallet:"Открыть кошелёк"},qrCodeModal:{connectWith:"Подключиться через {{ name }}",scan:"Отсканируйте код ниже.",openWallet:"Открыть {{ name }}",openExtension:"Расширение",dontHave:"У вас нет {{ name }}?"}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}},xn={en:Cn({common:{close:"Close",get:"GET",learnMore:"Learn more",openExtension:"Open Extension",copyLink:"Copy Link",copied:"Copied!",yourWallet:"your wallet"},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."}},walletModal:{loading:"Loading wallets",qrCode:"QR Code",wallets:"Wallets",universalQRModal:{scanQR:"Scan the code below with a camera in your TON wallet.",openWallet:"Open Wallet",openInstalledWallet:"Open Wallet",dontHave:"Explore TON wallets"},desktopSelectWalletModal:{selectWallet:"Select a wallet to connect."},mobileSelectWalletModal:{connectWallet:"Connect a Wallet",selectWallet:"$walletModal.desktopSelectWalletModal.selectWallet",installedWallet:"Installed Wallet"},qrCodeModal:{connectWith:"Connect with {{ name }}",scan:"Scan the code below.",openWallet:"Open {{ name }}",openExtension:"Open Extension",dontHave:"Don't have {{ name }}?"}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru:Cn(bn)};function Cn(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 _n=Ve(),Sn=Symbol("store-raw"),En=Symbol("store-node"),Rn=Symbol("store-name");function Ln(e,t){let n=e[be];if(!n&&(Object.defineProperty(e,be,{value:n=new Proxy(e,Nn)}),!Array.isArray(e))){const t=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=t.length;o<i;o++){const i=t[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(n)})}}return n}function An(e){let t;return null!=e&&"object"==typeof e&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function On(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[Sn])return n;if(!An(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=On(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let a=0,l=n.length;a<l;a++)i=n[a],s[i].get||(o=e[i],(r=On(o,t))!==o&&(e[i]=r))}return e}function kn(e){let t=e[En];return t||Object.defineProperty(e,En,{value:t={}}),t}function Tn(e,t,n){return e[t]||(e[t]=Mn(n))}function Pn(e){if(He()){const t=kn(e);(t._||(t._=Mn()))()}}function Mn(e){const[t,n]=je(e,{equals:!1,internal:!0});return t.$=n,t}const Nn={get(e,t,n){if(t===Sn)return e;if(t===be)return n;if(t===xe)return Pn(e),n;const r=kn(e),o=r.hasOwnProperty(t);let i=o?r[t]():e[t];if(t===En||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!He()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=Tn(r,t,i)())}return An(i)?Ln(i):i},has(e,t){return t===Sn||t===be||t===xe||t===En||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return Pn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==be&&t!==En&&t!==Rn?(delete n.value,delete n.writable,n.get=()=>e[be][t],n):n}};function $n(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=kn(e);(s=Tn(a,t,o))&&s.$((()=>n)),Array.isArray(e)&&e.length!==i&&(s=Tn(a,"length",i))&&s.$(e.length),(s=a._)&&s.$()}function jn(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];$n(e,o,t[o])}}function In(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)In(e,[r[o]].concat(t),n);return}if(s&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&In(e,[o].concat(t),n);return}if(s&&"object"===i){const{from:o=0,to:i=e.length-1,by:s=1}=r;for(let r=o;r<=i;r+=s)In(e,[r].concat(t),n);return}if(t.length>1)return void In(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=On(i),void 0===r||An(o)&&An(i)&&!Array.isArray(i)?jn(o,i):$n(e,r,i))}function Un(...[e,t]){const n=On(e||{}),r=Array.isArray(n);return[Ln(n),function(...e){De((()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=On(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&$n(e,n,r)}$n(e,"length",r)}else jn(e,t)}(n,e[0]):In(n,e)}))}]}var Wn=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Wn||{});const Bn={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#31A6F5",foreground:"#FFFFFF"},accent:"#31A6F5",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF"},text:{primary:"#0F0F0F",secondary:"#6A7785"}};var Kn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Dn}(e)}(e)};var Dn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Fn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Gn((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function qn(e,t,n){return e.concat(t).map((function(e){return Fn(e,n)}))}function Hn(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Vn(e,t){try{return t in e}catch(n){return!1}}function zn(e,t,n){var r={};return n.isMergeableObject(e)&&Hn(e).forEach((function(t){r[t]=Fn(e[t],n)})),Hn(t).forEach((function(o){(function(e,t){return Vn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(Vn(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Gn;var n=t.customMerge(e);return"function"==typeof n?n:Gn}(o,n)(e[o],t[o],n):r[o]=Fn(t[o],n))})),r}function Gn(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||qn,n.isMergeableObject=n.isMergeableObject||Kn,n.cloneUnlessOtherwiseSpecified=Fn;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):zn(e,t,n):Fn(t,n)}Gn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Gn(e,n,t)}),{})};var Yn=Gn;function Qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Jn(e){var t,n;return!1!==Qn(e)&&(void 0===(t=e.constructor)||!1!==Qn(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function Zn(e,t){if(!e)return t;return Yn(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:Jn})}const[Xn,er]=Un({theme:Wn.LIGHT,colors:Bn,borderRadius:"m"}),tr={[Wn.LIGHT]:Bn,[Wn.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#31A6F5",foreground:"#FFFFFF"},accent:"#E5E5EA",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},nr={[Wn.LIGHT]:void 0,[Wn.DARK]:void 0};function rr(e,t){t&&(nr[Wn.DARK]=Zn(t[Wn.DARK],nr[Wn.DARK]),nr[Wn.LIGHT]=Zn(t[Wn.LIGHT],nr[Wn.LIGHT])),er({theme:e,colors:Zn(nr[e],tr[e])})}const or="tc-root",ir="tc-disable-scroll",sr="tc-using-mouse",ar=()=>{document.body.addEventListener("mousedown",(()=>document.body.classList.add(sr))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove(sr)}));return ft(wn`
|
|
2
|
+
${or} * {
|
|
10
3
|
margin: 0;
|
|
11
4
|
padding: 0;
|
|
12
5
|
box-sizing: border-box;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
html, body {
|
|
6
|
+
|
|
7
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif;
|
|
16
8
|
-webkit-font-smoothing: antialiased;
|
|
17
|
-
-moz-osx-font-smoothing: grayscale;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
-webkit-tap-highlight-color: transparent;
|
|
18
11
|
}
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
${or} img {
|
|
14
|
+
-webkit-user-select: none;
|
|
15
|
+
-webkit-touch-callout: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${or} *:focus {
|
|
21
19
|
outline: #08f auto 2px;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
|
|
22
|
+
${or} li {
|
|
23
|
+
list-style: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${or} button {
|
|
25
27
|
outline: none;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
body.${ir} {
|
|
31
|
+
position: fixed;
|
|
32
|
+
overflow-y: scroll;
|
|
33
|
+
right: 0;
|
|
34
|
+
left: 0;
|
|
30
35
|
}
|
|
31
|
-
|
|
36
|
+
|
|
37
|
+
body.${sr} ${or} *:focus {
|
|
32
38
|
outline: none;
|
|
33
39
|
}
|
|
34
|
-
`,{})}
|
|
35
|
-
background-color: ${e=>
|
|
40
|
+
`,{})},lr=vn.div`
|
|
41
|
+
background-color: ${e=>e.theme.colors.background.secondary};
|
|
42
|
+
`,cr=e=>{let t;const[n,r]=je(null);return We((()=>{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))))})),[ft(bt,{get when(){return n()},get children(){return n()}}),ft(bt,{get when(){return!n()},get children(){return ft(lr,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};function ur(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 dr(e){return e.toString()+"px"}class hr extends O{constructor(...e){super(...e),Object.setPrototypeOf(this,hr.prototype)}}function fr(e,t="_self"){return window.open(e,t,"noreferrer noopener")}function gr(e){fr(e,"_blank")}function pr(e,t){return function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",t)}function yr(){if("undefined"==typeof localStorage)throw new hr("window.localStorage is undefined. localStorage is required for TonConnectUI")}function mr(){if("undefined"!=typeof window)return window}const vr={mobile:440,tablet:1020};function wr(e){const t=mr();if(!t)return"desktop"===e;const n=t.innerWidth;switch(e){case"desktop":return n>vr.tablet;case"tablet":return n>vr.mobile;default:return n<=vr.mobile}}function br(e){switch(e){case"mobile":return`@media (max-width: ${vr.mobile}px)`;case"tablet":return`@media (max-width: ${vr.tablet}px) (min-width: ${vr.mobile}px)`;default:return`@media (min-width: ${vr.tablet}px)`}}const xr="@media (hover: none)",Cr="@media not all and (hover: none)",_r={m:"100vh",s:"8px",none:"0"},Sr={s:.02,m:.04},Er=vn.button`
|
|
43
|
+
background-color: ${e=>"flat"===e.appearance?"transparent":ur(e.theme.colors.accent,.12)};
|
|
36
44
|
color: ${e=>e.theme.colors.accent};
|
|
37
45
|
|
|
38
|
-
padding: 9px 16px;
|
|
46
|
+
padding: ${e=>"flat"===e.appearance?"0":"9px 16px"};
|
|
39
47
|
border: none;
|
|
40
|
-
border-radius: ${e=>
|
|
48
|
+
border-radius: ${e=>_r[e.theme.borderRadius]};
|
|
41
49
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
42
50
|
|
|
43
51
|
font-size: 14px;
|
|
44
52
|
font-weight: 590;
|
|
45
53
|
line-height: 18px;
|
|
46
|
-
letter-spacing: -0.154px;
|
|
47
54
|
|
|
48
|
-
transition: transform 0.
|
|
55
|
+
transition: transform 0.125s ease-in-out;
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
${Cr} {
|
|
58
|
+
&:hover {
|
|
59
|
+
transform: ${e=>e.disabled?"unset":`scale(${1+Sr[e.scale]})`};
|
|
60
|
+
}
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
&:active {
|
|
55
|
-
transform: ${e=>e.disabled?"unset"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
transform: ${e=>e.disabled?"unset":`scale(${1-Sr[e.scale]})`};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
${xr} {
|
|
68
|
+
&:active {
|
|
69
|
+
transform: ${e=>e.disabled?"unset":`scale(${1-2*Sr[e.scale]})`};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;function Rr(e){const t=Fe((()=>Object.keys(e).filter((e=>e.startsWith("data-"))))),[n]=vt(e,t);return n}const Lr=e=>{const t=Rr(e);return ft(Er,mt({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"},"data-tc-button":"true"},t,{get children(){return e.children}}))};var Ar={exports:{}};!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var s=n.apply(null,o);s&&e.push(s)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var a in o)t.call(o,a)&&o[a]&&e.push(a)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(Ar);const Or=Ar.exports;function kr(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}const Tr=e=>{let t,n=!0;const[r,o]=je(),[i,s]=je(),a=Ge((()=>e.children)),{onBeforeEnter:l,onEnter:c,onAfterEnter:u,onBeforeExit:d,onExit:h,onAfterExit:f}=e,g=Be((()=>{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),De((()=>{r()!==t&&o(t),i()===t&&s(void 0)})),u&&u(t),"inout"===e.mode&&y(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),kr((()=>{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 y(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),kr((()=>{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 Ie((r=>{for(t=a();"function"==typeof t;)t=t();return Fe((()=>(t&&t!==r&&("outin"!==e.mode?p(t,r):n&&o(t)),r&&r!==t&&"inout"!==e.mode&&y(t,r),n=!1,t)))})),[r,i]};function Pr(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 Mr=e=>{const t=Ge((()=>e.children)),n=Be((()=>{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]=je();let d=[],h=!0;return Ie((()=>{const e=t(),c=[...e],f=new Set(e),g=new Set(d),p=n().enterClass.split(" "),y=n().enterActiveClass.split(" "),m=n().enterToClass.split(" "),v=n().exitClass.split(" "),w=n().exitActiveClass.split(" "),b=n().exitToClass.split(" ");for(let t=0;t<e.length;t++){const n=e[t];if(!h&&!g.has(n)){let e=function(t){!n||t&&t.target!==n||(n.removeEventListener("transitionend",e),n.removeEventListener("animationend",e),n.classList.remove(...y),n.classList.remove(...m),i&&i(n))};r&&r(n),n.classList.add(...p),n.classList.add(...y),kr((()=>{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;t<d.length;t++){const e=d[t];if(!f.has(e)&&e.parentNode){let n=function(t){t&&t.target!==e||(e.removeEventListener("transitionend",n),e.removeEventListener("animationend",n),e.classList.remove(...w),e.classList.remove(...b),l&&l(e),d=d.filter((t=>t!==e)),u(d))};c.splice(t,0,e),s&&s(e),e.classList.add(...v),e.classList.add(...w),kr((()=>{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)})),We((e=>{const t=c();return t.forEach((t=>{let n;(n=e.get(t))?n.new&&(n.new=!1,n.newPos=Pr(t)):e.set(t,n={pos:Pr(t),new:!h}),n.new&&t.addEventListener("transitionend",(()=>{n.new=!1,t.parentNode&&(n.newPos=Pr(t))}),{once:!0}),n.newPos&&(n.pos=n.newPos),n.newPos=Pr(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 Nr=Tt('<svg><path d="M9.1 3.40012L5.5 8.0001L9.1 12.6001" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>',0,!0),$r={left:0,top:90,right:180,bottom:270},jr=e=>{const t=yn();return ft(vn("svg")`
|
|
73
|
+
transform: rotate(${e=>$r[e.svgDirection]}deg);
|
|
64
74
|
transition: transform 0.1s ease-in-out;
|
|
65
|
-
`,{width:"
|
|
75
|
+
`,{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",get svgDirection(){return e.direction||"left"},get children(){const n=Nr.cloneNode(!0);return Ue((()=>Pt(n,"stroke",e.fill||t.colors.icon.secondary))),n}})},Ir=Tt('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.90003 3.89991L8.00002 7.9999M8.00002 7.9999L12.1 12.0999M8.00002 7.9999L12.1 3.8999M8.00002 7.9999L3.90002 12.0999" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),Ur=e=>{const t=yn();return(()=>{const n=Ir.cloneNode(!0),r=n.firstChild;return Ue((()=>Pt(r,"stroke",e.fill||t.colors.icon.secondary))),n})()},Wr=vn.button`
|
|
66
76
|
padding: 0;
|
|
67
77
|
display: flex;
|
|
68
78
|
justify-content: center;
|
|
@@ -74,16 +84,24 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
74
84
|
border: none;
|
|
75
85
|
cursor: pointer;
|
|
76
86
|
|
|
77
|
-
transition: transform 0.
|
|
87
|
+
transition: transform 0.125s ease-in-out;
|
|
78
88
|
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
${Cr} {
|
|
90
|
+
&:hover {
|
|
91
|
+
transform: scale(1.04);
|
|
92
|
+
}
|
|
81
93
|
}
|
|
82
94
|
|
|
83
95
|
&:active {
|
|
84
96
|
transform: scale(0.96);
|
|
85
97
|
}
|
|
86
|
-
|
|
98
|
+
|
|
99
|
+
${xr} {
|
|
100
|
+
&:active {
|
|
101
|
+
transform: scale(0.92);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,Br=e=>{const t=Rr(e),n=()=>e.icon||"close";return ft(Wr,mt({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[ft(bt,{get when(){return!!e.children},get children(){return e.children}}),ft(bt,{get when(){return!e.children},get children(){return ft(xt,{get children(){return[ft(Ct,{get when(){return"close"===n()},get children(){return ft(Ur,{get fill(){return e.fill}})}}),ft(Ct,{get when(){return"arrow"===n()},get children(){return ft(jr,{get fill(){return e.fill}})}})]}})}})]}}))},Kr=vn.div`
|
|
87
105
|
display: flex;
|
|
88
106
|
align-items: center;
|
|
89
107
|
justify-content: center;
|
|
@@ -95,79 +113,242 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
95
113
|
height: 100%;
|
|
96
114
|
background-color: rgba(0, 0, 0, 0.4);
|
|
97
115
|
|
|
98
|
-
${
|
|
116
|
+
${br("mobile")} {
|
|
99
117
|
align-items: flex-end;
|
|
100
118
|
}
|
|
101
|
-
|
|
119
|
+
|
|
120
|
+
@media (min-width: ${vr.mobile.toString()}px) and (max-height: 600px) {
|
|
121
|
+
padding: 48px 0;
|
|
122
|
+
align-items: flex-start;
|
|
123
|
+
overflow: scroll;
|
|
124
|
+
}
|
|
125
|
+
`,Dr=hn`
|
|
102
126
|
position: relative;
|
|
103
127
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16);
|
|
104
128
|
min-height: 100px;
|
|
105
129
|
width: 440px;
|
|
106
130
|
padding: 44px 56px 24px;
|
|
107
131
|
|
|
108
|
-
${
|
|
132
|
+
${br("mobile")} {
|
|
109
133
|
width: 100%;
|
|
110
134
|
}
|
|
111
|
-
`,
|
|
135
|
+
`,Fr=vn(Br)`
|
|
112
136
|
position: absolute;
|
|
113
137
|
right: 16px;
|
|
114
138
|
top: 16px;
|
|
115
|
-
`,
|
|
139
|
+
`,qr=Tt("<div></div>"),Hr=function(e,t){const n=n=>{var r;return!e.contains(n.target)&&(null==(r=t())?void 0:r())};document.body.addEventListener("click",n),qe((()=>document.body.removeEventListener("click",n)))},Vr=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),qe((()=>document.body.removeEventListener("keydown",n)))},zr={m:"24px",s:"16px",none:"0"},Gr=e=>{const t=yn(),n=Rr(e);return We((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=dr(-document.documentElement.scrollTop),document.body.classList.add(ir)):(document.body.classList.remove(ir),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),ft(Tr,{onBeforeEnter:e=>{const t=wr("mobile")?200:100;e.animate([{opacity:0},{opacity:1}],{duration:t}),wr("mobile")&&e.firstElementChild.animate([{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const n=wr("mobile")?200:100,r=e.animate([{opacity:1},{opacity:0}],{duration:n});if(wr("mobile")){const o=e.firstElementChild.animate([{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return ft(bt,{get when(){return e.opened},get children(){return ft(Kr,mt({"data-tc-modal":"true"},n,{get children(){const n=qr.cloneNode(!0);return $t(Vr,n,(()=>()=>e.onClose())),$t(Hr,n,(()=>()=>e.onClose())),jt(n,ft(Fr,{icon:"close",onClick:()=>e.onClose()}),null),jt(n,(()=>e.children),null),Ue((()=>Mt(n,Or(Dr,e.class,hn`
|
|
116
140
|
background-color: ${t.colors.background.primary};
|
|
117
|
-
border-radius: ${
|
|
141
|
+
border-radius: ${zr[t.borderRadius]};
|
|
118
142
|
|
|
119
|
-
${
|
|
120
|
-
border-radius: ${
|
|
121
|
-
${
|
|
143
|
+
${br("mobile")} {
|
|
144
|
+
border-radius: ${zr[t.borderRadius]}
|
|
145
|
+
${zr[t.borderRadius]} 0 0;
|
|
122
146
|
}
|
|
123
|
-
`)
|
|
147
|
+
`)))),n}}))}})}})},Yr={m:"22px",s:"12px",none:"0"},Qr={m:"18px",s:"8px",none:"0"},Jr=vn.div`
|
|
148
|
+
display: grid;
|
|
149
|
+
grid-template: 1fr / 1fr 1fr;
|
|
150
|
+
width: fit-content;
|
|
151
|
+
justify-items: center;
|
|
152
|
+
gap: 4px;
|
|
153
|
+
|
|
154
|
+
position: relative;
|
|
155
|
+
padding: 4px;
|
|
156
|
+
border-radius: ${e=>Yr[e.theme.borderRadius]};
|
|
157
|
+
|
|
158
|
+
background-color: ${e=>e.theme.colors.background.secondary};
|
|
159
|
+
`,Zr=vn.div`
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: 4px;
|
|
162
|
+
left: 4px;
|
|
163
|
+
|
|
164
|
+
height: calc(100% - 8px);
|
|
165
|
+
width: calc(50% - 4px);
|
|
166
|
+
|
|
167
|
+
border-radius: ${e=>Qr[e.theme.borderRadius]};
|
|
168
|
+
background-color: ${e=>e.theme.colors.background.segment};
|
|
169
|
+
|
|
170
|
+
transform: ${e=>e.right?"translateX(100%)":"translateX(0)"};
|
|
171
|
+
|
|
172
|
+
transition: transform 0.13s ease-in-out;
|
|
173
|
+
`,Xr=vn.input`
|
|
174
|
+
display: none;
|
|
175
|
+
`,eo=vn.label`
|
|
176
|
+
padding: 9px 12px;
|
|
177
|
+
z-index: 1;
|
|
178
|
+
|
|
179
|
+
cursor: ${e=>e.isActive?"default":"pointer"};
|
|
180
|
+
|
|
181
|
+
transition: transform 0.13s ease-in-out;
|
|
182
|
+
|
|
183
|
+
&:hover {
|
|
184
|
+
transform: ${e=>e.isActive?"none":"scale(1.025)"};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
> * {
|
|
188
|
+
${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`}
|
|
189
|
+
}
|
|
190
|
+
`,to={m:"16px",s:"8px",none:"0"},no=vn.div`
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
position: relative;
|
|
194
|
+
background-color: ${e=>e.theme.colors.background.secondary};
|
|
195
|
+
border-radius: ${e=>to[e.theme.borderRadius]};
|
|
196
|
+
padding: ${dr(24)} 0;
|
|
197
|
+
height: ${dr(304)};
|
|
198
|
+
width: 100%;
|
|
199
|
+
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
`,ro=vn.div`
|
|
202
|
+
position: relative;
|
|
203
|
+
|
|
204
|
+
width: fit-content;
|
|
205
|
+
margin: 0 auto;
|
|
206
|
+
|
|
207
|
+
> div:first-child {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
rect {
|
|
214
|
+
fill: transparent;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
path {
|
|
218
|
+
fill: ${e=>e.theme.colors.text.primary};
|
|
219
|
+
}
|
|
220
|
+
`,oo=vn.div`
|
|
221
|
+
position: absolute;
|
|
222
|
+
width: ${dr(60)};
|
|
223
|
+
height: ${dr(60)};
|
|
224
|
+
background: ${e=>e.theme.colors.background.secondary};
|
|
225
|
+
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
justify-content: center;
|
|
229
|
+
`,io=vn(cr)`
|
|
230
|
+
width: ${e=>dr(e.size)};
|
|
231
|
+
height: ${e=>dr(e.size)};
|
|
232
|
+
border-radius: 12px;
|
|
233
|
+
`,so=vn(Lr)`
|
|
234
|
+
filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
|
|
235
|
+
position: absolute;
|
|
236
|
+
bottom: 14px;
|
|
237
|
+
left: 50%;
|
|
238
|
+
|
|
239
|
+
transform: translate(-50%, 0);
|
|
240
|
+
|
|
241
|
+
background-color: ${e=>e.theme.colors.background.segment};
|
|
242
|
+
color: ${e=>e.theme.colors.text.primary};
|
|
243
|
+
|
|
244
|
+
&:hover {
|
|
245
|
+
transform: translate(-50%, 0) scale(1.04);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&:active {
|
|
249
|
+
transform: translate(-50%, 0) scale(0.96);
|
|
250
|
+
}
|
|
251
|
+
`;var ao={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<e;n+=1){t[n]=new Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(i=4*n+17),d(0,0),d(i-7,0),d(0,i-7),f(),h(),p(e,t),n>=7&&g(e),null==s&&(s=m(n,r,a)),y(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<i-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(var t=8;t<i-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},f=function(){for(var e=w.getPatternPosition(n),t=0;t<e.length;t+=1)for(var r=0;r<e.length;r+=1){var i=e[t],s=e[r];if(null==o[i][s])for(var a=-2;a<=2;a+=1)for(var l=-2;l<=2;l+=1)o[i+a][s+l]=-2==a||2==a||-2==l||2==l||0==a&&0==l}},g=function(e){for(var t=w.getBCHTypeNumber(n),r=0;r<18;r+=1){var s=!e&&1==(t>>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=w.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},y=function(e,t){for(var n=-1,r=i-1,s=7,a=0,l=w.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<e.length&&(d=1==(e[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=C.getRSBlocks(e,t),o=_(),i=0;i<n.length;i+=1){var s=n[i];o.put(s.getMode(),4),o.put(s.getLength(),w.getLengthInBits(s.getMode(),e)),s.write(o)}var a=0;for(i=0;i<r.length;i+=1)a+=r[i].dataCount;if(o.getLengthInBits()>8*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<t.length;a+=1){var l=t[a].dataCount,c=t[a].totalCount-l;r=Math.max(r,l),o=Math.max(o,c),i[a]=new Array(l);for(var u=0;u<i[a].length;u+=1)i[a][u]=255&e.getBuffer()[u+n];n+=l;var d=w.getErrorCorrectPolynomial(c),h=x(i[a],d.getLength()-1).mod(d);for(s[a]=new Array(d.getLength()-1),u=0;u<s[a].length;u+=1){var f=u+h.getLength()-s[a].length;s[a][u]=f>=0?h.getAt(f):0}}var g=0;for(u=0;u<t.length;u+=1)g+=t[u].totalCount;var p=new Array(g),y=0;for(u=0;u<r;u+=1)for(a=0;a<t.length;a+=1)u<i[a].length&&(p[y]=i[a][u],y+=1);for(u=0;u<o;u+=1)for(a=0;a<t.length;a+=1)u<s[a].length&&(p[y]=s[a][u],y+=1);return p}(o,r)};l.addData=function(e,t){var n=null;switch(t=t||"Byte"){case"Numeric":n=S(e);break;case"Alphanumeric":n=E(e);break;case"Byte":n=R(e);break;case"Kanji":n=L(e);break;default:throw"mode:"+t}a.push(n),s=null},l.isDark=function(e,t){if(e<0||i<=e||t<0||i<=t)throw e+","+t;return o[e][t]},l.getModuleCount=function(){return i},l.make=function(){if(n<1){for(var e=1;e<40;e++){for(var t=C.getRSBlocks(e,r),o=_(),i=0;i<a.length;i++){var s=a[i];o.put(s.getMode(),4),o.put(s.getLength(),w.getLengthInBits(s.getMode(),e)),s.write(o)}var u=0;for(i=0;i<t.length;i++)u+=t[i].dataCount;if(o.getLengthInBits()<=8*u)break}n=e}c(!1,function(){for(var e=0,t=0,n=0;n<8;n+=1){c(!0,n);var r=w.getLostPoint(l);(0==n||e>r)&&(e=r,t=n)}return t}())},l.createTableTag=function(e,t){e=e||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(t=void 0===t?4*e:t)+"px;",n+='">',n+="<tbody>";for(var r=0;r<l.getModuleCount();r+=1){n+="<tr>";for(var o=0;o<l.getModuleCount();o+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+e+"px;",n+=" height: "+e+"px;",n+=" background-color: ",n+=l.isDark(r,o)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>"},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+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',d+=o.scalable?"":' width="'+u+'px" height="'+u+'px"',d+=' viewBox="0 0 '+u+" "+u+'" ',d+=' preserveAspectRatio="xMinYMin meet"',d+=r.text||n.text?' role="img" aria-labelledby="'+v([r.id,n.id].join(" ").trim())+'"':"",d+=">",d+=r.text?'<title id="'+v(r.id)+'">'+v(r.text)+"</title>":"",d+=n.text?'<description id="'+v(n.id)+'">'+v(n.text)+"</description>":"",d+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',d+='<path d="',s=0;s<l.getModuleCount();s+=1)for(a=s*e+t,i=0;i<l.getModuleCount();i+=1)l.isDark(s,i)&&(d+="M"+(i*e+t)+","+a+c);return d+='" stroke="transparent" fill="black"/>',d+="</svg>"},l.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=l.getModuleCount()*e+2*t,r=t,o=n-t;return k(n,n,(function(t,n){if(r<=t&&t<o&&r<=n&&n<o){var i=Math.floor((t-r)/e),s=Math.floor((n-r)/e);return l.isDark(s,i)?0:1}return 1}))},l.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=l.getModuleCount()*e+2*t,o="";return o+="<img",o+=' src="',o+=l.createDataURL(e,t),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=v(n),o+='"'),o+="/>"};var v=function(e){for(var t="",n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case"<":t+="<";break;case">":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<s;t+=2){for(r=Math.floor((t-a)/1),o=Math.floor((t+1-a)/1),n=0;n<s;n+=1)i="█",a<=n&&n<c&&a<=t&&t<c&&l.isDark(r,Math.floor((n-a)/1))&&(i=" "),a<=n&&n<c&&a<=t+1&&t+1<c&&l.isDark(o,Math.floor((n-a)/1))?i+=" ":i+="█",h+=e<1&&t+1>=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<s;n+=1){for(o=Math.floor((n-a)/e),f="",r=0;r<s;r+=1)i=1,a<=r&&r<c&&a<=n&&n<c&&l.isDark(o,Math.floor((r-a)/e))&&(i=0),f+=i?u:d;for(o=0;o<e;o+=1)h+=f+"\n"}return h.substring(0,h.length-1)},l.renderTo2dContext=function(e,t){t=t||2;for(var n=l.getModuleCount(),r=0;r<n;r++)for(var o=0;o<n;o++)e.fillStyle=l.isDark(r,o)?"black":"white",e.fillRect(r*t,o*t,t,t)},l};e.stringToBytes=(e.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}}).default,e.createStringToBytes=function(e,t){var n=function(){for(var n=O(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},o=0,i={};;){var s=n.read();if(-1==s)break;var a=r(),l=r()<<8|r();i[String.fromCharCode(s<<8|a)]=l,o+=1}if(o!=t)throw o+" != "+t;return i}(),r="?".charCodeAt(0);return function(e){for(var t=[],o=0;o<e.length;o+=1){var i=e.charCodeAt(o);if(i<128)t.push(i);else{var s=n[e.charAt(o)];"number"==typeof s?(255&s)==s?t.push(s):(t.push(s>>>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,y=5,m=6,v=7,w=(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<<i(t)-i(n);return 21522^(e<<10|t)},o.getBCHTypeNumber=function(e){for(var t=e<<12;i(t)-i(r)>=0;)t^=r<<i(t)-i(r);return e<<12|t},o.getPatternPosition=function(e){return t[e-1]},o.getMaskFunction=function(e){switch(e){case d:return function(e,t){return(e+t)%2==0};case h:return function(e,t){return e%2==0};case f:return function(e,t){return t%3==0};case g:return function(e,t){return(e+t)%3==0};case p:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case y:return function(e,t){return e*t%2+e*t%3==0};case m:return function(e,t){return(e*t%2+e*t%3)%2==0};case v:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},o.getErrorCorrectPolynomial=function(e){for(var t=x([1],0),n=0;n<e;n+=1)t=t.multiply(x([1,b.gexp(n)],0));return t},o.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case s:return 10;case a:return 9;case l:case c:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case s:return 12;case a:return 11;case l:return 16;case c:return 10;default:throw"mode:"+e}else{if(!(t<41))throw"type:"+t;switch(e){case s:return 14;case a:return 13;case l:return 16;case c:return 12;default:throw"mode:"+e}}},o.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var o=0;o<t;o+=1){for(var i=0,s=e.isDark(r,o),a=-1;a<=1;a+=1)if(!(r+a<0||t<=r+a))for(var l=-1;l<=1;l+=1)o+l<0||t<=o+l||0==a&&0==l||s==e.isDark(r+a,o+l)&&(i+=1);i>5&&(n+=3+i-5)}for(r=0;r<t-1;r+=1)for(o=0;o<t-1;o+=1){var c=0;e.isDark(r,o)&&(c+=1),e.isDark(r+1,o)&&(c+=1),e.isDark(r,o+1)&&(c+=1),e.isDark(r+1,o+1)&&(c+=1),0!=c&&4!=c||(n+=3)}for(r=0;r<t;r+=1)for(o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(o=0;o<t;o+=1)for(r=0;r<t-6;r+=1)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);var u=0;for(o=0;o<t;o+=1)for(r=0;r<t;r+=1)e.isDark(r,o)&&(u+=1);return n+=Math.abs(100*u/t/t-50)/5*10},o),b=function(){for(var e=new Array(256),t=new Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;n<255;n+=1)t[e[n]]=n;var r={glog:function(e){if(e<1)throw"glog("+e+")";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}};return r}();function x(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n<e.length&&0==e[n];)n+=1;for(var r=new Array(e.length-n+t),o=0;o<e.length-n;o+=1)r[o]=e[o+n];return r}(),r={getAt:function(e){return n[e]},getLength:function(){return n.length},multiply:function(e){for(var t=new Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var o=0;o<e.getLength();o+=1)t[n+o]^=b.gexp(b.glog(r.getAt(n))+b.glog(e.getAt(o)));return x(t,0)},mod:function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=b.glog(r.getAt(0))-b.glog(e.getAt(0)),n=new Array(r.getLength()),o=0;o<r.getLength();o+=1)n[o]=r.getAt(o);for(o=0;o<e.getLength();o+=1)n[o]^=b.gexp(b.glog(e.getAt(o))+t);return x(n,0).mod(e)}};return r}var C=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},n={};return n.getRSBlocks=function(n,r){var o=function(t,n){switch(n){case u.L:return e[4*(t-1)+0];case u.M:return e[4*(t-1)+1];case u.Q:return e[4*(t-1)+2];case u.H:return e[4*(t-1)+3];default:return}}(n,r);if(void 0===o)throw"bad rs block @ typeNumber:"+n+"/errorCorrectionLevel:"+r;for(var i=o.length/3,s=[],a=0;a<i;a+=1)for(var l=o[3*a+0],c=o[3*a+1],d=o[3*a+2],h=0;h<l;h+=1)s.push(t(c,d));return s},n}(),_=function(){var e=[],t=0,n={getBuffer:function(){return e},getAt:function(t){var n=Math.floor(t/8);return 1==(e[n]>>>7-t%8&1)},put:function(e,t){for(var r=0;r<t;r+=1)n.putBit(1==(e>>>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<t.length;)e.put(o(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(o(t.substring(r,r+1)),4):t.length-r==2&&e.put(o(t.substring(r,r+2)),7))}},o=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+i(e.charAt(n));return t},i=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+e};return r},E=function(e){var t=a,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(var t=n,r=0;r+1<t.length;)e.put(45*o(t.charAt(r))+o(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(o(t.charAt(r)),6)}},o=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);if("A"<=e&&e<="Z")return e.charCodeAt(0)-"A".charCodeAt(0)+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return r},R=function(t){var n=l,r=e.stringToBytes(t),o={getMode:function(){return n},getLength:function(e){return r.length},write:function(e){for(var t=0;t<r.length;t+=1)e.put(r[t],8)}};return o},L=function(t){var n=c,r=e.stringToBytesFuncs.SJIS;if(!r)throw"sjis not supported.";!function(e,t){var n=r("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."}();var o=r(t),i={getMode:function(){return n},getLength:function(e){return~~(o.length/2)},write:function(e){for(var t=o,n=0;n+1<t.length;){var r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(n+1)+"/"+r;r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13),n+=2}if(n<t.length)throw"illegal char at "+(n+1)}};return i},A=function(){var e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o<r;o+=1)t.writeByte(e[o+n])},writeString:function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+="]"}};return t},O=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},k=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<<e,n=1+(1<<e),r=e+1,i=a(),s=0;s<t;s+=1)i.add(String.fromCharCode(s));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(n));var l,c,u,d=A(),h=(l=d,c=0,u=0,{write:function(e,t){if(e>>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<<c|u)),t-=8-c,e>>>=8-c,u=0,c=0;u|=e<<c,c+=t},flush:function(){c>0&&l.writeByte(u)}});h.write(t,r);var f=0,g=String.fromCharCode(o[f]);for(f+=1;f<o.length;){var p=String.fromCharCode(o[f]);f+=1,i.contains(g+p)?g+=p:(h.write(i.indexOf(g),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(g+p)),g=p)}return h.write(i.indexOf(g),r),h.write(n,r),h.flush(),d.toByteArray()},a=function(){var e={},t=0,n={add:function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return n};return i}(e,t),o=0;o<t;o+=1)for(var i=0;i<e;i+=1)r.setPixel(i,o,n(i,o));var s=A();r.write(s);for(var a=function(){var e=0,t=0,n=0,r="",o={},i=function(e){r+=String.fromCharCode(s(63&e))},s=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=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<o;s+=1)r+="="},o.toString=function(){return r},o}(),l=s.toByteArray(),c=0;c<l.length;c+=1)a.writeByte(l[c]);return a.flush(),"data:image/gif;base64,"+a};return e}();n.stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>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}(ao);const lo=ao.exports;function co(e){return(null==navigator?void 0:navigator.clipboard)?navigator.clipboard.writeText(e):(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),Promise.resolve())}var uo=(e,t,n)=>{const r=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==r?r:n},ho=(e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[n,r]=je(t),[o,i]=Un(e);return[(e,t,r)=>{const i=uo(o[n()],e,r||"");return"function"==typeof i?i(t):"string"==typeof i?((e,t,n=/{{(.*?)}}/g)=>e.replace(n,((e,n)=>uo(t,n,""))))(i,t||{}):i},{add(e,t){i(e,(e=>Object.assign(e||{},t)))},locale:e=>e?r(e):n(),dict:e=>uo(o,e)}]},fo=Ve({}),go=()=>ze(fo);const po=e=>{const[t]=go();return Be((()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())}))},yo=Tt("<div></div>"),mo={translationKey:"common.copyLink",text:"Copy Link"},vo={translationKey:"common.copied",text:"Copied!"},wo=e=>{let t,n,r;const[o,i]=je(!1),[s,a]=je(!1),[l,c]=je(!1),[u,d]=je(mo),[h,f]=je(48);We((()=>i(s()||l()))),We((()=>!o()&&d(mo))),We((()=>{const o=lo(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=dr(4*Math.ceil((i-e)/8));r.style.top=t,r.style.left=t,r.style.height=dr(e),r.style.width=dr(e),f(Math.round(48/s))}n.style.transform=`scale(${s})`}));let g=null;const p=()=>{co(e.sourceUrl),d(vo),null!=g&&clearTimeout(g),g=setTimeout((()=>d(mo)),3e3)};return ft(no,{get class(){return e.class},get children(){return[ft(ro,{ref(e){"function"==typeof n?n(e):n=e},onMouseEnter:()=>c(!0),onMouseLeave:()=>setTimeout((()=>c(!1))),get children(){return[(()=>{const e=yo.cloneNode(!0);return"function"==typeof t?$t(t,e):t=e,e})(),ft(bt,{get when(){return e.imageUrl},get children(){return ft(oo,{ref(e){"function"==typeof r?r(e):r=e},get children(){return ft(io,{get src(){return e.imageUrl},alt:"",get size(){return h()}})}})}})]}}),ft(Tr,{onBeforeEnter:e=>{e.animate([{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:200})},onExit:(e,t)=>{e.animate([{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:200}).finished.then((()=>{t()}))},get children(){return ft(bt,{get when(){return o()&&!e.disableCopy},get children(){return ft(so,{onClick:p,onMouseEnter:()=>o()&&a(!0),onMouseLeave:()=>setTimeout((()=>a(!1))),get children(){return ft(po,{get translationKey(){return u().translationKey},get children(){return u().text}})}})}})}})]}})},bo=vn.div`
|
|
252
|
+
font-style: normal;
|
|
253
|
+
font-weight: ${e=>e.fontWeight};
|
|
254
|
+
font-size: ${e=>e.fontSize};
|
|
255
|
+
line-height: ${e=>e.lineHeight};
|
|
256
|
+
|
|
257
|
+
color: ${e=>e.color};
|
|
258
|
+
`,xo=e=>{const t=yn(),[n]=go();let r;const o=mt({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return We((()=>{r&&"unset"!==o.cursor&&"pointer"!==getComputedStyle(r).cursor&&(r.style.cursor="default")})),ft(bo,{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 Be((()=>!!o.translationKey))()?n(o.translationKey,o.translationValues,null==(e=o.children)?void 0:e.toString()):o.children}})},Co=vn.button`
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
border: none;
|
|
261
|
+
background-color: unset;
|
|
262
|
+
padding: 12px 8px 8px;
|
|
263
|
+
height: 94px;
|
|
264
|
+
width: 92px;
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
align-items: center;
|
|
268
|
+
|
|
269
|
+
transition: transform 0.125s ease-in-out;
|
|
270
|
+
|
|
271
|
+
${Cr} {
|
|
272
|
+
&:hover {
|
|
273
|
+
transform: scale(1.04);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
&:active {
|
|
278
|
+
transform: scale(0.96);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
${br("mobile")} {
|
|
282
|
+
padding: 8px 4px;
|
|
283
|
+
height: 124px;
|
|
284
|
+
width: 82px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
${xr} {
|
|
288
|
+
&:active {
|
|
289
|
+
transform: scale(0.92);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
`,_o=vn(cr)`
|
|
293
|
+
width: 48px;
|
|
294
|
+
height: 48px;
|
|
295
|
+
border-radius: 12px;
|
|
296
|
+
|
|
297
|
+
margin-bottom: 8px;
|
|
298
|
+
|
|
299
|
+
${br("mobile")} {
|
|
300
|
+
width: 64px;
|
|
301
|
+
height: 64px;
|
|
302
|
+
border-radius: 16px;
|
|
303
|
+
}
|
|
304
|
+
`,So=vn(xo)`
|
|
305
|
+
font-weight: 590;
|
|
306
|
+
max-width: 76px;
|
|
307
|
+
white-space: nowrap;
|
|
308
|
+
text-overflow: ellipsis;
|
|
309
|
+
overflow: hidden;
|
|
310
|
+
`,Eo=e=>ft(Co,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[ft(_o,{get src(){return e.iconUrl},alt:""}),ft(So,{get children(){return e.name}})]}}),Ro=vn.h1`
|
|
124
311
|
font-style: normal;
|
|
125
312
|
font-weight: 700;
|
|
126
313
|
font-size: 24px;
|
|
127
314
|
line-height: 30px;
|
|
128
315
|
|
|
129
316
|
text-align: center;
|
|
130
|
-
letter-spacing: 0.072px;
|
|
131
317
|
|
|
132
318
|
color: ${e=>e.theme.colors.text.primary};
|
|
133
319
|
|
|
134
320
|
margin-top: 0;
|
|
135
321
|
margin-bottom: 6px;
|
|
136
|
-
|
|
322
|
+
|
|
323
|
+
cursor: default;
|
|
324
|
+
`,Lo=e=>{const[t]=go();return ft(Ro,{get class(){return e.class},"data-tc-h1":"true",get children(){var n;return Be((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},Ao=vn.h2`
|
|
137
325
|
font-style: normal;
|
|
138
326
|
font-weight: 510;
|
|
139
327
|
font-size: 16px;
|
|
140
|
-
line-height:
|
|
328
|
+
line-height: 20px;
|
|
141
329
|
|
|
142
330
|
text-align: center;
|
|
143
|
-
letter-spacing: -0.32px;
|
|
144
331
|
|
|
145
332
|
color: ${e=>e.theme.colors.text.secondary};
|
|
146
333
|
|
|
147
334
|
margin-top: 0;
|
|
148
335
|
margin-bottom: 32px;
|
|
149
|
-
|
|
336
|
+
|
|
337
|
+
cursor: default;
|
|
338
|
+
`,Oo=e=>{const[t]=go();return ft(Ao,{get class(){return e.class},"data-tc-h2":"true",get children(){var n;return Be((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},ko=vn.h3`
|
|
150
339
|
font-style: normal;
|
|
151
340
|
font-weight: 590;
|
|
152
341
|
font-size: 15px;
|
|
153
342
|
line-height: 20px;
|
|
154
343
|
|
|
155
|
-
letter-spacing: -0.24px;
|
|
156
|
-
|
|
157
344
|
color: ${e=>e.theme.colors.text.primary};
|
|
158
345
|
|
|
159
346
|
margin-top: 0;
|
|
160
347
|
margin-bottom: 0;
|
|
161
|
-
`,H3=e=>{const[t]=useI18n();return createComponent(H3Styled,{get children(){var n;return createMemo((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},TextStyled$3=styled.div`
|
|
162
|
-
font-style: normal;
|
|
163
|
-
font-weight: ${e=>e.fontWeight};
|
|
164
|
-
font-size: ${e=>e.fontSize};
|
|
165
|
-
line-height: ${e=>e.lineHeight};
|
|
166
|
-
letter-spacing: ${e=>e.letterSpacing};
|
|
167
348
|
|
|
168
|
-
|
|
169
|
-
`,
|
|
170
|
-
animation: ${
|
|
349
|
+
cursor: default;
|
|
350
|
+
`,To=e=>{const[t]=go();return ft(ko,{"data-tc-h3":"true",get children(){var n;return Be((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},Po=Tt('<svg width="18" height="17" viewBox="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 15.999L16.5 0.999023M16.5 0.999023V12.999M16.5 0.999023H4.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),Mo=e=>{const t=yn();return(()=>{const n=Po.cloneNode(!0),r=n.firstChild;return Ue((()=>Pt(r,"stroke",e.fill||t.colors.icon.secondary))),n})()},No=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z"></path></svg>'),$o=e=>{const t=yn();return(()=>{const n=No.cloneNode(!0),r=n.firstChild;return Ue((()=>Pt(r,"fill",e.fill||t.colors.icon.primary))),n})()},jo=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z"></path></svg>'),Io=Tt('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z"></path></svg>'),Uo=e=>{const t=yn(),n=()=>e.fill||t.colors.icon.success;return Be((()=>{const r=Be((()=>"s"===(e.size||"s")));return()=>r()?(()=>{const r=jo.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return Ue((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Pt(r,"class",s._v$=a),l!==s._v$2&&Pt(o,"fill",s._v$2=l),c!==s._v$3&&Pt(i,"fill",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const r=Io.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return Ue((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Pt(r,"class",s._v$4=a),l!==s._v$5&&Pt(o,"fill",s._v$5=l),c!==s._v$6&&Pt(i,"fill",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})()})())},Wo=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.86361 9.1364C7.51214 8.78493 7.51214 8.21508 7.86361 7.86361C8.21508 7.51214 8.78493 7.51214 9.1364 7.86361L12 10.7272L14.8636 7.86361C15.2151 7.51214 15.7849 7.51214 16.1364 7.86361C16.4879 8.21508 16.4879 8.78493 16.1364 9.1364L13.2728 12L16.1364 14.8636C16.4879 15.2151 16.4879 15.7849 16.1364 16.1364C15.7849 16.4879 15.2151 16.4879 14.8636 16.1364L12 13.2728L9.1364 16.1364C8.78493 16.4879 8.21508 16.4879 7.86361 16.1364C7.51214 15.7849 7.51214 15.2151 7.86361 14.8636L10.7272 12L7.86361 9.1364Z"></path></svg>'),Bo=Tt('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M24.0858 26.9142C23.3047 26.1332 23.3047 24.8668 24.0858 24.0858C24.8668 23.3047 26.1332 23.3047 26.9142 24.0858L36 33.1716L45.0858 24.0858C45.8668 23.3047 47.1332 23.3047 47.9142 24.0858C48.6953 24.8668 48.6953 26.1332 47.9142 26.9142L38.8284 36L47.9142 45.0858C48.6953 45.8668 48.6953 47.1332 47.9142 47.9142C47.1332 48.6953 45.8668 48.6953 45.0858 47.9142L36 38.8284L26.9142 47.9142C26.1332 48.6953 24.8668 48.6953 24.0858 47.9142C23.3047 47.1332 23.3047 45.8668 24.0858 45.0858L33.1716 36L24.0858 26.9142Z"></path></svg>'),Ko=e=>{const t=yn(),n=()=>e.fill||t.colors.icon.error;return Be((()=>{const r=Be((()=>"s"===(e.size||"s")));return()=>r()?(()=>{const r=Wo.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return Ue((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$&&Pt(r,"class",s._v$=a),l!==s._v$2&&Pt(o,"fill",s._v$2=l),c!==s._v$3&&Pt(i,"fill",s._v$3=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const r=Bo.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return Ue((s=>{const a=e.class,l=n(),c=t.colors.constant.white;return a!==s._v$4&&Pt(r,"class",s._v$4=a),l!==s._v$5&&Pt(o,"fill",s._v$5=l),c!==s._v$6&&Pt(i,"fill",s._v$6=c),s}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})()})())},Do=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z"></path></svg>'),Fo=Tt('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),qo=e=>{const t=yn(),n=()=>e.fill||t.colors.icon.tertiary,r=hn`
|
|
351
|
+
animation: ${fn`
|
|
171
352
|
0% {
|
|
172
353
|
transform: rotate(0deg);
|
|
173
354
|
}
|
|
@@ -175,27 +356,28 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
175
356
|
transform: rotate(360deg);
|
|
176
357
|
}
|
|
177
358
|
`} 1s linear infinite;
|
|
178
|
-
`;return(()=>{const
|
|
359
|
+
`;return Be((()=>{const t=Be((()=>"s"===(e.size||"s")));return()=>t()?(()=>{const t=Do.cloneNode(!0),o=t.firstChild;return Ue((i=>{const s=Or(r,e.class),a=n();return s!==i._v$&&Pt(t,"class",i._v$=s),a!==i._v$2&&Pt(o,"fill",i._v$2=a),i}),{_v$:void 0,_v$2:void 0}),t})():(()=>{const t=Fo.cloneNode(!0),o=t.firstChild;return Ue((i=>{const s=Or(r,e.class),a=n();return s!==i._v$3&&Pt(t,"class",i._v$3=s),a!==i._v$4&&Pt(o,"stroke",i._v$4=a),i}),{_v$3:void 0,_v$4:void 0}),t})()})())},Ho=Ve(),Vo=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z"></path></svg>'),zo=e=>{const t=yn();return(()=>{const n=Vo.cloneNode(!0),r=n.firstChild;return Ue((()=>Pt(r,"fill",e.fill||t.colors.icon.primary))),n})()},Go=Tt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z"></path></svg>'),Yo=e=>{const t=yn(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const e=Go.cloneNode(!0),t=e.firstChild,r=t.nextSibling;return Ue((e=>{const o=n(),i=n();return o!==e._v$&&Pt(t,"fill",e._v$=o),i!==e._v$2&&Pt(r,"fill",e._v$2=i),e}),{_v$:void 0,_v$2:void 0}),e})()},Qo={m:"8px",s:"4px",none:"0"},Jo={m:"16px",s:"8px",none:"0"},Zo=vn.div`
|
|
179
360
|
width: 256px;
|
|
180
361
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
181
|
-
border-radius: ${e=>
|
|
362
|
+
border-radius: ${e=>Jo[e.theme.borderRadius]};
|
|
182
363
|
|
|
183
364
|
background-color: ${e=>e.theme.colors.background.primary}
|
|
184
365
|
|
|
185
366
|
color: ${e=>e.theme.colors.text.primary}
|
|
186
|
-
`,
|
|
367
|
+
`,Xo=vn.ul`
|
|
187
368
|
background-color: ${e=>e.theme.colors.background.primary};
|
|
188
369
|
padding: 8px;
|
|
189
|
-
`,
|
|
370
|
+
`,ei=vn.button`
|
|
190
371
|
display: flex;
|
|
191
372
|
align-items: center;
|
|
192
373
|
gap: 8px;
|
|
193
|
-
|
|
374
|
+
height: 40px;
|
|
375
|
+
padding-left: 8px;
|
|
194
376
|
width: 100%;
|
|
195
377
|
|
|
196
378
|
background-color: ${e=>e.theme.colors.background.primary};
|
|
197
379
|
border: none;
|
|
198
|
-
border-radius: ${e=>
|
|
380
|
+
border-radius: ${e=>Qo[e.theme.borderRadius]};
|
|
199
381
|
cursor: pointer;
|
|
200
382
|
|
|
201
383
|
transition: background-color, transform 0.1s ease-in-out;
|
|
@@ -207,7 +389,7 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
207
389
|
&:active {
|
|
208
390
|
transform: scale(0.96);
|
|
209
391
|
}
|
|
210
|
-
`,
|
|
392
|
+
`,ti=Tt("<li></li>"),ni=e=>ft(xo,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),ri={m:"16px",s:"8px",none:"0"},oi=vn.div`
|
|
211
393
|
width: 256px;
|
|
212
394
|
padding: 12px 16px;
|
|
213
395
|
display: flex;
|
|
@@ -215,201 +397,134 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
215
397
|
|
|
216
398
|
background-color: ${e=>e.theme.colors.background.primary};
|
|
217
399
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
218
|
-
border-radius: ${e=>
|
|
219
|
-
`,
|
|
400
|
+
border-radius: ${e=>ri[e.theme.borderRadius]};
|
|
401
|
+
`,ii=vn.div`
|
|
402
|
+
width: 192px;
|
|
403
|
+
`,si=vn(xo)`
|
|
220
404
|
margin-top: 4px;
|
|
221
405
|
color: ${e=>e.theme.colors.text.secondary};
|
|
222
|
-
`,
|
|
406
|
+
`,ai=e=>{const t=Rr(e);return ft(oi,mt({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[ft(ii,{get children(){return[ft(To,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),ft(bt,{get when(){return e.text},get children(){return ft(si,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),Be((()=>e.icon))]}}))},li=vn(qo)`
|
|
223
407
|
align-self: center;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
`,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
`,ErrorTransactionNotification=e=>createComponent(Notification,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return createComponent(ErrorIconStyled$1,{})},get class(){return e.class},children:"Transaction cancelled"}),SuccessIconStyled$1=styled(SuccessIcon)`
|
|
230
|
-
min-width: 22px;
|
|
231
|
-
min-height: 22px;
|
|
232
|
-
`,SuccessTransactionNotification=e=>createComponent(Notification,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return createComponent(SuccessIconStyled$1,{})},get class(){return cn(e.class,"tc-notification")},children:"Transaction sent"}),NotificationClass=u`
|
|
408
|
+
`,ci=e=>{var t;const n=ze(Ho),[r]=go(),o=(null==(t=n.wallet)?void 0:t.name)||r("common.yourWallet",{},"your wallet");return ft(ai,{header:{translationKey:"notifications.confirm.header",translationValues:{name:o}},get class(){return e.class},get icon(){return ft(li,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},ui=vn(Ko)`
|
|
409
|
+
margin-top: 2px;
|
|
410
|
+
`,di=e=>ft(ai,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return ft(ui,{})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),hi=vn(Uo)`
|
|
411
|
+
margin-top: 2px;
|
|
412
|
+
`,fi=e=>ft(ai,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return ft(hi,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),gi=hn`
|
|
233
413
|
transform: translateY(-8px);
|
|
234
414
|
margin-bottom: 12px;
|
|
235
|
-
`,
|
|
415
|
+
`,pi=Tt('<div data-tc-list-notifications="true"></div>'),yi=vn(Lr)`
|
|
236
416
|
background-color: ${e=>e.theme.colors.connectButton.background};
|
|
237
417
|
color: ${e=>e.theme.colors.connectButton.foreground};
|
|
238
|
-
box-shadow: ${e=>`0 4px 24px ${
|
|
418
|
+
box-shadow: ${e=>`0 4px 24px ${ur(e.theme.colors.constant.black,.16)}`};
|
|
419
|
+
padding: 8px 16px 8px 12px;
|
|
239
420
|
|
|
240
421
|
display: flex;
|
|
241
422
|
align-items: center;
|
|
242
|
-
gap:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
transform: scale(1);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&:hover {
|
|
251
|
-
filter: ${e=>`brightness(${e.theme.theme===THEME.DARK?1.07:.95})`};
|
|
252
|
-
}
|
|
253
|
-
`,DropdownButtonStyled=styled(AccountButtonStyled)`
|
|
254
|
-
width: 140px;
|
|
255
|
-
gap: 11px;
|
|
423
|
+
gap: 4px;
|
|
424
|
+
height: 40px;
|
|
425
|
+
`,mi=vn(yi)`
|
|
426
|
+
padding: 12px 16px;
|
|
427
|
+
min-width: 148px;
|
|
256
428
|
justify-content: center;
|
|
257
429
|
background-color: ${e=>e.theme.colors.background.primary};
|
|
258
|
-
`,
|
|
259
|
-
width:
|
|
430
|
+
`,vi=vn(Lr)`
|
|
431
|
+
min-width: 148px;
|
|
432
|
+
height: 40px;
|
|
260
433
|
|
|
261
434
|
background-color: ${e=>e.theme.colors.background.primary};
|
|
262
435
|
color: ${e=>e.theme.colors.connectButton.foreground};
|
|
263
|
-
box-shadow: ${e=>`0 4px 24px ${
|
|
436
|
+
box-shadow: ${e=>`0 4px 24px ${ur(e.theme.colors.constant.black,.16)}`};
|
|
264
437
|
|
|
265
438
|
display: flex;
|
|
266
439
|
align-items: center;
|
|
267
440
|
justify-content: center;
|
|
268
|
-
`,
|
|
441
|
+
`,wi=vn(qo)`
|
|
269
442
|
height: 18px;
|
|
270
443
|
width: 18px;
|
|
271
|
-
`,
|
|
444
|
+
`,bi=vn.div`
|
|
272
445
|
display: flex;
|
|
273
446
|
flex-direction: column;
|
|
274
447
|
align-items: flex-end;
|
|
275
|
-
`,
|
|
448
|
+
`,xi=vn((e=>{const t=ze(Ho),[n,r]=je(!1),o=()=>__async(this,null,(function*(){const e=ye(t.account.address,t.account.chain===C.TESTNET);yield co(e),r(!0),setTimeout((()=>r(!1)),1e3)}));return ft(Zo,{ref(t){const n=e.ref;"function"==typeof n?n(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":"true",get children(){return ft(Xo,{get children(){return[(()=>{const e=ti.cloneNode(!0);return jt(e,ft(ei,{onClick:()=>o(),get children(){return[ft(zo,{}),ft(bt,{get when(){return!n()},get children(){return ft(ni,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),ft(bt,{get when(){return n()},get children(){return ft(ni,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),e})(),(()=>{const n=ti.cloneNode(!0);return jt(n,ft(ei,{onClick:()=>(t.disconnect(),void e.onClose()),get children(){return[ft(Yo,{}),ft(ni,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),n})()]}})}})}))`
|
|
276
449
|
box-sizing: border-box;
|
|
277
450
|
overflow: hidden;
|
|
278
451
|
margin-top: 12px;
|
|
279
|
-
`,
|
|
452
|
+
`,Ci=vn((e=>{const t=[],[n,r]=je([]);let o=-1;return We(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;t<e.length;t++)s[t]=e[t]()}else s=e();if(i)return void(i=!1);const a=Fe((()=>t(s,o,n)));return o=s,a}}(Xt,(e=>{if(e&&e.showNotification){o++;const n=o;r((t=>t.filter((e=>"confirm-transaction"!==e.action)).concat({id:n,action:e.name}))),t.push(setTimeout((()=>r((e=>e.filter((e=>e.id!==n))))),4500))}}))),qe((()=>{t.forEach(clearTimeout)})),(()=>{const t=pi.cloneNode(!0);return jt(t,ft(Mr,{onBeforeEnter:e=>{e.animate([{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(e,t)=>{e.animate([{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(t)},get children(){return ft(wt,{get each(){return n()},children:e=>ft(xt,{get children(){return[ft(Ct,{get when(){return"transaction-sent"===e.action},get children(){return ft(fi,{class:gi})}}),ft(Ct,{get when(){return"transaction-canceled"===e.action},get children(){return ft(di,{class:gi})}}),ft(Ct,{get when(){return"confirm-transaction"===e.action},get children(){return ft(ci,{class:gi})}})]}})})}})),Ue((()=>Mt(t,e.class))),t})()}))`
|
|
280
453
|
> div:first-child {
|
|
281
454
|
margin-top: 20px;
|
|
282
455
|
}
|
|
283
|
-
`;function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getMainAxisFromPlacement(e){return["top","bottom"].includes(getSide(e))?"x":"y"}function getLengthFromAxis(e){return"y"===e?"height":"width"}function computeCoordsFromPlacement(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=getMainAxisFromPlacement(t),l=getLengthFromAxis(a),c=r[l]/2-o[l]/2,u="x"===a;let d;switch(getSide(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(getAlignment(t)){case"start":d[a]-=c*(n&&u?-1:1);break;case"end":d[a]+=c*(n&&u?-1:1)}return d}const computePosition$1=(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}=computeCoordsFromPlacement(c,r,l),f=r,h={},p=0;for(let n=0;n<a.length;n++){const{name:i,fn:g}=a[n],{x:m,y:y,data:w,reset:C}=yield g({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=y?y:d,h=__spreadProps(__spreadValues({},h),{[i]:__spreadValues(__spreadValues({},h[i]),w)}),"production"!=={}.NODE_ENV&&p>50&&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(" ")),C&&p<=50&&(p++,"object"==typeof C&&(C.placement&&(f=C.placement),C.rects&&(c=!0===C.rects?yield s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),({x:u,y:d}=computeCoordsFromPlacement(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}}));function rectToClientRect(e){return __spreadProps(__spreadValues({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function getWindow(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():""}let uaString;function getUAString(){if(uaString)return uaString;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(uaString=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),uaString):navigator.userAgent}function isHTMLElement(e){return e instanceof getWindow(e).HTMLElement}function isElement(e){return e instanceof getWindow(e).Element}function isNode(e){return e instanceof getWindow(e).Node}function isShadowRoot(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof getWindow(e).ShadowRoot||e instanceof ShadowRoot}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function isTableElement(e){return["table","td","th"].includes(getNodeName(e))}function isContainingBlock(e){const t=/firefox/i.test(getUAString()),n=getComputedStyle(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 isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function isLastTraversableNode(e){return["html","body","#document"].includes(getNodeName(e))}const min=Math.min,max=Math.max,round=Math.round,FALLBACK_SCALE={x:1,y:1};function getScale(e){const t=!isElement(e)&&e.contextElement?e.contextElement:isElement(e)?e:null;if(!t)return FALLBACK_SCALE;const n=t.getBoundingClientRect(),r=getComputedStyle(t);if("border-box"!==r.boxSizing)return isHTMLElement(t)?{x:t.offsetWidth>0&&round(n.width)/t.offsetWidth||1,y:t.offsetHeight>0&&round(n.height)/t.offsetHeight||1}:FALLBACK_SCALE;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 getBoundingClientRect(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=FALLBACK_SCALE;t&&(r?isElement(r)&&(c=getScale(r)):c=getScale(e));const u=isElement(e)?getWindow(e):window,d=!isLayoutViewport()&&n,f=(l.left+(d&&null!=(o=null==(i=u.visualViewport)?void 0:i.offsetLeft)?o:0))/c.x,h=(l.top+(d&&null!=(s=null==(a=u.visualViewport)?void 0:a.offsetTop)?s:0))/c.y,p=l.width/c.x,g=l.height/c.y;return{width:p,height:g,top:h,right:f+p,bottom:h+g,left:f,x:f,y:h}}function getDocumentElement(e){return((isNode(e)?e.ownerDocument:e.document)||window.document).documentElement}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getNodeScroll(e).scrollLeft}function getRectRelativeToOffsetParent(e,t,n){const r=isHTMLElement(t),o=getDocumentElement(t),i=getBoundingClientRect(e,!0,"fixed"===n,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==getNodeName(t)||isOverflowElement(o))&&(s=getNodeScroll(t)),isHTMLElement(t)){const e=getBoundingClientRect(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=getWindowScrollBarX(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||(isShadowRoot(e)?e.host:null)||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getTrueOffsetParent(e){return isHTMLElement(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;t=getParentNode(t)}return null}function getOffsetParent(e){const t=getWindow(e);let n=getTrueOffsetParent(e);for(;n&&isTableElement(n)&&"static"===getComputedStyle(n).position;)n=getTrueOffsetParent(n);return n&&("html"===getNodeName(n)||"body"===getNodeName(n)&&"static"===getComputedStyle(n).position&&!isContainingBlock(n))?t:n||getContainingBlock(e)||t}function getDimensions(e){if(isHTMLElement(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=getBoundingClientRect(e);return{width:t.width,height:t.height}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=isHTMLElement(n),i=getDocumentElement(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"!==getNodeName(n)||isOverflowElement(i))&&(s=getNodeScroll(n)),isHTMLElement(n))){const e=getBoundingClientRect(n);a=getScale(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}}function getViewportRect(e,t){const n=getWindow(e),r=getDocumentElement(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=isLayoutViewport();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function getDocumentRect(e){var t;const n=getDocumentElement(e),r=getNodeScroll(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=max(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=max(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+getWindowScrollBarX(e);const l=-r.scrollTop;return"rtl"===getComputedStyle(o||n).direction&&(a+=max(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t){var n;void 0===t&&(t=[]);const r=getNearestOverflowAncestor(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=getWindow(r);return o?t.concat(i,i.visualViewport||[],isOverflowElement(r)?r:[]):t.concat(r,getOverflowAncestors(r))}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=isHTMLElement(e)?getScale(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}}function getClientRectFromClippingAncestor(e,t,n){return"viewport"===t?rectToClientRect(getViewportRect(e,n)):isElement(t)?getInnerBoundingClientRect(t,n):rectToClientRect(getDocumentRect(getDocumentElement(e)))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let r=getOverflowAncestors(e).filter((e=>isElement(e)&&"body"!==getNodeName(e))),o=null;const i="fixed"===getComputedStyle(e).position;let s=i?getParentNode(e):e;for(;isElement(s)&&!isLastTraversableNode(s);){const e=getComputedStyle(s),t=isContainingBlock(s);(i?!t&&!o:!t&&"static"===e.position&&!!o&&["absolute","fixed"].includes(o.position))?r=r.filter((e=>e!==s)):o=e,s=getParentNode(s)}return t.set(e,r),r}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?getClippingElementAncestors(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=getClientRectFromClippingAncestor(t,n,o);return e.top=max(r.top,e.top),e.right=min(r.right,e.right),e.bottom=min(r.bottom,e.bottom),e.left=max(r.left,e.left),e}),getClientRectFromClippingAncestor(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}const platform={getClippingRect:getClippingRect,convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,isElement:isElement,getDimensions:getDimensions,getOffsetParent:getOffsetParent,getDocumentElement:getDocumentElement,getScale:getScale,getElementRects(e){return __async(this,null,(function*(){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||getOffsetParent,i=this.getDimensions;return{reference:getRectRelativeToOffsetParent(t,yield o(n),r),floating:__spreadValues({x:0,y:0},yield i(n))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===getComputedStyle(e).direction};function autoUpdate(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?[...isElement(e)?getOverflowAncestors(e):e.contextElement?getOverflowAncestors(e.contextElement):[],...getOverflowAncestors(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})),isElement(e)&&!a&&d.observe(e),isElement(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let f=a?getBoundingClientRect(e):null;return a&&function t(){const r=getBoundingClientRect(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=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 computePosition=(e,t,n)=>{const r=new Map,o=__spreadValues({platform:platform},n),i=__spreadProps(__spreadValues({},o.platform),{_c:r});return computePosition$1(e,t,__spreadProps(__spreadValues({},o),{platform:i}))};function P(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]=createSignal({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[a,l]=createSignal();createEffect((()=>{let e=a();if(e)throw e.value}));let c=createMemo((()=>(e(),t(),{})));function u(){let i=e(),a=t();if(i&&a){let e=c();computePosition(i,a,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then((t=>{e===c()&&s(t)}),(e=>{l(e)}))}}return createEffect((()=>{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&&onCleanup(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}}const _tmpl$$3=template$1('<div id="tc-dropdown-container"></div>'),AccountButton=()=>{const e=useTheme(),t=useContext(ConnectorContext),n=useContext(TonConnectUiContext),[r,o]=createSignal(!1),[i,s]=createSignal(null),[a,l]=createSignal(!0);let c;const[u,d]=createSignal(),[f,h]=createSignal(),p=P(f,u,{whileElementsMounted:autoUpdate,placement:"bottom-end"});n.connectionRestored.then((()=>l(!1)));const g=t.onStatusChange((e=>{if(!e)return o(!1),void s(null);s(e.account)})),m=e=>{if(!i()||!r())return;const t=f().contains(e.target),n=c.contains(e.target);t||n||o(!1)};return onMount((()=>{document.body.addEventListener("click",m)})),onCleanup((()=>{document.body.removeEventListener("click",m),g()})),[createComponent(Show,{get when(){return a()},get children(){return createComponent(LoaderButtonStyled,{disabled:!0,id:"tc-connect-button-loading",get children(){return createComponent(LoaderIconStyled$2,{})}})}}),createComponent(Show,{get when(){return!a()},get children(){return[createComponent(Show,{get when(){return!i()},get children(){return createComponent(AccountButtonStyled,{onClick:()=>n.connectWallet(),id:"tc-connect-button",get children(){return[createComponent(TonIcon,{get fill(){return e.colors.connectButton.foreground}}),createComponent(Text,{translationKey:"button.connectWallet",fontSize:"15px",letterSpacing:"-0.24px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),createComponent(Show,{get when(){return i()},get children(){return createComponent(DropdownContainerStyled,{get children(){return[createComponent(DropdownButtonStyled,{onClick:()=>o((e=>!e)),ref:h,id:"tc-dropdown-button",get children(){return[createComponent(Text,{fontSize:"15px",letterSpacing:"-0.24px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const e=i();if(e){const t=toUserFriendlyAddress(e.address,e.chain===CHAIN.TESTNET);return t.slice(0,4)+"..."+t.slice(-4)}return""})()}}),createComponent(ArrowIcon,{direction:"bottom"})]}}),createComponent(Portal,{get children(){const e=_tmpl$$3.cloneNode(!0);return use(d,e),e.style.setProperty("z-index","999"),insert(e,createComponent(Transition,{onBeforeEnter:e=>{e.animate([{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{e.animate([{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return createComponent(Show,{get when(){return r()},get children(){return createComponent(DropdownStyled,{get hidden(){return!r()},onClose:()=>o(!1),ref(e){"function"==typeof c?c(e):c=e},id:"tc-dropdown"})}})}}),null),insert(e,createComponent(NotificationsStyled,{id:"tc-notifications"}),null),createRenderEffect((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}})]}})}})]}})]},QrCodeStyled=styled.div`
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
height: 276px;
|
|
288
|
-
width: 276px;
|
|
289
|
-
|
|
290
|
-
display: flex;
|
|
291
|
-
align-items: center;
|
|
292
|
-
justify-content: center;
|
|
293
|
-
|
|
294
|
-
> svg {
|
|
295
|
-
height: 276px;
|
|
296
|
-
width: 276px;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
rect {
|
|
301
|
-
fill: transparent;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
path {
|
|
305
|
-
fill: ${e=>e.theme.colors.text.primary};
|
|
306
|
-
}
|
|
307
|
-
`,ImageBackground=styled.div`
|
|
308
|
-
position: absolute;
|
|
309
|
-
width: 52px;
|
|
310
|
-
height: 52px;
|
|
311
|
-
background: ${e=>e.theme.colors.background.secondary};
|
|
312
|
-
padding: 7px;
|
|
313
|
-
top: 112px;
|
|
314
|
-
left: 112px;
|
|
315
|
-
|
|
316
|
-
display: flex;
|
|
317
|
-
align-items: center;
|
|
318
|
-
justify-content: center;
|
|
319
|
-
|
|
320
|
-
> img {
|
|
321
|
-
width: 46px;
|
|
322
|
-
height: 46px;
|
|
323
|
-
border-radius: 12px;
|
|
324
|
-
}
|
|
325
|
-
`;var qrcode$1={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<e;n+=1){t[n]=new Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(i=4*n+17),d(0,0),d(i-7,0),d(0,i-7),h(),f(),g(e,t),n>=7&&p(e),null==s&&(s=y(n,r,a)),m(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)},f=function(){for(var e=8;e<i-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(var t=8;t<i-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},h=function(){for(var e=C.getPatternPosition(n),t=0;t<e.length;t+=1)for(var r=0;r<e.length;r+=1){var i=e[t],s=e[r];if(null==o[i][s])for(var a=-2;a<=2;a+=1)for(var l=-2;l<=2;l+=1)o[i+a][s+l]=-2==a||2==a||-2==l||2==l||0==a&&0==l}},p=function(e){for(var t=C.getBCHTypeNumber(n),r=0;r<18;r+=1){var s=!e&&1==(t>>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}},g=function(e,t){for(var n=r<<3|t,s=C.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},m=function(e,t){for(var n=-1,r=i-1,s=7,a=0,l=C.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<e.length&&(d=1==(e[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}}},y=function(e,t,n){for(var r=b.getRSBlocks(e,t),o=S(),i=0;i<n.length;i+=1){var s=n[i];o.put(s.getMode(),4),o.put(s.getLength(),C.getLengthInBits(s.getMode(),e)),s.write(o)}var a=0;for(i=0;i<r.length;i+=1)a+=r[i].dataCount;if(o.getLengthInBits()>8*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<t.length;a+=1){var l=t[a].dataCount,c=t[a].totalCount-l;r=Math.max(r,l),o=Math.max(o,c),i[a]=new Array(l);for(var u=0;u<i[a].length;u+=1)i[a][u]=255&e.getBuffer()[u+n];n+=l;var d=C.getErrorCorrectPolynomial(c),f=E(i[a],d.getLength()-1).mod(d);for(s[a]=new Array(d.getLength()-1),u=0;u<s[a].length;u+=1){var h=u+f.getLength()-s[a].length;s[a][u]=h>=0?f.getAt(h):0}}var p=0;for(u=0;u<t.length;u+=1)p+=t[u].totalCount;var g=new Array(p),m=0;for(u=0;u<r;u+=1)for(a=0;a<t.length;a+=1)u<i[a].length&&(g[m]=i[a][u],m+=1);for(u=0;u<o;u+=1)for(a=0;a<t.length;a+=1)u<s[a].length&&(g[m]=s[a][u],m+=1);return g}(o,r)};l.addData=function(e,t){var n=null;switch(t=t||"Byte"){case"Numeric":n=x(e);break;case"Alphanumeric":n=_(e);break;case"Byte":n=T(e);break;case"Kanji":n=O(e);break;default:throw"mode:"+t}a.push(n),s=null},l.isDark=function(e,t){if(e<0||i<=e||t<0||i<=t)throw e+","+t;return o[e][t]},l.getModuleCount=function(){return i},l.make=function(){if(n<1){for(var e=1;e<40;e++){for(var t=b.getRSBlocks(e,r),o=S(),i=0;i<a.length;i++){var s=a[i];o.put(s.getMode(),4),o.put(s.getLength(),C.getLengthInBits(s.getMode(),e)),s.write(o)}var u=0;for(i=0;i<t.length;i++)u+=t[i].dataCount;if(o.getLengthInBits()<=8*u)break}n=e}c(!1,function(){for(var e=0,t=0,n=0;n<8;n+=1){c(!0,n);var r=C.getLostPoint(l);(0==n||e>r)&&(e=r,t=n)}return t}())},l.createTableTag=function(e,t){e=e||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(t=void 0===t?4*e:t)+"px;",n+='">',n+="<tbody>";for(var r=0;r<l.getModuleCount();r+=1){n+="<tr>";for(var o=0;o<l.getModuleCount();o+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+e+"px;",n+=" height: "+e+"px;",n+=" background-color: ",n+=l.isDark(r,o)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>"},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+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',d+=o.scalable?"":' width="'+u+'px" height="'+u+'px"',d+=' viewBox="0 0 '+u+" "+u+'" ',d+=' preserveAspectRatio="xMinYMin meet"',d+=r.text||n.text?' role="img" aria-labelledby="'+w([r.id,n.id].join(" ").trim())+'"':"",d+=">",d+=r.text?'<title id="'+w(r.id)+'">'+w(r.text)+"</title>":"",d+=n.text?'<description id="'+w(n.id)+'">'+w(n.text)+"</description>":"",d+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',d+='<path d="',s=0;s<l.getModuleCount();s+=1)for(a=s*e+t,i=0;i<l.getModuleCount();i+=1)l.isDark(s,i)&&(d+="M"+(i*e+t)+","+a+c);return d+='" stroke="transparent" fill="black"/>',d+="</svg>"},l.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=l.getModuleCount()*e+2*t,r=t,o=n-t;return N(n,n,(function(t,n){if(r<=t&&t<o&&r<=n&&n<o){var i=Math.floor((t-r)/e),s=Math.floor((n-r)/e);return l.isDark(s,i)?0:1}return 1}))},l.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=l.getModuleCount()*e+2*t,o="";return o+="<img",o+=' src="',o+=l.createDataURL(e,t),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=w(n),o+='"'),o+="/>"};var w=function(e){for(var t="",n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case"<":t+="<";break;case">":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={"██":"▀","█ ":"▀"," █":" "," ":" "},f="";for(t=0;t<s;t+=2){for(r=Math.floor((t-a)/1),o=Math.floor((t+1-a)/1),n=0;n<s;n+=1)i="█",a<=n&&n<c&&a<=t&&t<c&&l.isDark(r,Math.floor((n-a)/1))&&(i=" "),a<=n&&n<c&&a<=t+1&&t+1<c&&l.isDark(o,Math.floor((n-a)/1))?i+=" ":i+="█",f+=e<1&&t+1>=c?d[i]:u[i];f+="\n"}return s%2&&e>0?f.substring(0,f.length-s-1)+Array(s+1).join("▀"):f.substring(0,f.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(" "),f="",h="";for(n=0;n<s;n+=1){for(o=Math.floor((n-a)/e),h="",r=0;r<s;r+=1)i=1,a<=r&&r<c&&a<=n&&n<c&&l.isDark(o,Math.floor((r-a)/e))&&(i=0),h+=i?u:d;for(o=0;o<e;o+=1)f+=h+"\n"}return f.substring(0,f.length-1)},l.renderTo2dContext=function(e,t){t=t||2;for(var n=l.getModuleCount(),r=0;r<n;r++)for(var o=0;o<n;o++)e.fillStyle=l.isDark(r,o)?"black":"white",e.fillRect(r*t,o*t,t,t)},l};e.stringToBytes=(e.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}}).default,e.createStringToBytes=function(e,t){var n=function(){for(var n=A(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},o=0,i={};;){var s=n.read();if(-1==s)break;var a=r(),l=r()<<8|r();i[String.fromCharCode(s<<8|a)]=l,o+=1}if(o!=t)throw o+" != "+t;return i}(),r="?".charCodeAt(0);return function(e){for(var t=[],o=0;o<e.length;o+=1){var i=e.charCodeAt(o);if(i<128)t.push(i);else{var s=n[e.charAt(o)];"number"==typeof s?(255&s)==s?t.push(s):(t.push(s>>>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,f=1,h=2,p=3,g=4,m=5,y=6,w=7,C=(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<<i(t)-i(n);return 21522^(e<<10|t)},o.getBCHTypeNumber=function(e){for(var t=e<<12;i(t)-i(r)>=0;)t^=r<<i(t)-i(r);return e<<12|t},o.getPatternPosition=function(e){return t[e-1]},o.getMaskFunction=function(e){switch(e){case d:return function(e,t){return(e+t)%2==0};case f:return function(e,t){return e%2==0};case h:return function(e,t){return t%3==0};case p:return function(e,t){return(e+t)%3==0};case g:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case m:return function(e,t){return e*t%2+e*t%3==0};case y:return function(e,t){return(e*t%2+e*t%3)%2==0};case w:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},o.getErrorCorrectPolynomial=function(e){for(var t=E([1],0),n=0;n<e;n+=1)t=t.multiply(E([1,v.gexp(n)],0));return t},o.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case s:return 10;case a:return 9;case l:case c:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case s:return 12;case a:return 11;case l:return 16;case c:return 10;default:throw"mode:"+e}else{if(!(t<41))throw"type:"+t;switch(e){case s:return 14;case a:return 13;case l:return 16;case c:return 12;default:throw"mode:"+e}}},o.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var o=0;o<t;o+=1){for(var i=0,s=e.isDark(r,o),a=-1;a<=1;a+=1)if(!(r+a<0||t<=r+a))for(var l=-1;l<=1;l+=1)o+l<0||t<=o+l||0==a&&0==l||s==e.isDark(r+a,o+l)&&(i+=1);i>5&&(n+=3+i-5)}for(r=0;r<t-1;r+=1)for(o=0;o<t-1;o+=1){var c=0;e.isDark(r,o)&&(c+=1),e.isDark(r+1,o)&&(c+=1),e.isDark(r,o+1)&&(c+=1),e.isDark(r+1,o+1)&&(c+=1),0!=c&&4!=c||(n+=3)}for(r=0;r<t;r+=1)for(o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(o=0;o<t;o+=1)for(r=0;r<t-6;r+=1)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);var u=0;for(o=0;o<t;o+=1)for(r=0;r<t;r+=1)e.isDark(r,o)&&(u+=1);return n+=Math.abs(100*u/t/t-50)/5*10},o),v=function(){for(var e=new Array(256),t=new Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;n<255;n+=1)t[e[n]]=n;var r={glog:function(e){if(e<1)throw"glog("+e+")";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}};return r}();function E(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n<e.length&&0==e[n];)n+=1;for(var r=new Array(e.length-n+t),o=0;o<e.length-n;o+=1)r[o]=e[o+n];return r}(),r={getAt:function(e){return n[e]},getLength:function(){return n.length},multiply:function(e){for(var t=new Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var o=0;o<e.getLength();o+=1)t[n+o]^=v.gexp(v.glog(r.getAt(n))+v.glog(e.getAt(o)));return E(t,0)},mod:function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=v.glog(r.getAt(0))-v.glog(e.getAt(0)),n=new Array(r.getLength()),o=0;o<r.getLength();o+=1)n[o]=r.getAt(o);for(o=0;o<e.getLength();o+=1)n[o]^=v.gexp(v.glog(e.getAt(o))+t);return E(n,0).mod(e)}};return r}var b=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},n={};return n.getRSBlocks=function(n,r){var o=function(t,n){switch(n){case u.L:return e[4*(t-1)+0];case u.M:return e[4*(t-1)+1];case u.Q:return e[4*(t-1)+2];case u.H:return e[4*(t-1)+3];default:return}}(n,r);if(void 0===o)throw"bad rs block @ typeNumber:"+n+"/errorCorrectionLevel:"+r;for(var i=o.length/3,s=[],a=0;a<i;a+=1)for(var l=o[3*a+0],c=o[3*a+1],d=o[3*a+2],f=0;f<l;f+=1)s.push(t(c,d));return s},n}(),S=function(){var e=[],t=0,n={getBuffer:function(){return e},getAt:function(t){var n=Math.floor(t/8);return 1==(e[n]>>>7-t%8&1)},put:function(e,t){for(var r=0;r<t;r+=1)n.putBit(1==(e>>>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},x=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<t.length;)e.put(o(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(o(t.substring(r,r+1)),4):t.length-r==2&&e.put(o(t.substring(r,r+2)),7))}},o=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+i(e.charAt(n));return t},i=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+e};return r},_=function(e){var t=a,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(var t=n,r=0;r+1<t.length;)e.put(45*o(t.charAt(r))+o(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(o(t.charAt(r)),6)}},o=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);if("A"<=e&&e<="Z")return e.charCodeAt(0)-"A".charCodeAt(0)+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return r},T=function(t){var n=l,r=e.stringToBytes(t),o={getMode:function(){return n},getLength:function(e){return r.length},write:function(e){for(var t=0;t<r.length;t+=1)e.put(r[t],8)}};return o},O=function(t){var n=c,r=e.stringToBytesFuncs.SJIS;if(!r)throw"sjis not supported.";!function(e,t){var n=r("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."}();var o=r(t),i={getMode:function(){return n},getLength:function(e){return~~(o.length/2)},write:function(e){for(var t=o,n=0;n+1<t.length;){var r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(n+1)+"/"+r;r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13),n+=2}if(n<t.length)throw"illegal char at "+(n+1)}};return i},R=function(){var e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o<r;o+=1)t.writeByte(e[o+n])},writeString:function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+="]"}};return t},A=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},N=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<<e,n=1+(1<<e),r=e+1,i=a(),s=0;s<t;s+=1)i.add(String.fromCharCode(s));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(n));var l,c,u,d=R(),f=(l=d,c=0,u=0,{write:function(e,t){if(e>>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<<c|u)),t-=8-c,e>>>=8-c,u=0,c=0;u|=e<<c,c+=t},flush:function(){c>0&&l.writeByte(u)}});f.write(t,r);var h=0,p=String.fromCharCode(o[h]);for(h+=1;h<o.length;){var g=String.fromCharCode(o[h]);h+=1,i.contains(p+g)?p+=g:(f.write(i.indexOf(p),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(p+g)),p=g)}return f.write(i.indexOf(p),r),f.write(n,r),f.flush(),d.toByteArray()},a=function(){var e={},t=0,n={add:function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return n};return i}(e,t),o=0;o<t;o+=1)for(var i=0;i<e;i+=1)r.setPixel(i,o,n(i,o));var s=R();r.write(s);for(var a=function(){var e=0,t=0,n=0,r="",o={},i=function(e){r+=String.fromCharCode(s(63&e))},s=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=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<o;s+=1)r+="="},o.toString=function(){return r},o}(),l=s.toByteArray(),c=0;c<l.length;c+=1)a.writeByte(l[c]);return a.flush(),"data:image/gif;base64,"+a};return e}();n.stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>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}(qrcode$1);const qrcode=qrcode$1.exports,_tmpl$$2=template$1("<div></div>"),_tmpl$2=template$1('<img alt="">'),QRCode=e=>{let t;return createEffect((()=>{const n=qrcode(0,"L");n.addData(e.sourceUrl),n.make(),t.innerHTML=n.createSvgTag(4)})),createComponent(QrCodeStyled,{get children(){return[(()=>{const e=_tmpl$$2.cloneNode(!0);return"function"==typeof t?use(t,e):t=e,e})(),createComponent(ImageBackground,{get children(){const t=_tmpl$2.cloneNode(!0);return createRenderEffect((()=>setAttribute(t,"src",e.imageUrl))),t}})]}})},Translation=e=>{var t;const[n]=useI18n();return n(e.translationKey,e.translationValues,null==(t=e.children)?void 0:t.toString())},borders={m:"16px",s:"8px",none:"0"},QrCodeModalStyled=styled.div`
|
|
326
|
-
padding: 0 24px;
|
|
327
|
-
`,StyledIconButton=styled(IconButton)`
|
|
456
|
+
`;function _i(e){return e.split("-")[0]}function Si(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(_i(e))?"x":"y"}(t),l="y"===a?"height":"width";const c=r[l]/2-o[l]/2,u="x"===a;let d;switch(_i(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 Ei=(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}=Si(c,r,l),h=r,f={},g=0;for(let n=0;n<a.length;n++){const{name:i,fn:p}=a[n],{x:y,y:m,data:v,reset:w}=yield p({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=m?m:d,f=__spreadProps(__spreadValues({},f),{[i]:__spreadValues(__spreadValues({},f[i]),v)}),"production"!=={}.NODE_ENV&&g>50&&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(" ")),w&&g<=50&&(g++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(c=!0===w.rects?yield s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:d}=Si(c,h,l))),n=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}}));function Ri(e){return __spreadProps(__spreadValues({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function Li(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ai(e){return Li(e).getComputedStyle(e)}function Oi(e){return Ni(e)?(e.nodeName||"").toLowerCase():""}let ki;function Ti(){if(ki)return ki;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(ki=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),ki):navigator.userAgent}function Pi(e){return e instanceof Li(e).HTMLElement}function Mi(e){return e instanceof Li(e).Element}function Ni(e){return e instanceof Li(e).Node}function $i(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof Li(e).ShadowRoot||e instanceof ShadowRoot}function ji(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ai(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ii(e){return["table","td","th"].includes(Oi(e))}function Ui(e){const t=/firefox/i.test(Ti()),n=Ai(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 Wi(){return!/^((?!chrome|android).)*safari/i.test(Ti())}function Bi(e){return["html","body","#document"].includes(Oi(e))}const Ki=Math.min,Di=Math.max,Fi=Math.round,qi={x:1,y:1};function Hi(e){const t=!Mi(e)&&e.contextElement?e.contextElement:Mi(e)?e:null;if(!t)return qi;const n=t.getBoundingClientRect(),r=Ai(t);if("border-box"!==r.boxSizing)return Pi(t)?{x:t.offsetWidth>0&&Fi(n.width)/t.offsetWidth||1,y:t.offsetHeight>0&&Fi(n.height)/t.offsetHeight||1}:qi;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 Vi(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=qi;t&&(r?Mi(r)&&(c=Hi(r)):c=Hi(e));const u=Mi(e)?Li(e):window,d=!Wi()&&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 zi(e){return((Ni(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gi(e){return Mi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Yi(e){return Vi(zi(e)).left+Gi(e).scrollLeft}function Qi(e,t,n){const r=Pi(t),o=zi(t),i=Vi(e,!0,"fixed"===n,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==Oi(t)||ji(o))&&(s=Gi(t)),Pi(t)){const e=Vi(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=Yi(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}function Ji(e){if("html"===Oi(e))return e;const t=e.assignedSlot||e.parentNode||($i(e)?e.host:null)||zi(e);return $i(t)?t.host:t}function Zi(e){return Pi(e)&&"fixed"!==Ai(e).position?e.offsetParent:null}function Xi(e){const t=Li(e);let n=Zi(e);for(;n&&Ii(n)&&"static"===Ai(n).position;)n=Zi(n);return n&&("html"===Oi(n)||"body"===Oi(n)&&"static"===Ai(n).position&&!Ui(n))?t:n||function(e){let t=Ji(e);for(;Pi(t)&&!Bi(t);){if(Ui(t))return t;t=Ji(t)}return null}(e)||t}function es(e){const t=Ji(e);return Bi(t)?e.ownerDocument.body:Pi(t)&&ji(t)?t:es(t)}function ts(e,t){var n;void 0===t&&(t=[]);const r=es(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Li(r);return o?t.concat(i,i.visualViewport||[],ji(r)?r:[]):t.concat(r,ts(r))}function ns(e,t,n){return"viewport"===t?Ri(function(e,t){const n=Li(e),r=zi(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=Wi();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n)):Mi(t)?function(e,t){const n=Vi(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pi(e)?Hi(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):Ri(function(e){var t;const n=zi(e),r=Gi(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Di(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Di(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+Yi(e);const l=-r.scrollTop;return"rtl"===Ai(o||n).direction&&(a+=Di(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(zi(e)))}const rs={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=ts(e).filter((e=>Mi(e)&&"body"!==Oi(e))),o=null;const i="fixed"===Ai(e).position;let s=i?Ji(e):e;for(;Mi(s)&&!Bi(s);){const e=Ai(s),t=Ui(s);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==s)),s=Ji(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=ns(t,n,o);return e.top=Di(r.top,e.top),e.right=Ki(r.right,e.right),e.bottom=Ki(r.bottom,e.bottom),e.left=Di(r.left,e.left),e}),ns(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=Pi(n),i=zi(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"!==Oi(n)||ji(i))&&(s=Gi(n)),Pi(n))){const e=Vi(n);a=Hi(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:Mi,getDimensions:function(e){if(Pi(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Vi(e);return{width:t.width,height:t.height}},getOffsetParent:Xi,getDocumentElement:zi,getScale:Hi,getElementRects(e){return __async(this,null,(function*(){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Xi,i=this.getDimensions;return{reference:Qi(t,yield o(n),r),floating:__spreadValues({x:0,y:0},yield i(n))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Ai(e).direction};function os(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?[...Mi(e)?ts(e):e.contextElement?ts(e.contextElement):[],...ts(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})),Mi(e)&&!a&&d.observe(e),Mi(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let h=a?Vi(e):null;return a&&function t(){const r=Vi(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 is=(e,t,n)=>{const r=new Map,o=__spreadValues({platform:rs},n),i=__spreadProps(__spreadValues({},o.platform),{_c:r});return Ei(e,t,__spreadProps(__spreadValues({},o),{platform:i}))};const ss=Tt('<tc-root data-tc-dropdown-container="true"></tc-root>'),as=()=>{const e=yn(),t=ze(_n),n=ze(Ho),[r,o]=je(!1),[i,s]=je(t.account),[a,l]=je(!0);let c;const[u,d]=je(),[h,f]=je(),g=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]=je({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[a,l]=je();We((()=>{let e=a();if(e)throw e.value}));let c=Be((()=>(e(),t(),{})));function u(){let i=e(),a=t();if(i&&a){let e=c();is(i,a,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then((t=>{e===c()&&s(t)}),(e=>{l(e)}))}}return We((()=>{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&&qe(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}}(h,u,{whileElementsMounted:os,placement:"bottom-end"});n.connectionRestored.then((()=>l(!1)));const p=t.onStatusChange((e=>{if(!e)return o(!1),void s(null);s(e.account)})),y=e=>{if(!i()||!r())return;const t=h().contains(e.target),n=c.contains(e.target);t||n||o(!1)};var m;return m=()=>{document.body.addEventListener("click",y)},We((()=>Fe(m))),qe((()=>{document.body.removeEventListener("click",y),p()})),ft(Gt,{component:or,get children(){return[ft(bt,{get when(){return a()},get children(){return ft(vi,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return ft(wi,{})}})}}),ft(bt,{get when(){return!a()},get children(){return[ft(bt,{get when(){return!i()},get children(){return ft(yi,{onClick:()=>n.connectWallet(),"data-tc-connect-button":"true",get children(){return[ft($o,{get fill(){return e.colors.connectButton.foreground}}),ft(xo,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),ft(bt,{get when(){return i()},get children(){return ft(bi,{get children(){return[ft(mi,{onClick:()=>o((e=>!e)),ref:f,"data-tc-dropdown-button":"true",get children(){return[ft(xo,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const e=i();if(e){const t=ye(e.address,e.chain===C.TESTNET);return t.slice(0,4)+"…"+t.slice(-4)}return""})()}}),ft(jr,{direction:"bottom"})]}}),ft(zt,{get children(){const e=Fe((()=>document.importNode(ss,!0)));return $t(d,e),e.style.setProperty("z-index","999"),e._$owner=Ae,jt(e,ft(Tr,{onBeforeEnter:e=>{e.animate([{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{e.animate([{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return ft(bt,{get when(){return r()},get children(){return ft(xi,{get hidden(){return!r()},onClose:()=>o(!1),ref(e){"function"==typeof c?c(e):c=e}})}})}}),null),jt(e,ft(Ci,{}),null),Ue((t=>{var n,r;const o=g.strategy,i=`${null!=(n=g.y)?n:0}px`,s=`${null!=(r=g.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}})]}})}})]}})]}})},ls={m:"16px",s:"8px",none:"0"},cs=vn.div``,us=vn(Lo)`
|
|
457
|
+
max-width: 320px;
|
|
458
|
+
margin: 0 auto 6px;
|
|
459
|
+
`,ds=vn(Br)`
|
|
328
460
|
position: absolute;
|
|
329
461
|
top: 16px;
|
|
330
462
|
left: 16px;
|
|
331
|
-
`,
|
|
463
|
+
`,hs=vn(wo)`
|
|
332
464
|
margin-bottom: 16px;
|
|
333
|
-
|
|
334
|
-
border-radius: ${e=>borders[e.theme.borderRadius]};
|
|
335
|
-
display: flex;
|
|
336
|
-
align-items: center;
|
|
337
|
-
justify-content: center;
|
|
338
|
-
padding: 10px 0;
|
|
339
|
-
`,ButtonsContainerStyled=styled.div`
|
|
465
|
+
`,fs=vn.div`
|
|
340
466
|
display: flex;
|
|
341
467
|
gap: 16px;
|
|
342
468
|
height: 56px;
|
|
343
469
|
margin-bottom: 24px;
|
|
344
|
-
`,
|
|
470
|
+
`,gs=vn(Lr)`
|
|
471
|
+
padding: 0 16px;
|
|
472
|
+
height: 56px;
|
|
345
473
|
font-size: 16px;
|
|
346
474
|
line-height: 20px;
|
|
347
|
-
letter-spacing: -0.32px;
|
|
348
475
|
width: 100%;
|
|
349
|
-
border-radius: ${e=>
|
|
350
|
-
`,
|
|
476
|
+
border-radius: ${e=>ls[e.theme.borderRadius]};
|
|
477
|
+
`,ps=vn.div`
|
|
351
478
|
display: flex;
|
|
352
479
|
justify-content: space-between;
|
|
353
480
|
align-items: center;
|
|
354
|
-
`,
|
|
481
|
+
`,ys=vn(xo)`
|
|
482
|
+
padding-left: 8px;
|
|
355
483
|
color: ${e=>e.theme.colors.text.secondary};
|
|
356
484
|
font-size: 16px;
|
|
357
|
-
|
|
358
|
-
cursor: pointer;
|
|
485
|
+
`,[ms,vs]=Un({buttonRootId:null,language:"en",returnStrategy:"back",walletsListConfiguration:{}}),ws=vn.a`
|
|
359
486
|
display: block;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
padding:
|
|
363
|
-
|
|
364
|
-
transition: transform 0.1s ease-in-out;
|
|
487
|
+
text-decoration: unset;
|
|
488
|
+
`,bs=e=>ft(ws,mt({get href(){return e.href},get target(){return e.blank?"_blank":"_self"}},(()=>e.blank?{rel:"noreferrer noopener"}:{}),{get children(){return e.children}})),xs=e=>{const t=ze(_n),n=Be((()=>t.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)));return ft(cs,{"data-tc-wallet-qr-modal-desktop":"true",get children(){return[ft(ds,{icon:"arrow",onClick:()=>e.onBackClick()}),ft(us,{translationKey:"walletModal.qrCodeModal.connectWith",get translationValues(){return{name:e.wallet.name}},get children(){return["Connect with ",Be((()=>e.wallet.name))]}}),ft(Oo,{translationKey:"walletModal.qrCodeModal.scan",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan QR code with your phone’s or ",Be((()=>e.wallet.name)),"’s camera."]}}),ft(hs,{disableCopy:!1,get sourceUrl(){return n()},get imageUrl(){return e.wallet.imageUrl}}),ft(fs,{get children(){return[ft(gs,{scale:"s",onClick:()=>{Zt(__spreadProps(__spreadValues({},e.wallet),{openMethod:"universal-link"})),gr(pr(n(),ms.returnStrategy))},get children(){return ft(po,{translationKey:"walletModal.qrCodeModal.openWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Open ",Be((()=>e.wallet.name))]}})}}),ft(bt,{get when(){return ae(e.wallet)},get children(){return ft(gs,{scale:"s",onClick:()=>{Zt(e.wallet),t.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest)},get children(){return ft(po,{translationKey:"common.openExtension",children:"Open Extension"})}})}})]}}),ft(ps,{get children(){return[ft(ys,{translationKey:"walletModal.qrCodeModal.dontHave",get translationValues(){return{name:e.wallet.name}},get children(){return["Don't have ",Be((()=>e.wallet.name)),"?"]}}),ft(bs,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ft(Lr,{get children(){return ft(po,{translationKey:"common.get",children:"GET"})}})}})]}})]}})},Cs=vn(Gr)`
|
|
489
|
+
padding-left: 24px;
|
|
490
|
+
padding-right: 24px;
|
|
365
491
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
492
|
+
${br("mobile")} {
|
|
493
|
+
padding-left: 0;
|
|
494
|
+
padding-right: 0;
|
|
369
495
|
|
|
370
|
-
|
|
371
|
-
transform: scale(0.96);
|
|
496
|
+
min-height: 364px;
|
|
372
497
|
}
|
|
498
|
+
`,_s=vn(Lo)`
|
|
499
|
+
margin-top: 12px;
|
|
373
500
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
height: 72px;
|
|
377
|
-
border-radius: 18px;
|
|
378
|
-
|
|
379
|
-
margin-bottom: 8px;
|
|
380
|
-
|
|
381
|
-
${media("mobile")} {
|
|
382
|
-
width: 64px;
|
|
383
|
-
height: 64px;
|
|
384
|
-
border-radius: 16px;
|
|
385
|
-
}
|
|
501
|
+
${br("mobile")} {
|
|
502
|
+
padding: 0 10px;
|
|
386
503
|
}
|
|
504
|
+
`,Ss=vn.div`
|
|
505
|
+
margin: 30px 0;
|
|
506
|
+
width: 100%;
|
|
507
|
+
display: flex;
|
|
508
|
+
justify-content: center;
|
|
387
509
|
|
|
388
|
-
${
|
|
389
|
-
|
|
510
|
+
${br("mobile")} {
|
|
511
|
+
height: 160px;
|
|
512
|
+
align-items: center;
|
|
390
513
|
}
|
|
391
|
-
`,
|
|
514
|
+
`,Es=vn(xo)`
|
|
515
|
+
min-width: 84px;
|
|
516
|
+
text-align: center;
|
|
392
517
|
font-weight: 590;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
overflow: hidden;
|
|
397
|
-
|
|
398
|
-
@supports (-webkit-line-clamp: 2) {
|
|
399
|
-
overflow: hidden;
|
|
400
|
-
text-overflow: ellipsis;
|
|
401
|
-
white-space: initial;
|
|
402
|
-
display: -webkit-box;
|
|
403
|
-
-webkit-line-clamp: 2;
|
|
404
|
-
-webkit-box-orient: vertical;
|
|
405
|
-
}
|
|
406
|
-
`,_tmpl$$1=template$1('<img alt="">'),WalletItem=e=>createComponent(WalletItemStyled,{onClick:()=>e.onClick(),get children(){return[(()=>{const t=_tmpl$$1.cloneNode(!0);return createRenderEffect((()=>setAttribute(t,"src",e.iconUrl))),t})(),createComponent(StyledText,{get children(){return e.name}})]}}),SelectWalletModalStyled=styled.div``,UlStyled=styled.ul`
|
|
518
|
+
`,Rs=vn((e=>{const t="tabBar"+Math.floor(1e4*Math.random());return ft(Jr,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[ft(Zr,{get right(){return 1===e.selectedTabIndex}}),ft(eo,{get isActive(){return 0===e.selectedTabIndex},get children(){return[ft(Xr,{type:"radio",name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,0)}}),Be((()=>e.tab1))]}}),ft(eo,{get isActive(){return 1===e.selectedTabIndex},get children(){return[ft(Xr,{type:"radio",name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,1)}}),Be((()=>e.tab2))]}})]}})}))`
|
|
519
|
+
margin: 0 auto 22px;
|
|
520
|
+
`;function Ls(e){return"jsBridgeKey"in e?__spreadProps(__spreadValues({},e),{injected:fe.isWalletInjected(e.jsBridgeKey),embedded:fe.isInsideWalletBrowser(e.jsBridgeKey)}):e}function As(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(Ls),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}const[Os,ks]=je(wr("mobile"));mr()&&window.addEventListener("resize",(()=>ks(wr("mobile"))));const Ts=vn.ul`
|
|
407
521
|
display: flex;
|
|
408
522
|
margin: 0 auto 24px;
|
|
409
523
|
width: fit-content;
|
|
524
|
+
min-height: 124px;
|
|
410
525
|
max-width: 100%;
|
|
411
|
-
|
|
412
|
-
overflow:
|
|
526
|
+
overflow-x: auto;
|
|
527
|
+
overflow-y: hidden;
|
|
413
528
|
padding: 0 24px;
|
|
414
529
|
|
|
415
530
|
&&::-webkit-scrollbar {
|
|
@@ -418,71 +533,189 @@ function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)
|
|
|
418
533
|
|
|
419
534
|
-ms-overflow-style: none;
|
|
420
535
|
scrollbar-width: none;
|
|
536
|
+
`,Ps=vn.li`
|
|
537
|
+
width: 82px;
|
|
538
|
+
min-width: 82px;
|
|
539
|
+
height: 124px;
|
|
540
|
+
display: flex;
|
|
541
|
+
flex-direction: column;
|
|
542
|
+
align-items: center;
|
|
543
|
+
padding: 8px 4px;
|
|
421
544
|
|
|
422
|
-
|
|
423
|
-
|
|
545
|
+
text-align: center;
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
|
|
548
|
+
transition: transform 0.1s ease-in-out;
|
|
549
|
+
|
|
550
|
+
${Cr} {
|
|
551
|
+
&:hover {
|
|
552
|
+
transform: scale(1.04);
|
|
553
|
+
}
|
|
424
554
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
555
|
+
|
|
556
|
+
&:active {
|
|
557
|
+
transform: scale(0.96);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
${xr} {
|
|
561
|
+
&:active {
|
|
562
|
+
transform: scale(0.92);
|
|
563
|
+
}
|
|
430
564
|
}
|
|
431
|
-
`,
|
|
565
|
+
`,Ms=vn.div`
|
|
566
|
+
width: 1px;
|
|
567
|
+
margin: 0 10px;
|
|
568
|
+
height: 24px;
|
|
569
|
+
position: relative;
|
|
570
|
+
top: 30px;
|
|
571
|
+
|
|
572
|
+
background-color: ${e=>e.theme.colors.icon.tertiary};
|
|
573
|
+
`,Ns=vn.div`
|
|
574
|
+
width: 64px;
|
|
575
|
+
height: 64px;
|
|
576
|
+
border-radius: 16px;
|
|
577
|
+
display: flex;
|
|
578
|
+
align-items: center;
|
|
579
|
+
justify-content: center;
|
|
580
|
+
|
|
581
|
+
background-color: ${e=>ur(e.theme.colors.accent,.12)};
|
|
582
|
+
color: ${e=>e.theme.colors.accent};
|
|
583
|
+
|
|
584
|
+
margin-bottom: 8px;
|
|
585
|
+
`,$s=vn(Oo)`
|
|
586
|
+
margin-bottom: 24px;
|
|
587
|
+
padding: 0 24px;
|
|
588
|
+
min-height: 44px;
|
|
589
|
+
`,js=vn(Lr)`
|
|
432
590
|
display: block;
|
|
433
591
|
margin: 0 auto;
|
|
434
|
-
`,
|
|
435
|
-
|
|
436
|
-
|
|
592
|
+
`,Is="https://ton.org/wallets",Us=Tt('<div data-tc-wallets-modal-mobile="true"></div>'),Ws=Tt("<li></li>"),Bs=e=>{const t=ms.connector,n=yn(),r=()=>{const n=t.connect(e.walletsList.filter(ce).map((e=>({bridgeUrl:e.bridgeUrl,universalLink:e.universalLink}))),e.additionalRequest);Zt({openMethod:"universal-link"}),fr(pr(n,ms.returnStrategy))};return(()=>{const o=Us.cloneNode(!0);return jt(o,ft(Lo,{translationKey:"walletModal.mobileSelectWalletModal.connectWallet",children:"Connect a wallet"}),null),jt(o,ft($s,{translationKey:"walletModal.mobileSelectWalletModal.selectWallet",children:"Select your wallet from the options to get started."}),null),jt(o,ft(Ts,{get children(){return[ft(Ps,{onClick:r,get children(){return[ft(Ns,{get children(){return ft(Mo,{get fill(){return n.colors.accent}})}}),ft(xo,{fontWeight:590,translationKey:"walletModal.mobileSelectWalletModal.installedWallet",children:"Installed wallet"})]}}),ft(Ms,{children:" "}),ft(wt,{get each(){return e.walletsList.filter((e=>"bridgeUrl"in e))},children:n=>(()=>{const r=Ws.cloneNode(!0);return jt(r,ft(Eo,{get iconUrl(){return n.imageUrl},get name(){return n.name},onClick:()=>{var r;"universalLink"in(r=n)?(Zt(__spreadProps(__spreadValues({},r),{openMethod:"universal-link"})),fr(pr(t.connect({universalLink:r.universalLink,bridgeUrl:r.bridgeUrl},e.additionalRequest),ms.returnStrategy))):gr(r.aboutUrl)}})),r})()})]}}),null),jt(o,ft(bs,{get href(){return Is},blank:!0,get children(){return ft(js,{get children(){return ft(po,{translationKey:"common.learnMore",children:"Learn more"})}})}}),null),o})()},Ks={m:"16px",s:"8px",none:"0"},Ds={m:"8px",s:"4px",none:"0"},Fs=vn.div`
|
|
593
|
+
display: flex;
|
|
594
|
+
flex-direction: column;
|
|
595
|
+
align-items: center;
|
|
596
|
+
`,qs=vn(Oo)`
|
|
597
|
+
max-width: 320px;
|
|
598
|
+
margin-bottom: 24px;
|
|
599
|
+
`,Hs=vn(wo)`
|
|
600
|
+
margin-bottom: 16px;
|
|
601
|
+
`,Vs=vn.div`
|
|
602
|
+
display: flex;
|
|
603
|
+
gap: 16px;
|
|
604
|
+
width: 100%;
|
|
605
|
+
`,zs=vn(Lr)`
|
|
606
|
+
position: relative;
|
|
607
|
+
font-size: 16px;
|
|
608
|
+
line-height: 20px;
|
|
609
|
+
width: 100%;
|
|
610
|
+
padding: 0 16px;
|
|
611
|
+
height: 56px;
|
|
612
|
+
border-radius: ${e=>Ks[e.theme.borderRadius]};
|
|
437
613
|
|
|
438
|
-
|
|
439
|
-
|
|
614
|
+
&:hover {
|
|
615
|
+
${e=>e.disableEventsAnimation?"transform: unset;":""}
|
|
440
616
|
}
|
|
441
|
-
`,H1Styled$1=styled(H1)`
|
|
442
|
-
margin-top: 12px;
|
|
443
617
|
|
|
444
|
-
|
|
445
|
-
|
|
618
|
+
&:active {
|
|
619
|
+
${e=>e.disableEventsAnimation?"transform: unset;":""}
|
|
446
620
|
}
|
|
447
|
-
`,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
margin:
|
|
621
|
+
`,Gs=vn.ul`
|
|
622
|
+
position: absolute;
|
|
623
|
+
bottom: 100%;
|
|
624
|
+
left: 0;
|
|
625
|
+
margin: 0;
|
|
626
|
+
padding: 8px;
|
|
627
|
+
width: 188px;
|
|
628
|
+
transform: translateY(-16px);
|
|
629
|
+
|
|
630
|
+
background-color: ${e=>e.theme.colors.background.primary};
|
|
631
|
+
border-radius: ${e=>Ks[e.theme.borderRadius]};
|
|
632
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
633
|
+
`,Ys=vn.li`
|
|
634
|
+
padding: 8px;
|
|
635
|
+
|
|
636
|
+
display: flex;
|
|
637
|
+
align-items: center;
|
|
638
|
+
gap: 8px;
|
|
639
|
+
|
|
640
|
+
cursor: pointer;
|
|
641
|
+
border-radius: ${e=>Ds[e.theme.borderRadius]};
|
|
642
|
+
|
|
643
|
+
transition: background-color, transform 0.1s ease-in-out;
|
|
644
|
+
|
|
645
|
+
&:hover {
|
|
646
|
+
background-color: ${e=>e.theme.colors.background.secondary};
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
&:active {
|
|
650
|
+
transform: scale(0.96);
|
|
651
|
+
}
|
|
652
|
+
`,Qs=vn(cr)`
|
|
653
|
+
width: 24px;
|
|
654
|
+
height: 24px;
|
|
655
|
+
|
|
656
|
+
border-radius: 6px;
|
|
657
|
+
`,Js=vn.div`
|
|
658
|
+
margin-top: 23px;
|
|
659
|
+
margin-bottom: 1px;
|
|
452
660
|
width: 100%;
|
|
453
661
|
display: flex;
|
|
454
662
|
justify-content: center;
|
|
663
|
+
align-items: center;
|
|
664
|
+
`;vn(xo)`
|
|
665
|
+
color: ${e=>e.theme.colors.text.secondary};
|
|
666
|
+
font-size: 16px;
|
|
667
|
+
`;const Zs=e=>{const[t,n]=je(!1),r=ms.connector,o=e.walletsList.filter(ce).map((e=>({bridgeUrl:e.bridgeUrl,universalLink:e.universalLink}))),i=e.walletsList.filter(ae);Zt({openMethod:"qrcode"});const s=Be((()=>r.connect(o,e.additionalRequest))),a=()=>{function e(){Zt({openMethod:"universal-link"}),window.removeEventListener("blur",e)}window.addEventListener("blur",e),fr(pr(s(),ms.returnStrategy)),setTimeout((()=>{window.removeEventListener("blur",e)}),200)},l=t=>{if(t.stopPropagation(),1===i.length){const t=i[0];return Zt(t),void r.connect({jsBridgeKey:t.jsBridgeKey},e.additionalRequest)}n((e=>!e))};return ft(Fs,{onClick:()=>n(!1),"data-tc-universal-qr-desktop":"true",get children(){return[ft(qs,{translationKey:"walletModal.universalQRModal.scanQR",children:"Scan QR code with a TON Connect compatible wallet."}),ft(Hs,{get sourceUrl(){return s()},get disableCopy(){return t()}}),ft(Vs,{get children(){return[ft(zs,{onClick:a,scale:"s",get children(){return[ft(bt,{get when(){return i.length},get children(){return ft(po,{translationKey:"walletModal.universalQRModal.openWallet",children:"Open Wallet"})}}),ft(bt,{get when(){return!i.length},get children(){return ft(po,{translationKey:"walletModal.universalQRModal.openInstalledWallet",children:"Open Installed Wallet"})}})]}}),ft(bt,{get when(){return i.length},get children(){return ft(zs,{onClick:l,get disableEventsAnimation(){return t()},scale:"s",get children(){return[ft(Tr,{onBeforeEnter:e=>{e.animate([{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-16px)"}],{duration:150})},onExit:(e,t)=>{e.animate([{opacity:1,transform:"translateY(-16px)"},{opacity:0,transform:"translateY(0)"}],{duration:150}).finished.then(t)},get children(){return ft(bt,{get when(){return t()},get children(){return ft(Gs,{get children(){return ft(wt,{each:i,children:t=>ft(Ys,{onClick:()=>{return Zt(n=t),void r.connect({jsBridgeKey:n.jsBridgeKey},e.additionalRequest);var n},get children(){return[ft(Qs,{get src(){return t.imageUrl},alt:""}),ft(xo,{fontWeight:590,get children(){return t.name}})]}})})}})}})}}),ft(po,{translationKey:"common.openExtension",children:"Open Extension"})]}})}})]}}),ft(bt,{get when(){return!i.length},get children(){return ft(Js,{get children(){return ft(bs,{get href(){return Is},blank:!0,get children(){return ft(Lr,{appearance:"flat",class:hn`
|
|
668
|
+
font-size: 15px;
|
|
669
|
+
`,get children(){return ft(po,{translationKey:"common.learnMore",children:"Learn more"})}})}})}})}})]}})},Xs=vn.div`
|
|
670
|
+
display: flex;
|
|
671
|
+
flex-direction: column;
|
|
672
|
+
align-items: center;
|
|
673
|
+
`,ea=vn(Oo)`
|
|
674
|
+
margin-bottom: 26px;
|
|
675
|
+
`,ta=vn.ul`
|
|
676
|
+
display: grid;
|
|
677
|
+
grid-template-columns: repeat(auto-fit, 92px);
|
|
678
|
+
justify-content: center;
|
|
679
|
+
row-gap: 8px;
|
|
680
|
+
overflow-y: auto;
|
|
681
|
+
max-height: 410px;
|
|
682
|
+
width: calc(100% + 12px);
|
|
683
|
+
margin-bottom: 30px;
|
|
684
|
+
padding: 10px 0;
|
|
685
|
+
align-self: flex-start;
|
|
455
686
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
align-items: center;
|
|
687
|
+
&&::-webkit-scrollbar {
|
|
688
|
+
width: 8px;
|
|
459
689
|
}
|
|
460
|
-
|
|
690
|
+
|
|
691
|
+
&&::-webkit-scrollbar-track {
|
|
692
|
+
background: transparent;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
&&::-webkit-scrollbar-thumb {
|
|
696
|
+
background: #cacaca;
|
|
697
|
+
border-radius: 12px;
|
|
698
|
+
}
|
|
699
|
+
`,na=vn(Lr)`
|
|
700
|
+
display: block;
|
|
701
|
+
margin: 0 auto 1px;
|
|
702
|
+
font-size: 15px;
|
|
703
|
+
`,ra=Tt("<li></li>"),oa=e=>ft(Xs,{"data-tc-select-wallet-desktop":"true",get children(){return[ft(ea,{translationKey:"walletModal.desktopSelectWalletModal.selectWallet",children:"Choose your preferred wallet from the options to get started."}),ft(ta,{get children(){return ft(wt,{get each(){return e.walletsList},children:t=>(()=>{const n=ra.cloneNode(!0);return jt(n,ft(Eo,{get iconUrl(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),n})()})}}),ft(bs,{get href(){return Is},blank:!0,get children(){return ft(na,{appearance:"flat",get children(){return ft(po,{translationKey:"common.learnMore",children:"Learn more"})}})}})]}}),ia=Tt('<div data-tc-wallets-modal-desktop="true"></div>'),sa=()=>{const{locale:e}=go()[1];We((()=>e(ms.language)));const t=ze(_n),n=ze(Ho),[r]=Ke((()=>n.getWallets())),[o,i]=je(null),[s,a]=je(0),l=Be((()=>{if("ready"!==r.state)return null;let e=As(r(),ms.walletsListConfiguration);const t=ms.preferredWalletName,n=e.find((e=>e.name===t)),o=e.filter((e=>e.name===t)).length>=2;return t&&n&&!o&&(e=[n].concat(e.filter((e=>e.name!==t)))),e})),c=()=>{var e;return"loading"===(null==(e=ms.connectRequestParameters)?void 0:e.state)},u=Be((()=>{var e;if(!c())return null==(e=ms.connectRequestParameters)?void 0:e.value})),d=()=>{Qt(!1),i(null)},h=e=>ae(e)?(Zt(e),void t.connect({jsBridgeKey:e.jsBridgeKey},u())):ce(e)?(Zt(__spreadProps(__spreadValues({},e),{openMethod:"qrcode"})),void i(e)):void gr(e.aboutUrl);return qe(t.onStatusChange((e=>{e&&d()}))),ft(Cs,{get opened(){return Yt()},onClose:d,"data-tc-wallets-modal-container":"true",get children(){return[ft(bt,{get when(){return c()||!l()},get children(){return[ft(_s,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),ft(Ss,{get children(){return ft(qo,{size:"m"})}})]}}),ft(bt,{get when(){return Be((()=>!c()))()&&l()},get children(){return[ft(bt,{get when(){return Os()},get children(){return ft(Bs,{get walletsList(){return l()},get additionalRequest(){return u()}})}}),ft(bt,{get when(){return!Os()},get children(){return[ft(bt,{get when(){return!o()},get children(){const e=ia.cloneNode(!0);return jt(e,ft(Rs,{get tab1(){return ft(Es,{translationKey:"walletModal.qrCode",cursor:"unset",children:"QR Code"})},get tab2(){return ft(Es,{translationKey:"walletModal.wallets",cursor:"unset",children:"Wallets"})},get selectedTabIndex(){return s()},onSelectedTabIndexChange:a}),null),jt(e,ft(xt,{get children(){return[ft(Ct,{get when(){return 0===s()},get children(){return ft(Zs,{get walletsList(){return l()},get additionalRequest(){return u()}})}}),ft(Ct,{get when(){return 1===s()},get children(){return ft(oa,{get walletsList(){return l()},onSelect:h})}})]}}),null),e}}),ft(bt,{get when(){return o()},get children(){return ft(xs,{get additionalRequest(){return u()},get wallet(){return o()},onBackClick:()=>i(null)})}})]}})]}})]}})},aa=vn.div`
|
|
461
704
|
display: flex;
|
|
462
705
|
flex-direction: column;
|
|
463
706
|
align-items: center;
|
|
464
|
-
padding-bottom:
|
|
465
|
-
`,
|
|
466
|
-
margin-top:
|
|
467
|
-
`,
|
|
707
|
+
padding-bottom: 8px;
|
|
708
|
+
`,la=vn(Lo)`
|
|
709
|
+
margin-top: 16px;
|
|
710
|
+
`,ca=vn(xo)`
|
|
468
711
|
font-weight: 510;
|
|
469
712
|
font-size: 16px;
|
|
470
|
-
line-height:
|
|
471
|
-
letter-spacing: -0.32px;
|
|
713
|
+
line-height: 20px;
|
|
472
714
|
text-align: center;
|
|
473
715
|
max-width: 250px;
|
|
474
716
|
|
|
475
717
|
color: ${e=>e.theme.colors.text.secondary};
|
|
476
|
-
`,
|
|
718
|
+
`,ua=vn(Lr)`
|
|
477
719
|
margin-top: 32px;
|
|
478
|
-
`,ActionModal=e=>createComponent(ActionModalStyled,{get id(){return e.id},get children(){return[createMemo((()=>e.icon)),createComponent(H1Styled,{get translationKey(){return e.headerTranslationKey}}),createComponent(TextStyled,{get translationKey(){return e.textTranslationKey}}),createComponent(Show,{get when(){return!1!==e.showButton},get children(){return createComponent(ButtonStyled,{onClick:()=>e.onClose(),get children(){return createComponent(Translation,{translationKey:"common.close",children:"Close"})}})}})]}}),LoaderIconStyled=styled(LoaderIcon)`
|
|
479
|
-
height: 72px;
|
|
480
|
-
width: 72px;
|
|
481
|
-
`,ConfirmTransactionModal=e=>createComponent(ActionModal,{headerTranslationKey:"actionModal.confirmTransaction.header",textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return createComponent(LoaderIconStyled,{})},onClose:()=>e.onClose(),showButton:!1,get id(){return e.id}}),ErrorIconStyled=styled(ErrorIcon)`
|
|
482
|
-
height: 66px;
|
|
483
|
-
width: 66px;
|
|
484
|
-
`,TransactionCanceledModal=e=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return createComponent(ErrorIconStyled,{})},onClose:()=>e.onClose(),get id(){return e.id}}),SuccessIconStyled=styled(SuccessIcon)`
|
|
485
|
-
height: 66px;
|
|
486
|
-
width: 66px;
|
|
487
|
-
`,TransactionSentModal=e=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return createComponent(SuccessIconStyled,{})},onClose:()=>e.onClose(),get id(){return e.id}}),ActionsModal=()=>createComponent(Modal,{get opened(){var e;return createMemo((()=>null!==action()))()&&!0===(null==(e=action())?void 0:e.openModal)},onClose:()=>setAction(null),id:"tc-actions-modal-container",get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return"transaction-sent"===action().name},get children(){return createComponent(TransactionSentModal,{onClose:()=>setAction(null),id:"tc-transaction-sent-modal"})}}),createComponent(Match,{get when(){return"transaction-canceled"===action().name},get children(){return createComponent(TransactionCanceledModal,{onClose:()=>setAction(null),id:"tc-transaction-canceled-modal"})}}),createComponent(Match,{get when(){return"confirm-transaction"===action().name},get children(){return createComponent(ConfirmTransactionModal,{onClose:()=>setAction(null),id:"tc-confirm-modal"})}})]}})}}),App=e=>{const t=createI18nContext(i18nDictionary,appState.language);return createComponent(I18nContext.Provider,{value:t,get children(){return createComponent(TonConnectUiContext.Provider,{get value(){return e.tonConnectUI},get children(){return createComponent(ConnectorContext.Provider,{get value(){return appState.connector},get children(){return[createComponent(GlobalStyles,{}),createComponent(ThemeProvider,{theme:themeState,get children(){return[createComponent(Show,{get when(){return appState.buttonRootId},get children(){return createComponent(Portal,{get mount(){return document.getElementById(appState.buttonRootId)},get children(){return createComponent(AccountButton,{})}})}}),createComponent(WalletsModal,{}),createComponent(ActionsModal,{})]}})]}})}})}})},widgetController={openWalletsModal:()=>{setTimeout((()=>setWalletsModalOpen(!0)))},closeWalletsModal:()=>{setTimeout((()=>setWalletsModalOpen(!1)))},setAction:e=>{setTimeout((()=>setAction(e)))},clearAction:()=>{setTimeout((()=>setAction(null)))},getSelectedWalletInfo:()=>lastSelectedWalletInfo(),renderApp:(e,t)=>render((()=>createComponent(App,{tonConnectUI:t})),document.getElementById(e))};class TonConnectUIError extends TonConnectError{constructor(...e){super(...e),Object.setPrototypeOf(this,TonConnectUIError.prototype)}}class WalletInfoStorage{constructor(){if(__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_wallet-info"),"undefined"==typeof localStorage)throw new TonConnectUIError("window.localStorage is undefined. localStorage is required for TonConnectUI");this.localStorage=localStorage}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 TonConnectUI{constructor(e){if(__publicField(this,"walletInfoStorage",new WalletInfoStorage),__publicField(this,"connector"),__publicField(this,"_walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__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 TonConnectUIError("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new TonConnect({manifestUrl:e.manifestUrl,walletsListSource:e.walletsListSource})}this.getWallets();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=mergeOptions(e,{uiPreferences:{theme:"SYSTEM"}}),setAppState({connector:this.connector,getConnectParameters:null==e?void 0:e.getConnectParameters}),widgetController.renderApp(t,this)}static getWallets(){return TonConnect.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet}get walletInfo(){return this._walletInfo}set uiOptions(e){var t,n,r,o,i;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),setTheme(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(setTheme(getSystemTheme(),e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=subscribeToThemeChange(setTheme))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&setColors(e.uiPreferences.colorsSet),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&setBorderRadius(e.uiPreferences.borderRadius),setAppState((t=>{var n;const r=mergeOptions(__spreadValues(__spreadValues(__spreadValues({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!e.walletsList&&{walletsList:e.walletsList}),unwrap(t));return void 0!==e.buttonRootId&&(r.buttonRootId=e.buttonRootId),r}))}getWallets(){return __async(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>{if(t){const n=widgetController.getSelectedWalletInfo()||this.walletInfoStorage.getWalletInfo();e(__spreadValues(__spreadValues({},t),n))}else e(t)}),t)}connectWallet(){return __async(this,null,(function*(){var e;const t=(yield this.getWallets()).find((e=>"embedded"in e&&e.embedded));if(t){const n=yield null==(e=appState.getConnectParameters)?void 0:e.call(appState);setLastSelectedWalletInfo(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},n)}else widgetController.openWalletsModal();return new Promise(((e,t)=>{const n=this.connector.onStatusChange((r=>{if(n(),r){const t=widgetController.getSelectedWalletInfo()||this.walletInfoStorage.getWalletInfo();e(__spreadValues(__spreadValues({},r),t))}else t(new TonConnectUIError("Wallet was not connected"))}),t)}))}))}disconnect(){return this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return __async(this,null,(function*(){if(!this.connected||!this.walletInfo)throw new TonConnectUIError("Connect wallet to send a transaction.");const{notifications:n,modals:r,returnStrategy:o}=this.getModalsAndNotificationsConfiguration(t);"universalLink"in this.walletInfo&&"universal-link"===this.walletInfo.openMethod&&openLink(addReturnStrategy(this.walletInfo.universalLink,o)),widgetController.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before")});try{const t=yield this.connector.sendTransaction(e);return widgetController.setAction({name:"transaction-sent",showNotification:n.includes("success"),openModal:r.includes("success")}),t}catch(i){throw widgetController.setAction({name:"transaction-canceled",showNotification:n.includes("error"),openModal:r.includes("error")}),i instanceof TonConnectError?i:(console.error(i),new TonConnectUIError("Unhandled error:"+i))}}))}subscribeToWalletChange(){this.connector.onStatusChange((e=>{e?this.updateWalletInfo():this.walletInfoStorage.removeWalletInfo()}))}updateWalletInfo(){const e=widgetController.getSelectedWalletInfo();e?(this._walletInfo=e,this.walletInfoStorage.setWalletInfo(e)):this._walletInfo=this.walletInfoStorage.getWalletInfo()}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 TonConnectUIError(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r;const o=["before","success","error"];let i=o;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(i=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(i="all"===e.notifications?o:e.notifications);let s=["before"];return(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(s="all"===this.actionsConfiguration.modals?o:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(s="all"===e.modals?o:e.modals),{notifications:i,modals:s,returnStrategy:(null==e?void 0:e.returnStrategy)||"back"}}}exports.THEME=THEME,exports.TonConnectUI=TonConnectUI,exports.TonConnectUIError=TonConnectUIError,exports.default=TonConnectUI,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
720
|
+
`,da=e=>{const t=Rr(e);return ft(aa,mt(t,{get children(){return[Be((()=>e.icon)),ft(la,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),ft(ca,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),ft(bt,{get when(){return!1!==e.showButton},get children(){return ft(ua,{onClick:()=>e.onClose(),get children(){return ft(po,{translationKey:"common.close",children:"Close"})}})}})]}}))},ha=e=>{var t;const n=ze(Ho),[r]=go(),o=(null==(t=n.wallet)?void 0:t.name)||r("common.yourWallet",{},"your wallet");return ft(da,{headerTranslationKey:"actionModal.confirmTransaction.header",headerTranslationValues:{name:o},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return ft(qo,{size:"m"})},onClose:()=>e.onClose(),showButton:!1,"data-tc-confirm-modal":"true"})},fa=e=>ft(da,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return ft(Ko,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),ga=e=>ft(da,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return ft(Uo,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),pa=()=>ft(Gr,{get opened(){var e;return Be((()=>null!==Xt()))()&&!0===(null==(e=Xt())?void 0:e.openModal)},onClose:()=>en(null),"data-tc-actions-modal-container":"true",get children(){return ft(xt,{get children(){return[ft(Ct,{get when(){return"transaction-sent"===Xt().name},get children(){return ft(ga,{onClose:()=>en(null)})}}),ft(Ct,{get when(){return"transaction-canceled"===Xt().name},get children(){return ft(fa,{onClose:()=>en(null)})}}),ft(Ct,{get when(){return"confirm-transaction"===Xt().name},get children(){return ft(ha,{onClose:()=>en(null)})}})]}})}}),ya=e=>{const t=ho(xn,ms.language);return customElements.define(or,class extends HTMLDivElement{},{extends:"div"}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),ft(fo.Provider,{value:t,get children(){return ft(Ho.Provider,{get value(){return e.tonConnectUI},get children(){return ft(_n.Provider,{get value(){return ms.connector},get children(){return[ft(ar,{}),ft(pn,{theme:Xn,get children(){return[ft(bt,{get when(){return ms.buttonRootId},get children(){return ft(zt,{get mount(){return document.getElementById(ms.buttonRootId)},get children(){return ft(as,{})}})}}),ft(Gt,{component:or,get children(){return[ft(sa,{}),ft(pa,{})]}})]}})]}})}})}})},ma=()=>{setTimeout((()=>Qt(!0)))},va=e=>{setTimeout((()=>en(e)))},wa=()=>{setTimeout((()=>en(null)))},ba=()=>Jt(),xa=(e,t)=>function(e,t,n,r={}){let o;return $e((r=>{o=r,t===document?e():jt(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}((()=>ft(ya,{tonConnectUI:t})),document.getElementById(e));class Ca{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_wallet-info"),yr(),this.localStorage=localStorage}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 _a{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_preferred-wallet"),yr(),this.localStorage=localStorage}setPreferredWalletName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletName(){return this.localStorage.getItem(this.storageKey)||void 0}}class Sa{constructor(e){if(__publicField(this,"walletInfoStorage",new Ca),__publicField(this,"preferredWalletStorage",new _a),__publicField(this,"connector"),__publicField(this,"walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__publicField(this,"walletsList"),__publicField(this,"connectRequestParametersCallback"),__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 hr("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new fe({manifestUrl:e.manifestUrl})}this.walletsList=this.getWallets(),this.walletsList.then((e=>{return t=e.map((e=>e.imageUrl)),void[...new Set(t)].forEach((e=>{(new window.Image).src=e}));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=Zn(e,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletName();vs({connector:this.connector,preferredWalletName:n}),xa(t,this)}static getWallets(){return fe.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet&&this.walletInfo?__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),rr(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(rr(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?Wn.LIGHT:Wn.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?Wn.DARK:Wn.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(rr))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(s=e.uiPreferences.colorsSet,nr[Wn.DARK]=Zn(s[Wn.DARK],nr[Wn.DARK]),nr[Wn.LIGHT]=Zn(s[Wn.LIGHT],nr[Wn.LIGHT]),er((e=>({colors:Zn(nr[e.theme],tr[e.theme])})))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(a=e.uiPreferences.borderRadius,er({borderRadius:a})),vs((t=>{var n;const r=Zn(__spreadValues(__spreadValues(__spreadValues({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),On(t));return void 0!==e.buttonRootId&&(r.buttonRootId=e.buttonRootId),r}))}setConnectRequestParameters(e){var t;vs({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)}connectWallet(){return __async(this,null,(function*(){const e=(yield this.getWallets()).find(le);if(e){const t=t=>{Zt(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ms.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.connectRequestParametersCallback=t:t(null==n?void 0:n.value)}else ma();return new Promise(((e,t)=>{const n=this.connector.onStatusChange((r=>__async(this,null,(function*(){if(n(),r){const t=yield this.getSelectedWalletInfo(r);e(__spreadValues(__spreadValues({},r),t||this.walletInfoStorage.getWalletInfo()))}else t(new hr("Wallet was not connected"))}))),t)}))}))}disconnect(){return wa(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return __async(this,null,(function*(){if(!this.connected||!this.walletInfo)throw new hr("Connect wallet to send a transaction.");const{notifications:n,modals:r,returnStrategy:o}=this.getModalsAndNotificationsConfiguration(t);"universalLink"in this.walletInfo&&"universal-link"===this.walletInfo.openMethod&&fr(pr(this.walletInfo.universalLink,o)),va({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before")});try{const t=yield this.connector.sendTransaction(e);return va({name:"transaction-sent",showNotification:n.includes("success"),openModal:r.includes("success")}),t}catch(i){throw va({name:"transaction-canceled",showNotification:n.includes("error"),openModal:r.includes("error")}),i instanceof O?i:(console.error(i),new hr("Unhandled error:"+i))}}))}subscribeToWalletChange(){this.connector.onStatusChange((e=>__async(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletName((null==(t=this.walletInfo)?void 0:t.name)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletName(e){this.preferredWalletStorage.setPreferredWalletName(e),vs({preferredWalletName:e})}getSelectedWalletInfo(e){return __async(this,null,(function*(){let t,n=ba();if(!n)return null;if("name"in n)t=n;else{const r=As(yield this.walletsList,ms.walletsListConfiguration).find((t=>t.name.toLowerCase()===e.device.appName.toLowerCase()));if(!r)throw new hr(`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);t?(this.walletInfo=t,this.walletInfoStorage.setWalletInfo(t)):this.walletInfo=this.walletInfoStorage.getWalletInfo()}))}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 hr(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r;const o=["before","success","error"];let i=o;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(i=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(i="all"===e.notifications?o:e.notifications);let s=["before"];return(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(s="all"===this.actionsConfiguration.modals?o:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(s="all"===e.modals?o:e.modals),{notifications:i,modals:s,returnStrategy:(null==e?void 0:e.returnStrategy)||"back"}}}e.THEME=Wn,e.TonConnectUI=Sa,e.TonConnectUIError=hr,e.default=Sa,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
488
721
|
//# sourceMappingURL=tonconnect-ui.min.js.map
|