@wormhole-foundation/wormhole-connect 0.3.0-beta.0-development → 0.3.0-beta.1-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.
Files changed (61) hide show
  1. package/dist/assets/{aptos-pA6KZbBw.js → aptos--cRgJxLv.js} +1 -1
  2. package/dist/assets/ccip-nIi_p4zM.js +1 -0
  3. package/dist/assets/{cosmos-f5FpVoIT.js → cosmos-RixGz7q4.js} +1 -1
  4. package/dist/assets/{evm-Wgv0qkFH.js → evm-5aZ11sr9.js} +4 -4
  5. package/dist/assets/{index-asOtxns8.js → index-37oU2-By.js} +1 -1
  6. package/dist/assets/{index-hhU5j-34.js → index-LeHe4Gjj.js} +1 -1
  7. package/dist/assets/index-XtkoMMyw.js +7 -0
  8. package/dist/assets/index-bti7uInf.js +3 -0
  9. package/dist/assets/{index.es-0VUWq9QB.js → index.es--jOuZ4lh.js} +1 -1
  10. package/dist/assets/index.es-00radgcV.js +20 -0
  11. package/dist/assets/{index.es-4E5PqK_f.js → index.es-Pqf6uo9-.js} +3 -3
  12. package/dist/assets/libsodium-wrappers-XgohdhTj.js +1 -0
  13. package/dist/assets/{sei-M2rZ9ku5.js → sei-J78VkMVQ.js} +1 -1
  14. package/dist/assets/solana-3ev6kIv7.js +7 -0
  15. package/dist/assets/{solanaEmbed.esm-1Awe9a4x.js → solanaEmbed.esm-bag_3ej_.js} +1 -1
  16. package/dist/assets/{sui-7olk-qLk.js → sui-4vLtme4F.js} +1 -1
  17. package/dist/{assets/main-wVJAa1zx.js → main.js} +6 -6
  18. package/lib/{aptos-SE9xL6YR.mjs → aptos-AEDvNZW0.mjs} +1 -1
  19. package/lib/{aptos-HrKTgRXj.js → aptos-E_bmP-uH.js} +1 -1
  20. package/lib/{ccip-LevZMjhC.mjs → ccip-DgqxzCnp.mjs} +3 -3
  21. package/lib/{ccip-7BoLGyzE.js → ccip-x_5dfOyY.js} +1 -1
  22. package/lib/{cosmos-bi1xqrBB.mjs → cosmos-iL7Lphnv.mjs} +3 -3
  23. package/lib/{cosmos-RRozAQR1.js → cosmos-rBSbdATY.js} +1 -1
  24. package/lib/{evm-DpTGe1xN.js → evm-U8W0wnAS.js} +3 -3
  25. package/lib/{evm-hEWYh88n.mjs → evm-u33uO5mU.mjs} +4 -4
  26. package/lib/{index-fNBspXvL.mjs → index-HeJJ4ioY.mjs} +68 -68
  27. package/lib/{index-z6KdZ90O.mjs → index-IOv_IOHh.mjs} +1 -1
  28. package/lib/{index-gMv8O7x8.js → index-KI5CF8KC.js} +1 -1
  29. package/lib/{index-k3HwxTc6.js → index-Kg2IYkKj.js} +1 -1
  30. package/lib/{index-ff22c93m.js → index-PeRFKzot.js} +1 -1
  31. package/lib/{index-GybMpL7C.mjs → index-SGYq0qf1.mjs} +76 -74
  32. package/lib/{index-mo8HavDi.mjs → index-ej1vfGal.mjs} +2 -2
  33. package/lib/{index-QFolrIvD.js → index-jKol2sI7.js} +5 -5
  34. package/lib/index-nGC6YonD.js +3 -0
  35. package/lib/{index-z37Kqbxx.mjs → index-wrVsD6xr.mjs} +3 -3
  36. package/lib/{index.es-674v5fkD.js → index.es-4MsJTigr.js} +1 -1
  37. package/lib/{index.es-eijvlXbt.mjs → index.es-5no8HiJc.mjs} +4 -4
  38. package/lib/{index.es-LLujoQUP.js → index.es-60zy5kS0.js} +2 -2
  39. package/lib/{index.es-OZG9h1DE.mjs → index.es-FiIhT_0D.mjs} +1 -1
  40. package/lib/{index.es-5GouFA6T.mjs → index.es-YhzlyIL4.mjs} +2 -2
  41. package/lib/{index.es-i-lckTCE.js → index.es-vu-DHGhE.js} +1 -1
  42. package/lib/index.js +1 -1
  43. package/lib/index.mjs +1 -1
  44. package/lib/{libsodium-wrappers-5vjrjBSO.js → libsodium-wrappers-GC2qwMrd.js} +1 -1
  45. package/lib/{libsodium-wrappers-5Q5SB8Ev.mjs → libsodium-wrappers-ziNSE4zr.mjs} +1 -1
  46. package/lib/{sei-vPR2n1Y7.mjs → sei-Xk3hWtbl.mjs} +2 -2
  47. package/lib/{sei-NOgRpGt3.js → sei-zCfp2In3.js} +1 -1
  48. package/lib/{solana-Hqom8lV9.mjs → solana-3u6kb1G_.mjs} +3 -3
  49. package/lib/{solana-94sTiU-X.js → solana-lpXIOlL5.js} +1 -1
  50. package/lib/{solanaEmbed.esm-glCRh6tR.mjs → solanaEmbed.esm-93QbCbVq.mjs} +2 -2
  51. package/lib/{solanaEmbed.esm-tZxVLSLJ.js → solanaEmbed.esm-e2SOktqM.js} +1 -1
  52. package/lib/{sui-82tI9UDL.mjs → sui-BylAbrsX.mjs} +1 -1
  53. package/lib/{sui-lIzqq8QP.js → sui-O_R5r4YX.js} +1 -1
  54. package/package.json +1 -1
  55. package/dist/assets/ccip-u26S4Hov.js +0 -1
  56. package/dist/assets/index--x31VXme.js +0 -3
  57. package/dist/assets/index-3iD33HDP.js +0 -7
  58. package/dist/assets/index.es-DkxB7tN9.js +0 -20
  59. package/dist/assets/libsodium-wrappers-1pBdIONR.js +0 -1
  60. package/dist/assets/solana-6MSMmp1N.js +0 -7
  61. package/lib/index-TETuoXKR.js +0 -3
@@ -1,4 +1,4 @@
1
- import { g as Ut, ag as t, ah as S, ai as n, aj as j, ak as A, al as ue, am as v, an as p, ao as d, ap as a, aq as J, ar as Me, as as at, at as c, au as x, av as le, aw as H, W as Gt, c as Fe, ax as Qt, ay as Je, N as Yt, B as Ne } from "./index-GybMpL7C.mjs";
1
+ import { g as Ut, ag as t, ah as S, ai as n, aj as j, ak as A, al as ue, am as v, an as p, ao as d, ap as a, aq as J, ar as Me, as as at, at as c, au as x, av as le, aw as H, W as Gt, c as Fe, ax as Qt, ay as Je, N as Yt, B as Ne } from "./index-SGYq0qf1.mjs";
2
2
  import { g as ot, R as Zt } from "./wallets-XPPz8jCP.mjs";
3
3
  import "react";
4
4
  function Rt(i) {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-QFolrIvD.js"),ye=require("./wallets-dYYjlQ6_.js");require("react");function pt(i){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<i.length;n++){var s=i.charAt(n),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=n}var g=i.length,u=i.charAt(0),o=Math.log(g)/Math.log(256),c=Math.log(256)/Math.log(g);function A(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,N=0,y=0,p=l.length;y!==p&&l[y]===0;)y++,d++;for(var D=(p-y)*c+1>>>0,T=new Uint8Array(D);y!==p;){for(var z=l[y],B=0,h=D-1;(z!==0||B<N)&&h!==-1;h--,B++)z+=256*T[h]>>>0,T[h]=z%g>>>0,z=z/g>>>0;if(z!==0)throw new Error("Non-zero carry");N=B,y++}for(var O=D-N;O!==D&&T[O]===0;)O++;for(var $=u.repeat(d);O<D;++O)$+=i.charAt(T[O]);return $}function j(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;for(var d=0,N=0,y=0;l[d]===u;)N++,d++;for(var p=(l.length-d)*o+1>>>0,D=new Uint8Array(p);l[d];){var T=t[l.charCodeAt(d)];if(T===255)return;for(var z=0,B=p-1;(T!==0||z<y)&&B!==-1;B--,z++)T+=g*D[B]>>>0,D[B]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");y=z,d++}for(var h=p-y;h!==p&&D[h]===0;)h++;for(var O=new Uint8Array(N+(p-h)),$=N;h!==p;)O[$++]=D[h++];return O}function I(l){var d=j(l);if(d)return d;throw new Error("Non-base"+g+" character")}return{encode:A,decodeUnsafe:j,decode:I}}var Tt=pt;const Dt=Tt,bt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var St=Dt(bt);const Re=e.getDefaultExportFromCjs(St);function Lt(i){return i>64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function re(i,t){for(var r=i.replace(/[^A-Za-z0-9+/]/g,""),n=r.length,s=t?Math.ceil((n*3+1>>2)/t)*t:n*3+1>>2,a=new Uint8Array(s),g,u,o=0,c=0,A=0;A<n;A++)if(u=A&3,o|=Lt(r.charCodeAt(A))<<6*(3-u),u===3||n-A===1){for(g=0;g<3&&c<s;g++,c++)a[c]=o>>>(16>>>g&24)&255;o=0}return a}function ee(i){return i<26?i+65:i<52?i+71:i<62?i-4:i===62?43:i===63?47:65}function q(i){for(var t=2,r="",n=i.length,s=0,a=0;a<n;a++)t=a%3,s|=i[a]<<(16>>>t&24),(t===2||i.length-a===1)&&(r+=String.fromCodePoint(ee(s>>>18&63),ee(s>>>12&63),ee(s>>>6&63),ee(s&63)),s=0);return r.slice(0,r.length-2+t)+(t===2?"":t===1?"=":"==")}function de(i){var s;const t=i.startsWith("0x")?i.slice(2):i,n=((s=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:s.map(a=>parseInt(a,16)))??[];return Uint8Array.from(n)}function Ne(i){return i.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}var mt=32;function ne(i,t){let r=new Uint8Array(t),n=0;for(;i>0;)r[n]=Number(i%BigInt(256)),i=i/BigInt(256),n+=1;return r}var We=i=>Re.encode(i),Ve=i=>Re.decode(i),ht=class{constructor(i){this.bytePosition=0,this.dataView=new DataView(i.buffer)}shift(i){return this.bytePosition+=i,this}read8(){let i=this.dataView.getUint8(this.bytePosition);return this.shift(1),i}read16(){let i=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),i}read32(){let i=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),i}read64(){let i=this.read32(),r=this.read32().toString(16)+i.toString(16).padStart(8,"0");return BigInt("0x"+r).toString(10)}read128(){let i=BigInt(this.read64()),r=BigInt(this.read64()).toString(16)+i.toString(16).padStart(16,"0");return BigInt("0x"+r).toString(10)}read256(){let i=BigInt(this.read128()),r=BigInt(this.read128()).toString(16)+i.toString(16).padStart(32,"0");return BigInt("0x"+r).toString(10)}readBytes(i){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t,i);return this.shift(i),r}readULEB(){let i=this.bytePosition+this.dataView.byteOffset,t=new Uint8Array(this.dataView.buffer,i),{value:r,length:n}=Ct(t);return this.shift(n),r}readVec(i){let t=this.readULEB(),r=[];for(let n=0;n<t;n++)r.push(i(this,n,t));return r}},wt=class{constructor({size:i=1024,maxSize:t,allocateSize:r=1024}={}){this.bytePosition=0,this.size=i,this.maxSize=t||i,this.allocateSize=r,this.dataView=new DataView(new ArrayBuffer(i))}ensureSizeOrGrow(i){const t=this.bytePosition+i;if(t>this.size){const r=Math.min(this.maxSize,this.size+this.allocateSize);if(t>r)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=r;const n=new ArrayBuffer(this.size);new Uint8Array(n).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(n)}}shift(i){return this.bytePosition+=i,this}write8(i){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(i)),this.shift(1)}write16(i){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(i),!0),this.shift(2)}write32(i){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(i),!0),this.shift(4)}write64(i){return ne(BigInt(i),8).forEach(t=>this.write8(t)),this}write128(i){return ne(BigInt(i),16).forEach(t=>this.write8(t)),this}write256(i){return ne(BigInt(i),32).forEach(t=>this.write8(t)),this}writeULEB(i){return Et(i).forEach(t=>this.write8(t)),this}writeVec(i,t){return this.writeULEB(i.length),Array.from(i).forEach((r,n)=>t(this,r,n,i.length)),this}*[Symbol.iterator](){for(let i=0;i<this.bytePosition;i++)yield this.dataView.getUint8(i);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(i){return zt(this.toBytes(),i)}};function Et(i){let t=[],r=0;if(i===0)return[0];for(;i>0;)t[r]=i&127,(i>>=7)&&(t[r]|=128),r+=1;return t}function Ct(i){let t=0,r=0,n=0;for(;;){let s=i[n];if(n+=1,t|=(s&127)<<r,!(s&128))break;r+=7}return{value:t,length:n}}var L=class X{constructor(t){if(this.types=new Map,this.counter=0,t instanceof X){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(X.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let r of Object.keys(t.types.structs))this.registerStructType(r,t.types.structs[r]);if(t.types&&t.types.enums)for(let r of Object.keys(t.types.enums))this.registerEnumType(r,t.types.enums[r]);if(t.types&&t.types.aliases)for(let r of Object.keys(t.types.aliases))this.registerAlias(r,t.types.aliases[r]);t.withPrimitives!==!1&&xt(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,r,n){if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).encode(this,r,n,a)}if(typeof t=="object"){const s=this.tempKey();return new X(this).registerStructType(s,t).ser(s,r,n)}throw new Error(`Incorrect type passed into the '.ser()' function.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-jKol2sI7.js"),ye=require("./wallets-dYYjlQ6_.js");require("react");function pt(i){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<i.length;n++){var s=i.charAt(n),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=n}var g=i.length,u=i.charAt(0),o=Math.log(g)/Math.log(256),c=Math.log(256)/Math.log(g);function A(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,N=0,y=0,p=l.length;y!==p&&l[y]===0;)y++,d++;for(var D=(p-y)*c+1>>>0,T=new Uint8Array(D);y!==p;){for(var z=l[y],B=0,h=D-1;(z!==0||B<N)&&h!==-1;h--,B++)z+=256*T[h]>>>0,T[h]=z%g>>>0,z=z/g>>>0;if(z!==0)throw new Error("Non-zero carry");N=B,y++}for(var O=D-N;O!==D&&T[O]===0;)O++;for(var $=u.repeat(d);O<D;++O)$+=i.charAt(T[O]);return $}function j(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;for(var d=0,N=0,y=0;l[d]===u;)N++,d++;for(var p=(l.length-d)*o+1>>>0,D=new Uint8Array(p);l[d];){var T=t[l.charCodeAt(d)];if(T===255)return;for(var z=0,B=p-1;(T!==0||z<y)&&B!==-1;B--,z++)T+=g*D[B]>>>0,D[B]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");y=z,d++}for(var h=p-y;h!==p&&D[h]===0;)h++;for(var O=new Uint8Array(N+(p-h)),$=N;h!==p;)O[$++]=D[h++];return O}function I(l){var d=j(l);if(d)return d;throw new Error("Non-base"+g+" character")}return{encode:A,decodeUnsafe:j,decode:I}}var Tt=pt;const Dt=Tt,bt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var St=Dt(bt);const Re=e.getDefaultExportFromCjs(St);function Lt(i){return i>64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function re(i,t){for(var r=i.replace(/[^A-Za-z0-9+/]/g,""),n=r.length,s=t?Math.ceil((n*3+1>>2)/t)*t:n*3+1>>2,a=new Uint8Array(s),g,u,o=0,c=0,A=0;A<n;A++)if(u=A&3,o|=Lt(r.charCodeAt(A))<<6*(3-u),u===3||n-A===1){for(g=0;g<3&&c<s;g++,c++)a[c]=o>>>(16>>>g&24)&255;o=0}return a}function ee(i){return i<26?i+65:i<52?i+71:i<62?i-4:i===62?43:i===63?47:65}function q(i){for(var t=2,r="",n=i.length,s=0,a=0;a<n;a++)t=a%3,s|=i[a]<<(16>>>t&24),(t===2||i.length-a===1)&&(r+=String.fromCodePoint(ee(s>>>18&63),ee(s>>>12&63),ee(s>>>6&63),ee(s&63)),s=0);return r.slice(0,r.length-2+t)+(t===2?"":t===1?"=":"==")}function de(i){var s;const t=i.startsWith("0x")?i.slice(2):i,n=((s=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:s.map(a=>parseInt(a,16)))??[];return Uint8Array.from(n)}function Ne(i){return i.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}var mt=32;function ne(i,t){let r=new Uint8Array(t),n=0;for(;i>0;)r[n]=Number(i%BigInt(256)),i=i/BigInt(256),n+=1;return r}var We=i=>Re.encode(i),Ve=i=>Re.decode(i),ht=class{constructor(i){this.bytePosition=0,this.dataView=new DataView(i.buffer)}shift(i){return this.bytePosition+=i,this}read8(){let i=this.dataView.getUint8(this.bytePosition);return this.shift(1),i}read16(){let i=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),i}read32(){let i=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),i}read64(){let i=this.read32(),r=this.read32().toString(16)+i.toString(16).padStart(8,"0");return BigInt("0x"+r).toString(10)}read128(){let i=BigInt(this.read64()),r=BigInt(this.read64()).toString(16)+i.toString(16).padStart(16,"0");return BigInt("0x"+r).toString(10)}read256(){let i=BigInt(this.read128()),r=BigInt(this.read128()).toString(16)+i.toString(16).padStart(32,"0");return BigInt("0x"+r).toString(10)}readBytes(i){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t,i);return this.shift(i),r}readULEB(){let i=this.bytePosition+this.dataView.byteOffset,t=new Uint8Array(this.dataView.buffer,i),{value:r,length:n}=Ct(t);return this.shift(n),r}readVec(i){let t=this.readULEB(),r=[];for(let n=0;n<t;n++)r.push(i(this,n,t));return r}},wt=class{constructor({size:i=1024,maxSize:t,allocateSize:r=1024}={}){this.bytePosition=0,this.size=i,this.maxSize=t||i,this.allocateSize=r,this.dataView=new DataView(new ArrayBuffer(i))}ensureSizeOrGrow(i){const t=this.bytePosition+i;if(t>this.size){const r=Math.min(this.maxSize,this.size+this.allocateSize);if(t>r)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=r;const n=new ArrayBuffer(this.size);new Uint8Array(n).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(n)}}shift(i){return this.bytePosition+=i,this}write8(i){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(i)),this.shift(1)}write16(i){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(i),!0),this.shift(2)}write32(i){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(i),!0),this.shift(4)}write64(i){return ne(BigInt(i),8).forEach(t=>this.write8(t)),this}write128(i){return ne(BigInt(i),16).forEach(t=>this.write8(t)),this}write256(i){return ne(BigInt(i),32).forEach(t=>this.write8(t)),this}writeULEB(i){return Et(i).forEach(t=>this.write8(t)),this}writeVec(i,t){return this.writeULEB(i.length),Array.from(i).forEach((r,n)=>t(this,r,n,i.length)),this}*[Symbol.iterator](){for(let i=0;i<this.bytePosition;i++)yield this.dataView.getUint8(i);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(i){return zt(this.toBytes(),i)}};function Et(i){let t=[],r=0;if(i===0)return[0];for(;i>0;)t[r]=i&127,(i>>=7)&&(t[r]|=128),r+=1;return t}function Ct(i){let t=0,r=0,n=0;for(;;){let s=i[n];if(n+=1,t|=(s&127)<<r,!(s&128))break;r+=7}return{value:t,length:n}}var L=class X{constructor(t){if(this.types=new Map,this.counter=0,t instanceof X){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(X.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let r of Object.keys(t.types.structs))this.registerStructType(r,t.types.structs[r]);if(t.types&&t.types.enums)for(let r of Object.keys(t.types.enums))this.registerEnumType(r,t.types.enums[r]);if(t.types&&t.types.aliases)for(let r of Object.keys(t.types.aliases))this.registerAlias(r,t.types.aliases[r]);t.withPrimitives!==!1&&xt(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,r,n){if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).encode(this,r,n,a)}if(typeof t=="object"){const s=this.tempKey();return new X(this).registerStructType(s,t).ser(s,r,n)}throw new Error(`Incorrect type passed into the '.ser()' function.
2
2
  ${JSON.stringify(t)}`)}de(t,r,n){if(typeof r=="string")if(n)r=ft(r,n);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).decode(this,r,a)}if(typeof t=="object"){const s=new X(this),a=this.tempKey();return s.registerStructType(a,t).de(a,r,n)}throw new Error(`Incorrect type passed into the '.de()' function.
3
3
  ${JSON.stringify(t)}`)}hasType(t){return this.types.has(t)}registerAlias(t,r){return this.types.set(t,r),this}registerType(t,r,n,s=()=>!0){const{name:a,params:g}=this.parseTypeName(t);return this.types.set(a,{encode(u,o,c,A){const j=g.reduce((I,l,d)=>Object.assign(I,{[l]:A[d]}),{});return this._encodeRaw.call(u,new wt(c),o,A,j)},decode(u,o,c){const A=g.reduce((j,I,l)=>Object.assign(j,{[I]:c[l]}),{});return this._decodeRaw.call(u,new ht(o),c,A)},_encodeRaw(u,o,c,A){if(s(o))return r.call(this,u,o,c,A);throw new Error(`Validation failed for type ${a}, data: ${o}`)},_decodeRaw(u,o,c){return n.call(this,u,o,c)}}),this}registerAddressType(t,r,n="hex"){switch(n){case"base64":return this.registerType(t,function(a,g){return re(g).reduce((u,o)=>u.write8(o),a)},function(a){return q(a.readBytes(r))});case"hex":return this.registerType(t,function(a,g){return de(g).reduce((u,o)=>u.write8(o),a)},function(a){return Ne(a.readBytes(r))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(t){let{name:r,params:n}=this.parseTypeName(t);if(n.length>1)throw new Error("Vector can have only one type parameter; got "+r);return this.registerType(t,function(a,g,u,o){return a.writeVec(g,(c,A)=>{let j=u[0];if(!j)throw new Error(`Incorrect number of type parameters passed a to vector '${t}'`);let{name:I,params:l}=this.parseTypeName(j);if(this.hasType(I))return this.getTypeInterface(I)._encodeRaw.call(this,c,A,l,o);if(!(I in o))throw new Error(`Unable to find a matching type definition for ${I} in vector; make sure you passed a generic`);let{name:d,params:N}=this.parseTypeName(o[I]);return this.getTypeInterface(d)._encodeRaw.call(this,c,A,N,o)})},function(a,g,u){return a.readVec(o=>{let c=g[0];if(!c)throw new Error(`Incorrect number of type parameters passed to a vector '${t}'`);let{name:A,params:j}=this.parseTypeName(c);if(this.hasType(A))return this.getTypeInterface(A)._decodeRaw.call(this,o,j,u);if(!(A in u))throw new Error(`Unable to find a matching type definition for ${A} in vector; make sure you passed a generic`);let{name:I,params:l}=this.parseTypeName(u[A]);return this.getTypeInterface(I)._decodeRaw.call(this,o,l,u)})})}registerStructType(t,r){for(let u in r){let o=this.tempKey(),c=r[u];!Array.isArray(c)&&typeof c!="string"&&(r[u]=o,this.registerStructType(o,c))}let n=Object.freeze(r),s=Object.keys(n),{name:a,params:g}=this.parseTypeName(t);return this.registerType(t,function(o,c,A,j){if(!c||c.constructor!==Object)throw new Error(`Expected ${a} to be an Object, got: ${c}`);if(A.length!==g.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${g.length}, got: ${A.length}`);for(let I of s){if(!(I in c))throw new Error(`Struct ${a} requires field ${I}:${n[I]}`);const{name:l,params:d}=this.parseTypeName(n[I]);if(!g.includes(l))this.getTypeInterface(l)._encodeRaw.call(this,o,c[I],d,j);else{const N=g.indexOf(l);let{name:y,params:p}=this.parseTypeName(A[N]);if(this.hasType(y)){this.getTypeInterface(y)._encodeRaw.call(this,o,c[I],p,j);continue}if(!(y in j))throw new Error(`Unable to find a matching type definition for ${y} in ${a}; make sure you passed a generic`);let{name:D,params:T}=this.parseTypeName(j[y]);this.getTypeInterface(D)._encodeRaw.call(this,o,c[I],T,j)}}return o},function(o,c,A){if(c.length!==g.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${g.length}, got: ${c.length}`);let j={};for(let I of s){const{name:l,params:d}=this.parseTypeName(n[I]);if(!g.includes(l))j[I]=this.getTypeInterface(l)._decodeRaw.call(this,o,d,A);else{const N=g.indexOf(l);let{name:y,params:p}=this.parseTypeName(c[N]);if(this.hasType(y)){j[I]=this.getTypeInterface(y)._decodeRaw.call(this,o,p,A);continue}if(!(y in A))throw new Error(`Unable to find a matching type definition for ${y} in ${a}; make sure you passed a generic`);let{name:D,params:T}=this.parseTypeName(A[y]);j[I]=this.getTypeInterface(D)._decodeRaw.call(this,o,T,A)}}return j})}registerEnumType(t,r){for(let u in r){let o=this.tempKey(),c=r[u];c!==null&&!Array.isArray(c)&&typeof c!="string"&&(r[u]=o,this.registerStructType(o,c))}let n=Object.freeze(r),s=Object.keys(n),{name:a,params:g}=this.parseTypeName(t);return this.registerType(t,function(o,c,A,j){if(!c)throw new Error(`Unable to write enum "${a}", missing data.
4
4
  Received: "${c}"`);if(typeof c!="object")throw new Error(`Incorrect data passed into enum "${a}", expected object with properties: "${s.join(" | ")}".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wormhole-foundation/wormhole-connect",
3
- "version": "0.3.0-beta.0-development",
3
+ "version": "0.3.0-beta.1-development",
4
4
  "main": "lib/main.js",
5
5
  "module": "lib/main.mjs",
6
6
  "exports": {
@@ -1 +0,0 @@
1
- import{B as l,g as w,s as y,i as p,I as h,d as g,e as k,c as O,a as L,H as m,b as E}from"./evm-Wgv0qkFH.js";import"./main-wVJAa1zx.js";import"./index.es-DkxB7tN9.js";class x extends l{constructor({callbackSelector:e,cause:a,data:n,extraData:c,sender:d,urls:r}){var i;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(i=a.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(u=>` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(o,e){if(!p(o))throw new h({address:o});if(!p(e))throw new h({address:e});return o.toLowerCase()===e.toLowerCase()}const j="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(o,{blockNumber:e,blockTag:a,data:n,to:c}){const{args:d}=g({data:n,abi:[S]}),[r,i,u,t,s]=d;try{if(!$(c,r))throw new R({sender:r,to:c});const f=await A({data:u,sender:r,urls:i}),{data:b}=await L(o,{blockNumber:e,blockTag:a,data:O([t,k([{type:"bytes"},{type:"bytes"}],[f,s])]),to:c});return b}catch(f){throw new x({callbackSelector:t,cause:f,data:n,extraData:s,sender:r,urls:i})}}async function A({data:o,sender:e,urls:a}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const r=a[d],i=r.includes("{data}")?"GET":"POST",u=i==="POST"?{data:o,sender:e}:void 0;try{const t=await fetch(r.replace("{sender}",e).replace("{data}",o),{body:JSON.stringify(u),method:i});let s;if((c=t.headers.get("Content-Type"))!=null&&c.startsWith("application/json")?s=(await t.json()).data:s=await t.text(),!t.ok){n=new m({body:u,details:s!=null&&s.error?y(s.error):t.statusText,headers:t.headers,status:t.status,url:r});continue}if(!E(s)){n=new M({result:s,url:r});continue}return s}catch(t){n=new m({body:u,details:t.message,url:r})}}throw n}export{A as ccipFetch,D as offchainLookup,S as offchainLookupAbiItem,j as offchainLookupSignature};
@@ -1,3 +0,0 @@
1
- import{q as P,b2 as Ye,d as Z,b3 as Ze,aY as it}from"./main-wVJAa1zx.js";var Je={},Qe={exports:{}},je={};(function(o){o.fetch=n(P.fetch)&&n(P.ReadableStream),o.writableStream=n(P.WritableStream),o.abortController=n(P.AbortController);var r;function h(){if(r!==void 0)return r;if(P.XMLHttpRequest){r=new P.XMLHttpRequest;try{r.open("GET",P.XDomainRequest?"/":"https://example.com")}catch{r=null}}else r=null;return r}function f(g){var u=h();if(!u)return!1;try{return u.responseType=g,u.responseType===g}catch{}return!1}o.arraybuffer=o.fetch||f("arraybuffer"),o.msstream=!o.fetch&&f("ms-stream"),o.mozchunkedarraybuffer=!o.fetch&&f("moz-chunked-arraybuffer"),o.overrideMimeType=o.fetch||(h()?n(h().overrideMimeType):!1);function n(g){return typeof g=="function"}r=null})(je);var xe={},Ke=je,ft=Ze,et=Ye(),Ae=xe.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},$e=xe.IncomingMessage=function(o,r,h,f){var n=this;if(et.Readable.call(n),n._mode=h,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){Z.process.nextTick(function(){n.emit("close")})}),h==="fetch"){let C=function(){u.read().then(function(m){if(!n._destroyed){if(f(m.done),m.done){n.push(null);return}n.push(Z.Buffer.from(m.value)),C()}}).catch(function(m){f(!0),n._destroyed||n.emit("error",m)})};if(n._fetchResponse=r,n.url=r.url,n.statusCode=r.status,n.statusMessage=r.statusText,r.headers.forEach(function(m,A){n.headers[A.toLowerCase()]=m,n.rawHeaders.push(A,m)}),Ke.writableStream){var g=new WritableStream({write:function(m){return f(!1),new Promise(function(A,te){n._destroyed?te():n.push(Z.Buffer.from(m))?A():n._resumeFetch=A})},close:function(){f(!0),n._destroyed||n.push(null)},abort:function(m){f(!0),n._destroyed||n.emit("error",m)}});try{r.body.pipeTo(g).catch(function(m){f(!0),n._destroyed||n.emit("error",m)});return}catch{}}var u=r.body.getReader();C()}else{n._xhr=o,n._pos=0,n.url=o.responseURL,n.statusCode=o.status,n.statusMessage=o.statusText;var a=o.getAllResponseHeaders().split(/\r?\n/);if(a.forEach(function(C){var m=C.match(/^([^:]+):\s*(.*)/);if(m){var A=m[1].toLowerCase();A==="set-cookie"?(n.headers[A]===void 0&&(n.headers[A]=[]),n.headers[A].push(m[2])):n.headers[A]!==void 0?n.headers[A]+=", "+m[2]:n.headers[A]=m[2],n.rawHeaders.push(m[1],m[2])}}),n._charset="x-user-defined",!Ke.overrideMimeType){var v=n.rawHeaders["mime-type"];if(v){var T=v.match(/;\s*charset=([^;])(;|$)/);T&&(n._charset=T[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};ft($e,et.Readable);$e.prototype._read=function(){var o=this,r=o._resumeFetch;r&&(o._resumeFetch=null,r())};$e.prototype._onXHRProgress=function(o){var r=this,h=r._xhr,f=null;switch(r._mode){case"text":if(f=h.responseText,f.length>r._pos){var n=f.substr(r._pos);if(r._charset==="x-user-defined"){for(var g=Z.Buffer.alloc(n.length),u=0;u<n.length;u++)g[u]=n.charCodeAt(u)&255;r.push(g)}else r.push(n,r._charset);r._pos=f.length}break;case"arraybuffer":if(h.readyState!==Ae.DONE||!h.response)break;f=h.response,r.push(Z.Buffer.from(new Uint8Array(f)));break;case"moz-chunked-arraybuffer":if(f=h.response,h.readyState!==Ae.LOADING||!f)break;r.push(Z.Buffer.from(new Uint8Array(f)));break;case"ms-stream":if(f=h.response,h.readyState!==Ae.LOADING)break;var a=new P.MSStreamReader;a.onprogress=function(){a.result.byteLength>r._pos&&(r.push(Z.Buffer.from(new Uint8Array(a.result.slice(r._pos)))),r._pos=a.result.byteLength)},a.onload=function(){o(!0),r.push(null)},a.readAsArrayBuffer(f);break}r._xhr.readyState===Ae.DONE&&r._mode!=="ms-stream"&&(o(!0),r.push(null))};var he=je,ht=Ze,tt=xe,ke=Ye(),ut=tt.IncomingMessage,Ve=tt.readyStates;function ct(o,r){return he.fetch&&r?"fetch":he.mozchunkedarraybuffer?"moz-chunked-arraybuffer":he.msstream?"ms-stream":he.arraybuffer&&o?"arraybuffer":"text"}var S=Qe.exports=function(o){var r=this;ke.Writable.call(r),r._opts=o,r._body=[],r._headers={},o.auth&&r.setHeader("Authorization","Basic "+Z.Buffer.from(o.auth).toString("base64")),Object.keys(o.headers).forEach(function(n){r.setHeader(n,o.headers[n])});var h,f=!0;if(o.mode==="disable-fetch"||"requestTimeout"in o&&!he.abortController)f=!1,h=!0;else if(o.mode==="prefer-streaming")h=!1;else if(o.mode==="allow-wrong-content-type")h=!he.overrideMimeType;else if(!o.mode||o.mode==="default"||o.mode==="prefer-fast")h=!0;else throw new Error("Invalid value for opts.mode");r._mode=ct(h,f),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};ht(S,ke.Writable);S.prototype.setHeader=function(o,r){var h=this,f=o.toLowerCase();pt.indexOf(f)===-1&&(h._headers[f]={name:o,value:r})};S.prototype.getHeader=function(o){var r=this._headers[o.toLowerCase()];return r?r.value:null};S.prototype.removeHeader=function(o){var r=this;delete r._headers[o.toLowerCase()]};S.prototype._onFinish=function(){var o=this;if(!o._destroyed){var r=o._opts;"timeout"in r&&r.timeout!==0&&o.setTimeout(r.timeout);var h=o._headers,f=null;r.method!=="GET"&&r.method!=="HEAD"&&(f=new Blob(o._body,{type:(h["content-type"]||{}).value||""}));var n=[];if(Object.keys(h).forEach(function(v){var T=h[v].name,C=h[v].value;Array.isArray(C)?C.forEach(function(m){n.push([T,m])}):n.push([T,C])}),o._mode==="fetch"){var g=null;if(he.abortController){var u=new AbortController;g=u.signal,o._fetchAbortController=u,"requestTimeout"in r&&r.requestTimeout!==0&&(o._fetchTimer=P.setTimeout(function(){o.emit("requestTimeout"),o._fetchAbortController&&o._fetchAbortController.abort()},r.requestTimeout))}P.fetch(o._opts.url,{method:o._opts.method,headers:n,body:f||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:g}).then(function(v){o._fetchResponse=v,o._resetTimers(!1),o._connect()},function(v){o._resetTimers(!0),o._destroyed||o.emit("error",v)})}else{var a=o._xhr=new P.XMLHttpRequest;try{a.open(o._opts.method,o._opts.url,!0)}catch(v){Z.process.nextTick(function(){o.emit("error",v)});return}"responseType"in a&&(a.responseType=o._mode),"withCredentials"in a&&(a.withCredentials=!!r.withCredentials),o._mode==="text"&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(a.timeout=r.requestTimeout,a.ontimeout=function(){o.emit("requestTimeout")}),n.forEach(function(v){a.setRequestHeader(v[0],v[1])}),o._response=null,a.onreadystatechange=function(){switch(a.readyState){case Ve.LOADING:case Ve.DONE:o._onXHRProgress();break}},o._mode==="moz-chunked-arraybuffer"&&(a.onprogress=function(){o._onXHRProgress()}),a.onerror=function(){o._destroyed||(o._resetTimers(!0),o.emit("error",new Error("XHR error")))};try{a.send(f)}catch(v){Z.process.nextTick(function(){o.emit("error",v)});return}}}};function lt(o){try{var r=o.status;return r!==null&&r!==0}catch{return!1}}S.prototype._onXHRProgress=function(){var o=this;o._resetTimers(!1),!(!lt(o._xhr)||o._destroyed)&&(o._response||o._connect(),o._response._onXHRProgress(o._resetTimers.bind(o)))};S.prototype._connect=function(){var o=this;o._destroyed||(o._response=new ut(o._xhr,o._fetchResponse,o._mode,o._resetTimers.bind(o)),o._response.on("error",function(r){o.emit("error",r)}),o.emit("response",o._response))};S.prototype._write=function(o,r,h){var f=this;f._body.push(o),h()};S.prototype._resetTimers=function(o){var r=this;P.clearTimeout(r._socketTimer),r._socketTimer=null,o?(P.clearTimeout(r._fetchTimer),r._fetchTimer=null):r._socketTimeout&&(r._socketTimer=P.setTimeout(function(){r.emit("timeout")},r._socketTimeout))};S.prototype.abort=S.prototype.destroy=function(o){var r=this;r._destroyed=!0,r._resetTimers(!0),r._response&&(r._response._destroyed=!0),r._xhr?r._xhr.abort():r._fetchAbortController&&r._fetchAbortController.abort(),o&&r.emit("error",o)};S.prototype.end=function(o,r,h){var f=this;typeof o=="function"&&(h=o,o=void 0),ke.Writable.prototype.end.call(f,o,r,h)};S.prototype.setTimeout=function(o,r){var h=this;r&&h.once("timeout",r),h._socketTimeout=o,h._resetTimers(!1)};S.prototype.flushHeaders=function(){};S.prototype.setNoDelay=function(){};S.prototype.setSocketKeepAlive=function(){};var pt=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],dt=Qe.exports,mt=yt,vt=Object.prototype.hasOwnProperty;function yt(){for(var o={},r=0;r<arguments.length;r++){var h=arguments[r];for(var f in h)vt.call(h,f)&&(o[f]=h[f])}return o}var gt={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},He={exports:{}},qe={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */qe.exports;(function(o,r){(function(h){var f=r&&!r.nodeType&&r,n=o&&!o.nodeType&&o,g=typeof P=="object"&&P;(g.global===g||g.window===g||g.self===g)&&(h=g);var u,a=2147483647,v=36,T=1,C=26,m=38,A=700,te=72,ae=128,I="-",Oe=/^xn--/,Ee=/[^\x20-\x7E]/,Ue=/[\x2E\u3002\uFF0E\uFF61]/g,Le={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pe=v-T,M=Math.floor,re=String.fromCharCode,ie;function J(i){throw new RangeError(Le[i])}function de(i,p){for(var y=i.length,b=[];y--;)b[y]=p(i[y]);return b}function be(i,p){var y=i.split("@"),b="";y.length>1&&(b=y[0]+"@",i=y[1]),i=i.replace(Ue,".");var w=i.split("."),U=de(w,p).join(".");return b+U}function Te(i){for(var p=[],y=0,b=i.length,w,U;y<b;)w=i.charCodeAt(y++),w>=55296&&w<=56319&&y<b?(U=i.charCodeAt(y++),(U&64512)==56320?p.push(((w&1023)<<10)+(U&1023)+65536):(p.push(w),y--)):p.push(w);return p}function ue(i){return de(i,function(p){var y="";return p>65535&&(p-=65536,y+=re(p>>>10&1023|55296),p=56320|p&1023),y+=re(p),y}).join("")}function oe(i){return i-48<10?i-22:i-65<26?i-65:i-97<26?i-97:v}function ce(i,p){return i+22+75*(i<26)-((p!=0)<<5)}function ne(i,p,y){var b=0;for(i=y?M(i/A):i>>1,i+=M(i/p);i>pe*C>>1;b+=v)i=M(i/pe);return M(b+(pe+1)*i/(i+m))}function we(i){var p=[],y=i.length,b,w=0,U=ae,q=te,R,N,B,G,L,H,k,W,Q;for(R=i.lastIndexOf(I),R<0&&(R=0),N=0;N<R;++N)i.charCodeAt(N)>=128&&J("not-basic"),p.push(i.charCodeAt(N));for(B=R>0?R+1:0;B<y;){for(G=w,L=1,H=v;B>=y&&J("invalid-input"),k=oe(i.charCodeAt(B++)),(k>=v||k>M((a-w)/L))&&J("overflow"),w+=k*L,W=H<=q?T:H>=q+C?C:H-q,!(k<W);H+=v)Q=v-W,L>M(a/Q)&&J("overflow"),L*=Q;b=p.length+1,q=ne(w-G,b,G==0),M(w/b)>a-U&&J("overflow"),U+=M(w/b),w%=b,p.splice(w++,0,U)}return ue(p)}function Re(i){var p,y,b,w,U,q,R,N,B,G,L,H=[],k,W,Q,me;for(i=Te(i),k=i.length,p=ae,y=0,U=te,q=0;q<k;++q)L=i[q],L<128&&H.push(re(L));for(b=w=H.length,w&&H.push(I);b<k;){for(R=a,q=0;q<k;++q)L=i[q],L>=p&&L<R&&(R=L);for(W=b+1,R-p>M((a-y)/W)&&J("overflow"),y+=(R-p)*W,p=R,q=0;q<k;++q)if(L=i[q],L<p&&++y>a&&J("overflow"),L==p){for(N=y,B=v;G=B<=U?T:B>=U+C?C:B-U,!(N<G);B+=v)me=N-G,Q=v-G,H.push(re(ce(G+me%Q,0))),N=M(me/Q);H.push(re(ce(N,0))),U=ne(y,W,b==w),y=0,++b}++y,++p}return H.join("")}function Pe(i){return be(i,function(p){return Oe.test(p)?we(p.slice(4).toLowerCase()):p})}function Se(i){return be(i,function(p){return Ee.test(p)?"xn--"+Re(p):p})}if(u={version:"1.4.1",ucs2:{decode:Te,encode:ue},decode:we,encode:Re,toASCII:Se,toUnicode:Pe},f&&n)if(o.exports==f)n.exports=u;else for(ie in u)u.hasOwnProperty(ie)&&(f[ie]=u[ie]);else h.punycode=u})(P)})(qe,qe.exports);var _t=qe.exports;(function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var h=_t,f=it;function n(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var g=n(h),u=n(f),a={isString:function(e){return typeof e=="string"},isObject:function(e){return typeof e=="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}},v=g.default,T=a,C=ne,m=Re,A=Pe,te=we,ae=I;function I(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Oe=/^([a-z0-9.+-]+:)/i,Ee=/:[0-9]*$/,Ue=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Le=["<",">",'"',"`"," ","\r",`
2
- `," "],pe=["{","}","|","\\","^","`"].concat(Le),M=["'"].concat(pe),re=["%","/","?",";","#"].concat(M),ie=["/","?","#"],J=255,de=/^[+a-z0-9A-Z_-]{0,63}$/,be=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Te={javascript:!0,"javascript:":!0},ue={javascript:!0,"javascript:":!0},oe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ce=u.default;function ne(e,s,t){if(e&&T.isObject(e)&&e instanceof I)return e;var l=new I;return l.parse(e,s,t),l}I.prototype.parse=function(e,s,t){if(!T.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var l=e.indexOf("?"),_=l!==-1&&l<e.indexOf("#")?"?":"#",D=e.split(_),j=/\\/g;D[0]=D[0].replace(j,"/"),e=D.join(_);var c=e;if(c=c.trim(),!t&&e.split("#").length===1){var K=Ue.exec(c);if(K)return this.path=c,this.href=c,this.pathname=K[1],K[2]?(this.search=K[2],s?this.query=ce.parse(this.search.substr(1)):this.query=this.search.substr(1)):s&&(this.search="",this.query={}),this}var x=Oe.exec(c);if(x){x=x[0];var fe=x.toLowerCase();this.protocol=fe,c=c.substr(x.length)}if(t||x||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var ve=c.substr(0,2)==="//";ve&&!(x&&ue[x])&&(c=c.substr(2),this.slashes=!0)}if(!ue[x]&&(ve||x&&!oe[x])){for(var F=-1,O=0;O<ie.length;O++){var ee=c.indexOf(ie[O]);ee!==-1&&(F===-1||ee<F)&&(F=ee)}var ye,$;F===-1?$=c.lastIndexOf("@"):$=c.lastIndexOf("@",F),$!==-1&&(ye=c.slice(0,$),c=c.slice($+1),this.auth=decodeURIComponent(ye)),F=-1;for(var O=0;O<re.length;O++){var ee=c.indexOf(re[O]);ee!==-1&&(F===-1||ee<F)&&(F=ee)}F===-1&&(F=c.length),this.host=c.slice(0,F),c=c.slice(F),this.parseHost(),this.hostname=this.hostname||"";var ge=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ge)for(var d=this.hostname.split(/\./),O=0,E=d.length;O<E;O++){var V=d[O];if(V&&!V.match(de)){for(var z="",X=0,Ie=V.length;X<Ie;X++)V.charCodeAt(X)>127?z+="x":z+=V[X];if(!z.match(de)){var se=d.slice(0,O),Y=d.slice(O+1),le=V.match(be);le&&(se.push(le[1]),Y.unshift(le[2])),Y.length&&(c="/"+Y.join(".")+c),this.hostname=se.join(".");break}}}this.hostname.length>J?this.hostname="":this.hostname=this.hostname.toLowerCase(),ge||(this.hostname=v.toASCII(this.hostname));var Fe=this.port?":"+this.port:"",st=this.hostname||"";this.host=st+Fe,this.href+=this.host,ge&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!Te[fe])for(var O=0,E=M.length;O<E;O++){var _e=M[O];if(c.indexOf(_e)!==-1){var Me=encodeURIComponent(_e);Me===_e&&(Me=escape(_e)),c=c.split(_e).join(Me)}}var Ne=c.indexOf("#");Ne!==-1&&(this.hash=c.substr(Ne),c=c.slice(0,Ne));var Ce=c.indexOf("?");if(Ce!==-1?(this.search=c.substr(Ce),this.query=c.substr(Ce+1),s&&(this.query=ce.parse(this.query)),c=c.slice(0,Ce)):s&&(this.search="",this.query={}),c&&(this.pathname=c),oe[fe]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Fe=this.pathname||"",at=this.search||"";this.path=Fe+at}return this.href=this.format(),this};function we(e){return T.isString(e)&&(e=ne(e)),e instanceof I?e.format():I.prototype.format.call(e)}I.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var s=this.protocol||"",t=this.pathname||"",l=this.hash||"",_=!1,D="";this.host?_=e+this.host:this.hostname&&(_=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(_+=":"+this.port)),this.query&&T.isObject(this.query)&&Object.keys(this.query).length&&(D=ce.stringify(this.query));var j=this.search||D&&"?"+D||"";return s&&s.substr(-1)!==":"&&(s+=":"),this.slashes||(!s||oe[s])&&_!==!1?(_="//"+(_||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):_||(_=""),l&&l.charAt(0)!=="#"&&(l="#"+l),j&&j.charAt(0)!=="?"&&(j="?"+j),t=t.replace(/[?#]/g,function(c){return encodeURIComponent(c)}),j=j.replace("#","%23"),s+_+t+j+l};function Re(e,s){return ne(e,!1,!0).resolve(s)}I.prototype.resolve=function(e){return this.resolveObject(ne(e,!1,!0)).format()};function Pe(e,s){return e?ne(e,!1,!0).resolveObject(s):s}I.prototype.resolveObject=function(e){if(T.isString(e)){var s=new I;s.parse(e,!1,!0),e=s}for(var t=new I,l=Object.keys(this),_=0;_<l.length;_++){var D=l[_];t[D]=this[D]}if(t.hash=e.hash,e.href==="")return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var j=Object.keys(e),c=0;c<j.length;c++){var K=j[c];K!=="protocol"&&(t[K]=e[K])}return oe[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!oe[e.protocol]){for(var x=Object.keys(e),fe=0;fe<x.length;fe++){var ve=x[fe];t[ve]=e[ve]}return t.href=t.format(),t}if(t.protocol=e.protocol,!e.host&&!ue[e.protocol]){for(var E=(e.pathname||"").split("/");E.length&&!(e.host=E.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),E[0]!==""&&E.unshift(""),E.length<2&&E.unshift(""),t.pathname=E.join("/")}else t.pathname=e.pathname;if(t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,t.pathname||t.search){var F=t.pathname||"",O=t.search||"";t.path=F+O}return t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var ee=t.pathname&&t.pathname.charAt(0)==="/",ye=e.host||e.pathname&&e.pathname.charAt(0)==="/",$=ye||ee||t.host&&e.pathname,ge=$,d=t.pathname&&t.pathname.split("/")||[],E=e.pathname&&e.pathname.split("/")||[],V=t.protocol&&!oe[t.protocol];if(V&&(t.hostname="",t.port=null,t.host&&(d[0]===""?d[0]=t.host:d.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(E[0]===""?E[0]=e.host:E.unshift(e.host)),e.host=null),$=$&&(E[0]===""||d[0]==="")),ye)t.host=e.host||e.host===""?e.host:t.host,t.hostname=e.hostname||e.hostname===""?e.hostname:t.hostname,t.search=e.search,t.query=e.query,d=E;else if(E.length)d||(d=[]),d.pop(),d=d.concat(E),t.search=e.search,t.query=e.query;else if(!T.isNullOrUndefined(e.search)){if(V){t.hostname=t.host=d.shift();var z=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;z&&(t.auth=z.shift(),t.host=t.hostname=z.shift())}return t.search=e.search,t.query=e.query,(!T.isNull(t.pathname)||!T.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!d.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var X=d.slice(-1)[0],Ie=(t.host||e.host||d.length>1)&&(X==="."||X==="..")||X==="",se=0,Y=d.length;Y>=0;Y--)X=d[Y],X==="."?d.splice(Y,1):X===".."?(d.splice(Y,1),se++):se&&(d.splice(Y,1),se--);if(!$&&!ge)for(;se--;se)d.unshift("..");$&&d[0]!==""&&(!d[0]||d[0].charAt(0)!=="/")&&d.unshift(""),Ie&&d.join("/").substr(-1)!=="/"&&d.push("");var le=d[0]===""||d[0]&&d[0].charAt(0)==="/";if(V){t.hostname=t.host=le?"":d.length?d.shift():"";var z=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;z&&(t.auth=z.shift(),t.host=t.hostname=z.shift())}return $=$||t.host&&d.length,$&&!le&&d.unshift(""),d.length?t.pathname=d.join("/"):(t.pathname=null,t.path=null),(!T.isNull(t.pathname)||!T.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},I.prototype.parseHost=function(){var e=this.host,s=Ee.exec(e);s&&(s=s[0],s!==":"&&(this.port=s.substr(1)),e=e.substr(0,e.length-s.length)),e&&(this.hostname=e)};function Se(e,s){for(var t=0,l=e.length-1;l>=0;l--){var _=e[l];_==="."?e.splice(l,1):_===".."?(e.splice(l,1),t++):t&&(e.splice(l,1),t--)}if(s)for(;t--;t)e.unshift("..");return e}function i(){for(var e="",s=!1,t=arguments.length-1;t>=-1&&!s;t--){var l=t>=0?arguments[t]:"/";if(typeof l!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!l)continue;e=l+"/"+e,s=l.charAt(0)==="/"}return e=Se(p(e.split("/"),function(_){return!!_}),!s).join("/"),(s?"/":"")+e||"."}function p(e,s){if(e.filter)return e.filter(s);for(var t=[],l=0;l<e.length;l++)s(e[l],l,e)&&t.push(e[l]);return t}var y=function(e){function s(){var l=this||self;return delete e.prototype.__magic__,l}if(typeof globalThis=="object")return globalThis;if(this)return s();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:s});var t=__magic__;return t}(Object),b=te,w=C,U=m,q=ae,R=y.URL,N=y.URLSearchParams,B=/%/g,G=/\\/g,L=/\n/g,H=/\r/g,k=/\t/g,W=47;function Q(e){var s=e??null;return!!(s!==null&&(s!=null&&s.href)&&(s!=null&&s.origin))}function me(e){if(e.hostname!=="")throw new TypeError('File URL host must be "localhost" or empty on browser');for(var s=e.pathname,t=0;t<s.length;t++)if(s[t]==="%"){var l=s.codePointAt(t+2)|32;if(s[t+1]==="2"&&l===102)throw new TypeError("File URL path must not include encoded / characters")}return decodeURIComponent(s)}function nt(e){return e.includes("%")&&(e=e.replace(B,"%25")),e.includes("\\")&&(e=e.replace(G,"%5C")),e.includes(`
3
- `)&&(e=e.replace(L,"%0A")),e.includes("\r")&&(e=e.replace(H,"%0D")),e.includes(" ")&&(e=e.replace(k,"%09")),e}var De=function(s){if(typeof s>"u")throw new TypeError('The "domain" argument must be specified');return new R("http://"+s).hostname},Be=function(s){if(typeof s>"u")throw new TypeError('The "domain" argument must be specified');return new R("http://"+s).hostname},Ge=function(s){var t=new R("file://"),l=i(s),_=s.charCodeAt(s.length-1);return _===W&&l[l.length-1]!=="/"&&(l+="/"),t.pathname=nt(l),t},ze=function(s){if(!Q(s)&&typeof s!="string")throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof s+" ("+s+")");var t=new R(s);if(t.protocol!=="file:")throw new TypeError("The URL must be of scheme file");return me(t)},Xe=function(s,t){var l,_,D;if(t===void 0&&(t={}),!(s instanceof R))return b(s);if(typeof t!="object"||t===null)throw new TypeError('The "options" argument must be of type object.');var j=(l=t.auth)!=null?l:!0,c=(_=t.fragment)!=null?_:!0,K=(D=t.search)!=null?D:!0,x=new R(s.toString());return j||(x.username="",x.password=""),c||(x.hash=""),K||(x.search=""),x.toString()},We={format:Xe,parse:w,resolve:U,resolveObject:A,Url:q,URL:R,URLSearchParams:N,domainToASCII:De,domainToUnicode:Be,pathToFileURL:Ge,fileURLToPath:ze};r.URL=R,r.URLSearchParams=N,r.Url=q,r.default=We,r.domainToASCII=De,r.domainToUnicode=Be,r.fileURLToPath=ze,r.format=Xe,r.parse=w,r.pathToFileURL=Ge,r.resolve=U,r.resolveObject=A,r=o.exports=We})(He,He.exports);var rt=He.exports;(function(o){var r=dt,h=xe,f=mt,n=gt,g=rt,u=o;u.request=function(a,v){typeof a=="string"?a=g.parse(a):a=f(a);var T=P.location.protocol.search(/^https?:$/)===-1?"http:":"",C=a.protocol||T,m=a.hostname||a.host,A=a.port,te=a.path||"/";m&&m.indexOf(":")!==-1&&(m="["+m+"]"),a.url=(m?C+"//"+m:"")+(A?":"+A:"")+te,a.method=(a.method||"GET").toUpperCase(),a.headers=a.headers||{};var ae=new r(a);return v&&ae.on("response",v),ae},u.get=function(v,T){var C=u.request(v,T);return C.end(),C},u.ClientRequest=r,u.IncomingMessage=h.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=n,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})(Je);var ot={exports:{}};(function(o){var r=Je,h=rt,f=o.exports;for(var n in r)r.hasOwnProperty(n)&&(f[n]=r[n]);f.request=function(u,a){return u=g(u),r.request.call(this,u,a)},f.get=function(u,a){return u=g(u),r.get.call(this,u,a)};function g(u){if(typeof u=="string"&&(u=h.parse(u)),u.protocol||(u.protocol="https:"),u.protocol!=="https:")throw new Error('Protocol "'+u.protocol+'" not supported. Expected "https:"');return u}})(ot);var Tt=ot.exports;export{Tt as h,Je as s,rt as u};
@@ -1,7 +0,0 @@
1
- import{_ as fe}from"./main-wVJAa1zx.js";const me=Symbol(),ee=Object.getPrototypeOf,G=new WeakMap,ge=e=>e&&(G.has(e)?G.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{G.set(e,t)};var z={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const q=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>q(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,I=r)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const v=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(v,!0),l.set(n,[h,v]),Reflect.ownKeys(n).forEach(S=>{if(Object.getOwnPropertyDescriptor(v,S))return;const E=Reflect.get(n,S),M={value:E,enumerable:!0,configurable:!0};if(x.has(E))te(E,!1);else if(E instanceof Promise)delete M.value,M.get=()=>I(E);else if(A.has(E)){const[b,H]=A.get(E);M.value=c(b,H(),I)}Object.defineProperty(v,S,M)}),Object.preventExtensions(v)},m=new WeakMap,f=[1,1],W=n=>{if(!q(n))throw new Error("object required");const h=m.get(n);if(h)return h;let I=f[0];const y=new Set,v=(a,i=++f[0])=>{I!==i&&(I=i,y.forEach(o=>o(a,i)))};let S=f[1];const E=(a=++f[1])=>(S!==a&&!y.size&&(S=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const g=[...i];g[1]=[a,...g[1]],v(g,o)},b=new Map,H=(a,i)=>{if((z?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(y.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},Z=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},ue=a=>(y.add(a),y.size===1&&b.forEach(([o,g],_)=>{if((z?"production":void 0)!=="production"&&g)throw new Error("remove already exists");const R=o[3](M(_));b.set(_,[o,R])}),()=>{y.delete(a),y.size===0&&b.forEach(([o,g],_)=>{g&&(g(),b.set(_,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);Z(i);const g=Reflect.deleteProperty(a,i);return g&&v(["delete",[i],o]),g},set(a,i,o,g){const _=Reflect.has(a,i),R=Reflect.get(a,i,g);if(_&&(e(R,o)||m.has(o)&&e(R,m.get(o))))return!0;Z(i),q(o)&&(o=he(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,v(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,v(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&H(i,C)}return Reflect.set(a,i,V,g),v(["set",[i],o,R]),!0}});m.set(n,$);const pe=[J,E,c,ue];return A.set($,pe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function P(e,t,s){const r=A.get(e);(z?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:d,subscribe(e){return P(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:u,subscribe(e){return P(u.events,()=>e(ve(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},L=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:L,subscribe(e){return P(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:B,subscribe(e){return P(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Le=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Ee.call(t,s)&&ne(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=We({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",N.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const U={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))je.call(t,s)&&re(e,s,t[s]);return e};const ie=p.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Te={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await U.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await U.getMobileListings(m):await U.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Me({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=ie?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},k=j({open:!1}),F={state:k,subscribe(e){return P(k,()=>e(k))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&r)k.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),k.open=!0,t())},200)}})},close(){k.open=!1}};var Ue=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Pe.call(t,s)&&le(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=j({themeMode:_e()?"dark":"light"}),ce={state:T,subscribe(e){return P(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Se({},s))}},D=j({open:!1,message:"",variant:"success"}),$e={state:D,subscribe(e){return P(D,()=>e(D))},openToast(e,t){D.open=!0,D.message=e,D.variant=t},closeToast(){D.open=!1}};class ke{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-asOtxns8.js"),__vite__mapDeps([0,1,2,3]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ke},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,p as a,Ve as i,ce as n,$e as o,w as p,F as s,Te as t,N as y};
2
- function __vite__mapDeps(indexes) {
3
- if (!__vite__mapDeps.viteFileDeps) {
4
- __vite__mapDeps.viteFileDeps = ["assets/index-asOtxns8.js","assets/dijkstra-mfgL5WWt.js","assets/main-wVJAa1zx.js","main-O88ZzK88.css"]
5
- }
6
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
7
- }
@@ -1,20 +0,0 @@
1
- import{aT as Yr,D as kr,d as V,p as Xr}from"./main-wVJAa1zx.js";var At={},Qe={},R={},wr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){var _=u>>>16&65535,D=u&65535,w=l>>>16&65535,y=l&65535;return D*y+(_*y+D*w<<16>>>0)|0}e.mul=Math.imul||t;function r(u,l){return u+l|0}e.add=r;function i(u,l){return u-l|0}e.sub=i;function a(u,l){return u<<l|u>>>32-l}e.rotl=a;function s(u,l){return u<<32-l|u>>>l}e.rotr=s;function b(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(u){return e.isInteger(u)&&u>=-e.MAX_SAFE_INTEGER&&u<=e.MAX_SAFE_INTEGER}})(wr);Object.defineProperty(R,"__esModule",{value:!0});var vr=wr;function Jr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}R.readInt16BE=Jr;function Qr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}R.readUint16BE=Qr;function Zr(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}R.readInt16LE=Zr;function en(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}R.readUint16LE=en;function yr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}R.writeUint16BE=yr;R.writeInt16BE=yr;function gr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}R.writeUint16LE=gr;R.writeInt16LE=gr;function Et(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}R.readInt32BE=Et;function wt(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}R.readUint32BE=wt;function vt(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}R.readInt32LE=vt;function yt(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}R.readUint32LE=yt;function ke(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}R.writeUint32BE=ke;R.writeInt32BE=ke;function Xe(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}R.writeUint32LE=Xe;R.writeInt32LE=Xe;function tn(e,t){t===void 0&&(t=0);var r=Et(e,t),i=Et(e,t+4);return r*4294967296+i-(i>>31)*4294967296}R.readInt64BE=tn;function rn(e,t){t===void 0&&(t=0);var r=wt(e,t),i=wt(e,t+4);return r*4294967296+i}R.readUint64BE=rn;function nn(e,t){t===void 0&&(t=0);var r=vt(e,t),i=vt(e,t+4);return i*4294967296+r-(r>>31)*4294967296}R.readInt64LE=nn;function an(e,t){t===void 0&&(t=0);var r=yt(e,t),i=yt(e,t+4);return i*4294967296+r}R.readUint64LE=an;function pr(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),ke(e/4294967296>>>0,t,r),ke(e>>>0,t,r+4),t}R.writeUint64BE=pr;R.writeInt64BE=pr;function mr(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Xe(e>>>0,t,r),Xe(e/4294967296>>>0,t,r+4),t}R.writeUint64LE=mr;R.writeInt64LE=mr;function on(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,a=1,s=e/8+r-1;s>=r;s--)i+=t[s]*a,a*=256;return i}R.readUintBE=on;function un(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,a=1,s=r;s<r+e/8;s++)i+=t[s]*a,a*=256;return i}R.readUintLE=un;function sn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!vr.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var a=1,s=e/8+i-1;s>=i;s--)r[s]=t/a&255,a*=256;return r}R.writeUintBE=sn;function cn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!vr.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var a=1,s=i;s<i+e/8;s++)r[s]=t/a&255,a*=256;return r}R.writeUintLE=cn;function fn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}R.readFloat32BE=fn;function hn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t,!0)}R.readFloat32LE=hn;function ln(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}R.readFloat64BE=ln;function dn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}R.readFloat64LE=dn;function Dn(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e),t}R.writeFloat32BE=Dn;function bn(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e,!0),t}R.writeFloat32LE=bn;function _n(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e),t}R.writeFloat64BE=_n;function En(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e,!0),t}R.writeFloat64LE=En;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});function wn(e){for(var t=0;t<e.length;t++)e[t]=0;return e}pe.wipe=wn;Object.defineProperty(Qe,"__esModule",{value:!0});var _e=R,gt=pe,vn=20;function yn(e,t,r){for(var i=1634760805,a=857760878,s=2036477234,b=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],_=r[11]<<24|r[10]<<16|r[9]<<8|r[8],D=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],y=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],S=t[3]<<24|t[2]<<16|t[1]<<8|t[0],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],A=t[11]<<24|t[10]<<16|t[9]<<8|t[8],d=t[15]<<24|t[14]<<16|t[13]<<8|t[12],E=i,c=a,h=s,f=b,n=u,o=l,m=_,C=D,N=w,M=y,j=v,P=g,I=S,F=p,O=A,T=d,Y=0;Y<vn;Y+=2)E=E+n|0,I^=E,I=I>>>16|I<<16,N=N+I|0,n^=N,n=n>>>20|n<<12,c=c+o|0,F^=c,F=F>>>16|F<<16,M=M+F|0,o^=M,o=o>>>20|o<<12,h=h+m|0,O^=h,O=O>>>16|O<<16,j=j+O|0,m^=j,m=m>>>20|m<<12,f=f+C|0,T^=f,T=T>>>16|T<<16,P=P+T|0,C^=P,C=C>>>20|C<<12,h=h+m|0,O^=h,O=O>>>24|O<<8,j=j+O|0,m^=j,m=m>>>25|m<<7,f=f+C|0,T^=f,T=T>>>24|T<<8,P=P+T|0,C^=P,C=C>>>25|C<<7,c=c+o|0,F^=c,F=F>>>24|F<<8,M=M+F|0,o^=M,o=o>>>25|o<<7,E=E+n|0,I^=E,I=I>>>24|I<<8,N=N+I|0,n^=N,n=n>>>25|n<<7,E=E+o|0,T^=E,T=T>>>16|T<<16,j=j+T|0,o^=j,o=o>>>20|o<<12,c=c+m|0,I^=c,I=I>>>16|I<<16,P=P+I|0,m^=P,m=m>>>20|m<<12,h=h+C|0,F^=h,F=F>>>16|F<<16,N=N+F|0,C^=N,C=C>>>20|C<<12,f=f+n|0,O^=f,O=O>>>16|O<<16,M=M+O|0,n^=M,n=n>>>20|n<<12,h=h+C|0,F^=h,F=F>>>24|F<<8,N=N+F|0,C^=N,C=C>>>25|C<<7,f=f+n|0,O^=f,O=O>>>24|O<<8,M=M+O|0,n^=M,n=n>>>25|n<<7,c=c+m|0,I^=c,I=I>>>24|I<<8,P=P+I|0,m^=P,m=m>>>25|m<<7,E=E+o|0,T^=E,T=T>>>24|T<<8,j=j+T|0,o^=j,o=o>>>25|o<<7;_e.writeUint32LE(E+i|0,e,0),_e.writeUint32LE(c+a|0,e,4),_e.writeUint32LE(h+s|0,e,8),_e.writeUint32LE(f+b|0,e,12),_e.writeUint32LE(n+u|0,e,16),_e.writeUint32LE(o+l|0,e,20),_e.writeUint32LE(m+_|0,e,24),_e.writeUint32LE(C+D|0,e,28),_e.writeUint32LE(N+w|0,e,32),_e.writeUint32LE(M+y|0,e,36),_e.writeUint32LE(j+v|0,e,40),_e.writeUint32LE(P+g|0,e,44),_e.writeUint32LE(I+S|0,e,48),_e.writeUint32LE(F+p|0,e,52),_e.writeUint32LE(O+A|0,e,56),_e.writeUint32LE(T+d|0,e,60)}function Sr(e,t,r,i,a){if(a===void 0&&(a=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,b;if(a===0){if(t.length!==8&&t.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),b=s.length-t.length,s.set(t,b)}else{if(t.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=t,b=a}for(var u=new Uint8Array(64),l=0;l<r.length;l+=64){yn(u,s,e);for(var _=l;_<l+64&&_<r.length;_++)i[_]=r[_]^u[_-l];pn(s,0,b)}return gt.wipe(u),a===0&&gt.wipe(s),i}Qe.streamXOR=Sr;function gn(e,t,r,i){return i===void 0&&(i=0),gt.wipe(r),Sr(e,t,r,r,i)}Qe.stream=gn;function pn(e,t,r){for(var i=1;r--;)i=i+(e[t]&255)|0,e[t]=i&255,i>>>=8,t++;if(i>0)throw new Error("ChaCha: counter overflow")}var Or={},Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});function mn(e,t,r){return~(e-1)&t|e-1&r}Oe.select=mn;function Sn(e,t){return(e|0)-(t|0)-1>>>31&1}Oe.lessOrEqual=Sn;function Cr(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 1&r-1>>>8}Oe.compare=Cr;function On(e,t){return e.length===0||t.length===0?!1:Cr(e,t)!==0}Oe.equal=On;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Oe,r=pe;e.DIGEST_LENGTH=16;var i=function(){function b(u){this.digestLength=e.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 l=u[0]|u[1]<<8;this._r[0]=l&8191;var _=u[2]|u[3]<<8;this._r[1]=(l>>>13|_<<3)&8191;var D=u[4]|u[5]<<8;this._r[2]=(_>>>10|D<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(D>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var v=u[10]|u[11]<<8;this._r[6]=(y>>>14|v<<2)&8191;var g=u[12]|u[13]<<8;this._r[7]=(v>>>11|g<<5)&8065;var S=u[14]|u[15]<<8;this._r[8]=(g>>>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 b.prototype._blocks=function(u,l,_){for(var D=this._fin?0:2048,w=this._h[0],y=this._h[1],v=this._h[2],g=this._h[3],S=this._h[4],p=this._h[5],A=this._h[6],d=this._h[7],E=this._h[8],c=this._h[9],h=this._r[0],f=this._r[1],n=this._r[2],o=this._r[3],m=this._r[4],C=this._r[5],N=this._r[6],M=this._r[7],j=this._r[8],P=this._r[9];_>=16;){var I=u[l+0]|u[l+1]<<8;w+=I&8191;var F=u[l+2]|u[l+3]<<8;y+=(I>>>13|F<<3)&8191;var O=u[l+4]|u[l+5]<<8;v+=(F>>>10|O<<6)&8191;var T=u[l+6]|u[l+7]<<8;g+=(O>>>7|T<<9)&8191;var Y=u[l+8]|u[l+9]<<8;S+=(T>>>4|Y<<12)&8191,p+=Y>>>1&8191;var Q=u[l+10]|u[l+11]<<8;A+=(Y>>>14|Q<<2)&8191;var J=u[l+12]|u[l+13]<<8;d+=(Q>>>11|J<<5)&8191;var X=u[l+14]|u[l+15]<<8;E+=(J>>>8|X<<8)&8191,c+=X>>>5|D;var U=0,L=U;L+=w*h,L+=y*(5*P),L+=v*(5*j),L+=g*(5*M),L+=S*(5*N),U=L>>>13,L&=8191,L+=p*(5*C),L+=A*(5*m),L+=d*(5*o),L+=E*(5*n),L+=c*(5*f),U+=L>>>13,L&=8191;var B=U;B+=w*f,B+=y*h,B+=v*(5*P),B+=g*(5*j),B+=S*(5*M),U=B>>>13,B&=8191,B+=p*(5*N),B+=A*(5*C),B+=d*(5*m),B+=E*(5*o),B+=c*(5*n),U+=B>>>13,B&=8191;var x=U;x+=w*n,x+=y*f,x+=v*h,x+=g*(5*P),x+=S*(5*j),U=x>>>13,x&=8191,x+=p*(5*M),x+=A*(5*N),x+=d*(5*C),x+=E*(5*m),x+=c*(5*o),U+=x>>>13,x&=8191;var $=U;$+=w*o,$+=y*n,$+=v*f,$+=g*h,$+=S*(5*P),U=$>>>13,$&=8191,$+=p*(5*j),$+=A*(5*M),$+=d*(5*N),$+=E*(5*C),$+=c*(5*m),U+=$>>>13,$&=8191;var H=U;H+=w*m,H+=y*o,H+=v*n,H+=g*f,H+=S*h,U=H>>>13,H&=8191,H+=p*(5*P),H+=A*(5*j),H+=d*(5*M),H+=E*(5*N),H+=c*(5*C),U+=H>>>13,H&=8191;var K=U;K+=w*C,K+=y*m,K+=v*o,K+=g*n,K+=S*f,U=K>>>13,K&=8191,K+=p*h,K+=A*(5*P),K+=d*(5*j),K+=E*(5*M),K+=c*(5*N),U+=K>>>13,K&=8191;var W=U;W+=w*N,W+=y*C,W+=v*m,W+=g*o,W+=S*n,U=W>>>13,W&=8191,W+=p*f,W+=A*h,W+=d*(5*P),W+=E*(5*j),W+=c*(5*M),U+=W>>>13,W&=8191;var G=U;G+=w*M,G+=y*N,G+=v*C,G+=g*m,G+=S*o,U=G>>>13,G&=8191,G+=p*n,G+=A*f,G+=d*h,G+=E*(5*P),G+=c*(5*j),U+=G>>>13,G&=8191;var z=U;z+=w*j,z+=y*M,z+=v*N,z+=g*C,z+=S*m,U=z>>>13,z&=8191,z+=p*o,z+=A*n,z+=d*f,z+=E*h,z+=c*(5*P),U+=z>>>13,z&=8191;var k=U;k+=w*P,k+=y*j,k+=v*M,k+=g*N,k+=S*C,U=k>>>13,k&=8191,k+=p*m,k+=A*o,k+=d*n,k+=E*f,k+=c*h,U+=k>>>13,k&=8191,U=(U<<2)+U|0,U=U+L|0,L=U&8191,U=U>>>13,B+=U,w=L,y=B,v=x,g=$,S=H,p=K,A=W,d=G,E=z,c=k,l+=16,_-=16}this._h[0]=w,this._h[1]=y,this._h[2]=v,this._h[3]=g,this._h[4]=S,this._h[5]=p,this._h[6]=A,this._h[7]=d,this._h[8]=E,this._h[9]=c},b.prototype.finish=function(u,l){l===void 0&&(l=0);var _=new Uint16Array(10),D,w,y,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(D=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=D,D=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=D*5,D=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=D,D=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=D,_[0]=this._h[0]+5,D=_[0]>>>13,_[0]&=8191,v=1;v<10;v++)_[v]=this._h[v]+D,D=_[v]>>>13,_[v]&=8191;for(_[9]-=8192,w=(D^1)-1,v=0;v<10;v++)_[v]&=w;for(w=~w,v=0;v<10;v++)this._h[v]=this._h[v]&w|_[v];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,y=this._h[0]+this._pad[0],this._h[0]=y&65535,v=1;v<8;v++)y=(this._h[v]+this._pad[v]|0)+(y>>>16)|0,this._h[v]=y&65535;return u[l+0]=this._h[0]>>>0,u[l+1]=this._h[0]>>>8,u[l+2]=this._h[1]>>>0,u[l+3]=this._h[1]>>>8,u[l+4]=this._h[2]>>>0,u[l+5]=this._h[2]>>>8,u[l+6]=this._h[3]>>>0,u[l+7]=this._h[3]>>>8,u[l+8]=this._h[4]>>>0,u[l+9]=this._h[4]>>>8,u[l+10]=this._h[5]>>>0,u[l+11]=this._h[5]>>>8,u[l+12]=this._h[6]>>>0,u[l+13]=this._h[6]>>>8,u[l+14]=this._h[7]>>>0,u[l+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(u){var l=0,_=u.length,D;if(this._leftover){D=16-this._leftover,D>_&&(D=_);for(var w=0;w<D;w++)this._buffer[this._leftover+w]=u[l+w];if(_-=D,l+=D,this._leftover+=D,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(_>=16&&(D=_-_%16,this._blocks(u,l,D),l+=D,_-=D),_){for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[l+w];this._leftover+=_}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},b.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function a(b,u){var l=new i(b);l.update(u);var _=l.digest();return l.clean(),_}e.oneTimeAuth=a;function s(b,u){return b.length!==e.DIGEST_LENGTH||u.length!==e.DIGEST_LENGTH?!1:t.equal(b,u)}e.equal=s})(Or);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Qe,r=Or,i=pe,a=R,s=Oe;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),u=function(){function l(_){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,_.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(_)}return l.prototype.seal=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=D.length+this.tagLength,p;if(y){if(y.length!==S)throw new Error("ChaCha20Poly1305: incorrect destination length");p=y}else p=new Uint8Array(S);return t.streamXOR(this._key,v,D,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),w),i.wipe(v),p},l.prototype.open=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(D.length<this.tagLength)return null;var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=new Uint8Array(this.tagLength);if(this._authenticate(S,g,D.subarray(0,D.length-this.tagLength),w),!s.equal(S,D.subarray(D.length-this.tagLength,D.length)))return null;var p=D.length-this.tagLength,A;if(y){if(y.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");A=y}else A=new Uint8Array(p);return t.streamXOR(this._key,v,D.subarray(0,D.length-this.tagLength),A,4),i.wipe(v),A},l.prototype.clean=function(){return i.wipe(this._key),this},l.prototype._authenticate=function(_,D,w,y){var v=new r.Poly1305(D);y&&(v.update(y),y.length%16>0&&v.update(b.subarray(y.length%16))),v.update(w),w.length%16>0&&v.update(b.subarray(w.length%16));var g=new Uint8Array(8);y&&a.writeUint64LE(y.length,g),v.update(g),a.writeUint64LE(w.length,g),v.update(g);for(var S=v.digest(),p=0;p<S.length;p++)_[p]=S[p];v.clean(),i.wipe(S),i.wipe(g)},l}();e.ChaCha20Poly1305=u})(At);var Ur={},We={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});function Cn(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}Nt.isSerializableHash=Cn;Object.defineProperty(We,"__esModule",{value:!0});var me=Nt,Un=Oe,An=pe,Ar=function(){function e(t,r){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var a=0;a<i.length;a++)i[a]^=54;this._inner.update(i);for(var a=0;a<i.length;a++)i[a]^=106;this._outer.update(i),me.isSerializableHash(this._inner)&&me.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),An.wipe(i)}return e.prototype.reset=function(){if(!me.isSerializableHash(this._inner)||!me.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},e.prototype.clean=function(){me.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),me.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(t){return this._inner.update(t),this},e.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype.saveState=function(){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(t){if(!me.isSerializableHash(this._inner)||!me.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(t){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},e}();We.HMAC=Ar;function Nn(e,t,r){var i=new Ar(e,t);i.update(r);var a=i.digest();return i.clean(),a}We.hmac=Nn;We.equal=Un.equal;Object.defineProperty(Ur,"__esModule",{value:!0});var $t=We,Ht=pe,Tn=function(){function e(t,r,i,a){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=a;var s=$t.hmac(this._hash,i,r);this._hmac=new $t.HMAC(t,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(t===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>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},e.prototype.expand=function(t){for(var r=new Uint8Array(t),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},e.prototype.clean=function(){this._hmac.clean(),Ht.wipe(this._buffer),Ht.wipe(this._counter),this._bufpos=0},e}(),In=Ur.HKDF=Tn,Ze={},et={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.BrowserRandomSource=void 0;const Kt=65536;class Fn{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t=typeof self<"u"?self.crypto||self.msCrypto:null;t&&t.getRandomValues!==void 0&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(t);for(let i=0;i<r.length;i+=Kt)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,Kt)));return r}}tt.BrowserRandomSource=Fn;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.NodeRandomSource=void 0;const Mn=pe;class Pn{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Yr<"u"){const t=kr();t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(t);if(r.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(t);for(let a=0;a<i.length;a++)i[a]=r[a];return(0,Mn.wipe)(r),i}}rt.NodeRandomSource=Pn;Object.defineProperty(et,"__esModule",{value:!0});et.SystemRandomSource=void 0;const Rn=tt,jn=rt;class Ln{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Rn.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new jn.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}et.SystemRandomSource=Ln;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=et,r=R,i=pe;e.defaultRandomSource=new t.SystemRandomSource;function a(_,D=e.defaultRandomSource){return D.randomBytes(_)}e.randomBytes=a;function s(_=e.defaultRandomSource){const D=a(4,_),w=(0,r.readUint32LE)(D);return(0,i.wipe)(D),w}e.randomUint32=s;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(_,D=b,w=e.defaultRandomSource){if(D.length<2)throw new Error("randomString charset is too short");if(D.length>256)throw new Error("randomString charset is too long");let y="";const v=D.length,g=256-256%v;for(;_>0;){const S=a(Math.ceil(_*256/g),w);for(let p=0;p<S.length&&_>0;p++){const A=S[p];A<g&&(y+=D.charAt(A%v),_--)}(0,i.wipe)(S)}return y}e.randomString=u;function l(_,D=b,w=e.defaultRandomSource){const y=Math.ceil(_/(Math.log(D.length)/Math.LN2));return u(y,D,w)}e.randomStringForEntropy=l})(Ze);var nt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=R,r=pe;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(l,_){if(_===void 0&&(_=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var D=0;if(this._bytesHashed+=_,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&_>0;)this._buffer[this._bufferLength++]=l[D++],_--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(_>=this.blockSize&&(D=s(this._temp,this._state,l,D,_),_%=this.blockSize);_>0;)this._buffer[this._bufferLength++]=l[D++],_--;return this},u.prototype.finish=function(l){if(!this._finished){var _=this._bytesHashed,D=this._bufferLength,w=_/536870912|0,y=_<<3,v=_%64<56?64:128;this._buffer[D]=128;for(var g=D+1;g<v-8;g++)this._buffer[g]=0;t.writeUint32BE(w,this._buffer,v-8),t.writeUint32BE(y,this._buffer,v-4),s(this._temp,this._state,this._buffer,0,v),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)t.writeUint32BE(this._state[g],l,g*4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},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(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();e.SHA256=i;var a=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 s(u,l,_,D,w){for(;w>=64;){for(var y=l[0],v=l[1],g=l[2],S=l[3],p=l[4],A=l[5],d=l[6],E=l[7],c=0;c<16;c++){var h=D+c*4;u[c]=t.readUint32BE(_,h)}for(var c=16;c<64;c++){var f=u[c-2],n=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10;f=u[c-15];var o=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;u[c]=(n+u[c-7]|0)+(o+u[c-16]|0)}for(var c=0;c<64;c++){var n=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&A^~p&d)|0)+(E+(a[c]+u[c]|0)|0)|0,o=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&v^y&g^v&g)|0;E=d,d=A,A=p,p=S+n|0,S=g,g=v,v=y,y=n+o|0}l[0]+=y,l[1]+=v,l[2]+=g,l[3]+=S,l[4]+=p,l[5]+=A,l[6]+=d,l[7]+=E,D+=64,w-=64}return D}function b(u){var l=new i;l.update(u);var _=l.digest();return l.clean(),_}e.hash=b})(nt);var Tt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=Ze,r=pe;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(c){const h=new Float64Array(16);if(c)for(let f=0;f<c.length;f++)h[f]=c[f];return h}const a=new Uint8Array(32);a[0]=9;const s=i([56129,1]);function b(c){let h=1;for(let f=0;f<16;f++){let n=c[f]+h+65535;h=Math.floor(n/65536),c[f]=n-h*65536}c[0]+=h-1+37*(h-1)}function u(c,h,f){const n=~(f-1);for(let o=0;o<16;o++){const m=n&(c[o]^h[o]);c[o]^=m,h[o]^=m}}function l(c,h){const f=i(),n=i();for(let o=0;o<16;o++)n[o]=h[o];b(n),b(n),b(n);for(let o=0;o<2;o++){f[0]=n[0]-65517;for(let C=1;C<15;C++)f[C]=n[C]-65535-(f[C-1]>>16&1),f[C-1]&=65535;f[15]=n[15]-32767-(f[14]>>16&1);const m=f[15]>>16&1;f[14]&=65535,u(n,f,1-m)}for(let o=0;o<16;o++)c[2*o]=n[o]&255,c[2*o+1]=n[o]>>8}function _(c,h){for(let f=0;f<16;f++)c[f]=h[2*f]+(h[2*f+1]<<8);c[15]&=32767}function D(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]+f[n]}function w(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]-f[n]}function y(c,h,f){let n,o,m=0,C=0,N=0,M=0,j=0,P=0,I=0,F=0,O=0,T=0,Y=0,Q=0,J=0,X=0,U=0,L=0,B=0,x=0,$=0,H=0,K=0,W=0,G=0,z=0,k=0,Ce=0,Me=0,Be=0,Ye=0,ct=0,xt=0,ee=f[0],te=f[1],re=f[2],ne=f[3],ie=f[4],ae=f[5],oe=f[6],ue=f[7],se=f[8],ce=f[9],fe=f[10],he=f[11],le=f[12],de=f[13],De=f[14],be=f[15];n=h[0],m+=n*ee,C+=n*te,N+=n*re,M+=n*ne,j+=n*ie,P+=n*ae,I+=n*oe,F+=n*ue,O+=n*se,T+=n*ce,Y+=n*fe,Q+=n*he,J+=n*le,X+=n*de,U+=n*De,L+=n*be,n=h[1],C+=n*ee,N+=n*te,M+=n*re,j+=n*ne,P+=n*ie,I+=n*ae,F+=n*oe,O+=n*ue,T+=n*se,Y+=n*ce,Q+=n*fe,J+=n*he,X+=n*le,U+=n*de,L+=n*De,B+=n*be,n=h[2],N+=n*ee,M+=n*te,j+=n*re,P+=n*ne,I+=n*ie,F+=n*ae,O+=n*oe,T+=n*ue,Y+=n*se,Q+=n*ce,J+=n*fe,X+=n*he,U+=n*le,L+=n*de,B+=n*De,x+=n*be,n=h[3],M+=n*ee,j+=n*te,P+=n*re,I+=n*ne,F+=n*ie,O+=n*ae,T+=n*oe,Y+=n*ue,Q+=n*se,J+=n*ce,X+=n*fe,U+=n*he,L+=n*le,B+=n*de,x+=n*De,$+=n*be,n=h[4],j+=n*ee,P+=n*te,I+=n*re,F+=n*ne,O+=n*ie,T+=n*ae,Y+=n*oe,Q+=n*ue,J+=n*se,X+=n*ce,U+=n*fe,L+=n*he,B+=n*le,x+=n*de,$+=n*De,H+=n*be,n=h[5],P+=n*ee,I+=n*te,F+=n*re,O+=n*ne,T+=n*ie,Y+=n*ae,Q+=n*oe,J+=n*ue,X+=n*se,U+=n*ce,L+=n*fe,B+=n*he,x+=n*le,$+=n*de,H+=n*De,K+=n*be,n=h[6],I+=n*ee,F+=n*te,O+=n*re,T+=n*ne,Y+=n*ie,Q+=n*ae,J+=n*oe,X+=n*ue,U+=n*se,L+=n*ce,B+=n*fe,x+=n*he,$+=n*le,H+=n*de,K+=n*De,W+=n*be,n=h[7],F+=n*ee,O+=n*te,T+=n*re,Y+=n*ne,Q+=n*ie,J+=n*ae,X+=n*oe,U+=n*ue,L+=n*se,B+=n*ce,x+=n*fe,$+=n*he,H+=n*le,K+=n*de,W+=n*De,G+=n*be,n=h[8],O+=n*ee,T+=n*te,Y+=n*re,Q+=n*ne,J+=n*ie,X+=n*ae,U+=n*oe,L+=n*ue,B+=n*se,x+=n*ce,$+=n*fe,H+=n*he,K+=n*le,W+=n*de,G+=n*De,z+=n*be,n=h[9],T+=n*ee,Y+=n*te,Q+=n*re,J+=n*ne,X+=n*ie,U+=n*ae,L+=n*oe,B+=n*ue,x+=n*se,$+=n*ce,H+=n*fe,K+=n*he,W+=n*le,G+=n*de,z+=n*De,k+=n*be,n=h[10],Y+=n*ee,Q+=n*te,J+=n*re,X+=n*ne,U+=n*ie,L+=n*ae,B+=n*oe,x+=n*ue,$+=n*se,H+=n*ce,K+=n*fe,W+=n*he,G+=n*le,z+=n*de,k+=n*De,Ce+=n*be,n=h[11],Q+=n*ee,J+=n*te,X+=n*re,U+=n*ne,L+=n*ie,B+=n*ae,x+=n*oe,$+=n*ue,H+=n*se,K+=n*ce,W+=n*fe,G+=n*he,z+=n*le,k+=n*de,Ce+=n*De,Me+=n*be,n=h[12],J+=n*ee,X+=n*te,U+=n*re,L+=n*ne,B+=n*ie,x+=n*ae,$+=n*oe,H+=n*ue,K+=n*se,W+=n*ce,G+=n*fe,z+=n*he,k+=n*le,Ce+=n*de,Me+=n*De,Be+=n*be,n=h[13],X+=n*ee,U+=n*te,L+=n*re,B+=n*ne,x+=n*ie,$+=n*ae,H+=n*oe,K+=n*ue,W+=n*se,G+=n*ce,z+=n*fe,k+=n*he,Ce+=n*le,Me+=n*de,Be+=n*De,Ye+=n*be,n=h[14],U+=n*ee,L+=n*te,B+=n*re,x+=n*ne,$+=n*ie,H+=n*ae,K+=n*oe,W+=n*ue,G+=n*se,z+=n*ce,k+=n*fe,Ce+=n*he,Me+=n*le,Be+=n*de,Ye+=n*De,ct+=n*be,n=h[15],L+=n*ee,B+=n*te,x+=n*re,$+=n*ne,H+=n*ie,K+=n*ae,W+=n*oe,G+=n*ue,z+=n*se,k+=n*ce,Ce+=n*fe,Me+=n*he,Be+=n*le,Ye+=n*de,ct+=n*De,xt+=n*be,m+=38*B,C+=38*x,N+=38*$,M+=38*H,j+=38*K,P+=38*W,I+=38*G,F+=38*z,O+=38*k,T+=38*Ce,Y+=38*Me,Q+=38*Be,J+=38*Ye,X+=38*ct,U+=38*xt,o=1,n=m+o+65535,o=Math.floor(n/65536),m=n-o*65536,n=C+o+65535,o=Math.floor(n/65536),C=n-o*65536,n=N+o+65535,o=Math.floor(n/65536),N=n-o*65536,n=M+o+65535,o=Math.floor(n/65536),M=n-o*65536,n=j+o+65535,o=Math.floor(n/65536),j=n-o*65536,n=P+o+65535,o=Math.floor(n/65536),P=n-o*65536,n=I+o+65535,o=Math.floor(n/65536),I=n-o*65536,n=F+o+65535,o=Math.floor(n/65536),F=n-o*65536,n=O+o+65535,o=Math.floor(n/65536),O=n-o*65536,n=T+o+65535,o=Math.floor(n/65536),T=n-o*65536,n=Y+o+65535,o=Math.floor(n/65536),Y=n-o*65536,n=Q+o+65535,o=Math.floor(n/65536),Q=n-o*65536,n=J+o+65535,o=Math.floor(n/65536),J=n-o*65536,n=X+o+65535,o=Math.floor(n/65536),X=n-o*65536,n=U+o+65535,o=Math.floor(n/65536),U=n-o*65536,n=L+o+65535,o=Math.floor(n/65536),L=n-o*65536,m+=o-1+37*(o-1),o=1,n=m+o+65535,o=Math.floor(n/65536),m=n-o*65536,n=C+o+65535,o=Math.floor(n/65536),C=n-o*65536,n=N+o+65535,o=Math.floor(n/65536),N=n-o*65536,n=M+o+65535,o=Math.floor(n/65536),M=n-o*65536,n=j+o+65535,o=Math.floor(n/65536),j=n-o*65536,n=P+o+65535,o=Math.floor(n/65536),P=n-o*65536,n=I+o+65535,o=Math.floor(n/65536),I=n-o*65536,n=F+o+65535,o=Math.floor(n/65536),F=n-o*65536,n=O+o+65535,o=Math.floor(n/65536),O=n-o*65536,n=T+o+65535,o=Math.floor(n/65536),T=n-o*65536,n=Y+o+65535,o=Math.floor(n/65536),Y=n-o*65536,n=Q+o+65535,o=Math.floor(n/65536),Q=n-o*65536,n=J+o+65535,o=Math.floor(n/65536),J=n-o*65536,n=X+o+65535,o=Math.floor(n/65536),X=n-o*65536,n=U+o+65535,o=Math.floor(n/65536),U=n-o*65536,n=L+o+65535,o=Math.floor(n/65536),L=n-o*65536,m+=o-1+37*(o-1),c[0]=m,c[1]=C,c[2]=N,c[3]=M,c[4]=j,c[5]=P,c[6]=I,c[7]=F,c[8]=O,c[9]=T,c[10]=Y,c[11]=Q,c[12]=J,c[13]=X,c[14]=U,c[15]=L}function v(c,h){y(c,h,h)}function g(c,h){const f=i();for(let n=0;n<16;n++)f[n]=h[n];for(let n=253;n>=0;n--)v(f,f),n!==2&&n!==4&&y(f,f,h);for(let n=0;n<16;n++)c[n]=f[n]}function S(c,h){const f=new Uint8Array(32),n=new Float64Array(80),o=i(),m=i(),C=i(),N=i(),M=i(),j=i();for(let O=0;O<31;O++)f[O]=c[O];f[31]=c[31]&127|64,f[0]&=248,_(n,h);for(let O=0;O<16;O++)m[O]=n[O];o[0]=N[0]=1;for(let O=254;O>=0;--O){const T=f[O>>>3]>>>(O&7)&1;u(o,m,T),u(C,N,T),D(M,o,C),w(o,o,C),D(C,m,N),w(m,m,N),v(N,M),v(j,o),y(o,C,o),y(C,m,M),D(M,o,C),w(o,o,C),v(m,o),w(C,N,j),y(o,C,s),D(o,o,N),y(C,C,o),y(o,N,j),y(N,m,n),v(m,M),u(o,m,T),u(C,N,T)}for(let O=0;O<16;O++)n[O+16]=o[O],n[O+32]=C[O],n[O+48]=m[O],n[O+64]=N[O];const P=n.subarray(32),I=n.subarray(16);g(P,P),y(I,I,P);const F=new Uint8Array(32);return l(F,I),F}e.scalarMult=S;function p(c){return S(c,a)}e.scalarMultBase=p;function A(c){if(c.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const h=new Uint8Array(c);return{publicKey:p(h),secretKey:h}}e.generateKeyPairFromSeed=A;function d(c){const h=(0,t.randomBytes)(32,c),f=A(h);return(0,r.wipe)(h),f}e.generateKeyPair=d;function E(c,h,f=!1){if(c.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(h.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const n=S(c,h);if(f){let o=0;for(let m=0;m<n.length;m++)o|=n[m];if(o===0)throw new Error("X25519: invalid shared key")}return n}e.sharedKey=E})(Tt);function It(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Nr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?It(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Wt(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));const r=Nr(t);let i=0;for(const a of e)r.set(a,i),i+=a.length;return It(r)}function Bn(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var a=0;a<e.length;a++){var s=e.charAt(a),b=s.charCodeAt(0);if(r[b]!==255)throw new TypeError(s+" is ambiguous");r[b]=a}var u=e.length,l=e.charAt(0),_=Math.log(u)/Math.log(256),D=Math.log(256)/Math.log(u);function w(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var S=0,p=0,A=0,d=g.length;A!==d&&g[A]===0;)A++,S++;for(var E=(d-A)*D+1>>>0,c=new Uint8Array(E);A!==d;){for(var h=g[A],f=0,n=E-1;(h!==0||f<p)&&n!==-1;n--,f++)h+=256*c[n]>>>0,c[n]=h%u>>>0,h=h/u>>>0;if(h!==0)throw new Error("Non-zero carry");p=f,A++}for(var o=E-p;o!==E&&c[o]===0;)o++;for(var m=l.repeat(S);o<E;++o)m+=e.charAt(c[o]);return m}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var S=0;if(g[S]!==" "){for(var p=0,A=0;g[S]===l;)p++,S++;for(var d=(g.length-S)*_+1>>>0,E=new Uint8Array(d);g[S];){var c=r[g.charCodeAt(S)];if(c===255)return;for(var h=0,f=d-1;(c!==0||h<A)&&f!==-1;f--,h++)c+=u*E[f]>>>0,E[f]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");A=h,S++}if(g[S]!==" "){for(var n=d-A;n!==d&&E[n]===0;)n++;for(var o=new Uint8Array(p+(d-n)),m=p;n!==d;)o[m++]=E[n++];return o}}}function v(g){var S=y(g);if(S)return S;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:y,decode:v}}var xn=Bn,$n=xn;const Hn=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Kn=e=>new TextEncoder().encode(e),Wn=e=>new TextDecoder().decode(e);class Vn{constructor(t,r,i){this.name=t,this.prefix=r,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Gn{constructor(t,r,i){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Tr(this,t)}}class qn{constructor(t){this.decoders=t}or(t){return Tr(this,t)}decode(t){const r=t[0],i=this.decoders[r];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tr=(e,t)=>new qn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class zn{constructor(t,r,i,a){this.name=t,this.prefix=r,this.baseEncode=i,this.baseDecode=a,this.encoder=new Vn(t,r,i),this.decoder=new Gn(t,r,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const it=({name:e,prefix:t,encode:r,decode:i})=>new zn(e,t,r,i),Ve=({prefix:e,name:t,alphabet:r})=>{const{encode:i,decode:a}=$n(r,t);return it({prefix:e,name:t,encode:i,decode:s=>Hn(a(s))})},Yn=(e,t,r,i)=>{const a={};for(let D=0;D<t.length;++D)a[t[D]]=D;let s=e.length;for(;e[s-1]==="=";)--s;const b=new Uint8Array(s*r/8|0);let u=0,l=0,_=0;for(let D=0;D<s;++D){const w=a[e[D]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,b[_++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return b},kn=(e,t,r)=>{const i=t[t.length-1]==="=",a=(1<<r)-1;let s="",b=0,u=0;for(let l=0;l<e.length;++l)for(u=u<<8|e[l],b+=8;b>r;)b-=r,s+=t[a&u>>b];if(b&&(s+=t[a&u<<r-b]),i)for(;s.length*r&7;)s+="=";return s},Z=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>it({prefix:t,name:e,encode(a){return kn(a,i,r)},decode(a){return Yn(a,i,r,e)}}),Xn=it({prefix:"\0",name:"identity",encode:e=>Wn(e),decode:e=>Kn(e)}),Jn=Object.freeze(Object.defineProperty({__proto__:null,identity:Xn},Symbol.toStringTag,{value:"Module"})),Qn=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Zn=Object.freeze(Object.defineProperty({__proto__:null,base2:Qn},Symbol.toStringTag,{value:"Module"})),ei=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ti=Object.freeze(Object.defineProperty({__proto__:null,base8:ei},Symbol.toStringTag,{value:"Module"})),ri=Ve({prefix:"9",name:"base10",alphabet:"0123456789"}),ni=Object.freeze(Object.defineProperty({__proto__:null,base10:ri},Symbol.toStringTag,{value:"Module"})),ii=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ai=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),oi=Object.freeze(Object.defineProperty({__proto__:null,base16:ii,base16upper:ai},Symbol.toStringTag,{value:"Module"})),ui=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),si=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ci=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),fi=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hi=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),li=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),di=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Di=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bi=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),_i=Object.freeze(Object.defineProperty({__proto__:null,base32:ui,base32hex:hi,base32hexpad:di,base32hexpadupper:Di,base32hexupper:li,base32pad:ci,base32padupper:fi,base32upper:si,base32z:bi},Symbol.toStringTag,{value:"Module"})),Ei=Ve({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wi=Ve({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),vi=Object.freeze(Object.defineProperty({__proto__:null,base36:Ei,base36upper:wi},Symbol.toStringTag,{value:"Module"})),yi=Ve({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gi=Ve({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),pi=Object.freeze(Object.defineProperty({__proto__:null,base58btc:yi,base58flickr:gi},Symbol.toStringTag,{value:"Module"})),mi=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Si=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Oi=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ci=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Ui=Object.freeze(Object.defineProperty({__proto__:null,base64:mi,base64pad:Si,base64url:Oi,base64urlpad:Ci},Symbol.toStringTag,{value:"Module"})),Ir=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ai=Ir.reduce((e,t,r)=>(e[r]=t,e),[]),Ni=Ir.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Ti(e){return e.reduce((t,r)=>(t+=Ai[r],t),"")}function Ii(e){const t=[];for(const r of e){const i=Ni[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(i)}return new Uint8Array(t)}const Fi=it({prefix:"🚀",name:"base256emoji",encode:Ti,decode:Ii}),Mi=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Fi},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Vt={...Jn,...Zn,...ti,...ni,...oi,..._i,...vi,...pi,...Ui,...Mi};function Fr(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const Gt=Fr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ft=Fr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Nr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Mr={utf8:Gt,"utf-8":Gt,hex:Vt.base16,latin1:ft,ascii:ft,binary:ft,...Vt};function ye(e,t="utf8"){const r=Mr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?It(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function ge(e,t="utf8"){const r=Mr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var qt=function(e,t,r){if(r||arguments.length===2)for(var i=0,a=t.length,s;i<a;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},Pi=function(){function e(t,r,i){this.name=t,this.version=r,this.os=i,this.type="browser"}return e}(),Ri=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=V.process.platform}return e}(),ji=function(){function e(t,r,i,a){this.name=t,this.version=r,this.os=i,this.bot=a,this.type="bot-device"}return e}(),Li=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Bi=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),xi=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,$i=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,zt=3,Hi=[["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|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["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",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",xi]],Yt=[["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/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["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 Ki(e){return e?kt(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bi:typeof navigator<"u"?kt(navigator.userAgent):Gi()}function Wi(e){return e!==""&&Hi.reduce(function(t,r){var i=r[0],a=r[1];if(t)return t;var s=a.exec(e);return!!s&&[i,s]},!1)}function kt(e){var t=Wi(e);if(!t)return null;var r=t[0],i=t[1];if(r==="searchbot")return new Li;var a=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);a?a.length<zt&&(a=qt(qt([],a,!0),qi(zt-a.length),!0)):a=[];var s=a.join("."),b=Vi(e),u=$i.exec(e);return u&&u[1]?new ji(r,s,b,u[1]):new Pi(r,s,b)}function Vi(e){for(var t=0,r=Yt.length;t<r;t++){var i=Yt[t],a=i[0],s=i[1],b=s.exec(e);if(b)return a}return null}function Gi(){var e=typeof V.process<"u"&&V.process.version;return e?new Ri(V.process.version.slice(1)):null}function qi(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var Te={};/*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */var pt=function(e,t){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},pt(e,t)};function zi(e,t){pt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var mt=function(){return mt=Object.assign||function(t){for(var r,i=1,a=arguments.length;i<a;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},mt.apply(this,arguments)};function Yi(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]]);return r}function ki(e,t,r,i){var a=arguments.length,s=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var u=e.length-1;u>=0;u--)(b=e[u])&&(s=(a<3?b(s):a>3?b(t,r,s):b(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}function Xi(e,t){return function(r,i){t(r,i,e)}}function Ji(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Qi(e,t,r,i){function a(s){return s instanceof r?s:new r(function(b){b(s)})}return new(r||(r=Promise))(function(s,b){function u(D){try{_(i.next(D))}catch(w){b(w)}}function l(D){try{_(i.throw(D))}catch(w){b(w)}}function _(D){D.done?s(D.value):a(D.value).then(u,l)}_((i=i.apply(e,t||[])).next())})}function Zi(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,b;return b={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function u(_){return function(D){return l([_,D])}}function l(_){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,a&&(s=_[0]&2?a.return:_[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,_[1])).done)return s;switch(a=0,s&&(_=[_[0]&2,s.value]),_[0]){case 0:case 1:s=_;break;case 4:return r.label++,{value:_[1],done:!1};case 5:r.label++,a=_[1],_=[0];continue;case 7:_=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(_[0]===6||_[0]===2)){r=0;continue}if(_[0]===3&&(!s||_[1]>s[0]&&_[1]<s[3])){r.label=_[1];break}if(_[0]===6&&r.label<s[1]){r.label=s[1],s=_;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(_);break}s[2]&&r.ops.pop(),r.trys.pop();continue}_=t.call(e,r)}catch(D){_=[6,D],a=0}finally{i=s=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}}function ea(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}function ta(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function St(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),a,s=[],b;try{for(;(t===void 0||t-- >0)&&!(a=i.next()).done;)s.push(a.value)}catch(u){b={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(b)throw b.error}}return s}function ra(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pr(arguments[t]));return e}function na(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),a=0,t=0;t<r;t++)for(var s=arguments[t],b=0,u=s.length;b<u;b++,a++)i[a]=s[b];return i}function He(e){return this instanceof He?(this.v=e,this):new He(e)}function ia(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),a,s=[];return a={},b("next"),b("throw"),b("return"),a[Symbol.asyncIterator]=function(){return this},a;function b(y){i[y]&&(a[y]=function(v){return new Promise(function(g,S){s.push([y,v,g,S])>1||u(y,v)})})}function u(y,v){try{l(i[y](v))}catch(g){w(s[0][3],g)}}function l(y){y.value instanceof He?Promise.resolve(y.value.v).then(_,D):w(s[0][2],y)}function _(y){u("next",y)}function D(y){u("throw",y)}function w(y,v){y(v),s.shift(),s.length&&u(s[0][0],s[0][1])}}function aa(e){var t,r;return t={},i("next"),i("throw",function(a){throw a}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(a,s){t[a]=e[a]?function(b){return(r=!r)?{value:He(e[a](b)),done:a==="return"}:s?s(b):b}:s}}function oa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof St=="function"?St(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=e[s]&&function(b){return new Promise(function(u,l){b=e[s](b),a(u,l,b.done,b.value)})}}function a(s,b,u,l){Promise.resolve(l).then(function(_){s({value:_,done:u})},b)}}function ua(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function sa(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function ca(e){return e&&e.__esModule?e:{default:e}}function fa(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function ha(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const la=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return mt},__asyncDelegator:aa,__asyncGenerator:ia,__asyncValues:oa,__await:He,__awaiter:Qi,__classPrivateFieldGet:fa,__classPrivateFieldSet:ha,__createBinding:ea,__decorate:ki,__exportStar:ta,__extends:zi,__generator:Zi,__importDefault:ca,__importStar:sa,__makeTemplateObject:ua,__metadata:Ji,__param:Xi,__read:Pr,__rest:Yi,__spread:ra,__spreadArrays:na,__values:St},Symbol.toStringTag,{value:"Module"})),at=Xr(la);var ht={},xe={},Xt;function da(){if(Xt)return xe;Xt=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return xe.delay=e,xe}var Ue={},lt={},Ae={},Jt;function Da(){return Jt||(Jt=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.ONE_THOUSAND=Ae.ONE_HUNDRED=void 0,Ae.ONE_HUNDRED=100,Ae.ONE_THOUSAND=1e3),Ae}var dt={},Qt;function ba(){return Qt||(Qt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(dt)),dt}var Zt;function Rr(){return Zt||(Zt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=at;t.__exportStar(Da(),e),t.__exportStar(ba(),e)}(lt)),lt}var er;function _a(){if(er)return Ue;er=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.fromMiliseconds=Ue.toMiliseconds=void 0;const e=Rr();function t(i){return i*e.ONE_THOUSAND}Ue.toMiliseconds=t;function r(i){return Math.floor(i/e.ONE_THOUSAND)}return Ue.fromMiliseconds=r,Ue}var tr;function Ea(){return tr||(tr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=at;t.__exportStar(da(),e),t.__exportStar(_a(),e)}(ht)),ht}var Pe={},rr;function wa(){if(rr)return Pe;rr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const a=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:a})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return Pe.Watch=e,Pe.default=e,Pe}var Dt={},$e={},nr;function va(){if(nr)return $e;nr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.IWatch=void 0;class e{}return $e.IWatch=e,$e}var ir;function ya(){return ir||(ir=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),at.__exportStar(va(),e)}(Dt)),Dt}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=at;t.__exportStar(Ea(),e),t.__exportStar(wa(),e),t.__exportStar(ya(),e),t.__exportStar(Rr(),e)})(Te);var q={};Object.defineProperty(q,"__esModule",{value:!0});q.getLocalStorage=q.getLocalStorageOrThrow=q.getCrypto=q.getCryptoOrThrow=jr=q.getLocation=q.getLocationOrThrow=Mt=q.getNavigator=q.getNavigatorOrThrow=Ft=q.getDocument=q.getDocumentOrThrow=q.getFromWindowOrThrow=q.getFromWindow=void 0;function Fe(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}q.getFromWindow=Fe;function je(e){const t=Fe(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}q.getFromWindowOrThrow=je;function ga(){return je("document")}q.getDocumentOrThrow=ga;function pa(){return Fe("document")}var Ft=q.getDocument=pa;function ma(){return je("navigator")}q.getNavigatorOrThrow=ma;function Sa(){return Fe("navigator")}var Mt=q.getNavigator=Sa;function Oa(){return je("location")}q.getLocationOrThrow=Oa;function Ca(){return Fe("location")}var jr=q.getLocation=Ca;function Ua(){return je("crypto")}q.getCryptoOrThrow=Ua;function Aa(){return Fe("crypto")}q.getCrypto=Aa;function Na(){return je("localStorage")}q.getLocalStorageOrThrow=Na;function Ta(){return Fe("localStorage")}q.getLocalStorage=Ta;var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});var Lr=Pt.getWindowMetadata=void 0;const ar=q;function Ia(){let e,t;try{e=ar.getDocumentOrThrow(),t=ar.getLocationOrThrow()}catch{return null}function r(){const w=e.getElementsByTagName("link"),y=[];for(let v=0;v<w.length;v++){const g=w[v],S=g.getAttribute("rel");if(S&&S.toLowerCase().indexOf("icon")>-1){const p=g.getAttribute("href");if(p)if(p.toLowerCase().indexOf("https:")===-1&&p.toLowerCase().indexOf("http:")===-1&&p.indexOf("//")!==0){let A=t.protocol+"//"+t.host;if(p.indexOf("/")===0)A+=p;else{const d=t.pathname.split("/");d.pop();const E=d.join("/");A+=E+"/"+p}y.push(A)}else if(p.indexOf("//")===0){const A=t.protocol+p;y.push(A)}else y.push(p)}}return y}function i(...w){const y=e.getElementsByTagName("meta");for(let v=0;v<y.length;v++){const g=y[v],S=["itemprop","property","name"].map(p=>g.getAttribute(p)).filter(p=>p?w.includes(p):!1);if(S.length&&S){const p=g.getAttribute("content");if(p)return p}}return""}function a(){let w=i("name","og:site_name","og:title","twitter:title");return w||(w=e.title),w}function s(){return i("description","og:description","twitter:description","keywords")}const b=a(),u=s(),l=t.origin,_=r();return{description:u,url:l,icons:_,name:b}}Lr=Pt.getWindowMetadata=Ia;var Ke={},Fa=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Br="%[a-f0-9]{2}",or=new RegExp("("+Br+")|([^%]+?)","gi"),ur=new RegExp("("+Br+")+","gi");function Ot(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],Ot(r),Ot(i))}function Ma(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(or)||[],r=1;r<t.length;r++)e=Ot(t,r).join(""),t=e.match(or)||[];return e}}function Pa(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=ur.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Ma(r[0]);i!==r[0]&&(t[r[0]]=i)}r=ur.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var b=a[s];e=e.replace(new RegExp(b,"g"),t[b])}return e}var Ra=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Pa(e)}},ja=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},La=function(e,t){for(var r={},i=Object.keys(e),a=Array.isArray(t),s=0;s<i.length;s++){var b=i[s],u=e[b];(a?t.indexOf(b)!==-1:t(b,u,e))&&(r[b]=u)}return r};(function(e){const t=Fa,r=Ra,i=ja,a=La,s=d=>d==null,b=Symbol("encodeFragmentIdentifier");function u(d){switch(d.arrayFormat){case"index":return E=>(c,h)=>{const f=c.length;return h===void 0||d.skipNull&&h===null||d.skipEmptyString&&h===""?c:h===null?[...c,[D(E,d),"[",f,"]"].join("")]:[...c,[D(E,d),"[",D(f,d),"]=",D(h,d)].join("")]};case"bracket":return E=>(c,h)=>h===void 0||d.skipNull&&h===null||d.skipEmptyString&&h===""?c:h===null?[...c,[D(E,d),"[]"].join("")]:[...c,[D(E,d),"[]=",D(h,d)].join("")];case"colon-list-separator":return E=>(c,h)=>h===void 0||d.skipNull&&h===null||d.skipEmptyString&&h===""?c:h===null?[...c,[D(E,d),":list="].join("")]:[...c,[D(E,d),":list=",D(h,d)].join("")];case"comma":case"separator":case"bracket-separator":{const E=d.arrayFormat==="bracket-separator"?"[]=":"=";return c=>(h,f)=>f===void 0||d.skipNull&&f===null||d.skipEmptyString&&f===""?h:(f=f===null?"":f,h.length===0?[[D(c,d),E,D(f,d)].join("")]:[[h,D(f,d)].join(d.arrayFormatSeparator)])}default:return E=>(c,h)=>h===void 0||d.skipNull&&h===null||d.skipEmptyString&&h===""?c:h===null?[...c,D(E,d)]:[...c,[D(E,d),"=",D(h,d)].join("")]}}function l(d){let E;switch(d.arrayFormat){case"index":return(c,h,f)=>{if(E=/\[(\d*)\]$/.exec(c),c=c.replace(/\[\d*\]$/,""),!E){f[c]=h;return}f[c]===void 0&&(f[c]={}),f[c][E[1]]=h};case"bracket":return(c,h,f)=>{if(E=/(\[\])$/.exec(c),c=c.replace(/\[\]$/,""),!E){f[c]=h;return}if(f[c]===void 0){f[c]=[h];return}f[c]=[].concat(f[c],h)};case"colon-list-separator":return(c,h,f)=>{if(E=/(:list)$/.exec(c),c=c.replace(/:list$/,""),!E){f[c]=h;return}if(f[c]===void 0){f[c]=[h];return}f[c]=[].concat(f[c],h)};case"comma":case"separator":return(c,h,f)=>{const n=typeof h=="string"&&h.includes(d.arrayFormatSeparator),o=typeof h=="string"&&!n&&w(h,d).includes(d.arrayFormatSeparator);h=o?w(h,d):h;const m=n||o?h.split(d.arrayFormatSeparator).map(C=>w(C,d)):h===null?h:w(h,d);f[c]=m};case"bracket-separator":return(c,h,f)=>{const n=/(\[\])$/.test(c);if(c=c.replace(/\[\]$/,""),!n){f[c]=h&&w(h,d);return}const o=h===null?[]:h.split(d.arrayFormatSeparator).map(m=>w(m,d));if(f[c]===void 0){f[c]=o;return}f[c]=[].concat(f[c],o)};default:return(c,h,f)=>{if(f[c]===void 0){f[c]=h;return}f[c]=[].concat(f[c],h)}}}function _(d){if(typeof d!="string"||d.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function D(d,E){return E.encode?E.strict?t(d):encodeURIComponent(d):d}function w(d,E){return E.decode?r(d):d}function y(d){return Array.isArray(d)?d.sort():typeof d=="object"?y(Object.keys(d)).sort((E,c)=>Number(E)-Number(c)).map(E=>d[E]):d}function v(d){const E=d.indexOf("#");return E!==-1&&(d=d.slice(0,E)),d}function g(d){let E="";const c=d.indexOf("#");return c!==-1&&(E=d.slice(c)),E}function S(d){d=v(d);const E=d.indexOf("?");return E===-1?"":d.slice(E+1)}function p(d,E){return E.parseNumbers&&!Number.isNaN(Number(d))&&typeof d=="string"&&d.trim()!==""?d=Number(d):E.parseBooleans&&d!==null&&(d.toLowerCase()==="true"||d.toLowerCase()==="false")&&(d=d.toLowerCase()==="true"),d}function A(d,E){E=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},E),_(E.arrayFormatSeparator);const c=l(E),h=Object.create(null);if(typeof d!="string"||(d=d.trim().replace(/^[?#&]/,""),!d))return h;for(const f of d.split("&")){if(f==="")continue;let[n,o]=i(E.decode?f.replace(/\+/g," "):f,"=");o=o===void 0?null:["comma","separator","bracket-separator"].includes(E.arrayFormat)?o:w(o,E),c(w(n,E),o,h)}for(const f of Object.keys(h)){const n=h[f];if(typeof n=="object"&&n!==null)for(const o of Object.keys(n))n[o]=p(n[o],E);else h[f]=p(n,E)}return E.sort===!1?h:(E.sort===!0?Object.keys(h).sort():Object.keys(h).sort(E.sort)).reduce((f,n)=>{const o=h[n];return o&&typeof o=="object"&&!Array.isArray(o)?f[n]=y(o):f[n]=o,f},Object.create(null))}e.extract=S,e.parse=A,e.stringify=(d,E)=>{if(!d)return"";E=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},E),_(E.arrayFormatSeparator);const c=o=>E.skipNull&&s(d[o])||E.skipEmptyString&&d[o]==="",h=u(E),f={};for(const o of Object.keys(d))c(o)||(f[o]=d[o]);const n=Object.keys(f);return E.sort!==!1&&n.sort(E.sort),n.map(o=>{const m=d[o];return m===void 0?"":m===null?D(o,E):Array.isArray(m)?m.length===0&&E.arrayFormat==="bracket-separator"?D(o,E)+"[]":m.reduce(h(o),[]).join("&"):D(o,E)+"="+D(m,E)}).filter(o=>o.length>0).join("&")},e.parseUrl=(d,E)=>{E=Object.assign({decode:!0},E);const[c,h]=i(d,"#");return Object.assign({url:c.split("?")[0]||"",query:A(S(d),E)},E&&E.parseFragmentIdentifier&&h?{fragmentIdentifier:w(h,E)}:{})},e.stringifyUrl=(d,E)=>{E=Object.assign({encode:!0,strict:!0,[b]:!0},E);const c=v(d.url).split("?")[0]||"",h=e.extract(d.url),f=e.parse(h,{sort:!1}),n=Object.assign(f,d.query);let o=e.stringify(n,E);o&&(o=`?${o}`);let m=g(d.url);return d.fragmentIdentifier&&(m=`#${E[b]?D(d.fragmentIdentifier,E):d.fragmentIdentifier}`),`${c}${o}${m}`},e.pick=(d,E,c)=>{c=Object.assign({parseFragmentIdentifier:!0,[b]:!1},c);const{url:h,query:f,fragmentIdentifier:n}=e.parseUrl(d,c);return e.stringifyUrl({url:h,query:a(f,E),fragmentIdentifier:n},c)},e.exclude=(d,E,c)=>{const h=Array.isArray(E)?f=>!E.includes(f):(f,n)=>!E(f,n);return e.pick(d,h,c)}})(Ke);const Ba={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},xr=":";function jo(e){const[t,r]=e.split(xr);return{namespace:t,reference:r}}function Lo(e){const[t,r,i]=e.split(xr);return{namespace:t,reference:r,address:i}}function Bo(e,t=[]){const r=[];return Object.keys(e).forEach(i=>{if(t.length&&!t.includes(i))return;const a=e[i];r.push(...a.accounts)}),r}function $r(e,t){return e.includes(":")?[e]:t.chains||[]}const Hr="base10",Ee="base16",Ct="base64pad",Rt="utf8",Kr=0,Ge=1,xa=0,sr=1,Ut=12,jt=32;function xo(){const e=Tt.generateKeyPair();return{privateKey:ge(e.secretKey,Ee),publicKey:ge(e.publicKey,Ee)}}function $o(){const e=Ze.randomBytes(jt);return ge(e,Ee)}function Ho(e,t){const r=Tt.sharedKey(ye(e,Ee),ye(t,Ee),!0),i=new In(nt.SHA256,r).expand(jt);return ge(i,Ee)}function Ko(e){const t=nt.hash(ye(e,Ee));return ge(t,Ee)}function Wo(e){const t=nt.hash(ye(e,Rt));return ge(t,Ee)}function $a(e){return ye(`${e}`,Hr)}function ot(e){return Number(ge(e,Hr))}function Vo(e){const t=$a(typeof e.type<"u"?e.type:Kr);if(ot(t)===Ge&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?ye(e.senderPublicKey,Ee):void 0,i=typeof e.iv<"u"?ye(e.iv,Ee):Ze.randomBytes(Ut),a=new At.ChaCha20Poly1305(ye(e.symKey,Ee)).seal(i,ye(e.message,Rt));return Ha({type:t,sealed:a,iv:i,senderPublicKey:r})}function Go(e){const t=new At.ChaCha20Poly1305(ye(e.symKey,Ee)),{sealed:r,iv:i}=Wr(e.encoded),a=t.open(i,r);if(a===null)throw new Error("Failed to decrypt");return ge(a,Rt)}function Ha(e){if(ot(e.type)===Ge){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ge(Wt([e.type,e.senderPublicKey,e.iv,e.sealed]),Ct)}return ge(Wt([e.type,e.iv,e.sealed]),Ct)}function Wr(e){const t=ye(e,Ct),r=t.slice(xa,sr),i=sr;if(ot(r)===Ge){const u=i+jt,l=u+Ut,_=t.slice(i,u),D=t.slice(u,l),w=t.slice(l);return{type:r,sealed:w,iv:D,senderPublicKey:_}}const a=i+Ut,s=t.slice(i,a),b=t.slice(a);return{type:r,sealed:b,iv:s}}function qo(e,t){const r=Wr(e);return Ka({type:ot(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ge(r.senderPublicKey,Ee):void 0,receiverPublicKey:t==null?void 0:t.receiverPublicKey})}function Ka(e){const t=(e==null?void 0:e.type)||Kr;if(t===Ge){if(typeof(e==null?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(e==null?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e==null?void 0:e.senderPublicKey,receiverPublicKey:e==null?void 0:e.receiverPublicKey}}function zo(e){return e.type===Ge&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}var Wa=Object.defineProperty,cr=Object.getOwnPropertySymbols,Va=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,fr=(e,t,r)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hr=(e,t)=>{for(var r in t||(t={}))Va.call(t,r)&&fr(e,r,t[r]);if(cr)for(var r of cr(t))Ga.call(t,r)&&fr(e,r,t[r]);return e};const qa="ReactNative",we={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},za="js";function Vr(){return typeof V.process<"u"&&typeof V.process.versions<"u"&&typeof V.process.versions.node<"u"}function qe(){return!Ft()&&!!Mt()&&navigator.product===qa}function ut(){return!Vr()&&!!Mt()&&!!Ft()}function ze(){return qe()?we.reactNative:Vr()?we.node:ut()?we.browser:we.unknown}function Yo(){var e;try{return qe()&&typeof V.global<"u"&&typeof(V.global==null?void 0:V.global.Application)<"u"?(e=V.global.Application)==null?void 0:e.applicationId:void 0}catch{return}}function Ya(e,t){let r=Ke.parse(e);return r=hr(hr({},r),t),e=Ke.stringify(r),e}function ko(){return Lr()||{name:"",description:"",url:"",icons:[""]}}function ka(){if(ze()===we.reactNative&&typeof V.global<"u"&&typeof(V.global==null?void 0:V.global.Platform)<"u"){const{OS:r,Version:i}=V.global.Platform;return[r,i].join("-")}const e=Ki();if(e===null)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function Xa(){var e;const t=ze();return t===we.browser?[t,((e=jr())==null?void 0:e.host)||"unknown"].join(":"):t}function Ja(e,t,r){const i=ka(),a=Xa();return[[e,t].join("-"),[za,r].join("-"),i,a].join("/")}function Xo({protocol:e,version:t,relayUrl:r,sdkVersion:i,auth:a,projectId:s,useOnCloseEvent:b,bundleId:u}){const l=r.split("?"),_=Ja(e,t,i),D={auth:a,ua:_,projectId:s,useOnCloseEvent:b||void 0,origin:u||void 0},w=Ya(l[1]||"",D);return l[0]+"?"+w}function Ne(e,t){return e.filter(r=>t.includes(r)).length===e.length}function Jo(e){return Object.fromEntries(e.entries())}function Qo(e){return new Map(Object.entries(e))}function Zo(e=Te.FIVE_MINUTES,t){const r=Te.toMiliseconds(e||Te.FIVE_MINUTES);let i,a,s;return{resolve:b=>{s&&i&&(clearTimeout(s),i(b))},reject:b=>{s&&a&&(clearTimeout(s),a(b))},done:()=>new Promise((b,u)=>{s=setTimeout(()=>{u(new Error(t))},r),i=b,a=u})}}function eu(e,t,r){return new Promise(async(i,a)=>{const s=setTimeout(()=>a(new Error(r)),t);try{const b=await e;i(b)}catch(b){a(b)}clearTimeout(s)})}function Gr(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function tu(e){return Gr("topic",e)}function ru(e){return Gr("id",e)}function nu(e){const[t,r]=e.split(":"),i={id:void 0,topic:void 0};if(t==="topic"&&typeof r=="string")i.topic=r;else if(t==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return i}function iu(e,t){return Te.fromMiliseconds((t||Date.now())+Te.toMiliseconds(e))}function au(e){return Date.now()>=Te.toMiliseconds(e)}function ou(e,t){return`${e}${t?`:${t}`:""}`}function bt(e=[],t=[]){return[...new Set([...e,...t])]}async function uu({id:e,topic:t,wcDeepLink:r}){try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r;let a=i==null?void 0:i.href;if(typeof a!="string")return;a.endsWith("/")&&(a=a.slice(0,-1));const s=`${a}/wc?requestId=${e}&sessionTopic=${t}`,b=ze();b===we.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):b===we.reactNative&&typeof(V.global==null?void 0:V.global.Linking)<"u"&&await V.global.Linking.openURL(s)}catch(i){console.error(i)}}async function su(e,t){try{return await e.getItem(t)||(ut()?localStorage.getItem(t):void 0)}catch(r){console.error(r)}}const Qa="irn";function cu(e){return(e==null?void 0:e.relay)||{protocol:Qa}}function fu(e){const t=Ba[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Za=Object.defineProperty,lr=Object.getOwnPropertySymbols,eo=Object.prototype.hasOwnProperty,to=Object.prototype.propertyIsEnumerable,dr=(e,t,r)=>t in e?Za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ro=(e,t)=>{for(var r in t||(t={}))eo.call(t,r)&&dr(e,r,t[r]);if(lr)for(var r of lr(t))to.call(t,r)&&dr(e,r,t[r]);return e};function no(e,t="-"){const r={},i="relay"+t;return Object.keys(e).forEach(a=>{if(a.startsWith(i)){const s=a.replace(i,""),b=e[a];r[s]=b}}),r}function hu(e){e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;const t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,i=e.substring(0,t),a=e.substring(t+1,r).split("@"),s=typeof r<"u"?e.substring(r):"",b=Ke.parse(s);return{protocol:i,topic:io(a[0]),version:parseInt(a[1],10),symKey:b.symKey,relay:no(b)}}function io(e){return e.startsWith("//")?e.substring(2):e}function ao(e,t="-"){const r="relay",i={};return Object.keys(e).forEach(a=>{const s=r+t+a;e[a]&&(i[s]=e[a])}),i}function lu(e){return`${e.protocol}:${e.topic}@${e.version}?`+Ke.stringify(ro({symKey:e.symKey},ao(e.relay)))}var oo=Object.defineProperty,uo=Object.defineProperties,so=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertySymbols,co=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ho=(e,t)=>{for(var r in t||(t={}))co.call(t,r)&&br(e,r,t[r]);if(Dr)for(var r of Dr(t))fo.call(t,r)&&br(e,r,t[r]);return e},lo=(e,t)=>uo(e,so(t));function Le(e){const t=[];return e.forEach(r=>{const[i,a]=r.split(":");t.push(`${i}:${a}`)}),t}function Do(e){const t=[];return Object.values(e).forEach(r=>{t.push(...Le(r.accounts))}),t}function bo(e,t){const r=[];return Object.values(e).forEach(i=>{Le(i.accounts).includes(t)&&r.push(...i.methods)}),r}function _o(e,t){const r=[];return Object.values(e).forEach(i=>{Le(i.accounts).includes(t)&&r.push(...i.events)}),r}function du(e,t){const r=Co(e,t);if(r)throw new Error(r.message);const i={};for(const[a,s]of Object.entries(e))i[a]={methods:s.methods,events:s.events,chains:s.accounts.map(b=>`${b.split(":")[0]}:${b.split(":")[1]}`)};return i}function qr(e){return e.includes(":")}function Eo(e){return qr(e)?e.split(":")[0]:e}function Du(e){var t,r,i;const a={};if(!Lt(e))return a;for(const[s,b]of Object.entries(e)){const u=qr(s)?[s]:b.chains,l=b.methods||[],_=b.events||[],D=Eo(s);a[D]=lo(ho({},a[D]),{chains:bt(u,(t=a[D])==null?void 0:t.chains),methods:bt(l,(r=a[D])==null?void 0:r.methods),events:bt(_,(i=a[D])==null?void 0:i.events)})}return a}const wo={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},vo={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Se(e,t){const{message:r,code:i}=vo[e];return{message:t?`${r} ${t}`:r,code:i}}function Re(e,t){const{message:r,code:i}=wo[e];return{message:t?`${r} ${t}`:r,code:i}}function st(e,t){return Array.isArray(e)?typeof t<"u"&&e.length?e.every(t):!0:!1}function Lt(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function Ie(e){return typeof e>"u"}function ve(e,t){return t&&Ie(e)?!0:typeof e=="string"&&!!e.trim().length}function Bt(e,t){return t&&Ie(e)?!0:typeof e=="number"&&!isNaN(e)}function bu(e,t){const{requiredNamespaces:r}=t,i=Object.keys(e.namespaces),a=Object.keys(r);let s=!0;return Ne(a,i)?(i.forEach(b=>{const{accounts:u,methods:l,events:_}=e.namespaces[b],D=Le(u),w=r[b];(!Ne($r(b,w),D)||!Ne(w.methods,l)||!Ne(w.events,_))&&(s=!1)}),s):!1}function Je(e){return ve(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function yo(e){if(ve(e,!1)&&e.includes(":")){const t=e.split(":");if(t.length===3){const r=t[0]+":"+t[1];return!!t[2]&&Je(r)}}return!1}function _u(e){if(ve(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}function Eu(e){var t;return(t=e==null?void 0:e.proposer)==null?void 0:t.publicKey}function wu(e){return e==null?void 0:e.topic}function vu(e,t){let r=null;return ve(e==null?void 0:e.publicKey,!1)||(r=Se("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}function _r(e){let t=!0;return st(e)?e.length&&(t=e.every(r=>ve(r,!1))):t=!1,t}function go(e,t,r){let i=null;return st(t)&&t.length?t.forEach(a=>{i||Je(a)||(i=Re("UNSUPPORTED_CHAINS",`${r}, chain ${a} should be a string and conform to "namespace:chainId" format`))}):Je(e)||(i=Re("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function po(e,t,r){let i=null;return Object.entries(e).forEach(([a,s])=>{if(i)return;const b=go(a,$r(a,s),`${t} ${r}`);b&&(i=b)}),i}function mo(e,t){let r=null;return st(e)?e.forEach(i=>{r||yo(i)||(r=Re("UNSUPPORTED_ACCOUNTS",`${t}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):r=Re("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function So(e,t){let r=null;return Object.values(e).forEach(i=>{if(r)return;const a=mo(i==null?void 0:i.accounts,`${t} namespace`);a&&(r=a)}),r}function Oo(e,t){let r=null;return _r(e==null?void 0:e.methods)?_r(e==null?void 0:e.events)||(r=Re("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=Re("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}function zr(e,t){let r=null;return Object.values(e).forEach(i=>{if(r)return;const a=Oo(i,`${t}, namespace`);a&&(r=a)}),r}function yu(e,t,r){let i=null;if(e&&Lt(e)){const a=zr(e,t);a&&(i=a);const s=po(e,t,r);s&&(i=s)}else i=Se("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return i}function Co(e,t){let r=null;if(e&&Lt(e)){const i=zr(e,t);i&&(r=i);const a=So(e,t);a&&(r=a)}else r=Se("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function Uo(e){return ve(e.protocol,!0)}function gu(e,t){let r=!1;return t&&!e?r=!0:e&&st(e)&&e.length&&e.forEach(i=>{r=Uo(i)}),r}function pu(e){return typeof e=="number"}function mu(e){return typeof e<"u"&&typeof e!==null}function Su(e){return!(!e||typeof e!="object"||!e.code||!Bt(e.code,!1)||!e.message||!ve(e.message,!1))}function Ou(e){return!(Ie(e)||!ve(e.method,!1))}function Cu(e){return!(Ie(e)||Ie(e.result)&&Ie(e.error)||!Bt(e.id,!1)||!ve(e.jsonrpc,!1))}function Uu(e){return!(Ie(e)||!ve(e.name,!1))}function Au(e,t){return!(!Je(t)||!Do(e).includes(t))}function Nu(e,t,r){return ve(r,!1)?bo(e,t).includes(r):!1}function Tu(e,t,r){return ve(r,!1)?_o(e,t).includes(r):!1}function Iu(e,t,r){let i=null;const a=Ao(e),s=No(t),b=Object.keys(a),u=Object.keys(s),l=Er(Object.keys(e)),_=Er(Object.keys(t)),D=l.filter(w=>!_.includes(w));return D.length&&(i=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
15
- Required: ${D.toString()}
16
- Received: ${Object.keys(t).toString()}`)),Ne(b,u)||(i=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
17
- Required: ${b.toString()}
18
- Approved: ${u.toString()}`)),Object.keys(t).forEach(w=>{if(!w.includes(":")||i)return;const y=Le(t[w].accounts);y.includes(w)||(i=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${w}
19
- Required: ${w}
20
- Approved: ${y.toString()}`))}),b.forEach(w=>{i||(Ne(a[w].methods,s[w].methods)?Ne(a[w].events,s[w].events)||(i=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${w}`)):i=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${w}`))}),i}function Ao(e){const t={};return Object.keys(e).forEach(r=>{var i;r.includes(":")?t[r]=e[r]:(i=e[r].chains)==null||i.forEach(a=>{t[a]={methods:e[r].methods,events:e[r].events}})}),t}function Er(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function No(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{const i=Le(e[r].accounts);i==null||i.forEach(a=>{t[a]={accounts:e[r].accounts.filter(s=>s.includes(`${a}:`)),methods:e[r].methods,events:e[r].events}})}}),t}function Fu(e,t){return Bt(e,!1)&&e<=t.max&&e>=t.min}function Mu(){const e=ze();return new Promise(t=>{switch(e){case we.browser:t(To());break;case we.reactNative:t(Io());break;case we.node:t(Fo());break;default:t(!0)}})}function To(){return ut()&&(navigator==null?void 0:navigator.onLine)}async function Io(){if(qe()&&typeof V.global<"u"&&V.global!=null&&V.global.NetInfo){const e=await(V.global==null?void 0:V.global.NetInfo.fetch());return e==null?void 0:e.isConnected}return!0}function Fo(){return!0}function Pu(e){switch(ze()){case we.browser:Mo(e);break;case we.reactNative:Po(e);break}}function Mo(e){!qe()&&ut()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function Po(e){var t;qe()&&typeof V.global<"u"&&V.global!=null&&V.global.NetInfo&&((t=V.global)==null||t.NetInfo.addEventListener(r=>e(r==null?void 0:r.isConnected)))}const _t={};class Ru{static get(t){return _t[t]}static set(t,r){_t[t]=r}static delete(t){delete _t[t]}}export{ot as $,Ka as A,Lt as B,hu as C,Zo as D,ou as E,Go as F,au as G,qo as H,lu as I,Yo as J,Ko as K,mu as L,wu as M,Se as N,_u as O,ve as P,nu as Q,tu as R,bt as S,ru as T,Re as U,Eu as V,qe as W,Xo as X,ut as Y,Vr as Z,Ge as _,Bo as a,Jo as a0,Qo as a1,Wo as a2,cu as a3,fu as a4,ko as a5,du as a6,su as a7,uu as a8,bu as a9,Ru as aa,gu as ab,yu as ac,Co as ad,Iu as ae,Su as af,Uo as ag,vu as ah,Au as ai,Ou as aj,Nu as ak,Fu as al,Cu as am,Uu as an,Tu as ao,pu as ap,R as b,Te as c,Wt as d,Eo as e,ye as f,Ie as g,xo as h,$o as i,Ho as j,st as k,Wr as l,Mu as m,Pu as n,qr as o,Ee as p,zo as q,Ze as r,Du as s,ge as t,eu as u,jo as v,pe as w,Vo as x,iu as y,Lo as z};