@wormhole-foundation/wormhole-connect 1.0.0-beta.4-development → 1.0.0-beta.6-development
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/dist/assets/{ccip-Dn5z57Cx.js → ccip-HS3Cs5py.js} +1 -1
- package/dist/assets/{evm-Ci-t-8ei.js → evm-DyY55Fca.js} +4 -4
- package/dist/assets/{index-yInQCZK6.js → index-CeF-n8om.js} +1 -1
- package/dist/assets/{index-Da59NFoY.js → index-CqxhuXyT.js} +1 -1
- package/dist/assets/{index-DlyJ6Tua.js → index-CwoiJQ9y.js} +2 -2
- package/dist/assets/{index.es-DUffrgf3.js → index.es-BHZwRRXn.js} +2 -2
- package/dist/main.js +65 -65
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/consts/index.d.ts +0 -1
- package/dist/src/consts/index.d.ts.map +1 -1
- package/dist/src/routes/index.d.ts +0 -1
- package/dist/src/routes/index.d.ts.map +1 -1
- package/dist/src/sdklegacy/wormhole.d.ts +1 -38
- package/dist/src/sdklegacy/wormhole.d.ts.map +1 -1
- package/dist/src/store/redeem.d.ts +1 -4
- package/dist/src/store/redeem.d.ts.map +1 -1
- package/dist/src/telemetry/types.d.ts +2 -0
- package/dist/src/telemetry/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/transferValidation.d.ts +1 -2
- package/dist/src/utils/transferValidation.d.ts.map +1 -1
- package/dist/src/utils/wallet/index.d.ts +0 -1
- package/dist/src/utils/wallet/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/{algorand-BZfir-Gt.js → algorand-B3jpS4mY.js} +1 -1
- package/lib/{algorand-B9ai7AKk.mjs → algorand-CIOlvhGh.mjs} +3 -3
- package/lib/{aptos-CX7jOv1y.js → aptos-B7P6JL1S.js} +1 -1
- package/lib/{aptos-BiWZASIH.mjs → aptos-CKPSmGSC.mjs} +3 -3
- package/lib/{aptos-ZpPdNMHJ.mjs → aptos-CrnZjgsh.mjs} +1 -1
- package/lib/{aptos-D_w5IEUK.js → aptos-Cx4TaXYo.js} +2 -2
- package/lib/{ccip-CLMQ2RsP.js → ccip-B-q-r_A1.js} +1 -1
- package/lib/{ccip-lVzudYcQ.mjs → ccip-pU66-Jja.mjs} +1 -1
- package/lib/{cosmos-6rjmrhY_.js → cosmos-BDlV5WWM.js} +1 -1
- package/lib/{cosmos-B3YMB-qs.mjs → cosmos-mLLSK_Nm.mjs} +6 -6
- package/lib/{cosmwasm-SnVdtN68.mjs → cosmwasm-CGolR9gL.mjs} +7 -7
- package/lib/{cosmwasm-DMVssDjU.js → cosmwasm-CViLVch6.js} +2 -2
- package/lib/{events-t6i_QSEn.js → events-BSNN9qkd.js} +1 -1
- package/lib/{events-pgsgrP1S.mjs → events-Dzr-GrPB.mjs} +1 -1
- package/lib/{evm-Bd3DzKCY.mjs → evm-BILIyDaj.mjs} +7 -7
- package/lib/{evm-D7GRIPdg.js → evm-DMGYpAGT.js} +4 -4
- package/lib/{evm-DiQodX72.mjs → evm-DXAiSRNs.mjs} +5 -5
- package/lib/{evm-DFJuxSg1.js → evm-ronpaGiZ.js} +1 -1
- package/lib/{index-BAqClXT6.js → index-58isS1fK.js} +1 -1
- package/lib/{index-C_JBf5AE.js → index-AslWQnUt.js} +1 -1
- package/lib/{index-DJgWkkqj.mjs → index-BAErxF8G.mjs} +2 -2
- package/lib/{index-BZ7LatAr.js → index-BHGS0dw3.js} +6 -6
- package/lib/{index-B_FxM4qi.js → index-BJQjdDt-.js} +1 -1
- package/lib/{index-2LZtNZ5P.js → index-BKDeZ8n5.js} +1 -1
- package/lib/{index-D4-zCm-j.js → index-BN2lROi0.js} +1 -1
- package/lib/{index-BjpzXqrL.js → index-BO5ATVUH.js} +1 -1
- package/lib/{index-Dk2OkATw.js → index-BRdg8SSa.js} +1 -1
- package/lib/{index-0YCaekiF.mjs → index-BTS53_Aj.mjs} +2 -2
- package/lib/{index-Cl110Yt1.js → index-BVxqSkXh.js} +1 -1
- package/lib/{index-CkyGUP8I.mjs → index-BWe8c3sQ.mjs} +2 -2
- package/lib/{index-0QJFchou.mjs → index-BdINnTi7.mjs} +2 -2
- package/lib/{index-CdFX-OBR.mjs → index-Be-kzEHF.mjs} +4 -4
- package/lib/{index-C4NKqUWK.mjs → index-BvbKk4T6.mjs} +1 -1
- package/lib/{index-mAuqp4GD.js → index-Byr7P1JY.js} +1 -1
- package/lib/{index-DPq8nS1b.mjs → index-C1jcO7wH.mjs} +1 -1
- package/lib/{index-EhUlCH18.mjs → index-C2DCdxRC.mjs} +39 -122
- package/lib/{index-C9xfXphF.mjs → index-C2WFu8In.mjs} +2 -2
- package/lib/{index-BhrO8yNx.mjs → index-CAHXQCTs.mjs} +2 -2
- package/lib/{index-EPcXyhD3.js → index-CAcB_0Hd.js} +1 -1
- package/lib/{index-VI9qDjx0.js → index-CHAdrAO4.js} +1 -1
- package/lib/{index-hiGmsL0b.mjs → index-CMWEjIGj.mjs} +1 -1
- package/lib/{index-B64jLBfI.mjs → index-CSKSjjgt.mjs} +2 -2
- package/lib/{index-fPs98C_X.mjs → index-CZj2FglQ.mjs} +2 -2
- package/lib/{index-DWmEAYa2.js → index-Cd8xotiJ.js} +1 -1
- package/lib/{index-DUn9bDrk.mjs → index-Co1vTibS.mjs} +2 -2
- package/lib/{index-fD6yeQDw.mjs → index-CruftbOC.mjs} +7 -7
- package/lib/{index-CpM8O4af.mjs → index-D6u6ZlbM.mjs} +4 -4
- package/lib/{index-CE4mRmPN.js → index-DEAhtMw_.js} +1 -1
- package/lib/{index-CFVJznfe.js → index-DFZ0Ndqh.js} +1 -1
- package/lib/{index-DLXjX60f.js → index-DFa89Itc.js} +1 -1
- package/lib/{index-Bd6ExIDW.mjs → index-DWKvilYv.mjs} +4 -4
- package/lib/{index-BcbPoWss.mjs → index-DXCl1vFR.mjs} +3 -3
- package/lib/{index-DZbeM9gY.mjs → index-Da7Cxyq1.mjs} +2 -2
- package/lib/{index-B5TmFc4M.js → index-DbI4zYHg.js} +1 -1
- package/lib/{index-DVnPDtFx.mjs → index-DiF1ira9.mjs} +1 -1
- package/lib/{index-DllSkb9h.js → index-Dmko8wT8.js} +1 -1
- package/lib/{index-CvRFH7pa.js → index-Dpzov1Io.js} +1 -1
- package/lib/{index-BT7_dDgl.mjs → index-YNti7nIJ.mjs} +3 -3
- package/lib/{index-048e7Uvl.js → index-ZD733qpV.js} +1 -1
- package/lib/{index-QqzqKjF9.js → index-bdAItiPr.js} +1 -1
- package/lib/{index-DG5KwGj7.mjs → index-e3UZ_0nd.mjs} +3 -3
- package/lib/{index-BkyCouQJ.js → index-g3eZpZJ1.js} +1 -1
- package/lib/{index-B2aC_g_3.js → index-iXByZuY7.js} +1 -1
- package/lib/{index-BYv5Tbwe.mjs → index-mUmOCSLG.mjs} +1 -1
- package/lib/{index-bpVbPzFG.mjs → index-oMwdMcy1.mjs} +1 -1
- package/lib/{index-CcKxlhe-.js → index-wXdILngm.js} +1 -1
- package/lib/{index.es-WCp4WrVw.js → index.es-B6NnL7-2.js} +2 -2
- package/lib/{index.es-B4wQLKJO.mjs → index.es-DNGjs0VX.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-BdZeVEOK.js → libsodium-wrappers-B21TAmoM.js} +1 -1
- package/lib/{libsodium-wrappers-DnY3rBzj.mjs → libsodium-wrappers-BKcruoKB.mjs} +1 -1
- package/lib/{pako.esm-doGHPq3v.mjs → pako.esm-C_3vjkSx.mjs} +3 -3
- package/lib/{pako.esm-CpOVp0Fg.js → pako.esm-x_RIwOhS.js} +1 -1
- package/lib/{pbkdf2-DRrUaAek.js → pbkdf2-BiOly-Fb.js} +1 -1
- package/lib/{pbkdf2-CR1mMO6P.mjs → pbkdf2-h3af_qT8.mjs} +1 -1
- package/lib/{sei-BHskcl2R.js → sei-CsiLK3q4.js} +1 -1
- package/lib/{sei-ReMraEM4.mjs → sei-J7Ndid0z.mjs} +4 -4
- package/lib/{signer-BwkEV8NR.mjs → signer-Bqq-7pmw.mjs} +1 -1
- package/lib/{signer-C5udfQih.js → signer-DqTjY4LV.js} +1 -1
- package/lib/solana-CRL9xy7K.mjs +16 -0
- package/lib/{solana-BWRzXH9-.js → solana-Ce3qepls.js} +1 -1
- package/lib/{solana-kr2Et-_M.mjs → solana-DoXIYwUz.mjs} +4 -4
- package/lib/solana-rhlzUaN7.js +1 -0
- package/lib/{solanaEmbed.esm-HLygiesN.mjs → solanaEmbed.esm-BDiuwARH.mjs} +4 -4
- package/lib/{solanaEmbed.esm-8hegnauD.js → solanaEmbed.esm-aEhVr3dz.js} +1 -1
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/consts/index.d.ts +0 -1
- package/lib/src/consts/index.d.ts.map +1 -1
- package/lib/src/routes/index.d.ts +0 -1
- package/lib/src/routes/index.d.ts.map +1 -1
- package/lib/src/sdklegacy/wormhole.d.ts +1 -38
- package/lib/src/sdklegacy/wormhole.d.ts.map +1 -1
- package/lib/src/store/redeem.d.ts +1 -4
- package/lib/src/store/redeem.d.ts.map +1 -1
- package/lib/src/telemetry/types.d.ts +2 -0
- package/lib/src/telemetry/types.d.ts.map +1 -1
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/transferValidation.d.ts +1 -2
- package/lib/src/utils/transferValidation.d.ts.map +1 -1
- package/lib/src/utils/wallet/index.d.ts +0 -1
- package/lib/src/utils/wallet/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/{sui-B6XCpe1d.mjs → sui-Bd2bm_yF.mjs} +1 -1
- package/lib/{sui-BWRqoTdl.js → sui-CNNdjXyR.js} +2 -2
- package/lib/{sui-BocrppL0.js → sui-CthAG5pi.js} +1 -1
- package/lib/{sui-BuZPAcI0.mjs → sui-sEkivVSe.mjs} +4 -4
- package/lib/{unsignedTransaction-oXk8lD5s.mjs → unsignedTransaction-CA2s3rKG.mjs} +2 -2
- package/lib/{unsignedTransaction-DSuqsGgb.js → unsignedTransaction-qKKmqcBf.js} +1 -1
- package/lib/{utils-SML27G4C.js → utils-Deb--_8V.js} +1 -1
- package/lib/{utils-fI-uXUZk.mjs → utils-OPA3b1An.mjs} +2 -2
- package/package.json +1 -1
- package/dist/src/routes/utils.d.ts +0 -2
- package/dist/src/routes/utils.d.ts.map +0 -1
- package/dist/src/utils/sdk.d.ts +0 -19
- package/dist/src/utils/sdk.d.ts.map +0 -1
- package/lib/solana-ci1dqiv5.mjs +0 -16
- package/lib/solana-gFEm46ZS.js +0 -1
- package/lib/src/routes/utils.d.ts +0 -2
- package/lib/src/routes/utils.d.ts.map +0 -1
- package/lib/src/utils/sdk.d.ts +0 -19
- package/lib/src/utils/sdk.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("./index-BZ7LatAr.js"),Bl=require("./dijkstra-CtFxn7S9.js"),Vt=require("./events-t6i_QSEn.js"),$=require("./index-Cl110Yt1.js"),K=require("./index-DWmEAYa2.js");let kl=class extends $.r{constructor(e){super(e),this.events=new Vt.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict($.formatJsonRpcRequest(e.method,e.params||[],e.id||$.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{$.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),$.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var Dl=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},Ul=Dl,Po={"text/plain":"Text","text/html":"Url",default:"Text"},Ll="Copy to clipboard: #{key}, Enter";function ql(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function $l(t,e){var r,i,n,s,o,a,h=!1;e||(e={}),r=e.debug||!1;try{n=Ul(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=t,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(p){if(p.stopPropagation(),e.format)if(p.preventDefault(),typeof p.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=Po[e.format]||Po.default;window.clipboardData.setData(y,t)}else p.clipboardData.clearData(),p.clipboardData.setData(e.format,t);e.onCopy&&(p.preventDefault(),e.onCopy(p.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");h=!0}catch(p){r&&console.error("unable to copy using execCommand: ",p),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(y){r&&console.error("unable to copy using clipboardData: ",y),r&&console.error("falling back to prompt"),i=ql("message"in e?e.message:Ll),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return h}var zl=$l,jl={}.toString,Zs=Array.isArray||function(t){return jl.call(t)=="[object Array]"},Kl=Z.requireElliptic(),eo={},ze={};Object.defineProperty(ze,"__esModule",{value:!0});var Oc=ze.getLocalStorage=Hc=ze.getLocalStorageOrThrow=Kc=ze.getCrypto=jc=ze.getCryptoOrThrow=zc=ze.getLocation=$c=ze.getLocationOrThrow=qc=ze.getNavigator=Lc=ze.getNavigatorOrThrow=Uc=ze.getDocument=Dc=ze.getDocumentOrThrow=kc=ze.getFromWindowOrThrow=Bc=ze.getFromWindow=void 0;function Ur(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var Bc=ze.getFromWindow=Ur;function si(t){const e=Ur(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var kc=ze.getFromWindowOrThrow=si;function Hl(){return si("document")}var Dc=ze.getDocumentOrThrow=Hl;function Vl(){return Ur("document")}var Uc=ze.getDocument=Vl;function Jl(){return si("navigator")}var Lc=ze.getNavigatorOrThrow=Jl;function Wl(){return Ur("navigator")}var qc=ze.getNavigator=Wl;function Gl(){return si("location")}var $c=ze.getLocationOrThrow=Gl;function Ql(){return Ur("location")}var zc=ze.getLocation=Ql;function Yl(){return si("crypto")}var jc=ze.getCryptoOrThrow=Yl;function Xl(){return Ur("crypto")}var Kc=ze.getCrypto=Xl;function Zl(){return si("localStorage")}var Hc=ze.getLocalStorageOrThrow=Zl;function ef(){return Ur("localStorage")}Oc=ze.getLocalStorage=ef;Object.defineProperty(eo,"__esModule",{value:!0});var Vc=eo.getWindowMetadata=void 0;const To=ze;function tf(){let t,e;try{t=To.getDocumentOrThrow(),e=To.getLocationOrThrow()}catch{return null}function r(){const y=t.getElementsByTagName("link"),C=[];for(let E=0;E<y.length;E++){const v=y[E],k=v.getAttribute("rel");if(k&&k.toLowerCase().indexOf("icon")>-1){const B=v.getAttribute("href");if(B)if(B.toLowerCase().indexOf("https:")===-1&&B.toLowerCase().indexOf("http:")===-1&&B.indexOf("//")!==0){let U=e.protocol+"//"+e.host;if(B.indexOf("/")===0)U+=B;else{const A=e.pathname.split("/");A.pop();const F=A.join("/");U+=F+"/"+B}C.push(U)}else if(B.indexOf("//")===0){const U=e.protocol+B;C.push(U)}else C.push(B)}}return C}function i(...y){const C=t.getElementsByTagName("meta");for(let E=0;E<C.length;E++){const v=C[E],k=["itemprop","property","name"].map(B=>v.getAttribute(B)).filter(B=>B?y.includes(B):!1);if(k.length&&k){const B=v.getAttribute("content");if(B)return B}}return""}function n(){let y=i("name","og:site_name","og:title","twitter:title");return y||(y=t.title),y}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),h=e.origin,d=r();return{description:a,url:h,icons:d,name:o}}Vc=eo.getWindowMetadata=tf;var rf=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},nf=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),sf=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=Z.dist.process.platform}return t}(),of=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),af=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),cf=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),hf=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,uf=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Oo=3,lf=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",hf]],Bo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ff(t){return t?ko(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new cf:typeof navigator<"u"?ko(navigator.userAgent):gf()}function df(t){return t!==""&&lf.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function ko(t){var e=df(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new af;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Oo&&(n=rf(n,mf(Oo-n.length))):n=[];var s=n.join("."),o=pf(t),a=uf.exec(t);return a&&a[1]?new of(r,s,o,a[1]):new nf(r,s,o)}function pf(t){for(var e=0,r=Bo.length;e<r;e++){var i=Bo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function gf(){var t=typeof Z.dist.process<"u"&&Z.dist.process.version;return t?new sf(Z.dist.process.version.slice(1)):null}function mf(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function to(t){return ff(t)}function En(){const t=to();return t&&t.os?t.os:void 0}function Jc(){const t=En();return t?t.toLowerCase().includes("android"):!1}function Wc(){const t=En();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function yf(){return En()?Jc()||Wc():!1}function Gc(){const t=to();return t&&t.name?t.name.toLowerCase()==="node":!1}function wf(){return!Gc()&&!!Qc()}const vf=Bc,bf=kc,_f=Dc,Af=Uc,Ef=Lc,Qc=qc,Sf=$c,If=zc,Mf=jc,Nf=Kc,xf=Hc,Sn=Oc;function Cf(){return Vc()}function Ff(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Rf(t){return typeof t=="string"?t:JSON.stringify(t)}const Yc=Ff,Xc=Rf;function Zc(t,e){const r=Xc(e),i=Sn();i&&i.setItem(t,r)}function Pf(t){let e=null,r=null;const i=Sn();return i&&(r=i.getItem(t)),e=r&&Yc(r),e}function Tf(t){const e=Sn();e&&e.removeItem(t)}const eh="WALLETCONNECT_DEEPLINK_CHOICE";function Of(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function Bf(t){const e=t.href.split("?")[0];Zc(eh,Object.assign(Object.assign({},t),{href:e}))}function th(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function kf(t,e){let r=t;return e&&(r=e.map(i=>th(t,i)).filter(Boolean)),r}const rh="https://registry.walletconnect.com";function Df(){return rh+"/api/v2/wallets"}function Uf(){return rh+"/api/v2/dapps"}function ih(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function Lf(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>ih(r,e))}const qf=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:to,detectOS:En,formatIOSMobile:Of,formatMobileRegistry:Lf,formatMobileRegistryEntry:ih,getClientMeta:Cf,getCrypto:Nf,getCryptoOrThrow:Mf,getDappRegistryUrl:Uf,getDocument:Af,getDocumentOrThrow:_f,getFromWindow:vf,getFromWindowOrThrow:bf,getLocal:Pf,getLocalStorage:Sn,getLocalStorageOrThrow:xf,getLocation:If,getLocationOrThrow:Sf,getMobileLinkRegistry:kf,getMobileRegistryEntry:th,getNavigator:Qc,getNavigatorOrThrow:Ef,getWalletRegistryUrl:Df,isAndroid:Jc,isBrowser:wf,isIOS:Wc,isMobile:yf,isNode:Gc,mobileLinkChoiceKey:eh,removeLocal:Tf,safeJsonParse:Yc,safeJsonStringify:Xc,saveMobileLinkInfo:Bf,setLocal:Zc},Symbol.toStringTag,{value:"Module"})),$f=Z.getAugmentedNamespace(qf);var Oi={},zf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},nh={},Fr={},jf=Zs;function Kf(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}Pe.TYPED_ARRAY_SUPPORT=Kf();var Do=Pe.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function Pe(t,e,r){return!Pe.TYPED_ARRAY_SUPPORT&&!(this instanceof Pe)?new Pe(t,e,r):typeof t=="number"?sh(this,t):Yf(this,t,e,r)}Pe.TYPED_ARRAY_SUPPORT&&(Pe.prototype.__proto__=Uint8Array.prototype,Pe.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Pe[Symbol.species]===Pe&&Object.defineProperty(Pe,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function ro(t){if(t>=Do)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Do.toString(16)+" bytes");return t|0}function Hf(t){return t!==t}function Yr(t,e){var r;return Pe.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=Pe.prototype):(r=t,r===null&&(r=new Pe(e)),r.length=e),r}function sh(t,e){var r=Yr(t,e<0?0:ro(e)|0);if(!Pe.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function Vf(t,e){var r=ah(e)|0,i=Yr(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function Ms(t,e){for(var r=e.length<0?0:ro(e.length)|0,i=Yr(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function Jf(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),Pe.TYPED_ARRAY_SUPPORT?n.__proto__=Pe.prototype:n=Ms(t,n),n}function Wf(t,e){if(Pe.isBuffer(e)){var r=ro(e.length)|0,i=Yr(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Hf(e.length)?Yr(t,0):Ms(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ms(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oh(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function ah(t){if(Pe.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:oh(t).length}function Gf(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Qf(t,e,r,i){return Gf(oh(e,t.length-r),t,r,i)}function Yf(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Jf(t,e,r,i):typeof e=="string"?Vf(t,e):Wf(t,e)}Pe.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Qf(this,e,r,i)};Pe.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(Pe.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=Pe.prototype;else{var s=r-e;n=new Pe(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};Pe.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!Pe.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};Pe.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=Pe.isBuffer(e)?e:new Pe(e),a=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};Pe.concat=function(e,r){if(!jf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Yr(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=sh(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!Pe.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};Pe.byteLength=ah;Pe.prototype._isBuffer=!0;Pe.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};Fr.alloc=function(t){var e=new Pe(t);return e.fill(0),e};Fr.from=function(t){return new Pe(t)};var Pt={},io,Xf=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Pt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Pt.getSymbolTotalCodewords=function(e){return Xf[e]};Pt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};Pt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');io=e};Pt.isKanjiModeEnabled=function(){return typeof io<"u"};Pt.toSJIS=function(e){return io(e)};var In={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(In);function ch(){this.buffer=[],this.length=0}ch.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Zf=ch,Uo=Fr;function Bi(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=Uo.alloc(t*t),this.reservedBit=Uo.alloc(t*t)}Bi.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Bi.prototype.get=function(t,e){return this.data[t*this.size+e]};Bi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Bi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ed=Bi,hh={};(function(t){var e=Pt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],h=1;h<n-1;h++)a[h]=a[h-1]-o;return a.push(6),a.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var h=0;h<o;h++)a===0&&h===0||a===0&&h===o-1||a===o-1&&h===0||n.push([s[a],s[h]]);return n}})(hh);var uh={},td=Pt.getSymbolSize,Lo=7;uh.getPositions=function(e){var r=td(e);return[[0,0],[r-Lo,0],[0,r-Lo]]};var lh={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,h=0,d=null,p=null,y=0;y<s;y++){a=h=0,d=p=null;for(var C=0;C<s;C++){var E=n.get(y,C);E===d?a++:(a>=5&&(o+=e.N1+(a-5)),d=E,a=1),E=n.get(C,y),E===p?h++:(h>=5&&(o+=e.N1+(h-5)),p=E,h=1)}a>=5&&(o+=e.N1+(a-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var h=0;h<s-1;h++){var d=n.get(a,h)+n.get(a,h+1)+n.get(a+1,h)+n.get(a+1,h+1);(d===4||d===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,h=0,d=0;d<s;d++){a=h=0;for(var p=0;p<s;p++)a=a<<1&2047|n.get(d,p),p>=10&&(a===1488||a===93)&&o++,h=h<<1&2047|n.get(p,d),p>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var h=0;h<o;h++)s.isReserved(h,a)||s.xor(h,a,r(n,h,a))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,a=0,h=1/0,d=0;d<o;d++){s(d),t.applyMask(d,n);var p=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(d,n),p<h&&(h=p,a=d)}return a}})(lh);var Mn={},xr=In,Vi=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Ji=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Mn.getBlocksCount=function(e,r){switch(r){case xr.L:return Vi[(e-1)*4+0];case xr.M:return Vi[(e-1)*4+1];case xr.Q:return Vi[(e-1)*4+2];case xr.H:return Vi[(e-1)*4+3];default:return}};Mn.getTotalCodewordsCount=function(e,r){switch(r){case xr.L:return Ji[(e-1)*4+0];case xr.M:return Ji[(e-1)*4+1];case xr.Q:return Ji[(e-1)*4+2];case xr.H:return Ji[(e-1)*4+3];default:return}};var fh={},Nn={},dh=Fr,_i=dh.alloc(512),cn=dh.alloc(256);(function(){for(var e=1,r=0;r<255;r++)_i[r]=e,cn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)_i[r]=_i[r-255]})();Nn.log=function(e){if(e<1)throw new Error("log("+e+")");return cn[e]};Nn.exp=function(e){return _i[e]};Nn.mul=function(e,r){return e===0||r===0?0:_i[cn[e]+cn[r]]};(function(t){var e=Fr,r=Nn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var h=0;h<s.length;h++)o[a+h]^=r.mul(n[a],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],a);for(var d=0;d<o.length&&o[d]===0;)d++;o=o.slice(d)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(fh);var qo=Fr,ph=fh,rd=Z.bufferPolyfill.Buffer;function no(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}no.prototype.initialize=function(e){this.degree=e,this.genPoly=ph.generateECPolynomial(this.degree)};no.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=qo.alloc(this.degree),i=rd.concat([e,r],e.length+this.degree),n=ph.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=qo.alloc(this.degree);return n.copy(o,s),o}return n};var id=no,gh={},Rr={},so={};so.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var nr={},mh="[0-9]+",nd="[A-Z $%*+\\-./:]+",Ni="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ni=Ni.replace(/u/g,"\\u");var sd="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ni+`)(?:.|[\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("./index-BHGS0dw3.js"),Bl=require("./dijkstra-CtFxn7S9.js"),Vt=require("./events-BSNN9qkd.js"),$=require("./index-BVxqSkXh.js"),K=require("./index-Cd8xotiJ.js");let kl=class extends $.r{constructor(e){super(e),this.events=new Vt.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict($.formatJsonRpcRequest(e.method,e.params||[],e.id||$.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{$.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),$.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var Dl=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},Ul=Dl,Po={"text/plain":"Text","text/html":"Url",default:"Text"},Ll="Copy to clipboard: #{key}, Enter";function ql(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function $l(t,e){var r,i,n,s,o,a,h=!1;e||(e={}),r=e.debug||!1;try{n=Ul(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=t,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(p){if(p.stopPropagation(),e.format)if(p.preventDefault(),typeof p.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=Po[e.format]||Po.default;window.clipboardData.setData(y,t)}else p.clipboardData.clearData(),p.clipboardData.setData(e.format,t);e.onCopy&&(p.preventDefault(),e.onCopy(p.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");h=!0}catch(p){r&&console.error("unable to copy using execCommand: ",p),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(y){r&&console.error("unable to copy using clipboardData: ",y),r&&console.error("falling back to prompt"),i=ql("message"in e?e.message:Ll),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return h}var zl=$l,jl={}.toString,Zs=Array.isArray||function(t){return jl.call(t)=="[object Array]"},Kl=Z.requireElliptic(),eo={},ze={};Object.defineProperty(ze,"__esModule",{value:!0});var Oc=ze.getLocalStorage=Hc=ze.getLocalStorageOrThrow=Kc=ze.getCrypto=jc=ze.getCryptoOrThrow=zc=ze.getLocation=$c=ze.getLocationOrThrow=qc=ze.getNavigator=Lc=ze.getNavigatorOrThrow=Uc=ze.getDocument=Dc=ze.getDocumentOrThrow=kc=ze.getFromWindowOrThrow=Bc=ze.getFromWindow=void 0;function Ur(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var Bc=ze.getFromWindow=Ur;function si(t){const e=Ur(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var kc=ze.getFromWindowOrThrow=si;function Hl(){return si("document")}var Dc=ze.getDocumentOrThrow=Hl;function Vl(){return Ur("document")}var Uc=ze.getDocument=Vl;function Jl(){return si("navigator")}var Lc=ze.getNavigatorOrThrow=Jl;function Wl(){return Ur("navigator")}var qc=ze.getNavigator=Wl;function Gl(){return si("location")}var $c=ze.getLocationOrThrow=Gl;function Ql(){return Ur("location")}var zc=ze.getLocation=Ql;function Yl(){return si("crypto")}var jc=ze.getCryptoOrThrow=Yl;function Xl(){return Ur("crypto")}var Kc=ze.getCrypto=Xl;function Zl(){return si("localStorage")}var Hc=ze.getLocalStorageOrThrow=Zl;function ef(){return Ur("localStorage")}Oc=ze.getLocalStorage=ef;Object.defineProperty(eo,"__esModule",{value:!0});var Vc=eo.getWindowMetadata=void 0;const To=ze;function tf(){let t,e;try{t=To.getDocumentOrThrow(),e=To.getLocationOrThrow()}catch{return null}function r(){const y=t.getElementsByTagName("link"),C=[];for(let E=0;E<y.length;E++){const v=y[E],k=v.getAttribute("rel");if(k&&k.toLowerCase().indexOf("icon")>-1){const B=v.getAttribute("href");if(B)if(B.toLowerCase().indexOf("https:")===-1&&B.toLowerCase().indexOf("http:")===-1&&B.indexOf("//")!==0){let U=e.protocol+"//"+e.host;if(B.indexOf("/")===0)U+=B;else{const A=e.pathname.split("/");A.pop();const F=A.join("/");U+=F+"/"+B}C.push(U)}else if(B.indexOf("//")===0){const U=e.protocol+B;C.push(U)}else C.push(B)}}return C}function i(...y){const C=t.getElementsByTagName("meta");for(let E=0;E<C.length;E++){const v=C[E],k=["itemprop","property","name"].map(B=>v.getAttribute(B)).filter(B=>B?y.includes(B):!1);if(k.length&&k){const B=v.getAttribute("content");if(B)return B}}return""}function n(){let y=i("name","og:site_name","og:title","twitter:title");return y||(y=t.title),y}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),h=e.origin,d=r();return{description:a,url:h,icons:d,name:o}}Vc=eo.getWindowMetadata=tf;var rf=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},nf=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),sf=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=Z.dist.process.platform}return t}(),of=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),af=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),cf=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),hf=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,uf=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Oo=3,lf=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",hf]],Bo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ff(t){return t?ko(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new cf:typeof navigator<"u"?ko(navigator.userAgent):gf()}function df(t){return t!==""&&lf.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function ko(t){var e=df(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new af;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Oo&&(n=rf(n,mf(Oo-n.length))):n=[];var s=n.join("."),o=pf(t),a=uf.exec(t);return a&&a[1]?new of(r,s,o,a[1]):new nf(r,s,o)}function pf(t){for(var e=0,r=Bo.length;e<r;e++){var i=Bo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function gf(){var t=typeof Z.dist.process<"u"&&Z.dist.process.version;return t?new sf(Z.dist.process.version.slice(1)):null}function mf(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function to(t){return ff(t)}function En(){const t=to();return t&&t.os?t.os:void 0}function Jc(){const t=En();return t?t.toLowerCase().includes("android"):!1}function Wc(){const t=En();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function yf(){return En()?Jc()||Wc():!1}function Gc(){const t=to();return t&&t.name?t.name.toLowerCase()==="node":!1}function wf(){return!Gc()&&!!Qc()}const vf=Bc,bf=kc,_f=Dc,Af=Uc,Ef=Lc,Qc=qc,Sf=$c,If=zc,Mf=jc,Nf=Kc,xf=Hc,Sn=Oc;function Cf(){return Vc()}function Ff(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Rf(t){return typeof t=="string"?t:JSON.stringify(t)}const Yc=Ff,Xc=Rf;function Zc(t,e){const r=Xc(e),i=Sn();i&&i.setItem(t,r)}function Pf(t){let e=null,r=null;const i=Sn();return i&&(r=i.getItem(t)),e=r&&Yc(r),e}function Tf(t){const e=Sn();e&&e.removeItem(t)}const eh="WALLETCONNECT_DEEPLINK_CHOICE";function Of(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function Bf(t){const e=t.href.split("?")[0];Zc(eh,Object.assign(Object.assign({},t),{href:e}))}function th(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function kf(t,e){let r=t;return e&&(r=e.map(i=>th(t,i)).filter(Boolean)),r}const rh="https://registry.walletconnect.com";function Df(){return rh+"/api/v2/wallets"}function Uf(){return rh+"/api/v2/dapps"}function ih(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function Lf(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>ih(r,e))}const qf=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:to,detectOS:En,formatIOSMobile:Of,formatMobileRegistry:Lf,formatMobileRegistryEntry:ih,getClientMeta:Cf,getCrypto:Nf,getCryptoOrThrow:Mf,getDappRegistryUrl:Uf,getDocument:Af,getDocumentOrThrow:_f,getFromWindow:vf,getFromWindowOrThrow:bf,getLocal:Pf,getLocalStorage:Sn,getLocalStorageOrThrow:xf,getLocation:If,getLocationOrThrow:Sf,getMobileLinkRegistry:kf,getMobileRegistryEntry:th,getNavigator:Qc,getNavigatorOrThrow:Ef,getWalletRegistryUrl:Df,isAndroid:Jc,isBrowser:wf,isIOS:Wc,isMobile:yf,isNode:Gc,mobileLinkChoiceKey:eh,removeLocal:Tf,safeJsonParse:Yc,safeJsonStringify:Xc,saveMobileLinkInfo:Bf,setLocal:Zc},Symbol.toStringTag,{value:"Module"})),$f=Z.getAugmentedNamespace(qf);var Oi={},zf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},nh={},Fr={},jf=Zs;function Kf(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}Pe.TYPED_ARRAY_SUPPORT=Kf();var Do=Pe.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function Pe(t,e,r){return!Pe.TYPED_ARRAY_SUPPORT&&!(this instanceof Pe)?new Pe(t,e,r):typeof t=="number"?sh(this,t):Yf(this,t,e,r)}Pe.TYPED_ARRAY_SUPPORT&&(Pe.prototype.__proto__=Uint8Array.prototype,Pe.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Pe[Symbol.species]===Pe&&Object.defineProperty(Pe,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function ro(t){if(t>=Do)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Do.toString(16)+" bytes");return t|0}function Hf(t){return t!==t}function Yr(t,e){var r;return Pe.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=Pe.prototype):(r=t,r===null&&(r=new Pe(e)),r.length=e),r}function sh(t,e){var r=Yr(t,e<0?0:ro(e)|0);if(!Pe.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function Vf(t,e){var r=ah(e)|0,i=Yr(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function Ms(t,e){for(var r=e.length<0?0:ro(e.length)|0,i=Yr(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function Jf(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),Pe.TYPED_ARRAY_SUPPORT?n.__proto__=Pe.prototype:n=Ms(t,n),n}function Wf(t,e){if(Pe.isBuffer(e)){var r=ro(e.length)|0,i=Yr(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Hf(e.length)?Yr(t,0):Ms(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ms(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oh(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function ah(t){if(Pe.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:oh(t).length}function Gf(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Qf(t,e,r,i){return Gf(oh(e,t.length-r),t,r,i)}function Yf(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Jf(t,e,r,i):typeof e=="string"?Vf(t,e):Wf(t,e)}Pe.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Qf(this,e,r,i)};Pe.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(Pe.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=Pe.prototype;else{var s=r-e;n=new Pe(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};Pe.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!Pe.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};Pe.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=Pe.isBuffer(e)?e:new Pe(e),a=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};Pe.concat=function(e,r){if(!jf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Yr(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=sh(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!Pe.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};Pe.byteLength=ah;Pe.prototype._isBuffer=!0;Pe.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};Fr.alloc=function(t){var e=new Pe(t);return e.fill(0),e};Fr.from=function(t){return new Pe(t)};var Pt={},io,Xf=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Pt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Pt.getSymbolTotalCodewords=function(e){return Xf[e]};Pt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};Pt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');io=e};Pt.isKanjiModeEnabled=function(){return typeof io<"u"};Pt.toSJIS=function(e){return io(e)};var In={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(In);function ch(){this.buffer=[],this.length=0}ch.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Zf=ch,Uo=Fr;function Bi(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=Uo.alloc(t*t),this.reservedBit=Uo.alloc(t*t)}Bi.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Bi.prototype.get=function(t,e){return this.data[t*this.size+e]};Bi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Bi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ed=Bi,hh={};(function(t){var e=Pt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],h=1;h<n-1;h++)a[h]=a[h-1]-o;return a.push(6),a.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var h=0;h<o;h++)a===0&&h===0||a===0&&h===o-1||a===o-1&&h===0||n.push([s[a],s[h]]);return n}})(hh);var uh={},td=Pt.getSymbolSize,Lo=7;uh.getPositions=function(e){var r=td(e);return[[0,0],[r-Lo,0],[0,r-Lo]]};var lh={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,h=0,d=null,p=null,y=0;y<s;y++){a=h=0,d=p=null;for(var C=0;C<s;C++){var E=n.get(y,C);E===d?a++:(a>=5&&(o+=e.N1+(a-5)),d=E,a=1),E=n.get(C,y),E===p?h++:(h>=5&&(o+=e.N1+(h-5)),p=E,h=1)}a>=5&&(o+=e.N1+(a-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var h=0;h<s-1;h++){var d=n.get(a,h)+n.get(a,h+1)+n.get(a+1,h)+n.get(a+1,h+1);(d===4||d===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,h=0,d=0;d<s;d++){a=h=0;for(var p=0;p<s;p++)a=a<<1&2047|n.get(d,p),p>=10&&(a===1488||a===93)&&o++,h=h<<1&2047|n.get(p,d),p>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var h=0;h<o;h++)s.isReserved(h,a)||s.xor(h,a,r(n,h,a))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,a=0,h=1/0,d=0;d<o;d++){s(d),t.applyMask(d,n);var p=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(d,n),p<h&&(h=p,a=d)}return a}})(lh);var Mn={},xr=In,Vi=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Ji=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Mn.getBlocksCount=function(e,r){switch(r){case xr.L:return Vi[(e-1)*4+0];case xr.M:return Vi[(e-1)*4+1];case xr.Q:return Vi[(e-1)*4+2];case xr.H:return Vi[(e-1)*4+3];default:return}};Mn.getTotalCodewordsCount=function(e,r){switch(r){case xr.L:return Ji[(e-1)*4+0];case xr.M:return Ji[(e-1)*4+1];case xr.Q:return Ji[(e-1)*4+2];case xr.H:return Ji[(e-1)*4+3];default:return}};var fh={},Nn={},dh=Fr,_i=dh.alloc(512),cn=dh.alloc(256);(function(){for(var e=1,r=0;r<255;r++)_i[r]=e,cn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)_i[r]=_i[r-255]})();Nn.log=function(e){if(e<1)throw new Error("log("+e+")");return cn[e]};Nn.exp=function(e){return _i[e]};Nn.mul=function(e,r){return e===0||r===0?0:_i[cn[e]+cn[r]]};(function(t){var e=Fr,r=Nn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var h=0;h<s.length;h++)o[a+h]^=r.mul(n[a],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],a);for(var d=0;d<o.length&&o[d]===0;)d++;o=o.slice(d)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(fh);var qo=Fr,ph=fh,rd=Z.bufferPolyfill.Buffer;function no(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}no.prototype.initialize=function(e){this.degree=e,this.genPoly=ph.generateECPolynomial(this.degree)};no.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=qo.alloc(this.degree),i=rd.concat([e,r],e.length+this.degree),n=ph.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=qo.alloc(this.degree);return n.copy(o,s),o}return n};var id=no,gh={},Rr={},so={};so.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var nr={},mh="[0-9]+",nd="[A-Z $%*+\\-./:]+",Ni="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ni=Ni.replace(/u/g,"\\u");var sd="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ni+`)(?:.|[\r
|
|
2
2
|
]))+`;nr.KANJI=new RegExp(Ni,"g");nr.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");nr.BYTE=new RegExp(sd,"g");nr.NUMERIC=new RegExp(mh,"g");nr.ALPHANUMERIC=new RegExp(nd,"g");var od=new RegExp("^"+Ni+"$"),ad=new RegExp("^"+mh+"$"),cd=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");nr.testKanji=function(e){return od.test(e)};nr.testNumeric=function(e){return ad.test(e)};nr.testAlphanumeric=function(e){return cd.test(e)};(function(t){var e=so,r=nr;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,o){if(t.isValid(s))return s;try{return i(s)}catch{return o}}})(Rr);(function(t){var e=Pt,r=Mn,i=In,n=Rr,s=so,o=Zs,a=7973,h=e.getBCHDigit(a);function d(E,v,k){for(var B=1;B<=40;B++)if(v<=t.getCapacity(B,k,E))return B}function p(E,v){return n.getCharCountIndicator(E,v)+4}function y(E,v){var k=0;return E.forEach(function(B){var U=p(B.mode,v);k+=U+B.getBitsLength()}),k}function C(E,v){for(var k=1;k<=40;k++){var B=y(E,k);if(B<=t.getCapacity(k,v,n.MIXED))return k}}t.from=function(v,k){return s.isValid(v)?parseInt(v,10):k},t.getCapacity=function(v,k,B){if(!s.isValid(v))throw new Error("Invalid QR Code version");typeof B>"u"&&(B=n.BYTE);var U=e.getSymbolTotalCodewords(v),A=r.getTotalCodewordsCount(v,k),F=(U-A)*8;if(B===n.MIXED)return F;var R=F-p(B,v);switch(B){case n.NUMERIC:return Math.floor(R/10*3);case n.ALPHANUMERIC:return Math.floor(R/11*2);case n.KANJI:return Math.floor(R/13);case n.BYTE:default:return Math.floor(R/8)}},t.getBestVersionForData=function(v,k){var B,U=i.from(k,i.M);if(o(v)){if(v.length>1)return C(v,U);if(v.length===0)return 1;B=v[0]}else B=v;return d(B.mode,B.getLength(),U)},t.getEncodedBits=function(v){if(!s.isValid(v)||v<7)throw new Error("Invalid QR Code version");for(var k=v<<12;e.getBCHDigit(k)-h>=0;)k^=a<<e.getBCHDigit(k)-h;return v<<12|k}})(gh);var yh={},Ns=Pt,wh=1335,hd=21522,$o=Ns.getBCHDigit(wh);yh.getEncodedBits=function(e,r){for(var i=e.bit<<3|r,n=i<<10;Ns.getBCHDigit(n)-$o>=0;)n^=wh<<Ns.getBCHDigit(n)-$o;return(i<<10|n)^hd};var vh={},ud=Rr;function Xr(t){this.mode=ud.NUMERIC,this.data=t.toString()}Xr.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Xr.prototype.getLength=function(){return this.data.length};Xr.prototype.getBitsLength=function(){return Xr.getBitsLength(this.data.length)};Xr.prototype.write=function(e){var r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var ld=Xr,fd=Rr,Qn=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Zr(t){this.mode=fd.ALPHANUMERIC,this.data=t}Zr.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Zr.prototype.getLength=function(){return this.data.length};Zr.prototype.getBitsLength=function(){return Zr.getBitsLength(this.data.length)};Zr.prototype.write=function(e){var r;for(r=0;r+2<=this.data.length;r+=2){var i=Qn.indexOf(this.data[r])*45;i+=Qn.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(Qn.indexOf(this.data[r]),6)};var dd=Zr,pd=Fr,gd=Rr;function ei(t){this.mode=gd.BYTE,this.data=pd.from(t)}ei.getBitsLength=function(e){return e*8};ei.prototype.getLength=function(){return this.data.length};ei.prototype.getBitsLength=function(){return ei.getBitsLength(this.data.length)};ei.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var md=ei,yd=Rr,wd=Pt;function ti(t){this.mode=yd.KANJI,this.data=t}ti.getBitsLength=function(e){return e*13};ti.prototype.getLength=function(){return this.data.length};ti.prototype.getBitsLength=function(){return ti.getBitsLength(this.data.length)};ti.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=wd.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
3
3
|
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var vd=ti;(function(t){var e=Rr,r=ld,i=dd,n=md,s=vd,o=nr,a=Pt,h=Bl.dijkstraExports;function d(U){return unescape(encodeURIComponent(U)).length}function p(U,A,F){for(var R=[],O;(O=U.exec(F))!==null;)R.push({data:O[0],index:O.index,mode:A,length:O[0].length});return R}function y(U){var A=p(o.NUMERIC,e.NUMERIC,U),F=p(o.ALPHANUMERIC,e.ALPHANUMERIC,U),R,O;a.isKanjiModeEnabled()?(R=p(o.BYTE,e.BYTE,U),O=p(o.KANJI,e.KANJI,U)):(R=p(o.BYTE_KANJI,e.BYTE,U),O=[]);var D=A.concat(F,R,O);return D.sort(function(L,q){return L.index-q.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function C(U,A){switch(A){case e.NUMERIC:return r.getBitsLength(U);case e.ALPHANUMERIC:return i.getBitsLength(U);case e.KANJI:return s.getBitsLength(U);case e.BYTE:return n.getBitsLength(U)}}function E(U){return U.reduce(function(A,F){var R=A.length-1>=0?A[A.length-1]:null;return R&&R.mode===F.mode?(A[A.length-1].data+=F.data,A):(A.push(F),A)},[])}function v(U){for(var A=[],F=0;F<U.length;F++){var R=U[F];switch(R.mode){case e.NUMERIC:A.push([R,{data:R.data,mode:e.ALPHANUMERIC,length:R.length},{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.ALPHANUMERIC:A.push([R,{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.KANJI:A.push([R,{data:R.data,mode:e.BYTE,length:d(R.data)}]);break;case e.BYTE:A.push([{data:R.data,mode:e.BYTE,length:d(R.data)}])}}return A}function k(U,A){for(var F={},R={start:{}},O=["start"],D=0;D<U.length;D++){for(var L=U[D],q=[],Q=0;Q<L.length;Q++){var ee=L[Q],te=""+D+Q;q.push(te),F[te]={node:ee,lastCount:0},R[te]={};for(var xe=0;xe<O.length;xe++){var c=O[xe];F[c]&&F[c].node.mode===ee.mode?(R[c][te]=C(F[c].lastCount+ee.length,ee.mode)-C(F[c].lastCount,ee.mode),F[c].lastCount+=ee.length):(F[c]&&(F[c].lastCount=ee.length),R[c][te]=C(ee.length,ee.mode)+4+e.getCharCountIndicator(ee.mode,A))}}O=q}for(xe=0;xe<O.length;xe++)R[O[xe]].end=0;return{map:R,table:F}}function B(U,A){var F,R=e.getBestModeForData(U);if(F=e.from(A,R),F!==e.BYTE&&F.bit<R.bit)throw new Error('"'+U+'" cannot be encoded with mode '+e.toString(F)+`.
|
|
4
4
|
Suggested mode is: `+e.toString(R));switch(F===e.KANJI&&!a.isKanjiModeEnabled()&&(F=e.BYTE),F){case e.NUMERIC:return new r(U);case e.ALPHANUMERIC:return new i(U);case e.KANJI:return new s(U);case e.BYTE:return new n(U)}}t.fromArray=function(A){return A.reduce(function(F,R){return typeof R=="string"?F.push(B(R,null)):R.data&&F.push(B(R.data,R.mode)),F},[])},t.fromString=function(A,F){for(var R=y(A,a.isKanjiModeEnabled()),O=v(R),D=k(O,F),L=h.find_path(D.map,"start","end"),q=[],Q=1;Q<L.length-1;Q++)q.push(D.table[L[Q]].node);return t.fromArray(E(q))},t.rawSplit=function(A){return t.fromArray(y(A,a.isKanjiModeEnabled()))}})(vh);var zo=Fr,xn=Pt,Yn=In,bd=Zf,_d=ed,Ad=hh,Ed=uh,xs=lh,Cs=Mn,Sd=id,hn=gh,Id=yh,Md=Rr,Xn=vh,Nd=Zs;function xd(t,e){for(var r=t.size,i=Ed.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],a=-1;a<=7;a++)if(!(s+a<=-1||r<=s+a))for(var h=-1;h<=7;h++)o+h<=-1||r<=o+h||(a>=0&&a<=6&&(h===0||h===6)||h>=0&&h<=6&&(a===0||a===6)||a>=2&&a<=4&&h>=2&&h<=4?t.set(s+a,o+h,!0,!0):t.set(s+a,o+h,!1,!0))}function Cd(t){for(var e=t.size,r=8;r<e-8;r++){var i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function Fd(t,e){for(var r=Ad.getPositions(e),i=0;i<r.length;i++)for(var n=r[i][0],s=r[i][1],o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?t.set(n+o,s+a,!0,!0):t.set(n+o,s+a,!1,!0)}function Rd(t,e){for(var r=t.size,i=hn.getEncodedBits(e),n,s,o,a=0;a<18;a++)n=Math.floor(a/3),s=a%3+r-8-3,o=(i>>a&1)===1,t.set(n,s,o,!0),t.set(s,n,o,!0)}function Zn(t,e,r){var i=t.size,n=Id.getEncodedBits(e,r),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(i-15+s,8,o,!0),s<8?t.set(8,i-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(i-8,8,1,!0)}function Pd(t,e){for(var r=t.size,i=-1,n=r-1,s=7,o=0,a=r-1;a>0;a-=2)for(a===6&&a--;;){for(var h=0;h<2;h++)if(!t.isReserved(n,a-h)){var d=!1;o<e.length&&(d=(e[o]>>>s&1)===1),t.set(n,a-h,d),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function Td(t,e,r){var i=new bd;r.forEach(function(d){i.put(d.mode.bit,4),i.put(d.getLength(),Md.getCharCountIndicator(d.mode,t)),d.write(i)});var n=xn.getSymbolTotalCodewords(t),s=Cs.getTotalCodewordsCount(t,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var a=(o-i.getLengthInBits())/8,h=0;h<a;h++)i.put(h%2?17:236,8);return Od(i,t,e)}function Od(t,e,r){for(var i=xn.getSymbolTotalCodewords(e),n=Cs.getTotalCodewordsCount(e,r),s=i-n,o=Cs.getBlocksCount(e,r),a=i%o,h=o-a,d=Math.floor(i/o),p=Math.floor(s/o),y=p+1,C=d-p,E=new Sd(C),v=0,k=new Array(o),B=new Array(o),U=0,A=zo.from(t.buffer),F=0;F<o;F++){var R=F<h?p:y;k[F]=A.slice(v,v+R),B[F]=E.encode(k[F]),v+=R,U=Math.max(U,R)}var O=zo.alloc(i),D=0,L,q;for(L=0;L<U;L++)for(q=0;q<o;q++)L<k[q].length&&(O[D++]=k[q][L]);for(L=0;L<C;L++)for(q=0;q<o;q++)O[D++]=B[q][L];return O}function Bd(t,e,r,i){var n;if(Nd(t))n=Xn.fromArray(t);else if(typeof t=="string"){var s=e;if(!s){var o=Xn.rawSplit(t);s=hn.getBestVersionForData(o,r)}n=Xn.fromString(t,s||40)}else throw new Error("Invalid data");var a=hn.getBestVersionForData(n,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Pt = Object.defineProperty;
|
|
2
2
|
var _t = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var f = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { aX as c, bw as A, bA as z, bz as U, Z as l, cf as le, bB as G, by as S, bx as V, cg as Ge, ch as Ze, ci as Wt, cj as It, ck as Ut, cl as Nt, cm as O, cn as E, a8 as y, co as b, cp as Ft, cq as ye, c9 as dt, cr as xt, cs as lt, ct as zt, cu as Ot, cv as Q, cw as Lt, cx as Z, cy as H, cz as Dt, cA as qt, cB as Kt, cC as Vt, cD as Se, cE as Gt, cF as v, cG as Zt, e as oe, S as k, c7 as Ce, c8 as Ht, p as $, ce as Be, cH as Yt, cI as Qt, b6 as se, a$ as L, a5 as Xt, cJ as ft, bR as mt, g as gt } from "./index-
|
|
4
|
+
import { aX as c, bw as A, bA as z, bz as U, Z as l, cf as le, bB as G, by as S, bx as V, cg as Ge, ch as Ze, ci as Wt, cj as It, ck as Ut, cl as Nt, cm as O, cn as E, a8 as y, co as b, cp as Ft, cq as ye, c9 as dt, cr as xt, cs as lt, ct as zt, cu as Ot, cv as Q, cw as Lt, cx as Z, cy as H, cz as Dt, cA as qt, cB as Kt, cC as Vt, cD as Se, cE as Gt, cF as v, cG as Zt, e as oe, S as k, c7 as Ce, c8 as Ht, p as $, ce as Be, cH as Yt, cI as Qt, b6 as se, a$ as L, a5 as Xt, cJ as ft, bR as mt, g as gt } from "./index-C2DCdxRC.mjs";
|
|
5
5
|
const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
7
|
const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), D = new c("So11111111111111111111111111111111111111112");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var S = (i, e, t) => e in i ? v(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var a = (i, e, t) => S(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { cM as f, cN as I, a5 as x, r as p, cO as b, a8 as w, c7 as U, c8 as E, c9 as m, u as o, cP as k, s as c, p as h, cQ as F, ce as _, Z as $, cb as C, m as T, bM as l, cR as R, bR as N } from "./index-
|
|
5
|
-
import { A as O } from "./aptos-
|
|
4
|
+
import { cM as f, cN as I, a5 as x, r as p, cO as b, a8 as w, c7 as U, c8 as E, c9 as m, u as o, cP as k, s as c, p as h, cQ as F, ce as _, Z as $, cb as C, m as T, bM as l, cR as R, bR as N } from "./index-C2DCdxRC.mjs";
|
|
5
|
+
import { A as O } from "./aptos-CKPSmGSC.mjs";
|
|
6
6
|
class Q {
|
|
7
7
|
constructor(e, t, s, r, n = !1) {
|
|
8
8
|
a(this, "transaction");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var se = Object.defineProperty;
|
|
2
2
|
var oe = (s, e, t) => e in s ? se(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var d = (s, e, t) => oe(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { de as l, dh as T, da as y, cp as _, a8 as C, a5 as f, p as re, u as M, dl as Q, dm as ae, N as S, dc as ce, Z as ie, an as X, dd as N, df as P, dn as de, dp as $, cL as pe, dg as ge, dq as ue, dr as J, cb as fe, bM as le, bR as he } from "./index-
|
|
5
|
-
import { A as Ae } from "./algorand-
|
|
4
|
+
import { de as l, dh as T, da as y, cp as _, a8 as C, a5 as f, p as re, u as M, dl as Q, dm as ae, N as S, dc as ce, Z as ie, an as X, dd as N, df as P, dn as de, dp as $, cL as pe, dg as ge, dq as ue, dr as J, cb as fe, bM as le, bR as he } from "./index-C2DCdxRC.mjs";
|
|
5
|
+
import { A as Ae } from "./algorand-CIOlvhGh.mjs";
|
|
6
6
|
class ye {
|
|
7
7
|
constructor(e, t, o, n, r = !1) {
|
|
8
8
|
d(this, "transaction");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Lt=require("./index-BZ7LatAr.js");var ye={},Rt={},M={},pe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function r(u,o){var s=u>>>16&65535,_=u&65535,w=o>>>16&65535,d=o&65535;return _*d+(s*d+_*w<<16>>>0)|0}t.mul=Math.imul||r;function n(u,o){return u+o|0}t.add=n;function i(u,o){return u-o|0}t.sub=i;function h(u,o){return u<<o|u>>>32-o}t.rotl=h;function f(u,o){return u<<32-o|u>>>o}t.rotr=f;function E(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||E,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(pe);Object.defineProperty(M,"__esModule",{value:!0});var Se=pe;function Ke(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])<<16>>16}M.readInt16BE=Ke;function ze(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])>>>0}M.readUint16BE=ze;function Ye(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])<<16>>16}M.readInt16LE=Ye;function We(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])>>>0}M.readUint16LE=We;function me(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>8,r[n+1]=t>>>0,r}M.writeUint16BE=me;M.writeInt16BE=me;function Ce(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r}M.writeUint16LE=Ce;M.writeInt16LE=Ce;function Vt(t,r){return r===void 0&&(r=0),t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]}M.readInt32BE=Vt;function Xt(t,r){return r===void 0&&(r=0),(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}M.readUint32BE=Xt;function Jt(t,r){return r===void 0&&(r=0),t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}M.readInt32LE=Jt;function Zt(t,r){return r===void 0&&(r=0),(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r])>>>0}M.readUint32LE=Zt;function xt(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>24,r[n+1]=t>>>16,r[n+2]=t>>>8,r[n+3]=t>>>0,r}M.writeUint32BE=xt;M.writeInt32BE=xt;function Bt(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r[n+2]=t>>>16,r[n+3]=t>>>24,r}M.writeUint32LE=Bt;M.writeInt32LE=Bt;function qe(t,r){r===void 0&&(r=0);var n=Vt(t,r),i=Vt(t,r+4);return n*4294967296+i-(i>>31)*4294967296}M.readInt64BE=qe;function Ge(t,r){r===void 0&&(r=0);var n=Xt(t,r),i=Xt(t,r+4);return n*4294967296+i}M.readUint64BE=Ge;function $e(t,r){r===void 0&&(r=0);var n=Jt(t,r),i=Jt(t,r+4);return i*4294967296+n-(n>>31)*4294967296}M.readInt64LE=$e;function Ve(t,r){r===void 0&&(r=0);var n=Zt(t,r),i=Zt(t,r+4);return i*4294967296+n}M.readUint64LE=Ve;function Oe(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),xt(t/4294967296>>>0,r,n),xt(t>>>0,r,n+4),r}M.writeUint64BE=Oe;M.writeInt64BE=Oe;function Ue(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Bt(t>>>0,r,n),Bt(t/4294967296>>>0,r,n+4),r}M.writeUint64LE=Ue;M.writeInt64LE=Ue;function Xe(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,f=t/8+n-1;f>=n;f--)i+=r[f]*h,h*=256;return i}M.readUintBE=Xe;function Je(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,f=n;f<n+t/8;f++)i+=r[f]*h,h*=256;return i}M.readUintLE=Je;function Ze(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Se.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,f=t/8+i-1;f>=i;f--)n[f]=r/h&255,h*=256;return n}M.writeUintBE=Ze;function Qe(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Se.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,f=i;f<i+t/8;f++)n[f]=r/h&255,h*=256;return n}M.writeUintLE=Qe;function ke(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r)}M.readFloat32BE=ke;function tr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r,!0)}M.readFloat32LE=tr;function er(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r)}M.readFloat64BE=er;function rr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r,!0)}M.readFloat64LE=rr;function nr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t),r}M.writeFloat32BE=nr;function ir(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t,!0),r}M.writeFloat32LE=ir;function ar(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t),r}M.writeFloat64BE=ar;function ur(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t,!0),r}M.writeFloat64LE=ur;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});function or(t){for(var r=0;r<t.length;r++)t[r]=0;return t}Et.wipe=or;Object.defineProperty(Rt,"__esModule",{value:!0});var dt=M,Qt=Et,fr=20;function hr(t,r,n){for(var i=1634760805,h=857760878,f=2036477234,E=1797285236,u=n[3]<<24|n[2]<<16|n[1]<<8|n[0],o=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],_=n[15]<<24|n[14]<<16|n[13]<<8|n[12],w=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],l=n[27]<<24|n[26]<<16|n[25]<<8|n[24],v=n[31]<<24|n[30]<<16|n[29]<<8|n[28],S=r[3]<<24|r[2]<<16|r[1]<<8|r[0],g=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],j=r[15]<<24|r[14]<<16|r[13]<<8|r[12],U=i,c=h,b=f,D=E,e=u,a=o,y=s,m=_,A=w,L=d,B=l,x=v,F=S,N=g,p=O,T=j,$=0;$<fr;$+=2)U=U+e|0,F^=U,F=F>>>16|F<<16,A=A+F|0,e^=A,e=e>>>20|e<<12,c=c+a|0,N^=c,N=N>>>16|N<<16,L=L+N|0,a^=L,a=a>>>20|a<<12,b=b+y|0,p^=b,p=p>>>16|p<<16,B=B+p|0,y^=B,y=y>>>20|y<<12,D=D+m|0,T^=D,T=T>>>16|T<<16,x=x+T|0,m^=x,m=m>>>20|m<<12,b=b+y|0,p^=b,p=p>>>24|p<<8,B=B+p|0,y^=B,y=y>>>25|y<<7,D=D+m|0,T^=D,T=T>>>24|T<<8,x=x+T|0,m^=x,m=m>>>25|m<<7,c=c+a|0,N^=c,N=N>>>24|N<<8,L=L+N|0,a^=L,a=a>>>25|a<<7,U=U+e|0,F^=U,F=F>>>24|F<<8,A=A+F|0,e^=A,e=e>>>25|e<<7,U=U+a|0,T^=U,T=T>>>16|T<<16,B=B+T|0,a^=B,a=a>>>20|a<<12,c=c+y|0,F^=c,F=F>>>16|F<<16,x=x+F|0,y^=x,y=y>>>20|y<<12,b=b+m|0,N^=b,N=N>>>16|N<<16,A=A+N|0,m^=A,m=m>>>20|m<<12,D=D+e|0,p^=D,p=p>>>16|p<<16,L=L+p|0,e^=L,e=e>>>20|e<<12,b=b+m|0,N^=b,N=N>>>24|N<<8,A=A+N|0,m^=A,m=m>>>25|m<<7,D=D+e|0,p^=D,p=p>>>24|p<<8,L=L+p|0,e^=L,e=e>>>25|e<<7,c=c+y|0,F^=c,F=F>>>24|F<<8,x=x+F|0,y^=x,y=y>>>25|y<<7,U=U+a|0,T^=U,T=T>>>24|T<<8,B=B+T|0,a^=B,a=a>>>25|a<<7;dt.writeUint32LE(U+i|0,t,0),dt.writeUint32LE(c+h|0,t,4),dt.writeUint32LE(b+f|0,t,8),dt.writeUint32LE(D+E|0,t,12),dt.writeUint32LE(e+u|0,t,16),dt.writeUint32LE(a+o|0,t,20),dt.writeUint32LE(y+s|0,t,24),dt.writeUint32LE(m+_|0,t,28),dt.writeUint32LE(A+w|0,t,32),dt.writeUint32LE(L+d|0,t,36),dt.writeUint32LE(B+l|0,t,40),dt.writeUint32LE(x+v|0,t,44),dt.writeUint32LE(F+S|0,t,48),dt.writeUint32LE(N+g|0,t,52),dt.writeUint32LE(p+O|0,t,56),dt.writeUint32LE(T+j|0,t,60)}function Ae(t,r,n,i,h){if(h===void 0&&(h=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var f,E;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");f=new Uint8Array(16),E=f.length-r.length,f.set(r,E)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");f=r,E=h}for(var u=new Uint8Array(64),o=0;o<n.length;o+=64){hr(u,f,t);for(var s=o;s<o+64&&s<n.length;s++)i[s]=n[s]^u[s-o];cr(f,0,E)}return Qt.wipe(u),h===0&&Qt.wipe(f),i}Rt.streamXOR=Ae;function sr(t,r,n,i){return i===void 0&&(i=0),Qt.wipe(n),Ae(t,r,n,n,i)}Rt.stream=sr;function cr(t,r,n){for(var i=1;n--;)i=i+(t[r]&255)|0,t[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var Te={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});function lr(t,r,n){return~(t-1)&r|t-1&n}vt.select=lr;function Dr(t,r){return(t|0)-(r|0)-1>>>31&1}vt.lessOrEqual=Dr;function Fe(t,r){if(t.length!==r.length)return 0;for(var n=0,i=0;i<t.length;i++)n|=t[i]^r[i];return 1&n-1>>>8}vt.compare=Fe;function _r(t,r){return t.length===0||r.length===0?!1:Fe(t,r)!==0}vt.equal=_r;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=vt,n=Et;t.DIGEST_LENGTH=16;var i=function(){function E(u){this.digestLength=t.DIGEST_LENGTH,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,this._finished=!1;var o=u[0]|u[1]<<8;this._r[0]=o&8191;var s=u[2]|u[3]<<8;this._r[1]=(o>>>13|s<<3)&8191;var _=u[4]|u[5]<<8;this._r[2]=(s>>>10|_<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(_>>>7|w<<9)&8191;var d=u[8]|u[9]<<8;this._r[4]=(w>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var l=u[10]|u[11]<<8;this._r[6]=(d>>>14|l<<2)&8191;var v=u[12]|u[13]<<8;this._r[7]=(l>>>11|v<<5)&8065;var S=u[14]|u[15]<<8;this._r[8]=(v>>>8|S<<8)&8191,this._r[9]=S>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return E.prototype._blocks=function(u,o,s){for(var _=this._fin?0:2048,w=this._h[0],d=this._h[1],l=this._h[2],v=this._h[3],S=this._h[4],g=this._h[5],O=this._h[6],j=this._h[7],U=this._h[8],c=this._h[9],b=this._r[0],D=this._r[1],e=this._r[2],a=this._r[3],y=this._r[4],m=this._r[5],A=this._r[6],L=this._r[7],B=this._r[8],x=this._r[9];s>=16;){var F=u[o+0]|u[o+1]<<8;w+=F&8191;var N=u[o+2]|u[o+3]<<8;d+=(F>>>13|N<<3)&8191;var p=u[o+4]|u[o+5]<<8;l+=(N>>>10|p<<6)&8191;var T=u[o+6]|u[o+7]<<8;v+=(p>>>7|T<<9)&8191;var $=u[o+8]|u[o+9]<<8;S+=(T>>>4|$<<12)&8191,g+=$>>>1&8191;var Z=u[o+10]|u[o+11]<<8;O+=($>>>14|Z<<2)&8191;var J=u[o+12]|u[o+13]<<8;j+=(Z>>>11|J<<5)&8191;var X=u[o+14]|u[o+15]<<8;U+=(J>>>8|X<<8)&8191,c+=X>>>5|_;var C=0,R=C;R+=w*b,R+=d*(5*x),R+=l*(5*B),R+=v*(5*L),R+=S*(5*A),C=R>>>13,R&=8191,R+=g*(5*m),R+=O*(5*y),R+=j*(5*a),R+=U*(5*e),R+=c*(5*D),C+=R>>>13,R&=8191;var P=C;P+=w*D,P+=d*b,P+=l*(5*x),P+=v*(5*B),P+=S*(5*L),C=P>>>13,P&=8191,P+=g*(5*A),P+=O*(5*m),P+=j*(5*y),P+=U*(5*a),P+=c*(5*e),C+=P>>>13,P&=8191;var I=C;I+=w*e,I+=d*D,I+=l*b,I+=v*(5*x),I+=S*(5*B),C=I>>>13,I&=8191,I+=g*(5*L),I+=O*(5*A),I+=j*(5*m),I+=U*(5*y),I+=c*(5*a),C+=I>>>13,I&=8191;var H=C;H+=w*a,H+=d*e,H+=l*D,H+=v*b,H+=S*(5*x),C=H>>>13,H&=8191,H+=g*(5*B),H+=O*(5*L),H+=j*(5*A),H+=U*(5*m),H+=c*(5*y),C+=H>>>13,H&=8191;var K=C;K+=w*y,K+=d*a,K+=l*e,K+=v*D,K+=S*b,C=K>>>13,K&=8191,K+=g*(5*x),K+=O*(5*B),K+=j*(5*L),K+=U*(5*A),K+=c*(5*m),C+=K>>>13,K&=8191;var z=C;z+=w*m,z+=d*y,z+=l*a,z+=v*e,z+=S*D,C=z>>>13,z&=8191,z+=g*b,z+=O*(5*x),z+=j*(5*B),z+=U*(5*L),z+=c*(5*A),C+=z>>>13,z&=8191;var Y=C;Y+=w*A,Y+=d*m,Y+=l*y,Y+=v*a,Y+=S*e,C=Y>>>13,Y&=8191,Y+=g*D,Y+=O*b,Y+=j*(5*x),Y+=U*(5*B),Y+=c*(5*L),C+=Y>>>13,Y&=8191;var W=C;W+=w*L,W+=d*A,W+=l*m,W+=v*y,W+=S*a,C=W>>>13,W&=8191,W+=g*e,W+=O*D,W+=j*b,W+=U*(5*x),W+=c*(5*B),C+=W>>>13,W&=8191;var G=C;G+=w*B,G+=d*L,G+=l*A,G+=v*m,G+=S*y,C=G>>>13,G&=8191,G+=g*a,G+=O*e,G+=j*D,G+=U*b,G+=c*(5*x),C+=G>>>13,G&=8191;var V=C;V+=w*x,V+=d*B,V+=l*L,V+=v*A,V+=S*m,C=V>>>13,V&=8191,V+=g*y,V+=O*a,V+=j*e,V+=U*D,V+=c*b,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+R|0,R=C&8191,C=C>>>13,P+=C,w=R,d=P,l=I,v=H,S=K,g=z,O=Y,j=W,U=G,c=V,o+=16,s-=16}this._h[0]=w,this._h[1]=d,this._h[2]=l,this._h[3]=v,this._h[4]=S,this._h[5]=g,this._h[6]=O,this._h[7]=j,this._h[8]=U,this._h[9]=c},E.prototype.finish=function(u,o){o===void 0&&(o=0);var s=new Uint16Array(10),_,w,d,l;if(this._leftover){for(l=this._leftover,this._buffer[l++]=1;l<16;l++)this._buffer[l]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(_=this._h[1]>>>13,this._h[1]&=8191,l=2;l<10;l++)this._h[l]+=_,_=this._h[l]>>>13,this._h[l]&=8191;for(this._h[0]+=_*5,_=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=_,_=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=_,s[0]=this._h[0]+5,_=s[0]>>>13,s[0]&=8191,l=1;l<10;l++)s[l]=this._h[l]+_,_=s[l]>>>13,s[l]&=8191;for(s[9]-=8192,w=(_^1)-1,l=0;l<10;l++)s[l]&=w;for(w=~w,l=0;l<10;l++)this._h[l]=this._h[l]&w|s[l];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,l=1;l<8;l++)d=(this._h[l]+this._pad[l]|0)+(d>>>16)|0,this._h[l]=d&65535;return u[o+0]=this._h[0]>>>0,u[o+1]=this._h[0]>>>8,u[o+2]=this._h[1]>>>0,u[o+3]=this._h[1]>>>8,u[o+4]=this._h[2]>>>0,u[o+5]=this._h[2]>>>8,u[o+6]=this._h[3]>>>0,u[o+7]=this._h[3]>>>8,u[o+8]=this._h[4]>>>0,u[o+9]=this._h[4]>>>8,u[o+10]=this._h[5]>>>0,u[o+11]=this._h[5]>>>8,u[o+12]=this._h[6]>>>0,u[o+13]=this._h[6]>>>8,u[o+14]=this._h[7]>>>0,u[o+15]=this._h[7]>>>8,this._finished=!0,this},E.prototype.update=function(u){var o=0,s=u.length,_;if(this._leftover){_=16-this._leftover,_>s&&(_=s);for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[o+w];if(s-=_,o+=_,this._leftover+=_,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(_=s-s%16,this._blocks(u,o,_),o+=_,s-=_),s){for(var w=0;w<s;w++)this._buffer[this._leftover+w]=u[o+w];this._leftover+=s}return this},E.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},E.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},E}();t.Poly1305=i;function h(E,u){var o=new i(E);o.update(u);var s=o.digest();return o.clean(),s}t.oneTimeAuth=h;function f(E,u){return E.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:r.equal(E,u)}t.equal=f})(Te);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Rt,n=Te,i=Et,h=M,f=vt;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var E=new Uint8Array(16),u=function(){function o(s){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,s.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return o.prototype.seal=function(s,_,w,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var l=new Uint8Array(16);l.set(s,l.length-s.length);var v=new Uint8Array(32);r.stream(this._key,l,v,4);var S=_.length+this.tagLength,g;if(d){if(d.length!==S)throw new Error("ChaCha20Poly1305: incorrect destination length");g=d}else g=new Uint8Array(S);return r.streamXOR(this._key,l,_,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),v,g.subarray(0,g.length-this.tagLength),w),i.wipe(l),g},o.prototype.open=function(s,_,w,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(_.length<this.tagLength)return null;var l=new Uint8Array(16);l.set(s,l.length-s.length);var v=new Uint8Array(32);r.stream(this._key,l,v,4);var S=new Uint8Array(this.tagLength);if(this._authenticate(S,v,_.subarray(0,_.length-this.tagLength),w),!f.equal(S,_.subarray(_.length-this.tagLength,_.length)))return null;var g=_.length-this.tagLength,O;if(d){if(d.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(g);return r.streamXOR(this._key,l,_.subarray(0,_.length-this.tagLength),O,4),i.wipe(l),O},o.prototype.clean=function(){return i.wipe(this._key),this},o.prototype._authenticate=function(s,_,w,d){var l=new n.Poly1305(_);d&&(l.update(d),d.length%16>0&&l.update(E.subarray(d.length%16))),l.update(w),w.length%16>0&&l.update(E.subarray(w.length%16));var v=new Uint8Array(8);d&&h.writeUint64LE(d.length,v),l.update(v),h.writeUint64LE(w.length,v),l.update(v);for(var S=l.digest(),g=0;g<S.length;g++)s[g]=S[g];l.clean(),i.wipe(S),i.wipe(v)},o}();t.ChaCha20Poly1305=u})(ye);var Ne={},Ft={},ne={};Object.defineProperty(ne,"__esModule",{value:!0});function dr(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}ne.isSerializableHash=dr;Object.defineProperty(Ft,"__esModule",{value:!0});var bt=ne,Er=vt,br=Et,Me=function(){function t(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),bt.isSerializableHash(this._inner)&&bt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),br.wipe(i)}return t.prototype.reset=function(){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){bt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),bt.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(r){return this._inner.update(r),this},t.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},t.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},t.prototype.saveState=function(){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(r){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(r){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},t}();Ft.HMAC=Me;function vr(t,r,n){var i=new Me(t,r);i.update(n);var h=i.digest();return i.clean(),h}Ft.hmac=vr;Ft.equal=Er.equal;Object.defineProperty(Ne,"__esModule",{value:!0});var ue=Ft,oe=Et,wr=function(){function t(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var f=ue.hmac(this._hash,i,n);this._hmac=new ue.HMAC(r,f),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},t.prototype.clean=function(){this._hmac.clean(),oe.wipe(this._buffer),oe.wipe(this._counter),this._bufpos=0},t}(),gr=Ne.HKDF=wr,jt={},Pt={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.BrowserRandomSource=void 0;const fe=65536;class yr{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=fe)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,fe)));return n}}It.BrowserRandomSource=yr;var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.NodeRandomSource=void 0;const pr=Et;class Sr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Lt.commonjsRequire<"u"){const r=Lt.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,pr.wipe)(n),i}}Ht.NodeRandomSource=Sr;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SystemRandomSource=void 0;const mr=It,Cr=Ht;class Or{constructor(){if(this.isAvailable=!1,this.name="",this._source=new mr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Cr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Pt.SystemRandomSource=Or;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const r=Pt,n=M,i=Et;t.defaultRandomSource=new r.SystemRandomSource;function h(s,_=t.defaultRandomSource){return _.randomBytes(s)}t.randomBytes=h;function f(s=t.defaultRandomSource){const _=h(4,s),w=(0,n.readUint32LE)(_);return(0,i.wipe)(_),w}t.randomUint32=f;const E="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(s,_=E,w=t.defaultRandomSource){if(_.length<2)throw new Error("randomString charset is too short");if(_.length>256)throw new Error("randomString charset is too long");let d="";const l=_.length,v=256-256%l;for(;s>0;){const S=h(Math.ceil(s*256/v),w);for(let g=0;g<S.length&&s>0;g++){const O=S[g];O<v&&(d+=_.charAt(O%l),s--)}(0,i.wipe)(S)}return d}t.randomString=u;function o(s,_=E,w=t.defaultRandomSource){const d=Math.ceil(s/(Math.log(_.length)/Math.LN2));return u(d,_,w)}t.randomStringForEntropy=o})(jt);const Ur=Lt.getDefaultExportFromCjs(jt);var Le={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=M,n=Et;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},u.prototype.update=function(o,s){if(s===void 0&&(s=o.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var _=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=o[_++],s--;this._bufferLength===this.blockSize&&(f(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(_=f(this._temp,this._state,o,_,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=o[_++],s--;return this},u.prototype.finish=function(o){if(!this._finished){var s=this._bytesHashed,_=this._bufferLength,w=s/536870912|0,d=s<<3,l=s%64<56?64:128;this._buffer[_]=128;for(var v=_+1;v<l-8;v++)this._buffer[v]=0;r.writeUint32BE(w,this._buffer,l-8),r.writeUint32BE(d,this._buffer,l-4),f(this._temp,this._state,this._buffer,0,l),this._finished=!0}for(var v=0;v<this.digestLength/4;v++)r.writeUint32BE(this._state[v],o,v*4);return this},u.prototype.digest=function(){var o=new Uint8Array(this.digestLength);return this.finish(o),o},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(o){return this._state.set(o.state),this._bufferLength=o.bufferLength,o.buffer&&this._buffer.set(o.buffer),this._bytesHashed=o.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(o){n.wipe(o.state),o.buffer&&n.wipe(o.buffer),o.bufferLength=0,o.bytesHashed=0},u}();t.SHA256=i;var h=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function f(u,o,s,_,w){for(;w>=64;){for(var d=o[0],l=o[1],v=o[2],S=o[3],g=o[4],O=o[5],j=o[6],U=o[7],c=0;c<16;c++){var b=_+c*4;u[c]=r.readUint32BE(s,b)}for(var c=16;c<64;c++){var D=u[c-2],e=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=u[c-15];var a=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;u[c]=(e+u[c-7]|0)+(a+u[c-16]|0)}for(var c=0;c<64;c++){var e=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&O^~g&j)|0)+(U+(h[c]+u[c]|0)|0)|0,a=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&l^d&v^l&v)|0;U=j,j=O,O=g,g=S+e|0,S=v,v=l,l=d,d=e+a|0}o[0]+=d,o[1]+=l,o[2]+=v,o[3]+=S,o[4]+=g,o[5]+=O,o[6]+=j,o[7]+=U,_+=64,w-=64}return _}function E(u){var o=new i;o.update(u);var s=o.digest();return o.clean(),s}t.hash=E})(Le);var xe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const r=jt,n=Et;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(c){const b=new Float64Array(16);if(c)for(let D=0;D<c.length;D++)b[D]=c[D];return b}const h=new Uint8Array(32);h[0]=9;const f=i([56129,1]);function E(c){let b=1;for(let D=0;D<16;D++){let e=c[D]+b+65535;b=Math.floor(e/65536),c[D]=e-b*65536}c[0]+=b-1+37*(b-1)}function u(c,b,D){const e=~(D-1);for(let a=0;a<16;a++){const y=e&(c[a]^b[a]);c[a]^=y,b[a]^=y}}function o(c,b){const D=i(),e=i();for(let a=0;a<16;a++)e[a]=b[a];E(e),E(e),E(e);for(let a=0;a<2;a++){D[0]=e[0]-65517;for(let m=1;m<15;m++)D[m]=e[m]-65535-(D[m-1]>>16&1),D[m-1]&=65535;D[15]=e[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,u(e,D,1-y)}for(let a=0;a<16;a++)c[2*a]=e[a]&255,c[2*a+1]=e[a]>>8}function s(c,b){for(let D=0;D<16;D++)c[D]=b[2*D]+(b[2*D+1]<<8);c[15]&=32767}function _(c,b,D){for(let e=0;e<16;e++)c[e]=b[e]+D[e]}function w(c,b,D){for(let e=0;e<16;e++)c[e]=b[e]-D[e]}function d(c,b,D){let e,a,y=0,m=0,A=0,L=0,B=0,x=0,F=0,N=0,p=0,T=0,$=0,Z=0,J=0,X=0,C=0,R=0,P=0,I=0,H=0,K=0,z=0,Y=0,W=0,G=0,V=0,wt=0,St=0,Ot=0,Mt=0,Yt=0,ae=0,k=D[0],tt=D[1],et=D[2],rt=D[3],nt=D[4],it=D[5],at=D[6],ut=D[7],ot=D[8],ft=D[9],ht=D[10],st=D[11],ct=D[12],lt=D[13],Dt=D[14],_t=D[15];e=b[0],y+=e*k,m+=e*tt,A+=e*et,L+=e*rt,B+=e*nt,x+=e*it,F+=e*at,N+=e*ut,p+=e*ot,T+=e*ft,$+=e*ht,Z+=e*st,J+=e*ct,X+=e*lt,C+=e*Dt,R+=e*_t,e=b[1],m+=e*k,A+=e*tt,L+=e*et,B+=e*rt,x+=e*nt,F+=e*it,N+=e*at,p+=e*ut,T+=e*ot,$+=e*ft,Z+=e*ht,J+=e*st,X+=e*ct,C+=e*lt,R+=e*Dt,P+=e*_t,e=b[2],A+=e*k,L+=e*tt,B+=e*et,x+=e*rt,F+=e*nt,N+=e*it,p+=e*at,T+=e*ut,$+=e*ot,Z+=e*ft,J+=e*ht,X+=e*st,C+=e*ct,R+=e*lt,P+=e*Dt,I+=e*_t,e=b[3],L+=e*k,B+=e*tt,x+=e*et,F+=e*rt,N+=e*nt,p+=e*it,T+=e*at,$+=e*ut,Z+=e*ot,J+=e*ft,X+=e*ht,C+=e*st,R+=e*ct,P+=e*lt,I+=e*Dt,H+=e*_t,e=b[4],B+=e*k,x+=e*tt,F+=e*et,N+=e*rt,p+=e*nt,T+=e*it,$+=e*at,Z+=e*ut,J+=e*ot,X+=e*ft,C+=e*ht,R+=e*st,P+=e*ct,I+=e*lt,H+=e*Dt,K+=e*_t,e=b[5],x+=e*k,F+=e*tt,N+=e*et,p+=e*rt,T+=e*nt,$+=e*it,Z+=e*at,J+=e*ut,X+=e*ot,C+=e*ft,R+=e*ht,P+=e*st,I+=e*ct,H+=e*lt,K+=e*Dt,z+=e*_t,e=b[6],F+=e*k,N+=e*tt,p+=e*et,T+=e*rt,$+=e*nt,Z+=e*it,J+=e*at,X+=e*ut,C+=e*ot,R+=e*ft,P+=e*ht,I+=e*st,H+=e*ct,K+=e*lt,z+=e*Dt,Y+=e*_t,e=b[7],N+=e*k,p+=e*tt,T+=e*et,$+=e*rt,Z+=e*nt,J+=e*it,X+=e*at,C+=e*ut,R+=e*ot,P+=e*ft,I+=e*ht,H+=e*st,K+=e*ct,z+=e*lt,Y+=e*Dt,W+=e*_t,e=b[8],p+=e*k,T+=e*tt,$+=e*et,Z+=e*rt,J+=e*nt,X+=e*it,C+=e*at,R+=e*ut,P+=e*ot,I+=e*ft,H+=e*ht,K+=e*st,z+=e*ct,Y+=e*lt,W+=e*Dt,G+=e*_t,e=b[9],T+=e*k,$+=e*tt,Z+=e*et,J+=e*rt,X+=e*nt,C+=e*it,R+=e*at,P+=e*ut,I+=e*ot,H+=e*ft,K+=e*ht,z+=e*st,Y+=e*ct,W+=e*lt,G+=e*Dt,V+=e*_t,e=b[10],$+=e*k,Z+=e*tt,J+=e*et,X+=e*rt,C+=e*nt,R+=e*it,P+=e*at,I+=e*ut,H+=e*ot,K+=e*ft,z+=e*ht,Y+=e*st,W+=e*ct,G+=e*lt,V+=e*Dt,wt+=e*_t,e=b[11],Z+=e*k,J+=e*tt,X+=e*et,C+=e*rt,R+=e*nt,P+=e*it,I+=e*at,H+=e*ut,K+=e*ot,z+=e*ft,Y+=e*ht,W+=e*st,G+=e*ct,V+=e*lt,wt+=e*Dt,St+=e*_t,e=b[12],J+=e*k,X+=e*tt,C+=e*et,R+=e*rt,P+=e*nt,I+=e*it,H+=e*at,K+=e*ut,z+=e*ot,Y+=e*ft,W+=e*ht,G+=e*st,V+=e*ct,wt+=e*lt,St+=e*Dt,Ot+=e*_t,e=b[13],X+=e*k,C+=e*tt,R+=e*et,P+=e*rt,I+=e*nt,H+=e*it,K+=e*at,z+=e*ut,Y+=e*ot,W+=e*ft,G+=e*ht,V+=e*st,wt+=e*ct,St+=e*lt,Ot+=e*Dt,Mt+=e*_t,e=b[14],C+=e*k,R+=e*tt,P+=e*et,I+=e*rt,H+=e*nt,K+=e*it,z+=e*at,Y+=e*ut,W+=e*ot,G+=e*ft,V+=e*ht,wt+=e*st,St+=e*ct,Ot+=e*lt,Mt+=e*Dt,Yt+=e*_t,e=b[15],R+=e*k,P+=e*tt,I+=e*et,H+=e*rt,K+=e*nt,z+=e*it,Y+=e*at,W+=e*ut,G+=e*ot,V+=e*ft,wt+=e*ht,St+=e*st,Ot+=e*ct,Mt+=e*lt,Yt+=e*Dt,ae+=e*_t,y+=38*P,m+=38*I,A+=38*H,L+=38*K,B+=38*z,x+=38*Y,F+=38*W,N+=38*G,p+=38*V,T+=38*wt,$+=38*St,Z+=38*Ot,J+=38*Mt,X+=38*Yt,C+=38*ae,a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=x+a+65535,a=Math.floor(e/65536),x=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=p+a+65535,a=Math.floor(e/65536),p=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=x+a+65535,a=Math.floor(e/65536),x=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=p+a+65535,a=Math.floor(e/65536),p=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),c[0]=y,c[1]=m,c[2]=A,c[3]=L,c[4]=B,c[5]=x,c[6]=F,c[7]=N,c[8]=p,c[9]=T,c[10]=$,c[11]=Z,c[12]=J,c[13]=X,c[14]=C,c[15]=R}function l(c,b){d(c,b,b)}function v(c,b){const D=i();for(let e=0;e<16;e++)D[e]=b[e];for(let e=253;e>=0;e--)l(D,D),e!==2&&e!==4&&d(D,D,b);for(let e=0;e<16;e++)c[e]=D[e]}function S(c,b){const D=new Uint8Array(32),e=new Float64Array(80),a=i(),y=i(),m=i(),A=i(),L=i(),B=i();for(let p=0;p<31;p++)D[p]=c[p];D[31]=c[31]&127|64,D[0]&=248,s(e,b);for(let p=0;p<16;p++)y[p]=e[p];a[0]=A[0]=1;for(let p=254;p>=0;--p){const T=D[p>>>3]>>>(p&7)&1;u(a,y,T),u(m,A,T),_(L,a,m),w(a,a,m),_(m,y,A),w(y,y,A),l(A,L),l(B,a),d(a,m,a),d(m,y,L),_(L,a,m),w(a,a,m),l(y,a),w(m,A,B),d(a,m,f),_(a,a,A),d(m,m,a),d(a,A,B),d(A,y,e),l(y,L),u(a,y,T),u(m,A,T)}for(let p=0;p<16;p++)e[p+16]=a[p],e[p+32]=m[p],e[p+48]=y[p],e[p+64]=A[p];const x=e.subarray(32),F=e.subarray(16);v(x,x),d(F,F,x);const N=new Uint8Array(32);return o(N,F),N}t.scalarMult=S;function g(c){return S(c,h)}t.scalarMultBase=g;function O(c){if(c.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const b=new Uint8Array(c);return{publicKey:g(b),secretKey:b}}t.generateKeyPairFromSeed=O;function j(c){const b=(0,r.randomBytes)(32,c),D=O(b);return(0,n.wipe)(b),D}t.generateKeyPair=j;function U(c,b,D=!1){if(c.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const e=S(c,b);if(D){let a=0;for(let y=0;y<e.length;y++)a|=e[y];if(a===0)throw new Error("X25519: invalid shared key")}return e}t.sharedKey=U})(xe);function Ar(t,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<t.length;h++){var f=t.charAt(h),E=f.charCodeAt(0);if(n[E]!==255)throw new TypeError(f+" is ambiguous");n[E]=h}var u=t.length,o=t.charAt(0),s=Math.log(u)/Math.log(256),_=Math.log(256)/Math.log(u);function w(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";for(var S=0,g=0,O=0,j=v.length;O!==j&&v[O]===0;)O++,S++;for(var U=(j-O)*_+1>>>0,c=new Uint8Array(U);O!==j;){for(var b=v[O],D=0,e=U-1;(b!==0||D<g)&&e!==-1;e--,D++)b+=256*c[e]>>>0,c[e]=b%u>>>0,b=b/u>>>0;if(b!==0)throw new Error("Non-zero carry");g=D,O++}for(var a=U-g;a!==U&&c[a]===0;)a++;for(var y=o.repeat(S);a<U;++a)y+=t.charAt(c[a]);return y}function d(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;var S=0;if(v[S]!==" "){for(var g=0,O=0;v[S]===o;)g++,S++;for(var j=(v.length-S)*s+1>>>0,U=new Uint8Array(j);v[S];){var c=n[v.charCodeAt(S)];if(c===255)return;for(var b=0,D=j-1;(c!==0||b<O)&&D!==-1;D--,b++)c+=u*U[D]>>>0,U[D]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");O=b,S++}if(v[S]!==" "){for(var e=j-O;e!==j&&U[e]===0;)e++;for(var a=new Uint8Array(g+(j-e)),y=g;e!==j;)a[y++]=U[e++];return a}}}function l(v){var S=d(v);if(S)return S;throw new Error(`Non-${r} character`)}return{encode:w,decodeUnsafe:d,decode:l}}var Tr=Ar,Fr=Tr;const Nr=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Mr=t=>new TextEncoder().encode(t),Lr=t=>new TextDecoder().decode(t);class xr{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Br{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Be(this,r)}}class Rr{constructor(r){this.decoders=r}or(r){return Be(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Be=(t,r)=>new Rr({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}});class jr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new xr(r,n,i),this.decoder=new Br(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Kt=({name:t,prefix:r,encode:n,decode:i})=>new jr(t,r,n,i),Nt=({prefix:t,name:r,alphabet:n})=>{const{encode:i,decode:h}=Fr(n,r);return Kt({prefix:t,name:r,encode:i,decode:f=>Nr(h(f))})},Pr=(t,r,n,i)=>{const h={};for(let _=0;_<r.length;++_)h[r[_]]=_;let f=t.length;for(;t[f-1]==="=";)--f;const E=new Uint8Array(f*n/8|0);let u=0,o=0,s=0;for(let _=0;_<f;++_){const w=h[t[_]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);o=o<<n|w,u+=n,u>=8&&(u-=8,E[s++]=255&o>>u)}if(u>=n||255&o<<8-u)throw new SyntaxError("Unexpected end of data");return E},Ir=(t,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let f="",E=0,u=0;for(let o=0;o<t.length;++o)for(u=u<<8|t[o],E+=8;E>n;)E-=n,f+=r[h&u>>E];if(E&&(f+=r[h&u<<n-E]),i)for(;f.length*n&7;)f+="=";return f},Q=({name:t,prefix:r,bitsPerChar:n,alphabet:i})=>Kt({prefix:r,name:t,encode(h){return Ir(h,i,n)},decode(h){return Pr(h,i,n,t)}}),Hr=Kt({prefix:"\0",name:"identity",encode:t=>Lr(t),decode:t=>Mr(t)}),Kr=Object.freeze(Object.defineProperty({__proto__:null,identity:Hr},Symbol.toStringTag,{value:"Module"})),zr=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Yr=Object.freeze(Object.defineProperty({__proto__:null,base2:zr},Symbol.toStringTag,{value:"Module"})),Wr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),qr=Object.freeze(Object.defineProperty({__proto__:null,base8:Wr},Symbol.toStringTag,{value:"Module"})),Gr=Nt({prefix:"9",name:"base10",alphabet:"0123456789"}),$r=Object.freeze(Object.defineProperty({__proto__:null,base10:Gr},Symbol.toStringTag,{value:"Module"})),Vr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Jr=Object.freeze(Object.defineProperty({__proto__:null,base16:Vr,base16upper:Xr},Symbol.toStringTag,{value:"Module"})),Zr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tn=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rn=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),an=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),un=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),on=Object.freeze(Object.defineProperty({__proto__:null,base32:Zr,base32hex:en,base32hexpad:nn,base32hexpadupper:an,base32hexupper:rn,base32pad:kr,base32padupper:tn,base32upper:Qr,base32z:un},Symbol.toStringTag,{value:"Module"})),fn=Nt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hn=Nt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),sn=Object.freeze(Object.defineProperty({__proto__:null,base36:fn,base36upper:hn},Symbol.toStringTag,{value:"Module"})),cn=Nt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ln=Nt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:cn,base58flickr:ln},Symbol.toStringTag,{value:"Module"})),_n=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),dn=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),En=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),bn=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),vn=Object.freeze(Object.defineProperty({__proto__:null,base64:_n,base64pad:dn,base64url:En,base64urlpad:bn},Symbol.toStringTag,{value:"Module"})),Re=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),wn=Re.reduce((t,r,n)=>(t[n]=r,t),[]),gn=Re.reduce((t,r,n)=>(t[r.codePointAt(0)]=n,t),[]);function yn(t){return t.reduce((r,n)=>(r+=wn[n],r),"")}function pn(t){const r=[];for(const n of t){const i=gn[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const Sn=Kt({prefix:"🚀",name:"base256emoji",encode:yn,decode:pn}),mn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Sn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var je={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const Lt=require("./index-BHGS0dw3.js");var ye={},Rt={},M={},pe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function r(u,o){var s=u>>>16&65535,_=u&65535,w=o>>>16&65535,d=o&65535;return _*d+(s*d+_*w<<16>>>0)|0}t.mul=Math.imul||r;function n(u,o){return u+o|0}t.add=n;function i(u,o){return u-o|0}t.sub=i;function h(u,o){return u<<o|u>>>32-o}t.rotl=h;function f(u,o){return u<<32-o|u>>>o}t.rotr=f;function E(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||E,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(pe);Object.defineProperty(M,"__esModule",{value:!0});var Se=pe;function Ke(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])<<16>>16}M.readInt16BE=Ke;function ze(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])>>>0}M.readUint16BE=ze;function Ye(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])<<16>>16}M.readInt16LE=Ye;function We(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])>>>0}M.readUint16LE=We;function me(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>8,r[n+1]=t>>>0,r}M.writeUint16BE=me;M.writeInt16BE=me;function Ce(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r}M.writeUint16LE=Ce;M.writeInt16LE=Ce;function Vt(t,r){return r===void 0&&(r=0),t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]}M.readInt32BE=Vt;function Xt(t,r){return r===void 0&&(r=0),(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}M.readUint32BE=Xt;function Jt(t,r){return r===void 0&&(r=0),t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}M.readInt32LE=Jt;function Zt(t,r){return r===void 0&&(r=0),(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r])>>>0}M.readUint32LE=Zt;function xt(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>24,r[n+1]=t>>>16,r[n+2]=t>>>8,r[n+3]=t>>>0,r}M.writeUint32BE=xt;M.writeInt32BE=xt;function Bt(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r[n+2]=t>>>16,r[n+3]=t>>>24,r}M.writeUint32LE=Bt;M.writeInt32LE=Bt;function qe(t,r){r===void 0&&(r=0);var n=Vt(t,r),i=Vt(t,r+4);return n*4294967296+i-(i>>31)*4294967296}M.readInt64BE=qe;function Ge(t,r){r===void 0&&(r=0);var n=Xt(t,r),i=Xt(t,r+4);return n*4294967296+i}M.readUint64BE=Ge;function $e(t,r){r===void 0&&(r=0);var n=Jt(t,r),i=Jt(t,r+4);return i*4294967296+n-(n>>31)*4294967296}M.readInt64LE=$e;function Ve(t,r){r===void 0&&(r=0);var n=Zt(t,r),i=Zt(t,r+4);return i*4294967296+n}M.readUint64LE=Ve;function Oe(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),xt(t/4294967296>>>0,r,n),xt(t>>>0,r,n+4),r}M.writeUint64BE=Oe;M.writeInt64BE=Oe;function Ue(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Bt(t>>>0,r,n),Bt(t/4294967296>>>0,r,n+4),r}M.writeUint64LE=Ue;M.writeInt64LE=Ue;function Xe(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,f=t/8+n-1;f>=n;f--)i+=r[f]*h,h*=256;return i}M.readUintBE=Xe;function Je(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,f=n;f<n+t/8;f++)i+=r[f]*h,h*=256;return i}M.readUintLE=Je;function Ze(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Se.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,f=t/8+i-1;f>=i;f--)n[f]=r/h&255,h*=256;return n}M.writeUintBE=Ze;function Qe(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Se.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,f=i;f<i+t/8;f++)n[f]=r/h&255,h*=256;return n}M.writeUintLE=Qe;function ke(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r)}M.readFloat32BE=ke;function tr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r,!0)}M.readFloat32LE=tr;function er(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r)}M.readFloat64BE=er;function rr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r,!0)}M.readFloat64LE=rr;function nr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t),r}M.writeFloat32BE=nr;function ir(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t,!0),r}M.writeFloat32LE=ir;function ar(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t),r}M.writeFloat64BE=ar;function ur(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t,!0),r}M.writeFloat64LE=ur;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});function or(t){for(var r=0;r<t.length;r++)t[r]=0;return t}Et.wipe=or;Object.defineProperty(Rt,"__esModule",{value:!0});var dt=M,Qt=Et,fr=20;function hr(t,r,n){for(var i=1634760805,h=857760878,f=2036477234,E=1797285236,u=n[3]<<24|n[2]<<16|n[1]<<8|n[0],o=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],_=n[15]<<24|n[14]<<16|n[13]<<8|n[12],w=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],l=n[27]<<24|n[26]<<16|n[25]<<8|n[24],v=n[31]<<24|n[30]<<16|n[29]<<8|n[28],S=r[3]<<24|r[2]<<16|r[1]<<8|r[0],g=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],j=r[15]<<24|r[14]<<16|r[13]<<8|r[12],U=i,c=h,b=f,D=E,e=u,a=o,y=s,m=_,A=w,L=d,B=l,x=v,F=S,N=g,p=O,T=j,$=0;$<fr;$+=2)U=U+e|0,F^=U,F=F>>>16|F<<16,A=A+F|0,e^=A,e=e>>>20|e<<12,c=c+a|0,N^=c,N=N>>>16|N<<16,L=L+N|0,a^=L,a=a>>>20|a<<12,b=b+y|0,p^=b,p=p>>>16|p<<16,B=B+p|0,y^=B,y=y>>>20|y<<12,D=D+m|0,T^=D,T=T>>>16|T<<16,x=x+T|0,m^=x,m=m>>>20|m<<12,b=b+y|0,p^=b,p=p>>>24|p<<8,B=B+p|0,y^=B,y=y>>>25|y<<7,D=D+m|0,T^=D,T=T>>>24|T<<8,x=x+T|0,m^=x,m=m>>>25|m<<7,c=c+a|0,N^=c,N=N>>>24|N<<8,L=L+N|0,a^=L,a=a>>>25|a<<7,U=U+e|0,F^=U,F=F>>>24|F<<8,A=A+F|0,e^=A,e=e>>>25|e<<7,U=U+a|0,T^=U,T=T>>>16|T<<16,B=B+T|0,a^=B,a=a>>>20|a<<12,c=c+y|0,F^=c,F=F>>>16|F<<16,x=x+F|0,y^=x,y=y>>>20|y<<12,b=b+m|0,N^=b,N=N>>>16|N<<16,A=A+N|0,m^=A,m=m>>>20|m<<12,D=D+e|0,p^=D,p=p>>>16|p<<16,L=L+p|0,e^=L,e=e>>>20|e<<12,b=b+m|0,N^=b,N=N>>>24|N<<8,A=A+N|0,m^=A,m=m>>>25|m<<7,D=D+e|0,p^=D,p=p>>>24|p<<8,L=L+p|0,e^=L,e=e>>>25|e<<7,c=c+y|0,F^=c,F=F>>>24|F<<8,x=x+F|0,y^=x,y=y>>>25|y<<7,U=U+a|0,T^=U,T=T>>>24|T<<8,B=B+T|0,a^=B,a=a>>>25|a<<7;dt.writeUint32LE(U+i|0,t,0),dt.writeUint32LE(c+h|0,t,4),dt.writeUint32LE(b+f|0,t,8),dt.writeUint32LE(D+E|0,t,12),dt.writeUint32LE(e+u|0,t,16),dt.writeUint32LE(a+o|0,t,20),dt.writeUint32LE(y+s|0,t,24),dt.writeUint32LE(m+_|0,t,28),dt.writeUint32LE(A+w|0,t,32),dt.writeUint32LE(L+d|0,t,36),dt.writeUint32LE(B+l|0,t,40),dt.writeUint32LE(x+v|0,t,44),dt.writeUint32LE(F+S|0,t,48),dt.writeUint32LE(N+g|0,t,52),dt.writeUint32LE(p+O|0,t,56),dt.writeUint32LE(T+j|0,t,60)}function Ae(t,r,n,i,h){if(h===void 0&&(h=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var f,E;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");f=new Uint8Array(16),E=f.length-r.length,f.set(r,E)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");f=r,E=h}for(var u=new Uint8Array(64),o=0;o<n.length;o+=64){hr(u,f,t);for(var s=o;s<o+64&&s<n.length;s++)i[s]=n[s]^u[s-o];cr(f,0,E)}return Qt.wipe(u),h===0&&Qt.wipe(f),i}Rt.streamXOR=Ae;function sr(t,r,n,i){return i===void 0&&(i=0),Qt.wipe(n),Ae(t,r,n,n,i)}Rt.stream=sr;function cr(t,r,n){for(var i=1;n--;)i=i+(t[r]&255)|0,t[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var Te={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});function lr(t,r,n){return~(t-1)&r|t-1&n}vt.select=lr;function Dr(t,r){return(t|0)-(r|0)-1>>>31&1}vt.lessOrEqual=Dr;function Fe(t,r){if(t.length!==r.length)return 0;for(var n=0,i=0;i<t.length;i++)n|=t[i]^r[i];return 1&n-1>>>8}vt.compare=Fe;function _r(t,r){return t.length===0||r.length===0?!1:Fe(t,r)!==0}vt.equal=_r;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=vt,n=Et;t.DIGEST_LENGTH=16;var i=function(){function E(u){this.digestLength=t.DIGEST_LENGTH,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,this._finished=!1;var o=u[0]|u[1]<<8;this._r[0]=o&8191;var s=u[2]|u[3]<<8;this._r[1]=(o>>>13|s<<3)&8191;var _=u[4]|u[5]<<8;this._r[2]=(s>>>10|_<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(_>>>7|w<<9)&8191;var d=u[8]|u[9]<<8;this._r[4]=(w>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var l=u[10]|u[11]<<8;this._r[6]=(d>>>14|l<<2)&8191;var v=u[12]|u[13]<<8;this._r[7]=(l>>>11|v<<5)&8065;var S=u[14]|u[15]<<8;this._r[8]=(v>>>8|S<<8)&8191,this._r[9]=S>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return E.prototype._blocks=function(u,o,s){for(var _=this._fin?0:2048,w=this._h[0],d=this._h[1],l=this._h[2],v=this._h[3],S=this._h[4],g=this._h[5],O=this._h[6],j=this._h[7],U=this._h[8],c=this._h[9],b=this._r[0],D=this._r[1],e=this._r[2],a=this._r[3],y=this._r[4],m=this._r[5],A=this._r[6],L=this._r[7],B=this._r[8],x=this._r[9];s>=16;){var F=u[o+0]|u[o+1]<<8;w+=F&8191;var N=u[o+2]|u[o+3]<<8;d+=(F>>>13|N<<3)&8191;var p=u[o+4]|u[o+5]<<8;l+=(N>>>10|p<<6)&8191;var T=u[o+6]|u[o+7]<<8;v+=(p>>>7|T<<9)&8191;var $=u[o+8]|u[o+9]<<8;S+=(T>>>4|$<<12)&8191,g+=$>>>1&8191;var Z=u[o+10]|u[o+11]<<8;O+=($>>>14|Z<<2)&8191;var J=u[o+12]|u[o+13]<<8;j+=(Z>>>11|J<<5)&8191;var X=u[o+14]|u[o+15]<<8;U+=(J>>>8|X<<8)&8191,c+=X>>>5|_;var C=0,R=C;R+=w*b,R+=d*(5*x),R+=l*(5*B),R+=v*(5*L),R+=S*(5*A),C=R>>>13,R&=8191,R+=g*(5*m),R+=O*(5*y),R+=j*(5*a),R+=U*(5*e),R+=c*(5*D),C+=R>>>13,R&=8191;var P=C;P+=w*D,P+=d*b,P+=l*(5*x),P+=v*(5*B),P+=S*(5*L),C=P>>>13,P&=8191,P+=g*(5*A),P+=O*(5*m),P+=j*(5*y),P+=U*(5*a),P+=c*(5*e),C+=P>>>13,P&=8191;var I=C;I+=w*e,I+=d*D,I+=l*b,I+=v*(5*x),I+=S*(5*B),C=I>>>13,I&=8191,I+=g*(5*L),I+=O*(5*A),I+=j*(5*m),I+=U*(5*y),I+=c*(5*a),C+=I>>>13,I&=8191;var H=C;H+=w*a,H+=d*e,H+=l*D,H+=v*b,H+=S*(5*x),C=H>>>13,H&=8191,H+=g*(5*B),H+=O*(5*L),H+=j*(5*A),H+=U*(5*m),H+=c*(5*y),C+=H>>>13,H&=8191;var K=C;K+=w*y,K+=d*a,K+=l*e,K+=v*D,K+=S*b,C=K>>>13,K&=8191,K+=g*(5*x),K+=O*(5*B),K+=j*(5*L),K+=U*(5*A),K+=c*(5*m),C+=K>>>13,K&=8191;var z=C;z+=w*m,z+=d*y,z+=l*a,z+=v*e,z+=S*D,C=z>>>13,z&=8191,z+=g*b,z+=O*(5*x),z+=j*(5*B),z+=U*(5*L),z+=c*(5*A),C+=z>>>13,z&=8191;var Y=C;Y+=w*A,Y+=d*m,Y+=l*y,Y+=v*a,Y+=S*e,C=Y>>>13,Y&=8191,Y+=g*D,Y+=O*b,Y+=j*(5*x),Y+=U*(5*B),Y+=c*(5*L),C+=Y>>>13,Y&=8191;var W=C;W+=w*L,W+=d*A,W+=l*m,W+=v*y,W+=S*a,C=W>>>13,W&=8191,W+=g*e,W+=O*D,W+=j*b,W+=U*(5*x),W+=c*(5*B),C+=W>>>13,W&=8191;var G=C;G+=w*B,G+=d*L,G+=l*A,G+=v*m,G+=S*y,C=G>>>13,G&=8191,G+=g*a,G+=O*e,G+=j*D,G+=U*b,G+=c*(5*x),C+=G>>>13,G&=8191;var V=C;V+=w*x,V+=d*B,V+=l*L,V+=v*A,V+=S*m,C=V>>>13,V&=8191,V+=g*y,V+=O*a,V+=j*e,V+=U*D,V+=c*b,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+R|0,R=C&8191,C=C>>>13,P+=C,w=R,d=P,l=I,v=H,S=K,g=z,O=Y,j=W,U=G,c=V,o+=16,s-=16}this._h[0]=w,this._h[1]=d,this._h[2]=l,this._h[3]=v,this._h[4]=S,this._h[5]=g,this._h[6]=O,this._h[7]=j,this._h[8]=U,this._h[9]=c},E.prototype.finish=function(u,o){o===void 0&&(o=0);var s=new Uint16Array(10),_,w,d,l;if(this._leftover){for(l=this._leftover,this._buffer[l++]=1;l<16;l++)this._buffer[l]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(_=this._h[1]>>>13,this._h[1]&=8191,l=2;l<10;l++)this._h[l]+=_,_=this._h[l]>>>13,this._h[l]&=8191;for(this._h[0]+=_*5,_=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=_,_=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=_,s[0]=this._h[0]+5,_=s[0]>>>13,s[0]&=8191,l=1;l<10;l++)s[l]=this._h[l]+_,_=s[l]>>>13,s[l]&=8191;for(s[9]-=8192,w=(_^1)-1,l=0;l<10;l++)s[l]&=w;for(w=~w,l=0;l<10;l++)this._h[l]=this._h[l]&w|s[l];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,l=1;l<8;l++)d=(this._h[l]+this._pad[l]|0)+(d>>>16)|0,this._h[l]=d&65535;return u[o+0]=this._h[0]>>>0,u[o+1]=this._h[0]>>>8,u[o+2]=this._h[1]>>>0,u[o+3]=this._h[1]>>>8,u[o+4]=this._h[2]>>>0,u[o+5]=this._h[2]>>>8,u[o+6]=this._h[3]>>>0,u[o+7]=this._h[3]>>>8,u[o+8]=this._h[4]>>>0,u[o+9]=this._h[4]>>>8,u[o+10]=this._h[5]>>>0,u[o+11]=this._h[5]>>>8,u[o+12]=this._h[6]>>>0,u[o+13]=this._h[6]>>>8,u[o+14]=this._h[7]>>>0,u[o+15]=this._h[7]>>>8,this._finished=!0,this},E.prototype.update=function(u){var o=0,s=u.length,_;if(this._leftover){_=16-this._leftover,_>s&&(_=s);for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[o+w];if(s-=_,o+=_,this._leftover+=_,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(_=s-s%16,this._blocks(u,o,_),o+=_,s-=_),s){for(var w=0;w<s;w++)this._buffer[this._leftover+w]=u[o+w];this._leftover+=s}return this},E.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},E.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},E}();t.Poly1305=i;function h(E,u){var o=new i(E);o.update(u);var s=o.digest();return o.clean(),s}t.oneTimeAuth=h;function f(E,u){return E.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:r.equal(E,u)}t.equal=f})(Te);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Rt,n=Te,i=Et,h=M,f=vt;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var E=new Uint8Array(16),u=function(){function o(s){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,s.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return o.prototype.seal=function(s,_,w,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var l=new Uint8Array(16);l.set(s,l.length-s.length);var v=new Uint8Array(32);r.stream(this._key,l,v,4);var S=_.length+this.tagLength,g;if(d){if(d.length!==S)throw new Error("ChaCha20Poly1305: incorrect destination length");g=d}else g=new Uint8Array(S);return r.streamXOR(this._key,l,_,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),v,g.subarray(0,g.length-this.tagLength),w),i.wipe(l),g},o.prototype.open=function(s,_,w,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(_.length<this.tagLength)return null;var l=new Uint8Array(16);l.set(s,l.length-s.length);var v=new Uint8Array(32);r.stream(this._key,l,v,4);var S=new Uint8Array(this.tagLength);if(this._authenticate(S,v,_.subarray(0,_.length-this.tagLength),w),!f.equal(S,_.subarray(_.length-this.tagLength,_.length)))return null;var g=_.length-this.tagLength,O;if(d){if(d.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(g);return r.streamXOR(this._key,l,_.subarray(0,_.length-this.tagLength),O,4),i.wipe(l),O},o.prototype.clean=function(){return i.wipe(this._key),this},o.prototype._authenticate=function(s,_,w,d){var l=new n.Poly1305(_);d&&(l.update(d),d.length%16>0&&l.update(E.subarray(d.length%16))),l.update(w),w.length%16>0&&l.update(E.subarray(w.length%16));var v=new Uint8Array(8);d&&h.writeUint64LE(d.length,v),l.update(v),h.writeUint64LE(w.length,v),l.update(v);for(var S=l.digest(),g=0;g<S.length;g++)s[g]=S[g];l.clean(),i.wipe(S),i.wipe(v)},o}();t.ChaCha20Poly1305=u})(ye);var Ne={},Ft={},ne={};Object.defineProperty(ne,"__esModule",{value:!0});function dr(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}ne.isSerializableHash=dr;Object.defineProperty(Ft,"__esModule",{value:!0});var bt=ne,Er=vt,br=Et,Me=function(){function t(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),bt.isSerializableHash(this._inner)&&bt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),br.wipe(i)}return t.prototype.reset=function(){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){bt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),bt.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(r){return this._inner.update(r),this},t.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},t.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},t.prototype.saveState=function(){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(r){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(r){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},t}();Ft.HMAC=Me;function vr(t,r,n){var i=new Me(t,r);i.update(n);var h=i.digest();return i.clean(),h}Ft.hmac=vr;Ft.equal=Er.equal;Object.defineProperty(Ne,"__esModule",{value:!0});var ue=Ft,oe=Et,wr=function(){function t(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var f=ue.hmac(this._hash,i,n);this._hmac=new ue.HMAC(r,f),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},t.prototype.clean=function(){this._hmac.clean(),oe.wipe(this._buffer),oe.wipe(this._counter),this._bufpos=0},t}(),gr=Ne.HKDF=wr,jt={},Pt={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.BrowserRandomSource=void 0;const fe=65536;class yr{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=fe)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,fe)));return n}}It.BrowserRandomSource=yr;var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.NodeRandomSource=void 0;const pr=Et;class Sr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Lt.commonjsRequire<"u"){const r=Lt.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,pr.wipe)(n),i}}Ht.NodeRandomSource=Sr;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SystemRandomSource=void 0;const mr=It,Cr=Ht;class Or{constructor(){if(this.isAvailable=!1,this.name="",this._source=new mr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Cr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Pt.SystemRandomSource=Or;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const r=Pt,n=M,i=Et;t.defaultRandomSource=new r.SystemRandomSource;function h(s,_=t.defaultRandomSource){return _.randomBytes(s)}t.randomBytes=h;function f(s=t.defaultRandomSource){const _=h(4,s),w=(0,n.readUint32LE)(_);return(0,i.wipe)(_),w}t.randomUint32=f;const E="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(s,_=E,w=t.defaultRandomSource){if(_.length<2)throw new Error("randomString charset is too short");if(_.length>256)throw new Error("randomString charset is too long");let d="";const l=_.length,v=256-256%l;for(;s>0;){const S=h(Math.ceil(s*256/v),w);for(let g=0;g<S.length&&s>0;g++){const O=S[g];O<v&&(d+=_.charAt(O%l),s--)}(0,i.wipe)(S)}return d}t.randomString=u;function o(s,_=E,w=t.defaultRandomSource){const d=Math.ceil(s/(Math.log(_.length)/Math.LN2));return u(d,_,w)}t.randomStringForEntropy=o})(jt);const Ur=Lt.getDefaultExportFromCjs(jt);var Le={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=M,n=Et;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},u.prototype.update=function(o,s){if(s===void 0&&(s=o.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var _=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=o[_++],s--;this._bufferLength===this.blockSize&&(f(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(_=f(this._temp,this._state,o,_,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=o[_++],s--;return this},u.prototype.finish=function(o){if(!this._finished){var s=this._bytesHashed,_=this._bufferLength,w=s/536870912|0,d=s<<3,l=s%64<56?64:128;this._buffer[_]=128;for(var v=_+1;v<l-8;v++)this._buffer[v]=0;r.writeUint32BE(w,this._buffer,l-8),r.writeUint32BE(d,this._buffer,l-4),f(this._temp,this._state,this._buffer,0,l),this._finished=!0}for(var v=0;v<this.digestLength/4;v++)r.writeUint32BE(this._state[v],o,v*4);return this},u.prototype.digest=function(){var o=new Uint8Array(this.digestLength);return this.finish(o),o},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(o){return this._state.set(o.state),this._bufferLength=o.bufferLength,o.buffer&&this._buffer.set(o.buffer),this._bytesHashed=o.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(o){n.wipe(o.state),o.buffer&&n.wipe(o.buffer),o.bufferLength=0,o.bytesHashed=0},u}();t.SHA256=i;var h=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function f(u,o,s,_,w){for(;w>=64;){for(var d=o[0],l=o[1],v=o[2],S=o[3],g=o[4],O=o[5],j=o[6],U=o[7],c=0;c<16;c++){var b=_+c*4;u[c]=r.readUint32BE(s,b)}for(var c=16;c<64;c++){var D=u[c-2],e=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=u[c-15];var a=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;u[c]=(e+u[c-7]|0)+(a+u[c-16]|0)}for(var c=0;c<64;c++){var e=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&O^~g&j)|0)+(U+(h[c]+u[c]|0)|0)|0,a=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&l^d&v^l&v)|0;U=j,j=O,O=g,g=S+e|0,S=v,v=l,l=d,d=e+a|0}o[0]+=d,o[1]+=l,o[2]+=v,o[3]+=S,o[4]+=g,o[5]+=O,o[6]+=j,o[7]+=U,_+=64,w-=64}return _}function E(u){var o=new i;o.update(u);var s=o.digest();return o.clean(),s}t.hash=E})(Le);var xe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const r=jt,n=Et;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(c){const b=new Float64Array(16);if(c)for(let D=0;D<c.length;D++)b[D]=c[D];return b}const h=new Uint8Array(32);h[0]=9;const f=i([56129,1]);function E(c){let b=1;for(let D=0;D<16;D++){let e=c[D]+b+65535;b=Math.floor(e/65536),c[D]=e-b*65536}c[0]+=b-1+37*(b-1)}function u(c,b,D){const e=~(D-1);for(let a=0;a<16;a++){const y=e&(c[a]^b[a]);c[a]^=y,b[a]^=y}}function o(c,b){const D=i(),e=i();for(let a=0;a<16;a++)e[a]=b[a];E(e),E(e),E(e);for(let a=0;a<2;a++){D[0]=e[0]-65517;for(let m=1;m<15;m++)D[m]=e[m]-65535-(D[m-1]>>16&1),D[m-1]&=65535;D[15]=e[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,u(e,D,1-y)}for(let a=0;a<16;a++)c[2*a]=e[a]&255,c[2*a+1]=e[a]>>8}function s(c,b){for(let D=0;D<16;D++)c[D]=b[2*D]+(b[2*D+1]<<8);c[15]&=32767}function _(c,b,D){for(let e=0;e<16;e++)c[e]=b[e]+D[e]}function w(c,b,D){for(let e=0;e<16;e++)c[e]=b[e]-D[e]}function d(c,b,D){let e,a,y=0,m=0,A=0,L=0,B=0,x=0,F=0,N=0,p=0,T=0,$=0,Z=0,J=0,X=0,C=0,R=0,P=0,I=0,H=0,K=0,z=0,Y=0,W=0,G=0,V=0,wt=0,St=0,Ot=0,Mt=0,Yt=0,ae=0,k=D[0],tt=D[1],et=D[2],rt=D[3],nt=D[4],it=D[5],at=D[6],ut=D[7],ot=D[8],ft=D[9],ht=D[10],st=D[11],ct=D[12],lt=D[13],Dt=D[14],_t=D[15];e=b[0],y+=e*k,m+=e*tt,A+=e*et,L+=e*rt,B+=e*nt,x+=e*it,F+=e*at,N+=e*ut,p+=e*ot,T+=e*ft,$+=e*ht,Z+=e*st,J+=e*ct,X+=e*lt,C+=e*Dt,R+=e*_t,e=b[1],m+=e*k,A+=e*tt,L+=e*et,B+=e*rt,x+=e*nt,F+=e*it,N+=e*at,p+=e*ut,T+=e*ot,$+=e*ft,Z+=e*ht,J+=e*st,X+=e*ct,C+=e*lt,R+=e*Dt,P+=e*_t,e=b[2],A+=e*k,L+=e*tt,B+=e*et,x+=e*rt,F+=e*nt,N+=e*it,p+=e*at,T+=e*ut,$+=e*ot,Z+=e*ft,J+=e*ht,X+=e*st,C+=e*ct,R+=e*lt,P+=e*Dt,I+=e*_t,e=b[3],L+=e*k,B+=e*tt,x+=e*et,F+=e*rt,N+=e*nt,p+=e*it,T+=e*at,$+=e*ut,Z+=e*ot,J+=e*ft,X+=e*ht,C+=e*st,R+=e*ct,P+=e*lt,I+=e*Dt,H+=e*_t,e=b[4],B+=e*k,x+=e*tt,F+=e*et,N+=e*rt,p+=e*nt,T+=e*it,$+=e*at,Z+=e*ut,J+=e*ot,X+=e*ft,C+=e*ht,R+=e*st,P+=e*ct,I+=e*lt,H+=e*Dt,K+=e*_t,e=b[5],x+=e*k,F+=e*tt,N+=e*et,p+=e*rt,T+=e*nt,$+=e*it,Z+=e*at,J+=e*ut,X+=e*ot,C+=e*ft,R+=e*ht,P+=e*st,I+=e*ct,H+=e*lt,K+=e*Dt,z+=e*_t,e=b[6],F+=e*k,N+=e*tt,p+=e*et,T+=e*rt,$+=e*nt,Z+=e*it,J+=e*at,X+=e*ut,C+=e*ot,R+=e*ft,P+=e*ht,I+=e*st,H+=e*ct,K+=e*lt,z+=e*Dt,Y+=e*_t,e=b[7],N+=e*k,p+=e*tt,T+=e*et,$+=e*rt,Z+=e*nt,J+=e*it,X+=e*at,C+=e*ut,R+=e*ot,P+=e*ft,I+=e*ht,H+=e*st,K+=e*ct,z+=e*lt,Y+=e*Dt,W+=e*_t,e=b[8],p+=e*k,T+=e*tt,$+=e*et,Z+=e*rt,J+=e*nt,X+=e*it,C+=e*at,R+=e*ut,P+=e*ot,I+=e*ft,H+=e*ht,K+=e*st,z+=e*ct,Y+=e*lt,W+=e*Dt,G+=e*_t,e=b[9],T+=e*k,$+=e*tt,Z+=e*et,J+=e*rt,X+=e*nt,C+=e*it,R+=e*at,P+=e*ut,I+=e*ot,H+=e*ft,K+=e*ht,z+=e*st,Y+=e*ct,W+=e*lt,G+=e*Dt,V+=e*_t,e=b[10],$+=e*k,Z+=e*tt,J+=e*et,X+=e*rt,C+=e*nt,R+=e*it,P+=e*at,I+=e*ut,H+=e*ot,K+=e*ft,z+=e*ht,Y+=e*st,W+=e*ct,G+=e*lt,V+=e*Dt,wt+=e*_t,e=b[11],Z+=e*k,J+=e*tt,X+=e*et,C+=e*rt,R+=e*nt,P+=e*it,I+=e*at,H+=e*ut,K+=e*ot,z+=e*ft,Y+=e*ht,W+=e*st,G+=e*ct,V+=e*lt,wt+=e*Dt,St+=e*_t,e=b[12],J+=e*k,X+=e*tt,C+=e*et,R+=e*rt,P+=e*nt,I+=e*it,H+=e*at,K+=e*ut,z+=e*ot,Y+=e*ft,W+=e*ht,G+=e*st,V+=e*ct,wt+=e*lt,St+=e*Dt,Ot+=e*_t,e=b[13],X+=e*k,C+=e*tt,R+=e*et,P+=e*rt,I+=e*nt,H+=e*it,K+=e*at,z+=e*ut,Y+=e*ot,W+=e*ft,G+=e*ht,V+=e*st,wt+=e*ct,St+=e*lt,Ot+=e*Dt,Mt+=e*_t,e=b[14],C+=e*k,R+=e*tt,P+=e*et,I+=e*rt,H+=e*nt,K+=e*it,z+=e*at,Y+=e*ut,W+=e*ot,G+=e*ft,V+=e*ht,wt+=e*st,St+=e*ct,Ot+=e*lt,Mt+=e*Dt,Yt+=e*_t,e=b[15],R+=e*k,P+=e*tt,I+=e*et,H+=e*rt,K+=e*nt,z+=e*it,Y+=e*at,W+=e*ut,G+=e*ot,V+=e*ft,wt+=e*ht,St+=e*st,Ot+=e*ct,Mt+=e*lt,Yt+=e*Dt,ae+=e*_t,y+=38*P,m+=38*I,A+=38*H,L+=38*K,B+=38*z,x+=38*Y,F+=38*W,N+=38*G,p+=38*V,T+=38*wt,$+=38*St,Z+=38*Ot,J+=38*Mt,X+=38*Yt,C+=38*ae,a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=x+a+65535,a=Math.floor(e/65536),x=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=p+a+65535,a=Math.floor(e/65536),p=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=x+a+65535,a=Math.floor(e/65536),x=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=p+a+65535,a=Math.floor(e/65536),p=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),c[0]=y,c[1]=m,c[2]=A,c[3]=L,c[4]=B,c[5]=x,c[6]=F,c[7]=N,c[8]=p,c[9]=T,c[10]=$,c[11]=Z,c[12]=J,c[13]=X,c[14]=C,c[15]=R}function l(c,b){d(c,b,b)}function v(c,b){const D=i();for(let e=0;e<16;e++)D[e]=b[e];for(let e=253;e>=0;e--)l(D,D),e!==2&&e!==4&&d(D,D,b);for(let e=0;e<16;e++)c[e]=D[e]}function S(c,b){const D=new Uint8Array(32),e=new Float64Array(80),a=i(),y=i(),m=i(),A=i(),L=i(),B=i();for(let p=0;p<31;p++)D[p]=c[p];D[31]=c[31]&127|64,D[0]&=248,s(e,b);for(let p=0;p<16;p++)y[p]=e[p];a[0]=A[0]=1;for(let p=254;p>=0;--p){const T=D[p>>>3]>>>(p&7)&1;u(a,y,T),u(m,A,T),_(L,a,m),w(a,a,m),_(m,y,A),w(y,y,A),l(A,L),l(B,a),d(a,m,a),d(m,y,L),_(L,a,m),w(a,a,m),l(y,a),w(m,A,B),d(a,m,f),_(a,a,A),d(m,m,a),d(a,A,B),d(A,y,e),l(y,L),u(a,y,T),u(m,A,T)}for(let p=0;p<16;p++)e[p+16]=a[p],e[p+32]=m[p],e[p+48]=y[p],e[p+64]=A[p];const x=e.subarray(32),F=e.subarray(16);v(x,x),d(F,F,x);const N=new Uint8Array(32);return o(N,F),N}t.scalarMult=S;function g(c){return S(c,h)}t.scalarMultBase=g;function O(c){if(c.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const b=new Uint8Array(c);return{publicKey:g(b),secretKey:b}}t.generateKeyPairFromSeed=O;function j(c){const b=(0,r.randomBytes)(32,c),D=O(b);return(0,n.wipe)(b),D}t.generateKeyPair=j;function U(c,b,D=!1){if(c.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const e=S(c,b);if(D){let a=0;for(let y=0;y<e.length;y++)a|=e[y];if(a===0)throw new Error("X25519: invalid shared key")}return e}t.sharedKey=U})(xe);function Ar(t,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<t.length;h++){var f=t.charAt(h),E=f.charCodeAt(0);if(n[E]!==255)throw new TypeError(f+" is ambiguous");n[E]=h}var u=t.length,o=t.charAt(0),s=Math.log(u)/Math.log(256),_=Math.log(256)/Math.log(u);function w(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";for(var S=0,g=0,O=0,j=v.length;O!==j&&v[O]===0;)O++,S++;for(var U=(j-O)*_+1>>>0,c=new Uint8Array(U);O!==j;){for(var b=v[O],D=0,e=U-1;(b!==0||D<g)&&e!==-1;e--,D++)b+=256*c[e]>>>0,c[e]=b%u>>>0,b=b/u>>>0;if(b!==0)throw new Error("Non-zero carry");g=D,O++}for(var a=U-g;a!==U&&c[a]===0;)a++;for(var y=o.repeat(S);a<U;++a)y+=t.charAt(c[a]);return y}function d(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;var S=0;if(v[S]!==" "){for(var g=0,O=0;v[S]===o;)g++,S++;for(var j=(v.length-S)*s+1>>>0,U=new Uint8Array(j);v[S];){var c=n[v.charCodeAt(S)];if(c===255)return;for(var b=0,D=j-1;(c!==0||b<O)&&D!==-1;D--,b++)c+=u*U[D]>>>0,U[D]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");O=b,S++}if(v[S]!==" "){for(var e=j-O;e!==j&&U[e]===0;)e++;for(var a=new Uint8Array(g+(j-e)),y=g;e!==j;)a[y++]=U[e++];return a}}}function l(v){var S=d(v);if(S)return S;throw new Error(`Non-${r} character`)}return{encode:w,decodeUnsafe:d,decode:l}}var Tr=Ar,Fr=Tr;const Nr=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Mr=t=>new TextEncoder().encode(t),Lr=t=>new TextDecoder().decode(t);class xr{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Br{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Be(this,r)}}class Rr{constructor(r){this.decoders=r}or(r){return Be(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Be=(t,r)=>new Rr({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}});class jr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new xr(r,n,i),this.decoder=new Br(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Kt=({name:t,prefix:r,encode:n,decode:i})=>new jr(t,r,n,i),Nt=({prefix:t,name:r,alphabet:n})=>{const{encode:i,decode:h}=Fr(n,r);return Kt({prefix:t,name:r,encode:i,decode:f=>Nr(h(f))})},Pr=(t,r,n,i)=>{const h={};for(let _=0;_<r.length;++_)h[r[_]]=_;let f=t.length;for(;t[f-1]==="=";)--f;const E=new Uint8Array(f*n/8|0);let u=0,o=0,s=0;for(let _=0;_<f;++_){const w=h[t[_]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);o=o<<n|w,u+=n,u>=8&&(u-=8,E[s++]=255&o>>u)}if(u>=n||255&o<<8-u)throw new SyntaxError("Unexpected end of data");return E},Ir=(t,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let f="",E=0,u=0;for(let o=0;o<t.length;++o)for(u=u<<8|t[o],E+=8;E>n;)E-=n,f+=r[h&u>>E];if(E&&(f+=r[h&u<<n-E]),i)for(;f.length*n&7;)f+="=";return f},Q=({name:t,prefix:r,bitsPerChar:n,alphabet:i})=>Kt({prefix:r,name:t,encode(h){return Ir(h,i,n)},decode(h){return Pr(h,i,n,t)}}),Hr=Kt({prefix:"\0",name:"identity",encode:t=>Lr(t),decode:t=>Mr(t)}),Kr=Object.freeze(Object.defineProperty({__proto__:null,identity:Hr},Symbol.toStringTag,{value:"Module"})),zr=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Yr=Object.freeze(Object.defineProperty({__proto__:null,base2:zr},Symbol.toStringTag,{value:"Module"})),Wr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),qr=Object.freeze(Object.defineProperty({__proto__:null,base8:Wr},Symbol.toStringTag,{value:"Module"})),Gr=Nt({prefix:"9",name:"base10",alphabet:"0123456789"}),$r=Object.freeze(Object.defineProperty({__proto__:null,base10:Gr},Symbol.toStringTag,{value:"Module"})),Vr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Jr=Object.freeze(Object.defineProperty({__proto__:null,base16:Vr,base16upper:Xr},Symbol.toStringTag,{value:"Module"})),Zr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tn=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),en=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rn=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nn=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),an=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),un=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),on=Object.freeze(Object.defineProperty({__proto__:null,base32:Zr,base32hex:en,base32hexpad:nn,base32hexpadupper:an,base32hexupper:rn,base32pad:kr,base32padupper:tn,base32upper:Qr,base32z:un},Symbol.toStringTag,{value:"Module"})),fn=Nt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hn=Nt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),sn=Object.freeze(Object.defineProperty({__proto__:null,base36:fn,base36upper:hn},Symbol.toStringTag,{value:"Module"})),cn=Nt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ln=Nt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:cn,base58flickr:ln},Symbol.toStringTag,{value:"Module"})),_n=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),dn=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),En=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),bn=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),vn=Object.freeze(Object.defineProperty({__proto__:null,base64:_n,base64pad:dn,base64url:En,base64urlpad:bn},Symbol.toStringTag,{value:"Module"})),Re=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),wn=Re.reduce((t,r,n)=>(t[n]=r,t),[]),gn=Re.reduce((t,r,n)=>(t[r.codePointAt(0)]=n,t),[]);function yn(t){return t.reduce((r,n)=>(r+=wn[n],r),"")}function pn(t){const r=[];for(const n of t){const i=gn[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const Sn=Kt({prefix:"🚀",name:"base256emoji",encode:yn,decode:pn}),mn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Sn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var je={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var h = Object.defineProperty;
|
|
2
2
|
var m = (i, e, t) => e in i ? h(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var o = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { a8 as w, c9 as g, cL as p, u, bR as l } from "./index-
|
|
5
|
-
import { A as f } from "./aptos-
|
|
4
|
+
import { a8 as w, c9 as g, cL as p, u, bR as l } from "./index-C2DCdxRC.mjs";
|
|
5
|
+
import { A as f } from "./aptos-CKPSmGSC.mjs";
|
|
6
6
|
class c {
|
|
7
7
|
constructor(e, t, r, s) {
|
|
8
8
|
o(this, "network");
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var uu = Object.defineProperty;
|
|
2
2
|
var du = (e, t, n) => t in e ? uu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ct = (e, t, n) => du(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { V as h, X as Ur, Y as lu, Z as tt, $ as ia, a0 as aa, aa as fi, a3 as hi, N as pi, o as mu, a8 as gi, p as fu, cX as hu, a6 as yi, cY as Qo, cZ as bi, c_ as vi, c$ as wi, d0 as ki, d1 as _i, d2 as Si, d3 as pu, d4 as gu, d5 as yu, bR as bu, a9 as vu } from "./index-
|
|
5
|
-
import { t as jt, l as wu, s as qr, a as Rs, c as ca, m as ku } from "./index-
|
|
6
|
-
import { b as _u, r as Su, a as ua, c as Pu, x as Bt, d as Au, e as Tu } from "./pako.esm-
|
|
7
|
-
import { r as Eu, a as Cu } from "./index-
|
|
8
|
-
import { k as Mu, a as Ou, b as ju, t as da, c as Bu, v as Ru, p as Iu, q as $u, d as Nu, e as Du, f as xu, g as la, h as Uu, i as qu, j as Hu, l as Vu, m as Fu, n as Wu, o as Ju, r as Gu, s as Hr, u as Lu, w as zu, x as Ku, y as Qu, z as Zu, A as Xu, B as Yu, D as ed, E as td, F as nd, H as rd, I as ma, J as od, K as sd, L as id, M as ad, N as cd, G as Nt, C as Zo } from "./cosmwasm-
|
|
9
|
-
import { CosmwasmWormholeCore as ud } from "./index-
|
|
10
|
-
import { c as dd, C as ld } from "./unsignedTransaction-
|
|
4
|
+
import { V as h, X as Ur, Y as lu, Z as tt, $ as ia, a0 as aa, aa as fi, a3 as hi, N as pi, o as mu, a8 as gi, p as fu, cX as hu, a6 as yi, cY as Qo, cZ as bi, c_ as vi, c$ as wi, d0 as ki, d1 as _i, d2 as Si, d3 as pu, d4 as gu, d5 as yu, bR as bu, a9 as vu } from "./index-C2DCdxRC.mjs";
|
|
5
|
+
import { t as jt, l as wu, s as qr, a as Rs, c as ca, m as ku } from "./index-D6u6ZlbM.mjs";
|
|
6
|
+
import { b as _u, r as Su, a as ua, c as Pu, x as Bt, d as Au, e as Tu } from "./pako.esm-C_3vjkSx.mjs";
|
|
7
|
+
import { r as Eu, a as Cu } from "./index-BvbKk4T6.mjs";
|
|
8
|
+
import { k as Mu, a as Ou, b as ju, t as da, c as Bu, v as Ru, p as Iu, q as $u, d as Nu, e as Du, f as xu, g as la, h as Uu, i as qu, j as Hu, l as Vu, m as Fu, n as Wu, o as Ju, r as Gu, s as Hr, u as Lu, w as zu, x as Ku, y as Qu, z as Zu, A as Xu, B as Yu, D as ed, E as td, F as nd, H as rd, I as ma, J as od, K as sd, L as id, M as ad, N as cd, G as Nt, C as Zo } from "./cosmwasm-CGolR9gL.mjs";
|
|
9
|
+
import { CosmwasmWormholeCore as ud } from "./index-BTS53_Aj.mjs";
|
|
10
|
+
import { c as dd, C as ld } from "./unsignedTransaction-CA2s3rKG.mjs";
|
|
11
11
|
function md(e) {
|
|
12
12
|
return e.id !== void 0 && e.pending !== void 0 && e.data !== void 0;
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var Vg = Object.defineProperty;
|
|
2
2
|
var Wg = (c, B, Q) => B in c ? Vg(c, B, { enumerable: !0, configurable: !0, writable: !0, value: Q }) : c[B] = Q;
|
|
3
3
|
var yr = (c, B, Q) => Wg(c, typeof B != "symbol" ? B + "" : B, Q);
|
|
4
|
-
import { V as le, Z as fA, aS as E2, $ as ya, a1 as Zg, ac as rs, aT as Yn, a0 as is, aU as as, aK as G2, X as os, aV as ns, aW as $g } from "./index-
|
|
5
|
-
import { s as Af, h as ef, u as tf, r as Y1, k as rf, a as ji, b as af } from "./utils-
|
|
6
|
-
import { r as of } from "./index-
|
|
7
|
-
import { a as nf, r as sf } from "./pako.esm-
|
|
4
|
+
import { V as le, Z as fA, aS as E2, $ as ya, a1 as Zg, ac as rs, aT as Yn, a0 as is, aU as as, aK as G2, X as os, aV as ns, aW as $g } from "./index-C2DCdxRC.mjs";
|
|
5
|
+
import { s as Af, h as ef, u as tf, r as Y1, k as rf, a as ji, b as af } from "./utils-OPA3b1An.mjs";
|
|
6
|
+
import { r as of } from "./index-BvbKk4T6.mjs";
|
|
7
|
+
import { a as nf, r as sf } from "./pako.esm-C_3vjkSx.mjs";
|
|
8
8
|
var cf = {}, Ti = {}, Sr = {}, di = {};
|
|
9
9
|
Object.defineProperty(di, "__esModule", { value: !0 });
|
|
10
10
|
di.utf8Write = di.utf8Read = di.utf8Length = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var b=(m,n,e)=>n in m?U(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e;var c=(m,n,e)=>b(m,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";var U=Object.defineProperty;var b=(m,n,e)=>n in m?U(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e;var c=(m,n,e)=>b(m,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BHGS0dw3.js");require("./index-Dpzov1Io.js");const N=new t.Interface(["function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)","function receiveMessageAndSwap(bytes)"]),W=new t.Interface(["function quoteExactInputSingle((address,address,uint256,uint24,uint160)) public view returns (uint256,uint160,uint32,uint256)"]),T=100,B="https://gfx.relayers.xlabs.xyz/api/v1/swap/quote",_="https://thermae.fly.dev/api/order/create";class R{static async createOrder(n,e,r,o,s,a,i,h){var d,p;try{const{minAmountStart:l,minAmountFinish:w}=i.swapAmounts,g=t.canonicalAddress(r),[u,f]=t.resolveWrappedToken(n,e,o),[A,E]=t.resolveWrappedToken(n,r.chain,a),v=t.canonicalAddress(f),k=t.canonicalAddress(E),C=t.portico.get(n,e).portico,S=t.portico.get(n,r.chain).portico,I=t.networkChainToNativeChainId.get(n,e),F=t.networkChainToNativeChainId.get(n,r.chain),x={startingChainId:Number(I),startingToken:v.toLowerCase(),destinationChainId:Number(F),destinationToken:k.toLowerCase(),destinationAddress:g,porticoAddress:C,destinationPorticoAddress:S,startingTokenAmount:s.toString(),minAmountStart:l.toString(),minAmountEnd:w.toString(),bridgeNonce:h,relayerFee:i.relayerFee.toString(),feeTierStart:T,feeTierEnd:T,shouldWrapNative:u,shouldUnwrapNative:A},P=await t.axios.post(_,x);return this.validateCreateOrderResponse(P.data,x),P.data}catch(l){if(t.axios.isAxiosError(l)){const w=`${(d=l.response)==null?void 0:d.statusText}: ${(p=l.response)==null?void 0:p.data.message}`;throw new Error(`Could not create order: ${w},`)}throw l}}static async quoteRelayer(n,e,r){var h;if(t.isNative(e)||t.isNative(r))throw new Error("how did you get here tho?");const o=t.hex.encode(e.toUniversalAddress().toUint8Array(),!1),s=t.hex.encode(r.toUniversalAddress().toUint8Array(),!1),i={targetChain:t.toChainId(n),sourceToken:o,targetToken:s};try{const d=await t.axios.post(B,i);return BigInt(d.data.fee)}catch(d){throw t.axios.isAxiosError(d)?new Error(`Error getting relayer fee: ${(h=d.response)==null?void 0:h.statusText}`):d}}}c(R,"validateCreateOrderResponse",(n,e)=>{if(!t.isEqualCaseInsensitive(e.porticoAddress||"",n.transactionTarget))throw new Error("portico address mismatch");const r=N.decodeFunctionData("start",n.transactionData);if(r.length!==1||r[0].length!==10)throw new Error("decoded length mismatch");const o=t.hex.decode(r[0][0]);if(o.length!==32)throw new Error("flag set length mismatch");const{recipientChain:s,feeTierStart:a,feeTierFinish:i,flags:h}=t.PorticoBridge.deserializeFlagSet(o),{shouldWrapNative:d,shouldUnwrapNative:p}=h,[l,w]=t.platformNativeChainIdToNetworkChain("Evm",BigInt(e.destinationChainId));if(s!==t.toChainId(w))throw new Error("recipient chain mismatch");if(a!==e.feeTierStart)throw new Error("fee tier start mismatch");if(i!==e.feeTierEnd)throw new Error("fee tier end mismatch");if(!!d!==e.shouldWrapNative)throw new Error("should wrap native mismatch");if(!!p!==e.shouldUnwrapNative)throw new Error("should unwrap native mismatch");const g=r[0][1];if(!t.isEqualCaseInsensitive(g,e.startingToken))throw new Error("start token address mismatch");const u=r[0][3];if(!t.isEqualCaseInsensitive(u,e.destinationToken))throw new Error("final token address mismatch");const f=r[0][4];if(!t.isEqualCaseInsensitive(f,e.destinationAddress))throw new Error("recipient address mismatch");const A=r[0][5];if(!t.isEqualCaseInsensitive(A,e.destinationPorticoAddress||""))throw new Error("destination portico address mismatch");if(r[0][6].toString()!==e.startingTokenAmount)throw new Error("amount mismatch");if(r[0][7].toString()!==e.minAmountStart)throw new Error("min amount start mismatch");if(r[0][8].toString()!==e.minAmountEnd)throw new Error("min amount finish mismatch");if(r[0][9].toString()!==e.relayerFee)throw new Error("relayer fee mismatch")});class y{constructor(n,e,r,o){c(this,"network");c(this,"chain");c(this,"provider");c(this,"contracts");c(this,"chainId");c(this,"porticoAddress");c(this,"uniswapAddress");c(this,"porticoContract");c(this,"uniswapContract");c(this,"core");if(this.network=n,this.chain=e,this.provider=r,this.contracts=o,!o.portico)throw new Error("Unsupported chain, no contract addresses for: "+e);this.core=new t.EvmWormholeCore(n,e,r,o);const{portico:s,uniswapQuoterV2:a}=o.portico;this.porticoAddress=s,this.uniswapAddress=a,this.chainId=t.networkChainToNativeChainId.get(n,e),this.porticoContract=new t.Contract(this.porticoAddress,N.fragments,this.provider),this.uniswapContract=new t.Contract(this.uniswapAddress,W.fragments,this.provider)}static async fromRpc(n,e){const[r,o]=await t.EvmPlatform.chainFromRpc(n),s=e[o];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new y(r,o,n,s.contracts)}async*transfer(n,e,r,o,s,a){const{minAmountStart:i,minAmountFinish:h}=a.swapAmounts;if(i===0n)throw new Error("Invalid min swap amount");if(h===0n)throw new Error("Invalid min swap amount");const d=new t.EvmAddress(n).toString(),[p,l]=t.resolveWrappedToken(this.network,this.chain,r),[w,g]=t.resolveWrappedToken(this.network,e.chain,s),u=t.canonicalAddress(l),f=t.canonicalAddress(this.getTransferrableToken(u)),A=t.canonicalAddress(e),E=t.canonicalAddress(g),v=t.portico.get(this.network,e.chain).portico,k=new Date().valueOf()%2**4,C=t.PorticoBridge.serializeFlagSet({flags:{shouldWrapNative:p,shouldUnwrapNative:w},recipientChain:t.toChainId(e.chain),bridgeNonce:k,feeTierStart:T,feeTierFinish:T,padding:new Uint8Array(19)}),S=N.encodeFunctionData("start",[[C,u.toLowerCase(),f,E.toLowerCase(),A,v,o.toString(),i.toString(),h.toString(),a.relayerFee.toString()]]);p||(yield*this.approve(u,d,o,this.porticoAddress));const I=await this.core.getMessageFee(),F={to:this.porticoAddress,data:S,value:I+(p?o:0n)};yield this.createUnsignedTransaction(t.addFrom(F,d),"PorticoBridge.Transfer")}async*redeem(n,e){const r=await this.porticoContract.getFunction("receiveMessageAndSwap").populateTransaction(t.serialize(e)),o=new t.EvmAddress(n).toString();yield this.createUnsignedTransaction(t.addFrom(r,o),"PorticoBridge.Redeem")}async quoteSwap(n,e,r){const[,o]=t.resolveWrappedToken(this.network,this.chain,n),[,s]=t.resolveWrappedToken(this.network,this.chain,e),a=t.canonicalAddress(o),i=t.canonicalAddress(s);return t.isEqualCaseInsensitive(a,i)?r:(await this.uniswapContract.getFunction("quoteExactInputSingle").staticCall([a,i,r,T,0]))[0]}async quoteRelay(n,e){return await R.quoteRelayer(this.chain,n,e)}getTransferrableToken(n){var o;if(this.chain==="Ethereum")return t.Wormhole.tokenId("Ethereum",n);const e=t.getTokenByAddress(this.network,this.chain,n);if(!e)throw new Error("Unsupported source token: "+n);const r=(o=t.getTokensBySymbol(this.network,this.chain,e.symbol))==null?void 0:o.find(s=>s.original==="Ethereum");if(!r)throw new Error(`Unsupported symbol for chain ${e.symbol}: ${this.chain} `);return t.Wormhole.tokenId(r.chain,r.address)}async*approve(n,e,r,o){const s=t.EvmPlatform.getTokenImplementation(this.provider,n);if(await s.allowance(e,o)<r){const i=await s.approve.populateTransaction(o,r);yield this.createUnsignedTransaction(t.addFrom(i,e),"PorticoBridge.Approve")}}createUnsignedTransaction(n,e){return new t.EvmUnsignedTransaction(t.addChainId(n,this.chainId),this.network,this.chain,e,!1)}}t.registerProtocol(t._platform,"PorticoBridge",y);exports.EvmPorticoBridge=y;
|