bitcoin-wallet-connector 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +208 -0
  2. package/lib/BitcoinConnectionProvider.d.ts +23 -0
  3. package/lib/BitcoinWalletAdapterConnector-Bq835yj0.mjs +123 -0
  4. package/lib/BitcoinWalletAdapterConnector-Bq835yj0.mjs.map +1 -0
  5. package/lib/BitcoinWalletAdapterConnector-DMef0iHV.js +2 -0
  6. package/lib/BitcoinWalletAdapterConnector-DMef0iHV.js.map +1 -0
  7. package/lib/BitcoinWalletAdapterConnector.d.ts +30 -0
  8. package/lib/BitgetWalletAdapter.impl-C_HLO7Oi.mjs +10 -0
  9. package/lib/BitgetWalletAdapter.impl-C_HLO7Oi.mjs.map +1 -0
  10. package/lib/BitgetWalletAdapter.impl-CxnKMf7U.js +2 -0
  11. package/lib/BitgetWalletAdapter.impl-CxnKMf7U.js.map +1 -0
  12. package/lib/LeatherWalletAdapter.impl-B2QgX_tO.js +2 -0
  13. package/lib/LeatherWalletAdapter.impl-B2QgX_tO.js.map +1 -0
  14. package/lib/LeatherWalletAdapter.impl-RUYx555r.mjs +184 -0
  15. package/lib/LeatherWalletAdapter.impl-RUYx555r.mjs.map +1 -0
  16. package/lib/MagicEdenWalletAdapter.impl-CrA6SGvG.mjs +235 -0
  17. package/lib/MagicEdenWalletAdapter.impl-CrA6SGvG.mjs.map +1 -0
  18. package/lib/MagicEdenWalletAdapter.impl-Di3Nu2S5.js +2 -0
  19. package/lib/MagicEdenWalletAdapter.impl-Di3Nu2S5.js.map +1 -0
  20. package/lib/OkxWalletAdapter.impl-BepoUL1B.mjs +67 -0
  21. package/lib/OkxWalletAdapter.impl-BepoUL1B.mjs.map +1 -0
  22. package/lib/OkxWalletAdapter.impl-C8kesjGu.js +2 -0
  23. package/lib/OkxWalletAdapter.impl-C8kesjGu.js.map +1 -0
  24. package/lib/UnisatCompatibleWalletAdapterImpl-Cq2Oqk1b.js +2 -0
  25. package/lib/UnisatCompatibleWalletAdapterImpl-Cq2Oqk1b.js.map +1 -0
  26. package/lib/UnisatCompatibleWalletAdapterImpl-M38FqkZI.mjs +137 -0
  27. package/lib/UnisatCompatibleWalletAdapterImpl-M38FqkZI.mjs.map +1 -0
  28. package/lib/UnisatWalletAdapter.impl-CJB22se8.mjs +14 -0
  29. package/lib/UnisatWalletAdapter.impl-CJB22se8.mjs.map +1 -0
  30. package/lib/UnisatWalletAdapter.impl-EISvxdpc.js +2 -0
  31. package/lib/UnisatWalletAdapter.impl-EISvxdpc.js.map +1 -0
  32. package/lib/WalletAdapters.types-CnvOqHFH.mjs +32 -0
  33. package/lib/WalletAdapters.types-CnvOqHFH.mjs.map +1 -0
  34. package/lib/WalletAdapters.types-De_x1lzr.js +2 -0
  35. package/lib/WalletAdapters.types-De_x1lzr.js.map +1 -0
  36. package/lib/WalletAdapters.types.d.ts +110 -0
  37. package/lib/XverseCompatibleWalletAdapterImpl-Bf-BK5VK.js +2 -0
  38. package/lib/XverseCompatibleWalletAdapterImpl-Bf-BK5VK.js.map +1 -0
  39. package/lib/XverseCompatibleWalletAdapterImpl-DXKnO_-V.mjs +151 -0
  40. package/lib/XverseCompatibleWalletAdapterImpl-DXKnO_-V.mjs.map +1 -0
  41. package/lib/XverseWalletAdapter.impl-CZO0RQva.mjs +105 -0
  42. package/lib/XverseWalletAdapter.impl-CZO0RQva.mjs.map +1 -0
  43. package/lib/XverseWalletAdapter.impl-lJwMi-Iv.js +2 -0
  44. package/lib/XverseWalletAdapter.impl-lJwMi-Iv.js.map +1 -0
  45. package/lib/adapters/BitgetWalletAdapter.d.ts +2 -0
  46. package/lib/adapters/BitgetWalletAdapter.impl.d.ts +8 -0
  47. package/lib/adapters/LeatherWalletAdapter.d.ts +2 -0
  48. package/lib/adapters/LeatherWalletAdapter.impl.d.ts +41 -0
  49. package/lib/adapters/MagicEdenWalletAdapter.d.ts +11 -0
  50. package/lib/adapters/MagicEdenWalletAdapter.impl.d.ts +22 -0
  51. package/lib/adapters/MockAddressWalletAdapter.d.ts +33 -0
  52. package/lib/adapters/OkxWalletAdapter.d.ts +2 -0
  53. package/lib/adapters/OkxWalletAdapter.impl.d.ts +51 -0
  54. package/lib/adapters/UnisatWalletAdapter.d.ts +2 -0
  55. package/lib/adapters/UnisatWalletAdapter.impl.d.ts +14 -0
  56. package/lib/adapters/XverseWalletAdapter.d.ts +3 -0
  57. package/lib/adapters/XverseWalletAdapter.impl.d.ts +14 -0
  58. package/lib/adapters/index.d.ts +7 -0
  59. package/lib/adapters.js +2 -0
  60. package/lib/adapters.js.map +1 -0
  61. package/lib/adapters.mjs +11 -0
  62. package/lib/adapters.mjs.map +1 -0
  63. package/lib/bitget-C7oB4Ffq.mjs +5 -0
  64. package/lib/bitget-C7oB4Ffq.mjs.map +1 -0
  65. package/lib/bitget-DXnsxx_y.js +2 -0
  66. package/lib/bitget-DXnsxx_y.js.map +1 -0
  67. package/lib/index-CaV3F1Nm.js +424 -0
  68. package/lib/index-CaV3F1Nm.js.map +1 -0
  69. package/lib/index-CcQUdePc.mjs +12224 -0
  70. package/lib/index-CcQUdePc.mjs.map +1 -0
  71. package/lib/index-D7YwhNAG.mjs +3946 -0
  72. package/lib/index-D7YwhNAG.mjs.map +1 -0
  73. package/lib/index-Zx0KcpYx.js +2 -0
  74. package/lib/index-Zx0KcpYx.js.map +1 -0
  75. package/lib/index.d.ts +3 -0
  76. package/lib/index.js +2 -0
  77. package/lib/index.js.map +1 -0
  78. package/lib/index.mjs +20 -0
  79. package/lib/index.mjs.map +1 -0
  80. package/lib/leather-BoQG_CPn.mjs +5 -0
  81. package/lib/leather-BoQG_CPn.mjs.map +1 -0
  82. package/lib/leather-DJ8nWmM8.js +2 -0
  83. package/lib/leather-DJ8nWmM8.js.map +1 -0
  84. package/lib/magiceden-B36CEQa6.js +2 -0
  85. package/lib/magiceden-B36CEQa6.js.map +1 -0
  86. package/lib/magiceden-Cg7d3agI.mjs +5 -0
  87. package/lib/magiceden-Cg7d3agI.mjs.map +1 -0
  88. package/lib/misc-B5EWO_dn.mjs +10 -0
  89. package/lib/misc-B5EWO_dn.mjs.map +1 -0
  90. package/lib/misc-CigR0RqC.js +2 -0
  91. package/lib/misc-CigR0RqC.js.map +1 -0
  92. package/lib/okx-ChwzM0dK.js +2 -0
  93. package/lib/okx-ChwzM0dK.js.map +1 -0
  94. package/lib/okx-DWbHwazu.mjs +5 -0
  95. package/lib/okx-DWbHwazu.mjs.map +1 -0
  96. package/lib/react.d.ts +2 -0
  97. package/lib/react.js +2 -0
  98. package/lib/react.js.map +1 -0
  99. package/lib/react.mjs +128 -0
  100. package/lib/react.mjs.map +1 -0
  101. package/lib/transaction-CiLOYSE_.mjs +1063 -0
  102. package/lib/transaction-CiLOYSE_.mjs.map +1 -0
  103. package/lib/transaction-CzdnbXSo.js +2 -0
  104. package/lib/transaction-CzdnbXSo.js.map +1 -0
  105. package/lib/unisat-BvZW5h0U.js +2 -0
  106. package/lib/unisat-BvZW5h0U.js.map +1 -0
  107. package/lib/unisat-pLgab4nG.mjs +5 -0
  108. package/lib/unisat-pLgab4nG.mjs.map +1 -0
  109. package/lib/utils/StateChannel.d.ts +14 -0
  110. package/lib/utils/UnisatCompatibleWalletAdapterImpl.d.ts +99 -0
  111. package/lib/utils/XverseCompatibleWalletAdapterImpl.d.ts +80 -0
  112. package/lib/utils/XverseCompatibleWalletAdapterImpl_legacy.d.ts +44 -0
  113. package/lib/utils/bitcoinAddressHelpers.d.ts +14 -0
  114. package/lib/utils/bitcoinNetworkHelpers.d.ts +4 -0
  115. package/lib/utils/createAdapterAvailability.d.ts +15 -0
  116. package/lib/utils/error.d.ts +6 -0
  117. package/lib/utils/misc.d.ts +3 -0
  118. package/lib/xverse-IKOHyGi-.js +2 -0
  119. package/lib/xverse-IKOHyGi-.js.map +1 -0
  120. package/lib/xverse-iHLNanCB.mjs +5 -0
  121. package/lib/xverse-iHLNanCB.mjs.map +1 -0
  122. package/package.json +86 -0
  123. package/src/BitcoinConnectionProvider.stories.tsx +329 -0
  124. package/src/BitcoinConnectionProvider.tsx +234 -0
  125. package/src/BitcoinWalletAdapterConnector.ts +166 -0
  126. package/src/WalletAdapters.types.ts +154 -0
  127. package/src/_/bitget.png +0 -0
  128. package/src/_/leather.svg +4 -0
  129. package/src/_/magiceden.png +0 -0
  130. package/src/_/okx.png +0 -0
  131. package/src/_/unisat.svg +31 -0
  132. package/src/_/xverse.png +0 -0
  133. package/src/adapters/BitgetWalletAdapter.impl.ts +22 -0
  134. package/src/adapters/BitgetWalletAdapter.ts +44 -0
  135. package/src/adapters/LeatherWalletAdapter.impl.ts +324 -0
  136. package/src/adapters/LeatherWalletAdapter.ts +35 -0
  137. package/src/adapters/MagicEdenWalletAdapter.impl.ts +139 -0
  138. package/src/adapters/MagicEdenWalletAdapter.ts +51 -0
  139. package/src/adapters/MockAddressWalletAdapter.ts +199 -0
  140. package/src/adapters/OkxWalletAdapter.impl.ts +168 -0
  141. package/src/adapters/OkxWalletAdapter.ts +37 -0
  142. package/src/adapters/UnisatWalletAdapter.impl.ts +32 -0
  143. package/src/adapters/UnisatWalletAdapter.ts +50 -0
  144. package/src/adapters/XverseWalletAdapter.impl.ts +150 -0
  145. package/src/adapters/XverseWalletAdapter.ts +37 -0
  146. package/src/adapters/index.ts +7 -0
  147. package/src/env.d.ts +9 -0
  148. package/src/index.ts +3 -0
  149. package/src/react.ts +9 -0
  150. package/src/utils/StateChannel.ts +39 -0
  151. package/src/utils/UnisatCompatibleWalletAdapterImpl.ts +342 -0
  152. package/src/utils/XverseCompatibleWalletAdapterImpl.ts +288 -0
  153. package/src/utils/XverseCompatibleWalletAdapterImpl_legacy.ts +278 -0
  154. package/src/utils/bitcoinAddressHelpers.ts +132 -0
  155. package/src/utils/bitcoinNetworkHelpers.ts +17 -0
  156. package/src/utils/createAdapterAvailability.ts +92 -0
  157. package/src/utils/error.ts +13 -0
  158. package/src/utils/misc.ts +10 -0
@@ -0,0 +1,424 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var dn;function gc(e){return{lang:e?.lang??dn?.lang,message:e?.message,abortEarly:e?.abortEarly??dn?.abortEarly,abortPipeEarly:e?.abortPipeEarly??dn?.abortPipeEarly}}var mc;function yc(e){return mc?.get(e)}var wc;function bc(e){return wc?.get(e)}var xc;function Sc(e,t){return xc?.get(e)?.get(t)}function qr(e){const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function Ce(e,t,r,n,s){const o=s&&"input"in s?s.input:r.value,i=s?.expected??e.expects??null,a=s?.received??qr(o),h={kind:e.kind,type:e.type,input:o,expected:i,received:a,message:`Invalid ${t}: ${i?`Expected ${i} but r`:"R"}eceived ${a}`,requirement:e.requirement,path:s?.path,issues:s?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},f=e.kind==="schema",l=s?.message??e.message??Sc(e.reference,h.lang)??(f?bc(h.lang):null)??n.message??yc(h.lang);l!==void 0&&(h.message=typeof l=="function"?l(h):l),f&&(r.typed=!1),r.issues?r.issues.push(h):r.issues=[h]}function Ue(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},gc())}}}function gi(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Gr(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function mi(e,t){return{kind:"validation",type:"check",reference:mi,async:!1,expects:null,requirement:e,message:t,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&Ce(this,"input",r,n),r}}}function yi(e,t){return{kind:"validation",type:"max_length",reference:yi,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&Ce(this,"length",r,n,{received:`${r.value.length}`}),r}}}function wi(e,t){return{kind:"validation",type:"min_length",reference:wi,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&Ce(this,"length",r,n,{received:`${r.value.length}`}),r}}}function bi(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function Vr(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function ps(e,t){return!e["~run"]({value:t},{abortEarly:!0}).issues}function be(e,t){return{kind:"schema",type:"array",reference:be,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){const s=r.value;if(Array.isArray(s)){r.typed=!0,r.value=[];for(let o=0;o<s.length;o++){const i=s[o],a=this.item["~run"]({value:i},n);if(a.issues){const h={type:"array",origin:"value",input:s,key:o,value:i};for(const f of a.issues)f.path?f.path.unshift(h):f.path=[h],r.issues?.push(f);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else Ce(this,"type",r,n);return r}}}function gt(e){return{kind:"schema",type:"boolean",reference:gt,expects:"boolean",async:!1,message:e,get"~standard"(){return Ue(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:Ce(this,"type",t,r),t}}}function je(e,t){const r=[];for(const n in e)(`${+n}`!==n||typeof e[n]!="string"||!Object.is(e[e[n]],+n))&&r.push(e[n]);return{kind:"schema",type:"enum",reference:je,expects:Gr(r.map(qr),"|"),async:!1,enum:e,options:r,message:t,get"~standard"(){return Ue(this)},"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:Ce(this,"type",n,s),n}}}function J(e,t){return{kind:"schema",type:"literal",reference:J,expects:qr(e),async:!1,literal:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){return r.value===this.literal?r.typed=!0:Ce(this,"type",r,n),r}}}function xi(e,t){return{kind:"schema",type:"loose_object",reference:xi,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){const s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(const o in this.entries){const i=this.entries[o];if(o in s||(i.type==="exact_optional"||i.type==="optional"||i.type==="nullish")&&i.default!==void 0){const a=o in s?s[o]:Vr(i),h=i["~run"]({value:a},n);if(h.issues){const f={type:"object",origin:"value",input:s,key:o,value:a};for(const l of h.issues)l.path?l.path.unshift(f):l.path=[f],r.issues?.push(l);if(r.issues||(r.issues=h.issues),n.abortEarly){r.typed=!1;break}}h.typed||(r.typed=!1),r.value[o]=h.value}else if(i.fallback!==void 0)r.value[o]=bi(i);else if(i.type!=="exact_optional"&&i.type!=="optional"&&i.type!=="nullish"&&(Ce(this,"key",r,n,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),n.abortEarly))break}if(!r.issues||!n.abortEarly)for(const o in s)gi(s,o)&&!(o in this.entries)&&(r.value[o]=s[o])}else Ce(this,"type",r,n);return r}}}function Gn(e,t){return{kind:"schema",type:"non_optional",reference:Gn,expects:"!undefined",async:!1,wrapped:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){return r.value!==void 0&&(r=this.wrapped["~run"](r,n)),r.value===void 0&&Ce(this,"type",r,n),r}}}function He(e){return{kind:"schema",type:"null",reference:He,expects:"null",async:!1,message:e,get"~standard"(){return Ue(this)},"~run"(t,r){return t.value===null?t.typed=!0:Ce(this,"type",t,r),t}}}function Oe(e,t){return{kind:"schema",type:"nullish",reference:Oe,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Ue(this)},"~run"(r,n){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Vr(this,r,n)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function ge(e){return{kind:"schema",type:"number",reference:ge,expects:"number",async:!1,message:e,get"~standard"(){return Ue(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:Ce(this,"type",t,r),t}}}function S(e,t){return{kind:"schema",type:"object",reference:S,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){const s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(const o in this.entries){const i=this.entries[o];if(o in s||(i.type==="exact_optional"||i.type==="optional"||i.type==="nullish")&&i.default!==void 0){const a=o in s?s[o]:Vr(i),h=i["~run"]({value:a},n);if(h.issues){const f={type:"object",origin:"value",input:s,key:o,value:a};for(const l of h.issues)l.path?l.path.unshift(f):l.path=[f],r.issues?.push(l);if(r.issues||(r.issues=h.issues),n.abortEarly){r.typed=!1;break}}h.typed||(r.typed=!1),r.value[o]=h.value}else if(i.fallback!==void 0)r.value[o]=bi(i);else if(i.type!=="exact_optional"&&i.type!=="optional"&&i.type!=="nullish"&&(Ce(this,"key",r,n,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:s,key:o,value:s[o]}]}),n.abortEarly))break}}else Ce(this,"type",r,n);return r}}}function K(e,t){return{kind:"schema",type:"optional",reference:K,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Ue(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Vr(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Si(e,t){return{kind:"schema",type:"picklist",reference:Si,expects:Gr(e.map(qr),"|"),async:!1,options:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Ce(this,"type",r,n),r}}}function vi(e,t,r){return{kind:"schema",type:"record",reference:vi,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return Ue(this)},"~run"(n,s){const o=n.value;if(o&&typeof o=="object"){n.typed=!0,n.value={};for(const i in o)if(gi(o,i)){const a=o[i],h=this.key["~run"]({value:i},s);if(h.issues){const l={type:"object",origin:"key",input:o,key:i,value:a};for(const y of h.issues)y.path=[l],n.issues?.push(y);if(n.issues||(n.issues=h.issues),s.abortEarly){n.typed=!1;break}}const f=this.value["~run"]({value:a},s);if(f.issues){const l={type:"object",origin:"value",input:o,key:i,value:a};for(const y of f.issues)y.path?y.path.unshift(l):y.path=[l],n.issues?.push(y);if(n.issues||(n.issues=f.issues),s.abortEarly){n.typed=!1;break}}(!h.typed||!f.typed)&&(n.typed=!1),h.typed&&(n.value[h.value]=f.value)}}else Ce(this,"type",n,s);return n}}}function m(e){return{kind:"schema",type:"string",reference:m,expects:"string",async:!1,message:e,get"~standard"(){return Ue(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:Ce(this,"type",t,r),t}}}function gs(e){let t;if(e)for(const r of e)t?t.push(...r.issues):t=r.issues;return t}function Be(e,t){return{kind:"schema",type:"union",reference:Be,expects:Gr(e.map(r=>r.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return Ue(this)},"~run"(r,n){let s,o,i;for(const a of this.options){const h=a["~run"]({value:r.value},n);if(h.typed)if(h.issues)o?o.push(h):o=[h];else{s=h;break}else i?i.push(h):i=[h]}if(s)return s;if(o){if(o.length===1)return o[0];Ce(this,"type",r,n,{issues:gs(o)}),r.typed=!0}else{if(i?.length===1)return i[0];Ce(this,"type",r,n,{issues:gs(i)})}return r}}}function Wr(){return{kind:"schema",type:"unknown",reference:Wr,expects:"unknown",async:!1,get"~standard"(){return Ue(this)},"~run"(e){return e.typed=!0,e}}}function yr(e,t,r){return{kind:"schema",type:"variant",reference:yr,expects:"Object",async:!1,key:e,options:t,message:r,get"~standard"(){return Ue(this)},"~run"(n,s){const o=n.value;if(o&&typeof o=="object"){let i,a=0,h=this.key,f=[];const l=(y,k)=>{for(const I of y.options){if(I.type==="variant")l(I,new Set(k).add(I.key));else{let x=!0,M=0;for(const E of k){const U=I.entries[E];if(E in o?U["~run"]({typed:!1,value:o[E]},{abortEarly:!0}).issues:U.type!=="exact_optional"&&U.type!=="optional"&&U.type!=="nullish"){x=!1,h!==E&&(a<M||a===M&&E in o&&!(h in o))&&(a=M,h=E,f=[]),h===E&&f.push(I.entries[E].expects);break}M++}if(x){const E=I["~run"]({value:o},s);(!i||!i.typed&&E.typed)&&(i=E)}}if(i&&!i.issues)break}};if(l(this,new Set([this.key])),i)return i;Ce(this,"type",n,s,{input:o[h],expected:Gr(f,"|"),path:[{type:"object",origin:"value",input:o,key:h,value:o[h]}]})}else Ce(this,"type",n,s);return n}}}function ms(e,t){const r={...e.entries};for(const n of t)delete r[n];return{...e,entries:r,get"~standard"(){return Ue(this)}}}function Tn(...e){return{...e[0],pipe:e,get"~standard"(){return Ue(this)},"~run"(t,r){for(const n of e)if(n.kind!=="metadata"){if(t.issues&&(n.kind==="schema"||n.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=n["~run"](t,r))}return t}}}function vc(e){return e.wrapped}function Mc(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var _t={},bt={},et={},or={},ys;function Vn(){if(ys)return or;ys=1,or.byteLength=a,or.toByteArray=f,or.fromByteArray=k;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=n.length;s<o;++s)e[s]=n[s],t[n.charCodeAt(s)]=s;t[45]=62,t[95]=63;function i(I){var x=I.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var M=I.indexOf("=");M===-1&&(M=x);var E=M===x?0:4-M%4;return[M,E]}function a(I){var x=i(I),M=x[0],E=x[1];return(M+E)*3/4-E}function h(I,x,M){return(x+M)*3/4-M}function f(I){var x,M=i(I),E=M[0],U=M[1],j=new r(h(I,E,U)),O=0,G=U>0?E-4:E,L;for(L=0;L<G;L+=4)x=t[I.charCodeAt(L)]<<18|t[I.charCodeAt(L+1)]<<12|t[I.charCodeAt(L+2)]<<6|t[I.charCodeAt(L+3)],j[O++]=x>>16&255,j[O++]=x>>8&255,j[O++]=x&255;return U===2&&(x=t[I.charCodeAt(L)]<<2|t[I.charCodeAt(L+1)]>>4,j[O++]=x&255),U===1&&(x=t[I.charCodeAt(L)]<<10|t[I.charCodeAt(L+1)]<<4|t[I.charCodeAt(L+2)]>>2,j[O++]=x>>8&255,j[O++]=x&255),j}function l(I){return e[I>>18&63]+e[I>>12&63]+e[I>>6&63]+e[I&63]}function y(I,x,M){for(var E,U=[],j=x;j<M;j+=3)E=(I[j]<<16&16711680)+(I[j+1]<<8&65280)+(I[j+2]&255),U.push(l(E));return U.join("")}function k(I){for(var x,M=I.length,E=M%3,U=[],j=16383,O=0,G=M-E;O<G;O+=j)U.push(y(I,O,O+j>G?G:O+j));return E===1?(x=I[M-1],U.push(e[x>>2]+e[x<<4&63]+"==")):E===2&&(x=(I[M-2]<<8)+I[M-1],U.push(e[x>>10]+e[x>>4&63]+e[x<<2&63]+"=")),U.join("")}return or}var ws;function Yr(){if(ws)return et;ws=1,Object.defineProperty(et,"__esModule",{value:!0}),et.decode=et.encode=et.unescape=et.escape=et.pad=void 0;const e=Vn();function t(i){return`${i}${"=".repeat(4-(i.length%4||4))}`}et.pad=t;function r(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}et.escape=r;function n(i){return t(i).replace(/-/g,"+").replace(/_/g,"/")}et.unescape=n;function s(i){return r((0,e.fromByteArray)(new TextEncoder().encode(i)))}et.encode=s;function o(i){return new TextDecoder().decode((0,e.toByteArray)(t(n(i))))}return et.decode=o,et}var fn={},ar={},hn={},pn={},cr={},bs;function Ac(){return bs||(bs=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.crypto=void 0,cr.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),cr}var xs;function Qr(){return xs||(xs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=r,e.anumber=n,e.abytes=s,e.ahash=o,e.aexists=i,e.aoutput=a,e.u8=h,e.u32=f,e.clean=l,e.createView=y,e.rotr=k,e.rotl=I,e.byteSwap=x,e.byteSwap32=M,e.bytesToHex=j,e.hexToBytes=L,e.asyncLoop=$,e.utf8ToBytes=te,e.bytesToUtf8=H,e.toBytes=B,e.kdfInputToBytes=D,e.concatBytes=ee,e.checkOpts=Q,e.createHasher=se,e.createOptHasher=me,e.createXOFer=xe,e.randomBytes=ve;const t=Ac();function r(C){return C instanceof Uint8Array||ArrayBuffer.isView(C)&&C.constructor.name==="Uint8Array"}function n(C){if(!Number.isSafeInteger(C)||C<0)throw new Error("positive integer expected, got "+C)}function s(C,...W){if(!r(C))throw new Error("Uint8Array expected");if(W.length>0&&!W.includes(C.length))throw new Error("Uint8Array expected of length "+W+", got length="+C.length)}function o(C){if(typeof C!="function"||typeof C.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");n(C.outputLen),n(C.blockLen)}function i(C,W=!0){if(C.destroyed)throw new Error("Hash instance has been destroyed");if(W&&C.finished)throw new Error("Hash#digest() has already been called")}function a(C,W){s(C);const V=W.outputLen;if(C.length<V)throw new Error("digestInto() expects output buffer of length at least "+V)}function h(C){return new Uint8Array(C.buffer,C.byteOffset,C.byteLength)}function f(C){return new Uint32Array(C.buffer,C.byteOffset,Math.floor(C.byteLength/4))}function l(...C){for(let W=0;W<C.length;W++)C[W].fill(0)}function y(C){return new DataView(C.buffer,C.byteOffset,C.byteLength)}function k(C,W){return C<<32-W|C>>>W}function I(C,W){return C<<W|C>>>32-W>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function x(C){return C<<24&4278190080|C<<8&16711680|C>>>8&65280|C>>>24&255}e.swap8IfBE=e.isLE?C=>C:C=>x(C),e.byteSwapIfBE=e.swap8IfBE;function M(C){for(let W=0;W<C.length;W++)C[W]=x(C[W]);return C}e.swap32IfBE=e.isLE?C=>C:M;const E=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",U=Array.from({length:256},(C,W)=>W.toString(16).padStart(2,"0"));function j(C){if(s(C),E)return C.toHex();let W="";for(let V=0;V<C.length;V++)W+=U[C[V]];return W}const O={_0:48,_9:57,A:65,F:70,a:97,f:102};function G(C){if(C>=O._0&&C<=O._9)return C-O._0;if(C>=O.A&&C<=O.F)return C-(O.A-10);if(C>=O.a&&C<=O.f)return C-(O.a-10)}function L(C){if(typeof C!="string")throw new Error("hex string expected, got "+typeof C);if(E)return Uint8Array.fromHex(C);const W=C.length,V=W/2;if(W%2)throw new Error("hex string expected, got unpadded hex of length "+W);const X=new Uint8Array(V);for(let fe=0,he=0;fe<V;fe++,he+=2){const ye=G(C.charCodeAt(he)),Te=G(C.charCodeAt(he+1));if(ye===void 0||Te===void 0){const q=C[he]+C[he+1];throw new Error('hex string expected, got non-hex character "'+q+'" at index '+he)}X[fe]=ye*16+Te}return X}const _=async()=>{};e.nextTick=_;async function $(C,W,V){let X=Date.now();for(let fe=0;fe<C;fe++){V(fe);const he=Date.now()-X;he>=0&&he<W||(await(0,e.nextTick)(),X+=he)}}function te(C){if(typeof C!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(C))}function H(C){return new TextDecoder().decode(C)}function B(C){return typeof C=="string"&&(C=te(C)),s(C),C}function D(C){return typeof C=="string"&&(C=te(C)),s(C),C}function ee(...C){let W=0;for(let X=0;X<C.length;X++){const fe=C[X];s(fe),W+=fe.length}const V=new Uint8Array(W);for(let X=0,fe=0;X<C.length;X++){const he=C[X];V.set(he,fe),fe+=he.length}return V}function Q(C,W){if(W!==void 0&&{}.toString.call(W)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(C,W)}class re{}e.Hash=re;function se(C){const W=X=>C().update(B(X)).digest(),V=C();return W.outputLen=V.outputLen,W.blockLen=V.blockLen,W.create=()=>C(),W}function me(C){const W=(X,fe)=>C(fe).update(B(X)).digest(),V=C({});return W.outputLen=V.outputLen,W.blockLen=V.blockLen,W.create=X=>C(X),W}function xe(C){const W=(X,fe)=>C(fe).update(B(X)).digest(),V=C({});return W.outputLen=V.outputLen,W.blockLen=V.blockLen,W.create=X=>C(X),W}e.wrapConstructor=se,e.wrapConstructorWithOpts=me,e.wrapXOFConstructorWithOpts=xe;function ve(C=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(C));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(C));throw new Error("crypto.getRandomValues must be defined")}})(pn)),pn}var Ss;function Ec(){return Ss||(Ss=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Qr();class r extends t.Hash{constructor(o,i){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(o);const a=(0,t.toBytes)(i);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const h=this.blockLen,f=new Uint8Array(h);f.set(a.length>h?o.create().update(a).digest():a);for(let l=0;l<f.length;l++)f[l]^=54;this.iHash.update(f),this.oHash=o.create();for(let l=0;l<f.length;l++)f[l]^=106;this.oHash.update(f),(0,t.clean)(f)}update(o){return(0,t.aexists)(this),this.iHash.update(o),this}digestInto(o){(0,t.aexists)(this),(0,t.abytes)(o,this.outputLen),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||(o=Object.create(Object.getPrototypeOf(this),{}));const{oHash:i,iHash:a,finished:h,destroyed:f,blockLen:l,outputLen:y}=this;return o=o,o.finished=h,o.destroyed=f,o.blockLen=l,o.outputLen=y,o.oHash=i._cloneInto(o.oHash),o.iHash=a._cloneInto(o.iHash),o}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=r;const n=(s,o,i)=>new r(s,o).update(i).digest();e.hmac=n,e.hmac.create=(s,o)=>new r(s,o)})(hn)),hn}var at={},Ie={},Ge={},vs;function Ic(){if(vs)return Ge;vs=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.SHA512_IV=Ge.SHA384_IV=Ge.SHA224_IV=Ge.SHA256_IV=Ge.HashMD=void 0,Ge.setBigUint64=t,Ge.Chi=r,Ge.Maj=n;const e=Qr();function t(o,i,a,h){if(typeof o.setBigUint64=="function")return o.setBigUint64(i,a,h);const f=BigInt(32),l=BigInt(4294967295),y=Number(a>>f&l),k=Number(a&l),I=h?4:0,x=h?0:4;o.setUint32(i+I,y,h),o.setUint32(i+x,k,h)}function r(o,i,a){return o&i^~o&a}function n(o,i,a){return o&i^o&a^i&a}class s extends e.Hash{constructor(i,a,h,f){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=i,this.outputLen=a,this.padOffset=h,this.isLE=f,this.buffer=new Uint8Array(i),this.view=(0,e.createView)(this.buffer)}update(i){(0,e.aexists)(this),i=(0,e.toBytes)(i),(0,e.abytes)(i);const{view:a,buffer:h,blockLen:f}=this,l=i.length;for(let y=0;y<l;){const k=Math.min(f-this.pos,l-y);if(k===f){const I=(0,e.createView)(i);for(;f<=l-y;y+=f)this.process(I,y);continue}h.set(i.subarray(y,y+k),this.pos),this.pos+=k,y+=k,this.pos===f&&(this.process(a,0),this.pos=0)}return this.length+=i.length,this.roundClean(),this}digestInto(i){(0,e.aexists)(this),(0,e.aoutput)(i,this),this.finished=!0;const{buffer:a,view:h,blockLen:f,isLE:l}=this;let{pos:y}=this;a[y++]=128,(0,e.clean)(this.buffer.subarray(y)),this.padOffset>f-y&&(this.process(h,0),y=0);for(let E=y;E<f;E++)a[E]=0;t(h,f-8,BigInt(this.length*8),l),this.process(h,0);const k=(0,e.createView)(i),I=this.outputLen;if(I%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const x=I/4,M=this.get();if(x>M.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;E<x;E++)k.setUint32(4*E,M[E],l)}digest(){const{buffer:i,outputLen:a}=this;this.digestInto(i);const h=i.slice(0,a);return this.destroy(),h}_cloneInto(i){i||(i=new this.constructor),i.set(...this.get());const{blockLen:a,buffer:h,length:f,finished:l,destroyed:y,pos:k}=this;return i.destroyed=y,i.finished=l,i.length=f,i.pos=k,f%a&&i.buffer.set(h),i}clone(){return this._cloneInto()}}return Ge.HashMD=s,Ge.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Ge.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ge.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Ge}var ae={},Ms;function Nc(){if(Ms)return ae;Ms=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.toBig=ae.shrSL=ae.shrSH=ae.rotrSL=ae.rotrSH=ae.rotrBL=ae.rotrBH=ae.rotr32L=ae.rotr32H=ae.rotlSL=ae.rotlSH=ae.rotlBL=ae.rotlBH=ae.add5L=ae.add5H=ae.add4L=ae.add4H=ae.add3L=ae.add3H=void 0,ae.add=U,ae.fromBig=r,ae.split=n;const e=BigInt(2**32-1),t=BigInt(32);function r(H,B=!1){return B?{h:Number(H&e),l:Number(H>>t&e)}:{h:Number(H>>t&e)|0,l:Number(H&e)|0}}function n(H,B=!1){const D=H.length;let ee=new Uint32Array(D),Q=new Uint32Array(D);for(let re=0;re<D;re++){const{h:se,l:me}=r(H[re],B);[ee[re],Q[re]]=[se,me]}return[ee,Q]}const s=(H,B)=>BigInt(H>>>0)<<t|BigInt(B>>>0);ae.toBig=s;const o=(H,B,D)=>H>>>D;ae.shrSH=o;const i=(H,B,D)=>H<<32-D|B>>>D;ae.shrSL=i;const a=(H,B,D)=>H>>>D|B<<32-D;ae.rotrSH=a;const h=(H,B,D)=>H<<32-D|B>>>D;ae.rotrSL=h;const f=(H,B,D)=>H<<64-D|B>>>D-32;ae.rotrBH=f;const l=(H,B,D)=>H>>>D-32|B<<64-D;ae.rotrBL=l;const y=(H,B)=>B;ae.rotr32H=y;const k=(H,B)=>H;ae.rotr32L=k;const I=(H,B,D)=>H<<D|B>>>32-D;ae.rotlSH=I;const x=(H,B,D)=>B<<D|H>>>32-D;ae.rotlSL=x;const M=(H,B,D)=>B<<D-32|H>>>64-D;ae.rotlBH=M;const E=(H,B,D)=>H<<D-32|B>>>64-D;ae.rotlBL=E;function U(H,B,D,ee){const Q=(B>>>0)+(ee>>>0);return{h:H+D+(Q/2**32|0)|0,l:Q|0}}const j=(H,B,D)=>(H>>>0)+(B>>>0)+(D>>>0);ae.add3L=j;const O=(H,B,D,ee)=>B+D+ee+(H/2**32|0)|0;ae.add3H=O;const G=(H,B,D,ee)=>(H>>>0)+(B>>>0)+(D>>>0)+(ee>>>0);ae.add4L=G;const L=(H,B,D,ee,Q)=>B+D+ee+Q+(H/2**32|0)|0;ae.add4H=L;const _=(H,B,D,ee,Q)=>(H>>>0)+(B>>>0)+(D>>>0)+(ee>>>0)+(Q>>>0);ae.add5L=_;const $=(H,B,D,ee,Q,re)=>B+D+ee+Q+re+(H/2**32|0)|0;ae.add5H=$;const te={fromBig:r,split:n,toBig:s,shrSH:o,shrSL:i,rotrSH:a,rotrSL:h,rotrBH:f,rotrBL:l,rotr32H:y,rotr32L:k,rotlSH:I,rotlSL:x,rotlBH:M,rotlBL:E,add:U,add3L:j,add3H:O,add4L:G,add4H:L,add5H:$,add5L:_};return ae.default=te,ae}var As;function kc(){if(As)return Ie;As=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.sha512_224=Ie.sha512_256=Ie.sha384=Ie.sha512=Ie.sha224=Ie.sha256=Ie.SHA512_256=Ie.SHA512_224=Ie.SHA384=Ie.SHA512=Ie.SHA224=Ie.SHA256=void 0;const e=Ic(),t=Nc(),r=Qr(),n=Uint32Array.from([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]),s=new Uint32Array(64);class o extends e.HashMD{constructor(O=32){super(64,O,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:O,B:G,C:L,D:_,E:$,F:te,G:H,H:B}=this;return[O,G,L,_,$,te,H,B]}set(O,G,L,_,$,te,H,B){this.A=O|0,this.B=G|0,this.C=L|0,this.D=_|0,this.E=$|0,this.F=te|0,this.G=H|0,this.H=B|0}process(O,G){for(let Q=0;Q<16;Q++,G+=4)s[Q]=O.getUint32(G,!1);for(let Q=16;Q<64;Q++){const re=s[Q-15],se=s[Q-2],me=(0,r.rotr)(re,7)^(0,r.rotr)(re,18)^re>>>3,xe=(0,r.rotr)(se,17)^(0,r.rotr)(se,19)^se>>>10;s[Q]=xe+s[Q-7]+me+s[Q-16]|0}let{A:L,B:_,C:$,D:te,E:H,F:B,G:D,H:ee}=this;for(let Q=0;Q<64;Q++){const re=(0,r.rotr)(H,6)^(0,r.rotr)(H,11)^(0,r.rotr)(H,25),se=ee+re+(0,e.Chi)(H,B,D)+n[Q]+s[Q]|0,xe=((0,r.rotr)(L,2)^(0,r.rotr)(L,13)^(0,r.rotr)(L,22))+(0,e.Maj)(L,_,$)|0;ee=D,D=B,B=H,H=te+se|0,te=$,$=_,_=L,L=se+xe|0}L=L+this.A|0,_=_+this.B|0,$=$+this.C|0,te=te+this.D|0,H=H+this.E|0,B=B+this.F|0,D=D+this.G|0,ee=ee+this.H|0,this.set(L,_,$,te,H,B,D,ee)}roundClean(){(0,r.clean)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,r.clean)(this.buffer)}}Ie.SHA256=o;class i extends o{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}Ie.SHA224=i;const a=t.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),h=a[0],f=a[1],l=new Uint32Array(80),y=new Uint32Array(80);class k extends e.HashMD{constructor(O=64){super(128,O,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:O,Al:G,Bh:L,Bl:_,Ch:$,Cl:te,Dh:H,Dl:B,Eh:D,El:ee,Fh:Q,Fl:re,Gh:se,Gl:me,Hh:xe,Hl:ve}=this;return[O,G,L,_,$,te,H,B,D,ee,Q,re,se,me,xe,ve]}set(O,G,L,_,$,te,H,B,D,ee,Q,re,se,me,xe,ve){this.Ah=O|0,this.Al=G|0,this.Bh=L|0,this.Bl=_|0,this.Ch=$|0,this.Cl=te|0,this.Dh=H|0,this.Dl=B|0,this.Eh=D|0,this.El=ee|0,this.Fh=Q|0,this.Fl=re|0,this.Gh=se|0,this.Gl=me|0,this.Hh=xe|0,this.Hl=ve|0}process(O,G){for(let V=0;V<16;V++,G+=4)l[V]=O.getUint32(G),y[V]=O.getUint32(G+=4);for(let V=16;V<80;V++){const X=l[V-15]|0,fe=y[V-15]|0,he=t.rotrSH(X,fe,1)^t.rotrSH(X,fe,8)^t.shrSH(X,fe,7),ye=t.rotrSL(X,fe,1)^t.rotrSL(X,fe,8)^t.shrSL(X,fe,7),Te=l[V-2]|0,q=y[V-2]|0,Ne=t.rotrSH(Te,q,19)^t.rotrBH(Te,q,61)^t.shrSH(Te,q,6),wt=t.rotrSL(Te,q,19)^t.rotrBL(Te,q,61)^t.shrSL(Te,q,6),Qe=t.add4L(ye,wt,y[V-7],y[V-16]),Ot=t.add4H(Qe,he,Ne,l[V-7],l[V-16]);l[V]=Ot|0,y[V]=Qe|0}let{Ah:L,Al:_,Bh:$,Bl:te,Ch:H,Cl:B,Dh:D,Dl:ee,Eh:Q,El:re,Fh:se,Fl:me,Gh:xe,Gl:ve,Hh:C,Hl:W}=this;for(let V=0;V<80;V++){const X=t.rotrSH(Q,re,14)^t.rotrSH(Q,re,18)^t.rotrBH(Q,re,41),fe=t.rotrSL(Q,re,14)^t.rotrSL(Q,re,18)^t.rotrBL(Q,re,41),he=Q&se^~Q&xe,ye=re&me^~re&ve,Te=t.add5L(W,fe,ye,f[V],y[V]),q=t.add5H(Te,C,X,he,h[V],l[V]),Ne=Te|0,wt=t.rotrSH(L,_,28)^t.rotrBH(L,_,34)^t.rotrBH(L,_,39),Qe=t.rotrSL(L,_,28)^t.rotrBL(L,_,34)^t.rotrBL(L,_,39),Ot=L&$^L&H^$&H,Gt=_&te^_&B^te&B;C=xe|0,W=ve|0,xe=se|0,ve=me|0,se=Q|0,me=re|0,{h:Q,l:re}=t.add(D|0,ee|0,q|0,Ne|0),D=H|0,ee=B|0,H=$|0,B=te|0,$=L|0,te=_|0;const Ke=t.add3L(Ne,Qe,Gt);L=t.add3H(Ke,q,wt,Ot),_=Ke|0}({h:L,l:_}=t.add(this.Ah|0,this.Al|0,L|0,_|0)),{h:$,l:te}=t.add(this.Bh|0,this.Bl|0,$|0,te|0),{h:H,l:B}=t.add(this.Ch|0,this.Cl|0,H|0,B|0),{h:D,l:ee}=t.add(this.Dh|0,this.Dl|0,D|0,ee|0),{h:Q,l:re}=t.add(this.Eh|0,this.El|0,Q|0,re|0),{h:se,l:me}=t.add(this.Fh|0,this.Fl|0,se|0,me|0),{h:xe,l:ve}=t.add(this.Gh|0,this.Gl|0,xe|0,ve|0),{h:C,l:W}=t.add(this.Hh|0,this.Hl|0,C|0,W|0),this.set(L,_,$,te,H,B,D,ee,Q,re,se,me,xe,ve,C,W)}roundClean(){(0,r.clean)(l,y)}destroy(){(0,r.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Ie.SHA512=k;class I extends k{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}Ie.SHA384=I;const x=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),M=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class E extends k{constructor(){super(28),this.Ah=x[0]|0,this.Al=x[1]|0,this.Bh=x[2]|0,this.Bl=x[3]|0,this.Ch=x[4]|0,this.Cl=x[5]|0,this.Dh=x[6]|0,this.Dl=x[7]|0,this.Eh=x[8]|0,this.El=x[9]|0,this.Fh=x[10]|0,this.Fl=x[11]|0,this.Gh=x[12]|0,this.Gl=x[13]|0,this.Hh=x[14]|0,this.Hl=x[15]|0}}Ie.SHA512_224=E;class U extends k{constructor(){super(32),this.Ah=M[0]|0,this.Al=M[1]|0,this.Bh=M[2]|0,this.Bl=M[3]|0,this.Ch=M[4]|0,this.Cl=M[5]|0,this.Dh=M[6]|0,this.Dl=M[7]|0,this.Eh=M[8]|0,this.El=M[9]|0,this.Fh=M[10]|0,this.Fl=M[11]|0,this.Gh=M[12]|0,this.Gl=M[13]|0,this.Hh=M[14]|0,this.Hl=M[15]|0}}return Ie.SHA512_256=U,Ie.sha256=(0,r.createHasher)(()=>new o),Ie.sha224=(0,r.createHasher)(()=>new i),Ie.sha512=(0,r.createHasher)(()=>new k),Ie.sha384=(0,r.createHasher)(()=>new I),Ie.sha512_256=(0,r.createHasher)(()=>new U),Ie.sha512_224=(0,r.createHasher)(()=>new E),Ie}var Es;function Mi(){if(Es)return at;Es=1,Object.defineProperty(at,"__esModule",{value:!0}),at.sha224=at.SHA224=at.sha256=at.SHA256=void 0;const e=kc();return at.SHA256=e.SHA256,at.sha256=e.sha256,at.SHA224=e.SHA224,at.sha224=e.sha224,at}var gn={};const Tc={},Bc=Object.freeze(Object.defineProperty({__proto__:null,default:Tc},Symbol.toStringTag,{value:"Module"})),Ai=Mc(Bc);var Is;function Cc(){return Is||(Is=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.schnorr=e.verify=e.signSync=e.sign=e.getSharedSecret=e.recoverPublicKey=e.getPublicKey=e.hexToBytes=e.bytesToHex=e.Signature=e.Point=e.CURVE=void 0;const t=Ai,r=BigInt(0),n=BigInt(1),s=BigInt(2),o=BigInt(3),i=BigInt(8),a=Object.freeze({a:r,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});e.CURVE=a;const h=(w,p)=>(w+p/s)/p,f={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(w){const{n:p}=a,b=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),A=-n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),R=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),z=b,Y=BigInt("0x100000000000000000000000000000000"),Z=h(z*w,p),ie=h(-A*w,p);let ne=q(w-Z*b-ie*R,p),ue=q(-Z*A-ie*z,p);const we=ne>Y,Se=ue>Y;if(we&&(ne=p-ne),Se&&(ue=p-ue),ne>Y||ue>Y)throw new Error("splitScalarEndo: Endomorphism failed, k="+w);return{k1neg:we,k1:ne,k2neg:Se,k2:ue}}},l=32,y=32,k=32,I=l+1,x=2*l+1;function M(w){const{a:p,b}=a,A=q(w*w),R=q(A*w);return q(R+p*w+b)}const E=a.a===r;class U extends Error{constructor(p){super(p)}}function j(w){if(!(w instanceof O))throw new TypeError("JacobianPoint expected")}class O{constructor(p,b,A){this.x=p,this.y=b,this.z=A}static fromAffine(p){if(!(p instanceof _))throw new TypeError("JacobianPoint#fromAffine: expected Point");return p.equals(_.ZERO)?O.ZERO:new O(p.x,p.y,n)}static toAffineBatch(p){const b=Ot(p.map(A=>A.z));return p.map((A,R)=>A.toAffine(b[R]))}static normalizeZ(p){return O.toAffineBatch(p).map(O.fromAffine)}equals(p){j(p);const{x:b,y:A,z:R}=this,{x:z,y:Y,z:Z}=p,ie=q(R*R),ne=q(Z*Z),ue=q(b*ne),we=q(z*ie),Se=q(q(A*Z)*ne),Le=q(q(Y*R)*ie);return ue===we&&Se===Le}negate(){return new O(this.x,q(-this.y),this.z)}double(){const{x:p,y:b,z:A}=this,R=q(p*p),z=q(b*b),Y=q(z*z),Z=p+z,ie=q(s*(q(Z*Z)-R-Y)),ne=q(o*R),ue=q(ne*ne),we=q(ue-s*ie),Se=q(ne*(ie-we)-i*Y),Le=q(s*b*A);return new O(we,Se,Le)}add(p){j(p);const{x:b,y:A,z:R}=this,{x:z,y:Y,z:Z}=p;if(z===r||Y===r)return this;if(b===r||A===r)return p;const ie=q(R*R),ne=q(Z*Z),ue=q(b*ne),we=q(z*ie),Se=q(q(A*Z)*ne),Le=q(q(Y*R)*ie),Re=q(we-ue),ot=q(Le-Se);if(Re===r)return ot===r?this.double():O.ZERO;const Wt=q(Re*Re),Yt=q(Re*Wt),Qt=q(ue*Wt),Nr=q(ot*ot-Yt-s*Qt),ln=q(ot*(Qt-Nr)-Se*Yt),ir=q(R*Z*Re);return new O(Nr,ln,ir)}subtract(p){return this.add(p.negate())}multiplyUnsafe(p){const b=O.ZERO;if(typeof p=="bigint"&&p===r)return b;let A=Te(p);if(A===n)return this;if(!E){let we=b,Se=this;for(;A>r;)A&n&&(we=we.add(Se)),Se=Se.double(),A>>=n;return we}let{k1neg:R,k1:z,k2neg:Y,k2:Z}=f.splitScalar(A),ie=b,ne=b,ue=this;for(;z>r||Z>r;)z&n&&(ie=ie.add(ue)),Z&n&&(ne=ne.add(ue)),ue=ue.double(),z>>=n,Z>>=n;return R&&(ie=ie.negate()),Y&&(ne=ne.negate()),ne=new O(q(ne.x*f.beta),ne.y,ne.z),ie.add(ne)}precomputeWindow(p){const b=E?128/p+1:256/p+1,A=[];let R=this,z=R;for(let Y=0;Y<b;Y++){z=R,A.push(z);for(let Z=1;Z<2**(p-1);Z++)z=z.add(R),A.push(z);R=z.double()}return A}wNAF(p,b){!b&&this.equals(O.BASE)&&(b=_.BASE);const A=b&&b._WINDOW_SIZE||1;if(256%A)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let R=b&&L.get(b);R||(R=this.precomputeWindow(A),b&&A!==1&&(R=O.normalizeZ(R),L.set(b,R)));let z=O.ZERO,Y=O.BASE;const Z=1+(E?128/A:256/A),ie=2**(A-1),ne=BigInt(2**A-1),ue=2**A,we=BigInt(A);for(let Se=0;Se<Z;Se++){const Le=Se*ie;let Re=Number(p&ne);p>>=we,Re>ie&&(Re-=ue,p+=n);const ot=Le,Wt=Le+Math.abs(Re)-1,Yt=Se%2!==0,Qt=Re<0;Re===0?Y=Y.add(G(Yt,R[ot])):z=z.add(G(Qt,R[Wt]))}return{p:z,f:Y}}multiply(p,b){let A=Te(p),R,z;if(E){const{k1neg:Y,k1:Z,k2neg:ie,k2:ne}=f.splitScalar(A);let{p:ue,f:we}=this.wNAF(Z,b),{p:Se,f:Le}=this.wNAF(ne,b);ue=G(Y,ue),Se=G(ie,Se),Se=new O(q(Se.x*f.beta),Se.y,Se.z),R=ue.add(Se),z=we.add(Le)}else{const{p:Y,f:Z}=this.wNAF(A,b);R=Y,z=Z}return O.normalizeZ([R,z])[0]}toAffine(p){const{x:b,y:A,z:R}=this,z=this.equals(O.ZERO);p==null&&(p=z?i:Qe(R));const Y=p,Z=q(Y*Y),ie=q(Z*Y),ne=q(b*Z),ue=q(A*ie),we=q(R*Y);if(z)return _.ZERO;if(we!==n)throw new Error("invZ was invalid");return new _(ne,ue)}}O.BASE=new O(a.Gx,a.Gy,n),O.ZERO=new O(r,n,r);function G(w,p){const b=p.negate();return w?b:p}const L=new WeakMap;class _{constructor(p,b){this.x=p,this.y=b}_setWindowSize(p){this._WINDOW_SIZE=p,L.delete(this)}hasEvenY(){return this.y%s===r}static fromCompressedHex(p){const b=p.length===32,A=he(b?p:p.subarray(1));if(!Vt(A))throw new Error("Point is not on curve");const R=M(A);let z=wt(R);const Y=(z&n)===n;b?Y&&(z=q(-z)):(p[0]&1)===1!==Y&&(z=q(-z));const Z=new _(A,z);return Z.assertValidity(),Z}static fromUncompressedHex(p){const b=he(p.subarray(1,l+1)),A=he(p.subarray(l+1,l*2+1)),R=new _(b,A);return R.assertValidity(),R}static fromHex(p){const b=ye(p),A=b.length,R=b[0];if(A===l)return this.fromCompressedHex(b);if(A===I&&(R===2||R===3))return this.fromCompressedHex(b);if(A===x&&R===4)return this.fromUncompressedHex(b);throw new Error(`Point.fromHex: received invalid point. Expected 32-${I} compressed bytes or ${x} uncompressed bytes, not ${A}`)}static fromPrivateKey(p){return _.BASE.multiply(ht(p))}static fromSignature(p,b,A){const{r:R,s:z}=Xe(b);if(![0,1,2,3].includes(A))throw new Error("Cannot recover: invalid recovery bit");const Y=Ke(ye(p)),{n:Z}=a,ie=A===2||A===3?R+Z:R,ne=Qe(ie,Z),ue=q(-Y*ne,Z),we=q(z*ne,Z),Se=A&1?"03":"02",Le=_.fromHex(Se+W(ie)),Re=_.BASE.multiplyAndAddUnsafe(Le,ue,we);if(!Re)throw new Error("Cannot recover signature: point at infinify");return Re.assertValidity(),Re}toRawBytes(p=!1){return ve(this.toHex(p))}toHex(p=!1){const b=W(this.x);return p?`${this.hasEvenY()?"02":"03"}${b}`:`04${b}${W(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const p="Point is not on elliptic curve",{x:b,y:A}=this;if(!Vt(b)||!Vt(A))throw new Error(p);const R=q(A*A),z=M(b);if(q(R-z)!==r)throw new Error(p)}equals(p){return this.x===p.x&&this.y===p.y}negate(){return new _(this.x,q(-this.y))}double(){return O.fromAffine(this).double().toAffine()}add(p){return O.fromAffine(this).add(O.fromAffine(p)).toAffine()}subtract(p){return this.add(p.negate())}multiply(p){return O.fromAffine(this).multiply(p,this).toAffine()}multiplyAndAddUnsafe(p,b,A){const R=O.fromAffine(this),z=b===r||b===n||this!==_.BASE?R.multiplyUnsafe(b):R.multiply(b),Y=O.fromAffine(p).multiplyUnsafe(A),Z=z.add(Y);return Z.equals(O.ZERO)?void 0:Z.toAffine()}}e.Point=_,_.BASE=new _(a.Gx,a.Gy),_.ZERO=new _(r,r);function $(w){return Number.parseInt(w[0],16)>=8?"00"+w:w}function te(w){if(w.length<2||w[0]!==2)throw new Error(`Invalid signature integer tag: ${se(w)}`);const p=w[1],b=w.subarray(2,p+2);if(!p||b.length!==p)throw new Error("Invalid signature integer: wrong length");if(b[0]===0&&b[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:he(b),left:w.subarray(p+2)}}function H(w){if(w.length<2||w[0]!=48)throw new Error(`Invalid signature tag: ${se(w)}`);if(w[1]!==w.length-2)throw new Error("Invalid signature: incorrect length");const{data:p,left:b}=te(w.subarray(2)),{data:A,left:R}=te(b);if(R.length)throw new Error(`Invalid signature: left bytes after parsing: ${se(R)}`);return{r:p,s:A}}class B{constructor(p,b){this.r=p,this.s=b,this.assertValidity()}static fromCompact(p){const b=D(p),A="Signature.fromCompact";if(typeof p!="string"&&!b)throw new TypeError(`${A}: Expected string or Uint8Array`);const R=b?se(p):p;if(R.length!==128)throw new Error(`${A}: Expected 64-byte hex`);return new B(fe(R.slice(0,64)),fe(R.slice(64,128)))}static fromDER(p){const b=D(p);if(typeof p!="string"&&!b)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:A,s:R}=H(b?p:ve(p));return new B(A,R)}static fromHex(p){return this.fromDER(p)}assertValidity(){const{r:p,s:b}=this;if(!ft(p))throw new Error("Invalid Signature: r must be 0 < r < n");if(!ft(b))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const p=a.n>>n;return this.s>p}normalizeS(){return this.hasHighS()?new B(this.r,q(-this.s,a.n)):this}toDERRawBytes(){return ve(this.toDERHex())}toDERHex(){const p=$(X(this.s)),b=$(X(this.r)),A=p.length/2,R=b.length/2,z=X(A),Y=X(R);return`30${X(R+A+4)}02${Y}${b}02${z}${p}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return ve(this.toCompactHex())}toCompactHex(){return W(this.r)+W(this.s)}}e.Signature=B;function D(w){return w instanceof Uint8Array||ArrayBuffer.isView(w)&&w.constructor.name==="Uint8Array"}function ee(w){if(!D(w))throw new Error("Uint8Array expected")}function Q(...w){if(w.every(ee),w.length===1)return w[0];const p=w.reduce((A,R)=>A+R.length,0),b=new Uint8Array(p);for(let A=0,R=0;A<w.length;A++){const z=w[A];b.set(z,R),R+=z.length}return b}const re=Array.from({length:256},(w,p)=>p.toString(16).padStart(2,"0"));function se(w){ee(w);let p="";for(let b=0;b<w.length;b++)p+=re[w[b]];return p}e.bytesToHex=se;const me={_0:48,_9:57,A:65,F:70,a:97,f:102};function xe(w){if(w>=me._0&&w<=me._9)return w-me._0;if(w>=me.A&&w<=me.F)return w-(me.A-10);if(w>=me.a&&w<=me.f)return w-(me.a-10)}function ve(w){if(typeof w!="string")throw new Error("hex string expected, got "+typeof w);const p=w.length,b=p/2;if(p%2)throw new Error("hex string expected, got unpadded hex of length "+p);const A=new Uint8Array(b);for(let R=0,z=0;R<b;R++,z+=2){const Y=xe(w.charCodeAt(z)),Z=xe(w.charCodeAt(z+1));if(Y===void 0||Z===void 0){const ie=w[z]+w[z+1];throw new Error('hex string expected, got non-hex character "'+ie+'" at index '+z)}A[R]=Y*16+Z}return A}e.hexToBytes=ve;const C=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function W(w){if(typeof w!="bigint")throw new Error("Expected bigint");if(!(r<=w&&w<C))throw new Error("Expected number 0 <= n < 2^256");return w.toString(16).padStart(64,"0")}function V(w){const p=ve(W(w));if(p.length!==32)throw new Error("Error: expected 32 bytes");return p}function X(w){const p=w.toString(16);return p.length&1?`0${p}`:p}function fe(w){if(typeof w!="string")throw new TypeError("hexToNumber: expected string, got "+typeof w);return BigInt(`0x${w}`)}function he(w){return fe(se(w))}function ye(w){return D(w)?Uint8Array.from(w):ve(w)}function Te(w){if(typeof w=="number"&&Number.isSafeInteger(w)&&w>0)return BigInt(w);if(typeof w=="bigint"&&ft(w))return w;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function q(w,p=a.P){const b=w%p;return b>=r?b:p+b}function Ne(w,p){const{P:b}=a;let A=w;for(;p-- >r;)A*=A,A%=b;return A}function wt(w){const{P:p}=a,b=BigInt(6),A=BigInt(11),R=BigInt(22),z=BigInt(23),Y=BigInt(44),Z=BigInt(88),ie=w*w*w%p,ne=ie*ie*w%p,ue=Ne(ne,o)*ne%p,we=Ne(ue,o)*ne%p,Se=Ne(we,s)*ie%p,Le=Ne(Se,A)*Se%p,Re=Ne(Le,R)*Le%p,ot=Ne(Re,Y)*Re%p,Wt=Ne(ot,Z)*ot%p,Yt=Ne(Wt,Y)*Re%p,Qt=Ne(Yt,o)*ne%p,Nr=Ne(Qt,z)*Le%p,ln=Ne(Nr,b)*ie%p,ir=Ne(ln,s);if(ir*ir%p!==w)throw new Error("Cannot find square root");return ir}function Qe(w,p=a.P){if(w===r||p<=r)throw new Error(`invert: expected positive integers, got n=${w} mod=${p}`);let b=q(w,p),A=p,R=r,z=n;for(;b!==r;){const Z=A/b,ie=A%b,ne=R-z*Z;A=b,b=ie,R=z,z=ne}if(A!==n)throw new Error("invert: does not exist");return q(R,p)}function Ot(w,p=a.P){const b=new Array(w.length),A=w.reduce((z,Y,Z)=>Y===r?z:(b[Z]=z,q(z*Y,p)),n),R=Qe(A,p);return w.reduceRight((z,Y,Z)=>Y===r?z:(b[Z]=q(z*b[Z],p),q(z*Y,p)),R),b}function Gt(w){const p=w.length*8-y*8,b=he(w);return p>0?b>>BigInt(p):b}function Ke(w,p=!1){const b=Gt(w);if(p)return b;const{n:A}=a;return b>=A?b-A:b}let tt,Rt;class Ar{constructor(p,b){if(this.hashLen=p,this.qByteLen=b,typeof p!="number"||p<2)throw new Error("hashLen must be a number");if(typeof b!="number"||b<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(p).fill(1),this.k=new Uint8Array(p).fill(0),this.counter=0}hmac(...p){return e.utils.hmacSha256(this.k,...p)}hmacSync(...p){return Rt(this.k,...p)}checkSync(){if(typeof Rt!="function")throw new U("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(p=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),p),this.v=await this.hmac(this.v),p.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),p),this.v=await this.hmac(this.v))}reseedSync(p=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),p),this.v=this.hmacSync(this.v),p.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),p),this.v=this.hmacSync(this.v))}async generate(){this.incr();let p=0;const b=[];for(;p<this.qByteLen;){this.v=await this.hmac(this.v);const A=this.v.slice();b.push(A),p+=this.v.length}return Q(...b)}generateSync(){this.checkSync(),this.incr();let p=0;const b=[];for(;p<this.qByteLen;){this.v=this.hmacSync(this.v);const A=this.v.slice();b.push(A),p+=this.v.length}return Q(...b)}}function ft(w){return r<w&&w<a.n}function Vt(w){return r<w&&w<a.P}function Er(w,p,b,A=!0){const{n:R}=a,z=Ke(w,!0);if(!ft(z))return;const Y=Qe(z,R),Z=_.BASE.multiply(z),ie=q(Z.x,R);if(ie===r)return;const ne=q(Y*q(p+b*ie,R),R);if(ne===r)return;let ue=new B(ie,ne),we=(Z.x===ue.r?0:2)|Number(Z.y&n);return A&&ue.hasHighS()&&(ue=ue.normalizeS(),we^=1),{sig:ue,recovery:we}}function ht(w){let p;if(typeof w=="bigint")p=w;else if(typeof w=="number"&&Number.isSafeInteger(w)&&w>0)p=BigInt(w);else if(typeof w=="string"){if(w.length!==2*y)throw new Error("Expected 32 bytes of private key");p=fe(w)}else if(D(w)){if(w.length!==y)throw new Error("Expected 32 bytes of private key");p=he(w)}else throw new TypeError("Expected valid private key");if(!ft(p))throw new Error("Expected private key: 0 < key < n");return p}function Nt(w){return w instanceof _?(w.assertValidity(),w):_.fromHex(w)}function Xe(w){if(w instanceof B)return w.assertValidity(),w;try{return B.fromDER(w)}catch{return B.fromCompact(w)}}function sr(w,p=!1){return _.fromPrivateKey(w).toRawBytes(p)}e.getPublicKey=sr;function cn(w,p,b,A=!1){return _.fromSignature(w,p,b).toRawBytes(A)}e.recoverPublicKey=cn;function it(w){const p=D(w),b=typeof w=="string",A=(p||b)&&w.length;return p?A===I||A===x:b?A===I*2||A===x*2:w instanceof _}function un(w,p,b=!1){if(it(w))throw new TypeError("getSharedSecret: first arg must be private key");if(!it(p))throw new TypeError("getSharedSecret: second arg must be public key");const A=Nt(p);return A.assertValidity(),A.multiply(ht(w)).toRawBytes(b)}e.getSharedSecret=un;function d(w){const p=w.length>l?w.slice(0,l):w;return he(p)}function c(w){const p=d(w),b=q(p,a.n);return u(b<r?p:b)}function u(w){return V(w)}function g(w,p,b){if(w==null)throw new Error(`sign: expected valid message hash, not "${w}"`);const A=ye(w),R=ht(p),z=[u(R),c(A)];if(b!=null){b===!0&&(b=e.utils.randomBytes(l));const ie=ye(b);if(ie.length!==l)throw new Error(`sign: Expected ${l} bytes of extra data`);z.push(ie)}const Y=Q(...z),Z=d(A);return{seed:Y,m:Z,d:R}}function v(w,p){const{sig:b,recovery:A}=w,{der:R,recovered:z}=Object.assign({canonical:!0,der:!0},p),Y=R?b.toDERRawBytes():b.toCompactRawBytes();return z?[Y,A]:Y}async function T(w,p,b={}){const{seed:A,m:R,d:z}=g(w,p,b.extraEntropy),Y=new Ar(k,y);await Y.reseed(A);let Z;for(;!(Z=Er(await Y.generate(),R,z,b.canonical));)await Y.reseed();return v(Z,b)}e.sign=T;function F(w,p,b={}){const{seed:A,m:R,d:z}=g(w,p,b.extraEntropy),Y=new Ar(k,y);Y.reseedSync(A);let Z;for(;!(Z=Er(Y.generateSync(),R,z,b.canonical));)Y.reseedSync();return v(Z,b)}e.signSync=F;const pe={strict:!0};function ke(w,p,b,A=pe){let R;try{R=Xe(w),p=ye(p)}catch{return!1}const{r:z,s:Y}=R;if(A.strict&&R.hasHighS())return!1;const Z=Ke(p);let ie;try{ie=Nt(b)}catch{return!1}const{n:ne}=a,ue=Qe(Y,ne),we=q(Z*ue,ne),Se=q(z*ue,ne),Le=_.BASE.multiplyAndAddUnsafe(ie,we,Se);return Le?q(Le.x,ne)===z:!1}e.verify=ke;function Me(w){return q(he(w),a.n)}class Ae{constructor(p,b){this.r=p,this.s=b,this.assertValidity()}static fromHex(p){const b=ye(p);if(b.length!==64)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${b.length}`);const A=he(b.subarray(0,32)),R=he(b.subarray(32,64));return new Ae(A,R)}assertValidity(){const{r:p,s:b}=this;if(!Vt(p)||!ft(b))throw new Error("Invalid signature")}toHex(){return W(this.r)+W(this.s)}toRawBytes(){return ve(this.toHex())}}function Ee(w){return _.fromPrivateKey(w).toRawX()}class us{constructor(p,b,A=e.utils.randomBytes()){if(p==null)throw new TypeError(`sign: Expected valid message, not "${p}"`);this.m=ye(p);const{x:R,scalar:z}=this.getScalar(ht(b));if(this.px=R,this.d=z,this.rand=ye(A),this.rand.length!==32)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(p){const b=_.fromPrivateKey(p),A=b.hasEvenY()?p:a.n-p;return{point:b,scalar:A,x:b.toRawX()}}initNonce(p,b){return V(p^he(b))}finalizeNonce(p){const b=q(he(p),a.n);if(b===r)throw new Error("sign: Creation of signature failed. k is zero");const{point:A,x:R,scalar:z}=this.getScalar(b);return{R:A,rx:R,k:z}}finalizeSig(p,b,A,R){return new Ae(p.x,q(b+A*R,a.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:p,d:b,px:A,rand:R}=this,z=e.utils.taggedHash,Y=this.initNonce(b,await z(kt.aux,R)),{R:Z,rx:ie,k:ne}=this.finalizeNonce(await z(kt.nonce,Y,A,p)),ue=Me(await z(kt.challenge,ie,A,p)),we=this.finalizeSig(Z,ne,ue,b);return await fs(we,p,A)||this.error(),we}calcSync(){const{m:p,d:b,px:A,rand:R}=this,z=e.utils.taggedHashSync,Y=this.initNonce(b,z(kt.aux,R)),{R:Z,rx:ie,k:ne}=this.finalizeNonce(z(kt.nonce,Y,A,p)),ue=Me(z(kt.challenge,ie,A,p)),we=this.finalizeSig(Z,ne,ue,b);return hs(we,p,A)||this.error(),we}}async function hc(w,p,b){return new us(w,p,b).calc()}function pc(w,p,b){return new us(w,p,b).calcSync()}function ls(w,p,b){const A=w instanceof Ae,R=A?w:Ae.fromHex(w);return A&&R.assertValidity(),{...R,m:ye(p),P:Nt(b)}}function ds(w,p,b,A){const R=_.BASE.multiplyAndAddUnsafe(p,ht(b),q(-A,a.n));return!(!R||!R.hasEvenY()||R.x!==w)}async function fs(w,p,b){try{const{r:A,s:R,m:z,P:Y}=ls(w,p,b),Z=Me(await e.utils.taggedHash(kt.challenge,V(A),Y.toRawX(),z));return ds(A,Y,R,Z)}catch{return!1}}function hs(w,p,b){try{const{r:A,s:R,m:z,P:Y}=ls(w,p,b),Z=Me(e.utils.taggedHashSync(kt.challenge,V(A),Y.toRawX(),z));return ds(A,Y,R,Z)}catch(A){if(A instanceof U)throw A;return!1}}e.schnorr={Signature:Ae,getPublicKey:Ee,sign:hc,verify:fs,signSync:pc,verifySync:hs},_.BASE._setWindowSize(8);const $e={node:t,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},kt={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},Ir={};e.utils={bytesToHex:se,hexToBytes:ve,concatBytes:Q,mod:q,invert:Qe,isValidPrivateKey(w){try{return ht(w),!0}catch{return!1}},_bigintTo32Bytes:V,_normalizePrivateKey:ht,hashToPrivateKey:w=>{w=ye(w);const p=y+8;if(w.length<p||w.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const b=q(he(w),a.n-n)+n;return V(b)},randomBytes:(w=32)=>{if($e.web)return $e.web.getRandomValues(new Uint8Array(w));if($e.node){const{randomBytes:p}=$e.node;return Uint8Array.from(p(w))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.hashToPrivateKey(e.utils.randomBytes(y+8)),precompute(w=8,p=_.BASE){const b=p===_.BASE?p:new _(p.x,p.y);return b._setWindowSize(w),b.multiply(o),b},sha256:async(...w)=>{if($e.web){const p=await $e.web.subtle.digest("SHA-256",Q(...w));return new Uint8Array(p)}else if($e.node){const{createHash:p}=$e.node,b=p("sha256");return w.forEach(A=>b.update(A)),Uint8Array.from(b.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(w,...p)=>{if($e.web){const b=await $e.web.subtle.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),A=Q(...p),R=await $e.web.subtle.sign("HMAC",b,A);return new Uint8Array(R)}else if($e.node){const{createHmac:b}=$e.node,A=b("sha256",w);return p.forEach(R=>A.update(R)),Uint8Array.from(A.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(w,...p)=>{let b=Ir[w];if(b===void 0){const A=await e.utils.sha256(Uint8Array.from(w,R=>R.charCodeAt(0)));b=Q(A,A),Ir[w]=b}return e.utils.sha256(b,...p)},taggedHashSync:(w,...p)=>{if(typeof tt!="function")throw new U("sha256Sync is undefined, you need to set it");let b=Ir[w];if(b===void 0){const A=tt(Uint8Array.from(w,R=>R.charCodeAt(0)));b=Q(A,A),Ir[w]=b}return tt(b,...p)},_JacobianPoint:O},Object.defineProperties(e.utils,{sha256Sync:{configurable:!1,get(){return tt},set(w){tt||(tt=w)}},hmacSha256Sync:{configurable:!1,get(){return Rt},set(w){Rt||(Rt=w)}}})})(gn)),gn}var Dt={},Ns;function Pc(){if(Ns)return Dt;Ns=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.joseToDer=Dt.derToJose=void 0;const e=Vn(),t=Yr();function r(E){return(E/8|0)+(E%8===0?0:1)}const n={ES256:r(256),ES384:r(384),ES512:r(521)};function s(E){const U=n[E];if(U)return U;throw new Error(`Unknown algorithm "${E}"`)}const o=128,i=0,a=32,h=16,f=2,l=h|a|i<<6,y=f|i<<6;function k(E){if(E instanceof Uint8Array)return E;if(typeof E=="string")return(0,e.toByteArray)((0,t.pad)(E));throw new TypeError("ECDSA signature must be a Base64 string or a Uint8Array")}function I(E,U){const j=k(E),O=s(U),G=O+1,L=j.length;let _=0;if(j[_++]!==l)throw new Error('Could not find expected "seq"');let $=j[_++];if($===(o|1)&&($=j[_++]),L-_<$)throw new Error(`"seq" specified length of "${$}", only "${L-_}" remaining`);if(j[_++]!==y)throw new Error('Could not find expected "int" for "r"');const te=j[_++];if(L-_-2<te)throw new Error(`"r" specified length of "${te}", only "${L-_-2}" available`);if(G<te)throw new Error(`"r" specified length of "${te}", max of "${G}" is acceptable`);const H=_;if(_+=te,j[_++]!==y)throw new Error('Could not find expected "int" for "s"');const B=j[_++];if(L-_!==B)throw new Error(`"s" specified length of "${B}", expected "${L-_}"`);if(G<B)throw new Error(`"s" specified length of "${B}", max of "${G}" is acceptable`);const D=_;if(_+=B,_!==L)throw new Error(`Expected to consume entire array, but "${L-_}" bytes remain`);const ee=O-te,Q=O-B,re=new Uint8Array(ee+te+Q+B);for(_=0;_<ee;++_)re[_]=0;re.set(j.subarray(H+Math.max(-ee,0),H+te),_),_=O;for(const se=_;_<se+Q;++_)re[_]=0;return re.set(j.subarray(D+Math.max(-Q,0),D+B),_),(0,t.escape)((0,e.fromByteArray)(re))}Dt.derToJose=I;function x(E,U,j){let O=0;for(;U+O<j&&E[U+O]===0;)++O;return E[U+O]>=o&&--O,O}function M(E,U){E=k(E);const j=s(U),O=E.length;if(O!==j*2)throw new TypeError(`"${U}" signatures must be "${j*2}" bytes, saw "${O}"`);const G=x(E,0,j),L=x(E,j,E.length),_=j-G,$=j-L,te=2+_+1+1+$,H=te<o,B=new Uint8Array((H?2:3)+te);let D=0;return B[D++]=l,H?B[D++]=te:(B[D++]=o|1,B[D++]=te&255),B[D++]=y,B[D++]=_,G<0?(B[D++]=0,B.set(E.subarray(0,j),D),D+=j):(B.set(E.subarray(G,j),D),D+=j-G),B[D++]=y,B[D++]=$,L<0?(B[D++]=0,B.set(E.subarray(j),D)):B.set(E.subarray(j+L),D),B}return Dt.joseToDer=M,Dt}var Ft={},ks;function Zr(){if(ks)return Ft;ks=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.InvalidTokenError=Ft.MissingParametersError=void 0;class e extends Error{constructor(n){super(),this.name="MissingParametersError",this.message=n||""}}Ft.MissingParametersError=e;class t extends Error{constructor(n){super(),this.name="InvalidTokenError",this.message=n||""}}return Ft.InvalidTokenError=t,Ft}var Ts;function Oc(){if(Ts)return ar;Ts=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.SECP256K1Client=void 0;const e=Ec(),t=Mi(),r=Cc(),n=Pc(),s=Zr(),o=Qr();r.utils.hmacSha256Sync=(a,...h)=>{const f=e.hmac.create(t.sha256,a);return h.forEach(l=>f.update(l)),f.digest()};class i{static derivePublicKey(h,f=!0){return h.length===66&&(h=h.slice(0,64)),h.length<64&&(h=h.padStart(64,"0")),(0,o.bytesToHex)(r.getPublicKey(h,f))}static signHash(h,f,l="jose"){if(!h||!f)throw new s.MissingParametersError("a signing input hash and private key are all required");const y=r.signSync(h,f.slice(0,64),{der:!0,canonical:!1});if(l==="der")return(0,o.bytesToHex)(y);if(l==="jose")return(0,n.derToJose)(y,"ES256");throw Error("Invalid signature format")}static loadSignature(h){return(0,n.joseToDer)(h,"ES256")}static verifyHash(h,f,l){if(!h||!f||!l)throw new s.MissingParametersError("a signing input hash, der signature, and public key are all required");return r.verify(f,h,l,{strict:!1})}}return ar.SECP256K1Client=i,i.algorithmName="ES256K",ar}var Bs;function Wn(){return Bs||(Bs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cryptoClients=e.SECP256K1Client=void 0;const t=Oc();Object.defineProperty(e,"SECP256K1Client",{enumerable:!0,get:function(){return t.SECP256K1Client}});const r={ES256K:t.SECP256K1Client};e.cryptoClients=r})(fn)),fn}var xt={},Cs;function Ei(){if(Cs)return xt;Cs=1;var e=xt&&xt.__awaiter||function(s,o,i,a){function h(f){return f instanceof i?f:new i(function(l){l(f)})}return new(i||(i=Promise))(function(f,l){function y(x){try{I(a.next(x))}catch(M){l(M)}}function k(x){try{I(a.throw(x))}catch(M){l(M)}}function I(x){x.done?f(x.value):h(x.value).then(y,k)}I((a=a.apply(s,o||[])).next())})};Object.defineProperty(xt,"__esModule",{value:!0}),xt.hashSha256Async=xt.hashSha256=void 0;const t=Mi();function r(s){return(0,t.sha256)(s)}xt.hashSha256=r;function n(s){return e(this,void 0,void 0,function*(){try{if(typeof crypto<"u"&&typeof crypto.subtle<"u"){const i=typeof s=="string"?new TextEncoder().encode(s):s,a=yield crypto.subtle.digest("SHA-256",i);return new Uint8Array(a)}else{const i=Ai;if(!i.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(i.createHash("sha256").update(s).digest())}}catch(o){return console.log(o),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(r(s))}})}return xt.hashSha256Async=n,xt}var Ps;function Rc(){if(Ps)return bt;Ps=1;var e=bt&&bt.__awaiter||function(h,f,l,y){function k(I){return I instanceof l?I:new l(function(x){x(I)})}return new(l||(l=Promise))(function(I,x){function M(j){try{U(y.next(j))}catch(O){x(O)}}function E(j){try{U(y.throw(j))}catch(O){x(O)}}function U(j){j.done?I(j.value):k(j.value).then(M,E)}U((y=y.apply(h,f||[])).next())})};Object.defineProperty(bt,"__esModule",{value:!0}),bt.TokenSigner=bt.createUnsecuredToken=void 0;const t=Yr(),r=Wn(),n=Zr(),s=Ei();function o(h,f){const l=[],y=t.encode(JSON.stringify(f));l.push(y);const k=t.encode(JSON.stringify(h));return l.push(k),l.join(".")}function i(h){return o(h,{typ:"JWT",alg:"none"})+"."}bt.createUnsecuredToken=i;class a{constructor(f,l){if(!(f&&l))throw new n.MissingParametersError("a signing algorithm and private key are required");if(typeof f!="string")throw new Error("signing algorithm parameter must be a string");if(f=f.toUpperCase(),!r.cryptoClients.hasOwnProperty(f))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=r.cryptoClients[f],this.rawPrivateKey=l}header(f={}){const l={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},l,f)}sign(f,l=!1,y={}){const k=this.header(y),I=o(f,k),x=(0,s.hashSha256)(I);return this.createWithSignedHash(f,l,k,I,x)}signAsync(f,l=!1,y={}){return e(this,void 0,void 0,function*(){const k=this.header(y),I=o(f,k),x=yield(0,s.hashSha256Async)(I);return this.createWithSignedHash(f,l,k,I,x)})}createWithSignedHash(f,l,y,k,I){const x=this.cryptoClient.signHash(I,this.rawPrivateKey);return l?{header:[t.encode(JSON.stringify(y))],payload:JSON.stringify(f),signature:[x]}:[k,x].join(".")}}return bt.TokenSigner=a,bt}var ur={},Os;function _c(){if(Os)return ur;Os=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.TokenVerifier=void 0;const e=Yr(),t=Wn(),r=Zr(),n=Ei();class s{constructor(i,a){if(!(i&&a))throw new r.MissingParametersError("a signing algorithm and public key are required");if(typeof i!="string")throw"signing algorithm parameter must be a string";if(i=i.toUpperCase(),!t.cryptoClients.hasOwnProperty(i))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=t.cryptoClients[i],this.rawPublicKey=a}verify(i){return typeof i=="string"?this.verifyCompact(i,!1):typeof i=="object"?this.verifyExpanded(i,!1):!1}verifyAsync(i){return typeof i=="string"?this.verifyCompact(i,!0):typeof i=="object"?this.verifyExpanded(i,!0):Promise.resolve(!1)}verifyCompact(i,a){const h=i.split("."),f=h[0]+"."+h[1],l=y=>{const k=this.cryptoClient.loadSignature(h[2]);return this.cryptoClient.verifyHash(y,k,this.rawPublicKey)};if(a)return(0,n.hashSha256Async)(f).then(y=>l(y));{const y=(0,n.hashSha256)(f);return l(y)}}verifyExpanded(i,a){const h=[i.header.join("."),e.encode(i.payload)].join(".");let f=!0;const l=y=>(i.signature.map(k=>{const I=this.cryptoClient.loadSignature(k);this.cryptoClient.verifyHash(y,I,this.rawPublicKey)||(f=!1)}),f);if(a)return(0,n.hashSha256Async)(h).then(y=>l(y));{const y=(0,n.hashSha256)(h);return l(y)}}}return ur.TokenVerifier=s,ur}var lr={},Rs;function Dc(){if(Rs)return lr;Rs=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.decodeToken=void 0;const e=Yr();function t(r){if(typeof r=="string"){const n=r.split("."),s=JSON.parse(e.decode(n[0])),o=JSON.parse(e.decode(n[1])),i=n[2];return{header:s,payload:o,signature:i}}else if(typeof r=="object"){if(typeof r.payload!="string")throw new Error("Expected token payload to be a base64 or json string");let n=r.payload;r.payload[0]!=="{"&&(n=e.decode(n));const s=[];return r.header.map(o=>{const i=JSON.parse(e.decode(o));s.push(i)}),{header:s,payload:JSON.parse(n),signature:r.signature}}}return lr.decodeToken=t,lr}var _s;function Fc(){return _s||(_s=1,(function(e){var t=_t&&_t.__createBinding||(Object.create?(function(n,s,o,i){i===void 0&&(i=o);var a=Object.getOwnPropertyDescriptor(s,o);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(n,i,a)}):(function(n,s,o,i){i===void 0&&(i=o),n[i]=s[o]})),r=_t&&_t.__exportStar||function(n,s){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Rc(),e),r(_c(),e),r(Dc(),e),r(Zr(),e),r(Wn(),e)})(_t)),_t}var Ct=Fc();function Ii(e,t){return function(){return e.apply(t,arguments)}}const{toString:jc}=Object.prototype,{getPrototypeOf:Yn}=Object,{iterator:Jr,toStringTag:Ni}=Symbol,Kr=(e=>t=>{const r=jc.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),dt=e=>(e=e.toLowerCase(),t=>Kr(t)===e),Xr=e=>t=>typeof t===e,{isArray:$t}=Array,Jt=Xr("undefined");function wr(e){return e!==null&&!Jt(e)&&e.constructor!==null&&!Jt(e.constructor)&&Ze(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ki=dt("ArrayBuffer");function Lc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ki(e.buffer),t}const zc=Xr("string"),Ze=Xr("function"),Ti=Xr("number"),br=e=>e!==null&&typeof e=="object",Uc=e=>e===!0||e===!1,Or=e=>{if(Kr(e)!=="object")return!1;const t=Yn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ni in e)&&!(Jr in e)},Hc=e=>{if(!br(e)||wr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},qc=dt("Date"),Gc=dt("File"),Vc=dt("Blob"),Wc=dt("FileList"),Yc=e=>br(e)&&Ze(e.pipe),Qc=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ze(e.append)&&((t=Kr(e))==="formdata"||t==="object"&&Ze(e.toString)&&e.toString()==="[object FormData]"))},Zc=dt("URLSearchParams"),[Jc,Kc,Xc,$c]=["ReadableStream","Request","Response","Headers"].map(dt),eu=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xr(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),$t(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(wr(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function Bi(e,t){if(wr(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ci=e=>!Jt(e)&&e!==zt;function Bn(){const{caseless:e,skipUndefined:t}=Ci(this)&&this||{},r={},n=(s,o)=>{const i=e&&Bi(r,o)||o;Or(r[i])&&Or(s)?r[i]=Bn(r[i],s):Or(s)?r[i]=Bn({},s):$t(s)?r[i]=s.slice():(!t||!Jt(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&xr(arguments[s],n);return r}const tu=(e,t,r,{allOwnKeys:n}={})=>(xr(t,(s,o)=>{r&&Ze(s)?e[o]=Ii(s,r):e[o]=s},{allOwnKeys:n}),e),ru=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nu=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},su=(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=r!==!1&&Yn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},iu=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},ou=e=>{if(!e)return null;if($t(e))return e;let t=e.length;if(!Ti(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},au=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Yn(Uint8Array)),cu=(e,t)=>{const n=(e&&e[Jr]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},uu=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},lu=dt("HTMLFormElement"),du=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Ds=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),fu=dt("RegExp"),Pi=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};xr(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},hu=e=>{Pi(e,(t,r)=>{if(Ze(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Ze(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},pu=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return $t(e)?n(e):n(String(e).split(t)),r},gu=()=>{},mu=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yu(e){return!!(e&&Ze(e.append)&&e[Ni]==="FormData"&&e[Jr])}const wu=e=>{const t=new Array(10),r=(n,s)=>{if(br(n)){if(t.indexOf(n)>=0)return;if(wr(n))return n;if(!("toJSON"in n)){t[s]=n;const o=$t(n)?[]:{};return xr(n,(i,a)=>{const h=r(i,s+1);!Jt(h)&&(o[a]=h)}),t[s]=void 0,o}}return n};return r(e,0)},bu=dt("AsyncFunction"),xu=e=>e&&(br(e)||Ze(e))&&Ze(e.then)&&Ze(e.catch),Oi=((e,t)=>e?setImmediate:t?((r,n)=>(zt.addEventListener("message",({source:s,data:o})=>{s===zt&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),zt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ze(zt.postMessage)),Su=typeof queueMicrotask<"u"?queueMicrotask.bind(zt):typeof process<"u"&&process.nextTick||Oi,vu=e=>e!=null&&Ze(e[Jr]),P={isArray:$t,isArrayBuffer:ki,isBuffer:wr,isFormData:Qc,isArrayBufferView:Lc,isString:zc,isNumber:Ti,isBoolean:Uc,isObject:br,isPlainObject:Or,isEmptyObject:Hc,isReadableStream:Jc,isRequest:Kc,isResponse:Xc,isHeaders:$c,isUndefined:Jt,isDate:qc,isFile:Gc,isBlob:Vc,isRegExp:fu,isFunction:Ze,isStream:Yc,isURLSearchParams:Zc,isTypedArray:au,isFileList:Wc,forEach:xr,merge:Bn,extend:tu,trim:eu,stripBOM:ru,inherits:nu,toFlatObject:su,kindOf:Kr,kindOfTest:dt,endsWith:iu,toArray:ou,forEachEntry:cu,matchAll:uu,isHTMLForm:lu,hasOwnProperty:Ds,hasOwnProp:Ds,reduceDescriptors:Pi,freezeMethods:hu,toObjectSet:pu,toCamelCase:du,noop:gu,toFiniteNumber:mu,findKey:Bi,global:zt,isContextDefined:Ci,isSpecCompliantForm:yu,toJSONObject:wu,isAsyncFn:bu,isThenable:xu,setImmediate:Oi,asap:Su,isIterable:vu};function le(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}P.inherits(le,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.status}}});const Ri=le.prototype,_i={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_i[e]={value:e}});Object.defineProperties(le,_i);Object.defineProperty(Ri,"isAxiosError",{value:!0});le.from=(e,t,r,n,s,o)=>{const i=Object.create(Ri);P.toFlatObject(e,i,function(l){return l!==Error.prototype},f=>f!=="isAxiosError");const a=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return le.call(i,a,h,r,n,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const Mu=null;function Cn(e){return P.isPlainObject(e)||P.isArray(e)}function Di(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Fs(e,t,r){return e?e.concat(t).map(function(s,o){return s=Di(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function Au(e){return P.isArray(e)&&!e.some(Cn)}const Eu=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=P.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,E){return!P.isUndefined(E[M])});const n=r.metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,h=(r.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(s))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(P.isDate(x))return x.toISOString();if(P.isBoolean(x))return x.toString();if(!h&&P.isBlob(x))throw new le("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(x)||P.isTypedArray(x)?h&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function l(x,M,E){let U=x;if(x&&!E&&typeof x=="object"){if(P.endsWith(M,"{}"))M=n?M:M.slice(0,-2),x=JSON.stringify(x);else if(P.isArray(x)&&Au(x)||(P.isFileList(x)||P.endsWith(M,"[]"))&&(U=P.toArray(x)))return M=Di(M),U.forEach(function(O,G){!(P.isUndefined(O)||O===null)&&t.append(i===!0?Fs([M],G,o):i===null?M:M+"[]",f(O))}),!1}return Cn(x)?!0:(t.append(Fs(E,M,o),f(x)),!1)}const y=[],k=Object.assign(Eu,{defaultVisitor:l,convertValue:f,isVisitable:Cn});function I(x,M){if(!P.isUndefined(x)){if(y.indexOf(x)!==-1)throw Error("Circular reference detected in "+M.join("."));y.push(x),P.forEach(x,function(U,j){(!(P.isUndefined(U)||U===null)&&s.call(t,U,P.isString(j)?j.trim():j,M,k))===!0&&I(U,M?M.concat(j):[j])}),y.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return I(e),t}function js(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Qn(e,t){this._pairs=[],e&&$r(e,this,t)}const Fi=Qn.prototype;Fi.append=function(t,r){this._pairs.push([t,r])};Fi.toString=function(t){const r=t?function(n){return t.call(this,n,js)}:js;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Iu(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ji(e,t,r){if(!t)return e;const n=r&&r.encode||Iu;P.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(s?o=s(t,r):o=P.isURLSearchParams(t)?t.toString():new Qn(t,r).toString(n),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ls{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Li={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nu=typeof URLSearchParams<"u"?URLSearchParams:Qn,ku=typeof FormData<"u"?FormData:null,Tu=typeof Blob<"u"?Blob:null,Bu={isBrowser:!0,classes:{URLSearchParams:Nu,FormData:ku,Blob:Tu},protocols:["http","https","file","blob","url","data"]},Zn=typeof window<"u"&&typeof document<"u",Pn=typeof navigator=="object"&&navigator||void 0,Cu=Zn&&(!Pn||["ReactNative","NativeScript","NS"].indexOf(Pn.product)<0),Pu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ou=Zn&&window.location.href||"http://localhost",Ru=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zn,hasStandardBrowserEnv:Cu,hasStandardBrowserWebWorkerEnv:Pu,navigator:Pn,origin:Ou},Symbol.toStringTag,{value:"Module"})),We={...Ru,...Bu};function _u(e,t){return $r(e,new We.classes.URLSearchParams,{visitor:function(r,n,s,o){return We.isNode&&P.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Du(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Fu(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function zi(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),h=o>=r.length;return i=!i&&P.isArray(s)?s.length:i,h?(P.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!a):((!s[i]||!P.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&P.isArray(s[i])&&(s[i]=Fu(s[i])),!a)}if(P.isFormData(e)&&P.isFunction(e.entries)){const r={};return P.forEachEntry(e,(n,s)=>{t(Du(n),s,r,0)}),r}return null}function ju(e,t,r){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Sr={transitional:Li,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=P.isObject(t);if(o&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return s?JSON.stringify(zi(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return _u(t,this.formSerializer).toString();if((a=P.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return $r(a?{"files[]":t}:t,h&&new h,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),ju(t)):t}],transformResponse:[function(t){const r=this.transitional||Sr.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?le.from(a,le.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{Sr.headers[e]={}});const Lu=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zu=e=>{const t={};let r,n,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&Lu[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},zs=Symbol("internals");function dr(e){return e&&String(e).trim().toLowerCase()}function Rr(e){return e===!1||e==null?e:P.isArray(e)?e.map(Rr):String(e)}function Uu(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Hu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mn(e,t,r,n,s){if(P.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!P.isString(t)){if(P.isString(n))return t.indexOf(n)!==-1;if(P.isRegExp(n))return n.test(t)}}function qu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Gu(e,t){const r=P.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let Je=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(a,h,f){const l=dr(h);if(!l)throw new Error("header name must be a non-empty string");const y=P.findKey(s,l);(!y||s[y]===void 0||f===!0||f===void 0&&s[y]!==!1)&&(s[y||h]=Rr(a))}const i=(a,h)=>P.forEach(a,(f,l)=>o(f,l,h));if(P.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(P.isString(t)&&(t=t.trim())&&!Hu(t))i(zu(t),r);else if(P.isObject(t)&&P.isIterable(t)){let a={},h,f;for(const l of t){if(!P.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[f=l[0]]=(h=a[f])?P.isArray(h)?[...h,l[1]]:[h,l[1]]:l[1]}i(a,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=dr(t),t){const n=P.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Uu(s);if(P.isFunction(r))return r.call(this,s,n);if(P.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=dr(t),t){const n=P.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||mn(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=dr(i),i){const a=P.findKey(n,i);a&&(!r||mn(n,n[a],a,r))&&(delete n[a],s=!0)}}return P.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||mn(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return P.forEach(this,(s,o)=>{const i=P.findKey(n,o);if(i){r[i]=Rr(s),delete r[o];return}const a=t?qu(o):String(o).trim();a!==o&&delete r[o],r[a]=Rr(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return P.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&P.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[zs]=this[zs]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=dr(i);n[a]||(Gu(s,i),n[a]=!0)}return P.isArray(t)?t.forEach(o):o(t),this}};Je.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(Je.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});P.freezeMethods(Je);function yn(e,t){const r=this||Sr,n=t||r,s=Je.from(n.headers);let o=n.data;return P.forEach(e,function(a){o=a.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ui(e){return!!(e&&e.__CANCEL__)}function er(e,t,r){le.call(this,e??"canceled",le.ERR_CANCELED,t,r),this.name="CanceledError"}P.inherits(er,le,{__CANCEL__:!0});function Hi(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new le("Request failed with status code "+r.status,[le.ERR_BAD_REQUEST,le.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Vu(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wu(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(h){const f=Date.now(),l=n[o];i||(i=f),r[s]=h,n[s]=f;let y=o,k=0;for(;y!==s;)k+=r[y++],y=y%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-i<t)return;const I=l&&f-l;return I?Math.round(k*1e3/I):void 0}}function Yu(e,t){let r=0,n=1e3/t,s,o;const i=(f,l=Date.now())=>{r=l,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const l=Date.now(),y=l-r;y>=n?i(f,l):(s=f,o||(o=setTimeout(()=>{o=null,i(s)},n-y)))},()=>s&&i(s)]}const Fr=(e,t,r=3)=>{let n=0;const s=Wu(50,250);return Yu(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,h=i-n,f=s(h),l=i<=a;n=i;const y={loaded:i,total:a,progress:a?i/a:void 0,bytes:h,rate:f||void 0,estimated:f&&a&&l?(a-i)/f:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(y)},r)},Us=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Hs=e=>(...t)=>P.asap(()=>e(...t)),Qu=We.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,We.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(We.origin),We.navigator&&/(msie|trident)/i.test(We.navigator.userAgent)):()=>!0,Zu=We.hasStandardBrowserEnv?{write(e,t,r,n,s,o){const i=[e+"="+encodeURIComponent(t)];P.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),P.isString(n)&&i.push("path="+n),P.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ju(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ku(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function qi(e,t,r){let n=!Ju(t);return e&&(n||r==!1)?Ku(e,t):t}const qs=e=>e instanceof Je?{...e}:e;function Ht(e,t){t=t||{};const r={};function n(f,l,y,k){return P.isPlainObject(f)&&P.isPlainObject(l)?P.merge.call({caseless:k},f,l):P.isPlainObject(l)?P.merge({},l):P.isArray(l)?l.slice():l}function s(f,l,y,k){if(P.isUndefined(l)){if(!P.isUndefined(f))return n(void 0,f,y,k)}else return n(f,l,y,k)}function o(f,l){if(!P.isUndefined(l))return n(void 0,l)}function i(f,l){if(P.isUndefined(l)){if(!P.isUndefined(f))return n(void 0,f)}else return n(void 0,l)}function a(f,l,y){if(y in t)return n(f,l);if(y in e)return n(void 0,f)}const h={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(f,l,y)=>s(qs(f),qs(l),y,!0)};return P.forEach(Object.keys({...e,...t}),function(l){const y=h[l]||s,k=y(e[l],t[l],l);P.isUndefined(k)&&y!==a||(r[l]=k)}),r}const Gi=e=>{const t=Ht({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Je.from(i),t.url=ji(qi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),P.isFormData(r)){if(We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(P.isFunction(r.getHeaders)){const h=r.getHeaders(),f=["content-type","content-length"];Object.entries(h).forEach(([l,y])=>{f.includes(l.toLowerCase())&&i.set(l,y)})}}if(We.hasStandardBrowserEnv&&(n&&P.isFunction(n)&&(n=n(t)),n||n!==!1&&Qu(t.url))){const h=s&&o&&Zu.read(o);h&&i.set(s,h)}return t},Xu=typeof XMLHttpRequest<"u",$u=Xu&&function(e){return new Promise(function(r,n){const s=Gi(e);let o=s.data;const i=Je.from(s.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:f}=s,l,y,k,I,x;function M(){I&&I(),x&&x(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function U(){if(!E)return;const O=Je.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:O,config:e,request:E};Hi(function($){r($),M()},function($){n($),M()},L),E=null}"onloadend"in E?E.onloadend=U:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(U)},E.onabort=function(){E&&(n(new le("Request aborted",le.ECONNABORTED,e,E)),E=null)},E.onerror=function(G){const L=G&&G.message?G.message:"Network Error",_=new le(L,le.ERR_NETWORK,e,E);_.event=G||null,n(_),E=null},E.ontimeout=function(){let G=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||Li;s.timeoutErrorMessage&&(G=s.timeoutErrorMessage),n(new le(G,L.clarifyTimeoutError?le.ETIMEDOUT:le.ECONNABORTED,e,E)),E=null},o===void 0&&i.setContentType(null),"setRequestHeader"in E&&P.forEach(i.toJSON(),function(G,L){E.setRequestHeader(L,G)}),P.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),a&&a!=="json"&&(E.responseType=s.responseType),f&&([k,x]=Fr(f,!0),E.addEventListener("progress",k)),h&&E.upload&&([y,I]=Fr(h),E.upload.addEventListener("progress",y),E.upload.addEventListener("loadend",I)),(s.cancelToken||s.signal)&&(l=O=>{E&&(n(!O||O.type?new er(null,e,E):O),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const j=Vu(s.url);if(j&&We.protocols.indexOf(j)===-1){n(new le("Unsupported protocol "+j+":",le.ERR_BAD_REQUEST,e));return}E.send(o||null)})},el=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(f){if(!s){s=!0,a();const l=f instanceof Error?f:this.reason;n.abort(l instanceof le?l:new er(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new le(`timeout ${t} of ms exceeded`,le.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:h}=n;return h.unsubscribe=()=>P.asap(a),h}},tl=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},rl=async function*(e,t){for await(const r of nl(e))yield*tl(r,t)},nl=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Gs=(e,t,r,n)=>{const s=rl(e,t);let o=0,i,a=h=>{i||(i=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:f,value:l}=await s.next();if(f){a(),h.close();return}let y=l.byteLength;if(r){let k=o+=y;r(k)}h.enqueue(new Uint8Array(l))}catch(f){throw a(f),f}},cancel(h){return a(h),s.return()}},{highWaterMark:2})},Vs=64*1024,{isFunction:kr}=P,Vi=(({fetch:e,Request:t,Response:r})=>({fetch:e,Request:t,Response:r}))(P.global),{ReadableStream:Ws,TextEncoder:Ys}=P.global,Qs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sl=e=>{const{fetch:t,Request:r,Response:n}=Object.assign({},Vi,e),s=kr(t),o=kr(r),i=kr(n);if(!s)return!1;const a=s&&kr(Ws),h=s&&(typeof Ys=="function"?(x=>M=>x.encode(M))(new Ys):async x=>new Uint8Array(await new r(x).arrayBuffer())),f=o&&a&&Qs(()=>{let x=!1;const M=new r(We.origin,{body:new Ws,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!M}),l=i&&a&&Qs(()=>P.isReadableStream(new n("").body)),y={stream:l&&(x=>x.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!y[x]&&(y[x]=(M,E)=>{let U=M&&M[x];if(U)return U.call(M);throw new le(`Response type '${x}' is not supported`,le.ERR_NOT_SUPPORT,E)})});const k=async x=>{if(x==null)return 0;if(P.isBlob(x))return x.size;if(P.isSpecCompliantForm(x))return(await new r(We.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(P.isArrayBufferView(x)||P.isArrayBuffer(x))return x.byteLength;if(P.isURLSearchParams(x)&&(x=x+""),P.isString(x))return(await h(x)).byteLength},I=async(x,M)=>{const E=P.toFiniteNumber(x.getContentLength());return E??k(M)};return async x=>{let{url:M,method:E,data:U,signal:j,cancelToken:O,timeout:G,onDownloadProgress:L,onUploadProgress:_,responseType:$,headers:te,withCredentials:H="same-origin",fetchOptions:B}=Gi(x);$=$?($+"").toLowerCase():"text";let D=el([j,O&&O.toAbortSignal()],G),ee=null;const Q=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let re;try{if(_&&f&&E!=="get"&&E!=="head"&&(re=await I(te,U))!==0){let W=new r(M,{method:"POST",body:U,duplex:"half"}),V;if(P.isFormData(U)&&(V=W.headers.get("content-type"))&&te.setContentType(V),W.body){const[X,fe]=Us(re,Fr(Hs(_)));U=Gs(W.body,Vs,X,fe)}}P.isString(H)||(H=H?"include":"omit");const se=o&&"credentials"in r.prototype,me={...B,signal:D,method:E.toUpperCase(),headers:te.normalize().toJSON(),body:U,duplex:"half",credentials:se?H:void 0};ee=o&&new r(M,me);let xe=await(o?t(ee,B):t(M,me));const ve=l&&($==="stream"||$==="response");if(l&&(L||ve&&Q)){const W={};["status","statusText","headers"].forEach(he=>{W[he]=xe[he]});const V=P.toFiniteNumber(xe.headers.get("content-length")),[X,fe]=L&&Us(V,Fr(Hs(L),!0))||[];xe=new n(Gs(xe.body,Vs,X,()=>{fe&&fe(),Q&&Q()}),W)}$=$||"text";let C=await y[P.findKey(y,$)||"text"](xe,x);return!ve&&Q&&Q(),await new Promise((W,V)=>{Hi(W,V,{data:C,headers:Je.from(xe.headers),status:xe.status,statusText:xe.statusText,config:x,request:ee})})}catch(se){throw Q&&Q(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new le("Network Error",le.ERR_NETWORK,x,ee),{cause:se.cause||se}):le.from(se,se&&se.code,x,ee)}}},il=new Map,Wi=e=>{let t=P.merge.call({skipUndefined:!0},Vi,e?e.env:null);const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,a=i,h,f,l=il;for(;a--;)h=o[a],f=l.get(h),f===void 0&&l.set(h,f=a?new Map:sl(t)),l=f;return f};Wi();const On={http:Mu,xhr:$u,fetch:{get:Wi}};P.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zs=e=>`- ${e}`,ol=e=>P.isFunction(e)||e===null||e===!1,Yi={getAdapter:(e,t)=>{e=P.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let a;if(s=n,!ol(n)&&(s=On[(a=String(n)).toLowerCase()],s===void 0))throw new le(`Unknown adapter '${a}'`);if(s&&(P.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([h,f])=>`adapter ${h} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
4
+ `+i.map(Zs).join(`
5
+ `):" "+Zs(i[0]):"as no adapter specified";throw new le("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:On};function wn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new er(null,e)}function Js(e){return wn(e),e.headers=Je.from(e.headers),e.data=yn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Yi.getAdapter(e.adapter||Sr.adapter,e)(e).then(function(n){return wn(e),n.data=yn.call(e,e.transformResponse,n),n.headers=Je.from(n.headers),n},function(n){return Ui(n)||(wn(e),n&&n.response&&(n.response.data=yn.call(e,e.transformResponse,n.response),n.response.headers=Je.from(n.response.headers))),Promise.reject(n)})}const Qi="1.12.0",en={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{en[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ks={};en.transitional=function(t,r,n){function s(o,i){return"[Axios v"+Qi+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,a)=>{if(t===!1)throw new le(s(i," has been removed"+(r?" in "+r:"")),le.ERR_DEPRECATED);return r&&!Ks[i]&&(Ks[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,a):!0}};en.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function al(e,t,r){if(typeof e!="object")throw new le("options must be an object",le.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const a=e[o],h=a===void 0||i(a,o,e);if(h!==!0)throw new le("option "+o+" must be "+h,le.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new le("Unknown option "+o,le.ERR_BAD_OPTION)}}const _r={assertOptions:al,validators:en},pt=_r.validators;let Ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ls,response:new Ls}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ht(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&_r.assertOptions(n,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),s!=null&&(P.isFunction(s)?r.paramsSerializer={serialize:s}:_r.assertOptions(s,{encode:pt.function,serialize:pt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),_r.assertOptions(r,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&P.merge(o.common,o[r.method]);o&&P.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),r.headers=Je.concat(i,o);const a=[];let h=!0;this.interceptors.request.forEach(function(M){typeof M.runWhen=="function"&&M.runWhen(r)===!1||(h=h&&M.synchronous,a.unshift(M.fulfilled,M.rejected))});const f=[];this.interceptors.response.forEach(function(M){f.push(M.fulfilled,M.rejected)});let l,y=0,k;if(!h){const x=[Js.bind(this),void 0];for(x.unshift(...a),x.push(...f),k=x.length,l=Promise.resolve(r);y<k;)l=l.then(x[y++],x[y++]);return l}k=a.length;let I=r;for(y=0;y<k;){const x=a[y++],M=a[y++];try{I=x(I)}catch(E){M.call(this,E);break}}try{l=Js.call(this,I)}catch(x){return Promise.reject(x)}for(y=0,k=f.length;y<k;)l=l.then(f[y++],f[y++]);return l}getUri(t){t=Ht(this.defaults,t);const r=qi(t.baseURL,t.url,t.allowAbsoluteUrls);return ji(r,t.params,t.paramsSerializer)}};P.forEach(["delete","get","head","options"],function(t){Ut.prototype[t]=function(r,n){return this.request(Ht(n||{},{method:t,url:r,data:(n||{}).data}))}});P.forEach(["post","put","patch"],function(t){function r(n){return function(o,i,a){return this.request(Ht(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Ut.prototype[t]=r(),Ut.prototype[t+"Form"]=r(!0)});let cl=class Zi{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,a){n.reason||(n.reason=new er(o,i,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Zi(function(s){t=s}),cancel:t}}};function ul(e){return function(r){return e.apply(null,r)}}function ll(e){return P.isObject(e)&&e.isAxiosError===!0}const Rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rn).forEach(([e,t])=>{Rn[t]=e});function Ji(e){const t=new Ut(e),r=Ii(Ut.prototype.request,t);return P.extend(r,Ut.prototype,t,{allOwnKeys:!0}),P.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Ji(Ht(e,s))},r}const Pe=Ji(Sr);Pe.Axios=Ut;Pe.CanceledError=er;Pe.CancelToken=cl;Pe.isCancel=Ui;Pe.VERSION=Qi;Pe.toFormData=$r;Pe.AxiosError=le;Pe.Cancel=Pe.CanceledError;Pe.all=function(t){return Promise.all(t)};Pe.spread=ul;Pe.isAxiosError=ll;Pe.mergeConfig=Ht;Pe.AxiosHeaders=Je;Pe.formToJSON=e=>zi(P.isHTMLForm(e)?new FormData(e):e);Pe.getAdapter=Yi.getAdapter;Pe.HttpStatusCode=Rn;Pe.default=Pe;const{Axios:yp,AxiosError:wp,CanceledError:bp,isCancel:xp,CancelToken:Sp,VERSION:vp,all:Mp,Cancel:Ap,isAxiosError:Ep,spread:Ip,toFormData:Np,AxiosHeaders:kp,HttpStatusCode:Tp,formToJSON:Bp,getAdapter:Cp,mergeConfig:Pp}=Pe,dl="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function fl(e){if(!e||typeof e!="string")throw new Error(`Expected base58 string but got “${e}”`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character “${e.match(/[IOl0]/gmu)}”`);const t=e.match(/^1+/gmu),r=t?t[0].length:0,n=(e.length-r)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(r),...e.match(/.{1}/gmu).map(s=>dl.indexOf(s)).reduce((s,o)=>(s=s.map(i=>{const a=i*58+o;return o=a>>8,a}),s),new Uint8Array(n)).reverse().filter((s=>o=>s=s||o)(!1))])}var jt={},Xs;function hl(){if(Xs)return jt;Xs=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.bech32m=jt.bech32=void 0;const e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",t={};for(let f=0;f<e.length;f++){const l=e.charAt(f);t[l]=f}function r(f){const l=f>>25;return(f&33554431)<<5^-(l>>0&1)&996825010^-(l>>1&1)&642813549^-(l>>2&1)&513874426^-(l>>3&1)&1027748829^-(l>>4&1)&705979059}function n(f){let l=1;for(let y=0;y<f.length;++y){const k=f.charCodeAt(y);if(k<33||k>126)return"Invalid prefix ("+f+")";l=r(l)^k>>5}l=r(l);for(let y=0;y<f.length;++y){const k=f.charCodeAt(y);l=r(l)^k&31}return l}function s(f,l,y,k){let I=0,x=0;const M=(1<<y)-1,E=[];for(let U=0;U<f.length;++U)for(I=I<<l|f[U],x+=l;x>=y;)x-=y,E.push(I>>x&M);if(k)x>0&&E.push(I<<y-x&M);else{if(x>=l)return"Excess padding";if(I<<y-x&M)return"Non-zero padding"}return E}function o(f){return s(f,8,5,!0)}function i(f){const l=s(f,5,8,!1);if(Array.isArray(l))return l}function a(f){const l=s(f,5,8,!1);if(Array.isArray(l))return l;throw new Error(l)}function h(f){let l;f==="bech32"?l=1:l=734539939;function y(M,E,U){if(U=U||90,M.length+7+E.length>U)throw new TypeError("Exceeds length limit");M=M.toLowerCase();let j=n(M);if(typeof j=="string")throw new Error(j);let O=M+"1";for(let G=0;G<E.length;++G){const L=E[G];if(L>>5!==0)throw new Error("Non 5-bit word");j=r(j)^L,O+=e.charAt(L)}for(let G=0;G<6;++G)j=r(j);j^=l;for(let G=0;G<6;++G){const L=j>>(5-G)*5&31;O+=e.charAt(L)}return O}function k(M,E){if(E=E||90,M.length<8)return M+" too short";if(M.length>E)return"Exceeds length limit";const U=M.toLowerCase(),j=M.toUpperCase();if(M!==U&&M!==j)return"Mixed-case string "+M;M=U;const O=M.lastIndexOf("1");if(O===-1)return"No separator character for "+M;if(O===0)return"Missing prefix for "+M;const G=M.slice(0,O),L=M.slice(O+1);if(L.length<6)return"Data too short";let _=n(G);if(typeof _=="string")return _;const $=[];for(let te=0;te<L.length;++te){const H=L.charAt(te),B=t[H];if(B===void 0)return"Unknown character "+H;_=r(_)^B,!(te+6>=L.length)&&$.push(B)}return _!==l?"Invalid checksum for "+M:{prefix:G,words:$}}function I(M,E){const U=k(M,E);if(typeof U=="object")return U}function x(M,E){const U=k(M,E);if(typeof U=="object")return U;throw new Error(U)}return{decodeUnsafe:I,decode:x,encode:y,toWords:o,fromWordsUnsafe:i,fromWords:a}}return jt.bech32=h("bech32"),jt.bech32m=h("bech32m"),jt}var bn=hl();const pl=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];function gl(e){return new ml}class ml{constructor(){this.A=1779033703,this.B=-1150833019,this.C=1013904242,this.D=-1521486534,this.E=1359893119,this.F=-1694144372,this.G=528734635,this.H=1541459225,this._size=0,this._sp=0,(!Tr||fr>=8e3)&&(Tr=new ArrayBuffer(8e3),fr=0),this._byte=new Uint8Array(Tr,fr,80),this._word=new Int32Array(Tr,fr,20),fr+=80}update(t){if(typeof t=="string")return this._utf8(t);if(t==null)throw new TypeError("Invalid type: "+typeof t);const r=t.byteOffset,n=t.byteLength;let s=n/64|0,o=0;if(s&&!(r&3)&&!(this._size%64)){const a=new Int32Array(t.buffer,r,s*16);for(;s--;)this._int32(a,o>>2),o+=64;this._size+=o}if(t.BYTES_PER_ELEMENT!==1&&t.buffer){const a=new Uint8Array(t.buffer,r+o,n-o);return this._uint8(a)}return o===n?this:this._uint8(t,o)}_uint8(t,r){const{_byte:n,_word:s}=this,o=t.length;for(r=r|0;r<o;){const i=this._size%64;let a=i;for(;r<o&&a<64;)n[a++]=t[r++];a>=64&&this._int32(s),this._size+=a-i}return this}_utf8(t){const{_byte:r,_word:n}=this,s=t.length;let o=this._sp;for(let i=0;i<s;){const a=this._size%64;let h=a;for(;i<s&&h<64;){let f=t.charCodeAt(i++)|0;f<128?r[h++]=f:f<2048?(r[h++]=192|f>>>6,r[h++]=128|f&63):f<55296||f>57343?(r[h++]=224|f>>>12,r[h++]=128|f>>>6&63,r[h++]=128|f&63):o?(f=((o&1023)<<10)+(f&1023)+65536,r[h++]=240|f>>>18,r[h++]=128|f>>>12&63,r[h++]=128|f>>>6&63,r[h++]=128|f&63,o=0):o=f}h>=64&&(this._int32(n),n[0]=n[16]),this._size+=h-a}return this._sp=o,this}_int32(t,r){let{A:n,B:s,C:o,D:i,E:a,F:h,G:f,H:l}=this,y=0;for(r=r|0;y<16;)Lt[y++]=ct(t[r++]);for(y=16;y<64;y++)Lt[y]=Al(Lt[y-2])+Lt[y-7]+Ml(Lt[y-15])+Lt[y-16]|0;for(y=0;y<64;y++){const k=l+vl(a)+bl(a,h,f)+pl[y]+Lt[y]|0,I=Sl(n)+xl(n,s,o)|0;l=f,f=h,h=a,a=i+k|0,i=o,o=s,s=n,n=k+I|0}this.A=n+this.A|0,this.B=s+this.B|0,this.C=o+this.C|0,this.D=i+this.D|0,this.E=a+this.E|0,this.F=h+this.F|0,this.G=f+this.G|0,this.H=l+this.H|0}digest(t){const{_byte:r,_word:n}=this;let s=this._size%64|0;for(r[s++]=128;s&3;)r[s++]=0;if(s>>=2,s>14){for(;s<16;)n[s++]=0;s=0,this._int32(n)}for(;s<16;)n[s++]=0;const o=this._size*8,i=(o&4294967295)>>>0,a=(o-i)/4294967296;return a&&(n[14]=ct(a)),i&&(n[15]=ct(i)),this._int32(n),t==="hex"?this._hex():this._bin()}_hex(){const{A:t,B:r,C:n,D:s,E:o,F:i,G:a,H:h}=this;return Tt(t)+Tt(r)+Tt(n)+Tt(s)+Tt(o)+Tt(i)+Tt(a)+Tt(h)}_bin(){const{A:t,B:r,C:n,D:s,E:o,F:i,G:a,H:h,_byte:f,_word:l}=this;return l[0]=ct(t),l[1]=ct(r),l[2]=ct(n),l[3]=ct(s),l[4]=ct(o),l[5]=ct(i),l[6]=ct(a),l[7]=ct(h),f.slice(0,32)}}const Lt=new Int32Array(64);let Tr,fr=0;const Tt=e=>(e+4294967296).toString(16).substr(-8),yl=(e=>e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255),wl=(e=>e),ct=El()?wl:yl,bl=(e,t,r)=>r^e&(t^r),xl=(e,t,r)=>e&t|r&(e|t),Sl=e=>(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),vl=e=>(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7),Ml=e=>(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,Al=e=>(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10;function El(){return new Uint8Array(new Uint16Array([65279]).buffer)[0]===254}const $s=e=>gl().update(e).digest();var St;(function(e){e.mainnet="mainnet",e.testnet="testnet",e.regtest="regtest",e.signet="signet"})(St||(St={}));var rt;(function(e){e.p2pkh="p2pkh",e.p2sh="p2sh",e.p2wpkh="p2wpkh",e.p2wsh="p2wsh",e.p2tr="p2tr"})(rt||(rt={}));const ei={0:{type:rt.p2pkh,network:St.mainnet},111:{type:rt.p2pkh,network:St.testnet},5:{type:rt.p2sh,network:St.mainnet},196:{type:rt.p2sh,network:St.testnet}};function Il(e,t){return e}const Ki=(e,t)=>({...e,network:Il(e.network)}),Nl=(e,t)=>{let r;try{e.startsWith("bc1p")||e.startsWith("tb1p")||e.startsWith("bcrt1p")?r=bn.bech32m.decode(e):r=bn.bech32.decode(e)}catch{throw new Error("Invalid address")}const s={bc:St.mainnet,tb:St.testnet,bcrt:St.regtest}[r.prefix];if(s===void 0)throw new Error("Invalid address");const o=r.words[0];if(o===void 0||o<0||o>16)throw new Error("Invalid address");const i=bn.bech32.fromWords(r.words.slice(1));let a;return i.length===20?a=rt.p2wpkh:o===1?a=rt.p2tr:a=rt.p2wsh,Ki({bech32:!0,network:s,address:e,type:a})},ti=(e,t)=>{let r;const n=e.slice(0,2).toLowerCase();if(n==="bc"||n==="tb")return Nl(e);try{r=fl(e)}catch{throw new Error("Invalid address")}const{length:s}=r;if(s!==25)throw new Error("Invalid address");const o=r[0],i=r.slice(s-4,s),a=r.slice(0,s-4),h=$s($s(a)).slice(0,4);if(i.some((y,k)=>y!==h[k]))throw new Error("Invalid address");const f=Object.keys(ei).map(Number);if(o===void 0||!f.includes(o))throw new Error("Invalid address");const l=ei[o];if(!l)throw new Error("Invalid address");return Ki({...l,address:e,bech32:!1})};var xn={},Br={};var ri;function kl(){return ri||(ri=1,Br.read=function(e,t,r,n,s){var o,i,a=s*8-n-1,h=(1<<a)-1,f=h>>1,l=-7,y=r?s-1:0,k=r?-1:1,I=e[t+y];for(y+=k,o=I&(1<<-l)-1,I>>=-l,l+=a;l>0;o=o*256+e[t+y],y+=k,l-=8);for(i=o&(1<<-l)-1,o>>=-l,l+=n;l>0;i=i*256+e[t+y],y+=k,l-=8);if(o===0)o=1-f;else{if(o===h)return i?NaN:(I?-1:1)*(1/0);i=i+Math.pow(2,n),o=o-f}return(I?-1:1)*i*Math.pow(2,o-n)},Br.write=function(e,t,r,n,s,o){var i,a,h,f=o*8-s-1,l=(1<<f)-1,y=l>>1,k=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:o-1,x=n?1:-1,M=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-i))<1&&(i--,h*=2),i+y>=1?t+=k/h:t+=k*Math.pow(2,1-y),t*h>=2&&(i++,h/=2),i+y>=l?(a=0,i=l):i+y>=1?(a=(t*h-1)*Math.pow(2,s),i=i+y):(a=t*Math.pow(2,y-1)*Math.pow(2,s),i=0));s>=8;e[r+I]=a&255,I+=x,a/=256,s-=8);for(i=i<<s|a,f+=s;f>0;e[r+I]=i&255,I+=x,i/=256,f-=8);e[r+I-x]|=M*128}),Br}var ni;function Tl(){return ni||(ni=1,(function(e){const t=Vn(),r=kl(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=j,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const d=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(d,c),d.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function i(d){if(d>s)throw new RangeError('The value "'+d+'" is invalid for option "size"');const c=new Uint8Array(d);return Object.setPrototypeOf(c,a.prototype),c}function a(d,c,u){if(typeof d=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(d)}return h(d,c,u)}a.poolSize=8192;function h(d,c,u){if(typeof d=="string")return k(d,c);if(ArrayBuffer.isView(d))return x(d);if(d==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d);if(Xe(d,ArrayBuffer)||d&&Xe(d.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xe(d,SharedArrayBuffer)||d&&Xe(d.buffer,SharedArrayBuffer)))return M(d,c,u);if(typeof d=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=d.valueOf&&d.valueOf();if(g!=null&&g!==d)return a.from(g,c,u);const v=E(d);if(v)return v;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof d[Symbol.toPrimitive]=="function")return a.from(d[Symbol.toPrimitive]("string"),c,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d)}a.from=function(d,c,u){return h(d,c,u)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function f(d){if(typeof d!="number")throw new TypeError('"size" argument must be of type number');if(d<0)throw new RangeError('The value "'+d+'" is invalid for option "size"')}function l(d,c,u){return f(d),d<=0?i(d):c!==void 0?typeof u=="string"?i(d).fill(c,u):i(d).fill(c):i(d)}a.alloc=function(d,c,u){return l(d,c,u)};function y(d){return f(d),i(d<0?0:U(d)|0)}a.allocUnsafe=function(d){return y(d)},a.allocUnsafeSlow=function(d){return y(d)};function k(d,c){if((typeof c!="string"||c==="")&&(c="utf8"),!a.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const u=O(d,c)|0;let g=i(u);const v=g.write(d,c);return v!==u&&(g=g.slice(0,v)),g}function I(d){const c=d.length<0?0:U(d.length)|0,u=i(c);for(let g=0;g<c;g+=1)u[g]=d[g]&255;return u}function x(d){if(Xe(d,Uint8Array)){const c=new Uint8Array(d);return M(c.buffer,c.byteOffset,c.byteLength)}return I(d)}function M(d,c,u){if(c<0||d.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(d.byteLength<c+(u||0))throw new RangeError('"length" is outside of buffer bounds');let g;return c===void 0&&u===void 0?g=new Uint8Array(d):u===void 0?g=new Uint8Array(d,c):g=new Uint8Array(d,c,u),Object.setPrototypeOf(g,a.prototype),g}function E(d){if(a.isBuffer(d)){const c=U(d.length)|0,u=i(c);return u.length===0||d.copy(u,0,0,c),u}if(d.length!==void 0)return typeof d.length!="number"||sr(d.length)?i(0):I(d);if(d.type==="Buffer"&&Array.isArray(d.data))return I(d.data)}function U(d){if(d>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return d|0}function j(d){return+d!=d&&(d=0),a.alloc(+d)}a.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==a.prototype},a.compare=function(c,u){if(Xe(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),Xe(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(c)||!a.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===u)return 0;let g=c.length,v=u.length;for(let T=0,F=Math.min(g,v);T<F;++T)if(c[T]!==u[T]){g=c[T],v=u[T];break}return g<v?-1:v<g?1:0},a.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(c,u){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return a.alloc(0);let g;if(u===void 0)for(u=0,g=0;g<c.length;++g)u+=c[g].length;const v=a.allocUnsafe(u);let T=0;for(g=0;g<c.length;++g){let F=c[g];if(Xe(F,Uint8Array))T+F.length>v.length?(a.isBuffer(F)||(F=a.from(F)),F.copy(v,T)):Uint8Array.prototype.set.call(v,F,T);else if(a.isBuffer(F))F.copy(v,T);else throw new TypeError('"list" argument must be an Array of Buffers');T+=F.length}return v};function O(d,c){if(a.isBuffer(d))return d.length;if(ArrayBuffer.isView(d)||Xe(d,ArrayBuffer))return d.byteLength;if(typeof d!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof d);const u=d.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&u===0)return 0;let v=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return ft(d).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return ht(d).length;default:if(v)return g?-1:ft(d).length;c=(""+c).toLowerCase(),v=!0}}a.byteLength=O;function G(d,c,u){let g=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,c>>>=0,u<=c))return"";for(d||(d="utf8");;)switch(d){case"hex":return C(this,c,u);case"utf8":case"utf-8":return re(this,c,u);case"ascii":return xe(this,c,u);case"latin1":case"binary":return ve(this,c,u);case"base64":return Q(this,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,c,u);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase(),g=!0}}a.prototype._isBuffer=!0;function L(d,c,u){const g=d[c];d[c]=d[u],d[u]=g}a.prototype.swap16=function(){const c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<c;u+=2)L(this,u,u+1);return this},a.prototype.swap32=function(){const c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<c;u+=4)L(this,u,u+3),L(this,u+1,u+2);return this},a.prototype.swap64=function(){const c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<c;u+=8)L(this,u,u+7),L(this,u+1,u+6),L(this,u+2,u+5),L(this,u+3,u+4);return this},a.prototype.toString=function(){const c=this.length;return c===0?"":arguments.length===0?re(this,0,c):G.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(c){if(!a.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:a.compare(this,c)===0},a.prototype.inspect=function(){let c="";const u=e.INSPECT_MAX_BYTES;return c=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(c+=" ... "),"<Buffer "+c+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(c,u,g,v,T){if(Xe(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(u===void 0&&(u=0),g===void 0&&(g=c?c.length:0),v===void 0&&(v=0),T===void 0&&(T=this.length),u<0||g>c.length||v<0||T>this.length)throw new RangeError("out of range index");if(v>=T&&u>=g)return 0;if(v>=T)return-1;if(u>=g)return 1;if(u>>>=0,g>>>=0,v>>>=0,T>>>=0,this===c)return 0;let F=T-v,pe=g-u;const ke=Math.min(F,pe),Me=this.slice(v,T),Ae=c.slice(u,g);for(let Ee=0;Ee<ke;++Ee)if(Me[Ee]!==Ae[Ee]){F=Me[Ee],pe=Ae[Ee];break}return F<pe?-1:pe<F?1:0};function _(d,c,u,g,v){if(d.length===0)return-1;if(typeof u=="string"?(g=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,sr(u)&&(u=v?0:d.length-1),u<0&&(u=d.length+u),u>=d.length){if(v)return-1;u=d.length-1}else if(u<0)if(v)u=0;else return-1;if(typeof c=="string"&&(c=a.from(c,g)),a.isBuffer(c))return c.length===0?-1:$(d,c,u,g,v);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?v?Uint8Array.prototype.indexOf.call(d,c,u):Uint8Array.prototype.lastIndexOf.call(d,c,u):$(d,[c],u,g,v);throw new TypeError("val must be string, number or Buffer")}function $(d,c,u,g,v){let T=1,F=d.length,pe=c.length;if(g!==void 0&&(g=String(g).toLowerCase(),g==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(d.length<2||c.length<2)return-1;T=2,F/=2,pe/=2,u/=2}function ke(Ae,Ee){return T===1?Ae[Ee]:Ae.readUInt16BE(Ee*T)}let Me;if(v){let Ae=-1;for(Me=u;Me<F;Me++)if(ke(d,Me)===ke(c,Ae===-1?0:Me-Ae)){if(Ae===-1&&(Ae=Me),Me-Ae+1===pe)return Ae*T}else Ae!==-1&&(Me-=Me-Ae),Ae=-1}else for(u+pe>F&&(u=F-pe),Me=u;Me>=0;Me--){let Ae=!0;for(let Ee=0;Ee<pe;Ee++)if(ke(d,Me+Ee)!==ke(c,Ee)){Ae=!1;break}if(Ae)return Me}return-1}a.prototype.includes=function(c,u,g){return this.indexOf(c,u,g)!==-1},a.prototype.indexOf=function(c,u,g){return _(this,c,u,g,!0)},a.prototype.lastIndexOf=function(c,u,g){return _(this,c,u,g,!1)};function te(d,c,u,g){u=Number(u)||0;const v=d.length-u;g?(g=Number(g),g>v&&(g=v)):g=v;const T=c.length;g>T/2&&(g=T/2);let F;for(F=0;F<g;++F){const pe=parseInt(c.substr(F*2,2),16);if(sr(pe))return F;d[u+F]=pe}return F}function H(d,c,u,g){return Nt(ft(c,d.length-u),d,u,g)}function B(d,c,u,g){return Nt(Vt(c),d,u,g)}function D(d,c,u,g){return Nt(ht(c),d,u,g)}function ee(d,c,u,g){return Nt(Er(c,d.length-u),d,u,g)}a.prototype.write=function(c,u,g,v){if(u===void 0)v="utf8",g=this.length,u=0;else if(g===void 0&&typeof u=="string")v=u,g=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(g)?(g=g>>>0,v===void 0&&(v="utf8")):(v=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const T=this.length-u;if((g===void 0||g>T)&&(g=T),c.length>0&&(g<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");v||(v="utf8");let F=!1;for(;;)switch(v){case"hex":return te(this,c,u,g);case"utf8":case"utf-8":return H(this,c,u,g);case"ascii":case"latin1":case"binary":return B(this,c,u,g);case"base64":return D(this,c,u,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,c,u,g);default:if(F)throw new TypeError("Unknown encoding: "+v);v=(""+v).toLowerCase(),F=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(d,c,u){return c===0&&u===d.length?t.fromByteArray(d):t.fromByteArray(d.slice(c,u))}function re(d,c,u){u=Math.min(d.length,u);const g=[];let v=c;for(;v<u;){const T=d[v];let F=null,pe=T>239?4:T>223?3:T>191?2:1;if(v+pe<=u){let ke,Me,Ae,Ee;switch(pe){case 1:T<128&&(F=T);break;case 2:ke=d[v+1],(ke&192)===128&&(Ee=(T&31)<<6|ke&63,Ee>127&&(F=Ee));break;case 3:ke=d[v+1],Me=d[v+2],(ke&192)===128&&(Me&192)===128&&(Ee=(T&15)<<12|(ke&63)<<6|Me&63,Ee>2047&&(Ee<55296||Ee>57343)&&(F=Ee));break;case 4:ke=d[v+1],Me=d[v+2],Ae=d[v+3],(ke&192)===128&&(Me&192)===128&&(Ae&192)===128&&(Ee=(T&15)<<18|(ke&63)<<12|(Me&63)<<6|Ae&63,Ee>65535&&Ee<1114112&&(F=Ee))}}F===null?(F=65533,pe=1):F>65535&&(F-=65536,g.push(F>>>10&1023|55296),F=56320|F&1023),g.push(F),v+=pe}return me(g)}const se=4096;function me(d){const c=d.length;if(c<=se)return String.fromCharCode.apply(String,d);let u="",g=0;for(;g<c;)u+=String.fromCharCode.apply(String,d.slice(g,g+=se));return u}function xe(d,c,u){let g="";u=Math.min(d.length,u);for(let v=c;v<u;++v)g+=String.fromCharCode(d[v]&127);return g}function ve(d,c,u){let g="";u=Math.min(d.length,u);for(let v=c;v<u;++v)g+=String.fromCharCode(d[v]);return g}function C(d,c,u){const g=d.length;(!c||c<0)&&(c=0),(!u||u<0||u>g)&&(u=g);let v="";for(let T=c;T<u;++T)v+=cn[d[T]];return v}function W(d,c,u){const g=d.slice(c,u);let v="";for(let T=0;T<g.length-1;T+=2)v+=String.fromCharCode(g[T]+g[T+1]*256);return v}a.prototype.slice=function(c,u){const g=this.length;c=~~c,u=u===void 0?g:~~u,c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),u<0?(u+=g,u<0&&(u=0)):u>g&&(u=g),u<c&&(u=c);const v=this.subarray(c,u);return Object.setPrototypeOf(v,a.prototype),v};function V(d,c,u){if(d%1!==0||d<0)throw new RangeError("offset is not uint");if(d+c>u)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(c,u,g){c=c>>>0,u=u>>>0,g||V(c,u,this.length);let v=this[c],T=1,F=0;for(;++F<u&&(T*=256);)v+=this[c+F]*T;return v},a.prototype.readUintBE=a.prototype.readUIntBE=function(c,u,g){c=c>>>0,u=u>>>0,g||V(c,u,this.length);let v=this[c+--u],T=1;for(;u>0&&(T*=256);)v+=this[c+--u]*T;return v},a.prototype.readUint8=a.prototype.readUInt8=function(c,u){return c=c>>>0,u||V(c,1,this.length),this[c]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(c,u){return c=c>>>0,u||V(c,2,this.length),this[c]|this[c+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(c,u){return c=c>>>0,u||V(c,2,this.length),this[c]<<8|this[c+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(c,u){return c=c>>>0,u||V(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(c,u){return c=c>>>0,u||V(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},a.prototype.readBigUInt64LE=it(function(c){c=c>>>0,Ke(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===void 0)&&tt(c,this.length-8);const v=u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,T=this[++c]+this[++c]*2**8+this[++c]*2**16+g*2**24;return BigInt(v)+(BigInt(T)<<BigInt(32))}),a.prototype.readBigUInt64BE=it(function(c){c=c>>>0,Ke(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===void 0)&&tt(c,this.length-8);const v=u*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],T=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+g;return(BigInt(v)<<BigInt(32))+BigInt(T)}),a.prototype.readIntLE=function(c,u,g){c=c>>>0,u=u>>>0,g||V(c,u,this.length);let v=this[c],T=1,F=0;for(;++F<u&&(T*=256);)v+=this[c+F]*T;return T*=128,v>=T&&(v-=Math.pow(2,8*u)),v},a.prototype.readIntBE=function(c,u,g){c=c>>>0,u=u>>>0,g||V(c,u,this.length);let v=u,T=1,F=this[c+--v];for(;v>0&&(T*=256);)F+=this[c+--v]*T;return T*=128,F>=T&&(F-=Math.pow(2,8*u)),F},a.prototype.readInt8=function(c,u){return c=c>>>0,u||V(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},a.prototype.readInt16LE=function(c,u){c=c>>>0,u||V(c,2,this.length);const g=this[c]|this[c+1]<<8;return g&32768?g|4294901760:g},a.prototype.readInt16BE=function(c,u){c=c>>>0,u||V(c,2,this.length);const g=this[c+1]|this[c]<<8;return g&32768?g|4294901760:g},a.prototype.readInt32LE=function(c,u){return c=c>>>0,u||V(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},a.prototype.readInt32BE=function(c,u){return c=c>>>0,u||V(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},a.prototype.readBigInt64LE=it(function(c){c=c>>>0,Ke(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===void 0)&&tt(c,this.length-8);const v=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(g<<24);return(BigInt(v)<<BigInt(32))+BigInt(u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),a.prototype.readBigInt64BE=it(function(c){c=c>>>0,Ke(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===void 0)&&tt(c,this.length-8);const v=(u<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(v)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+g)}),a.prototype.readFloatLE=function(c,u){return c=c>>>0,u||V(c,4,this.length),r.read(this,c,!0,23,4)},a.prototype.readFloatBE=function(c,u){return c=c>>>0,u||V(c,4,this.length),r.read(this,c,!1,23,4)},a.prototype.readDoubleLE=function(c,u){return c=c>>>0,u||V(c,8,this.length),r.read(this,c,!0,52,8)},a.prototype.readDoubleBE=function(c,u){return c=c>>>0,u||V(c,8,this.length),r.read(this,c,!1,52,8)};function X(d,c,u,g,v,T){if(!a.isBuffer(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>v||c<T)throw new RangeError('"value" argument is out of bounds');if(u+g>d.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(c,u,g,v){if(c=+c,u=u>>>0,g=g>>>0,!v){const pe=Math.pow(2,8*g)-1;X(this,c,u,g,pe,0)}let T=1,F=0;for(this[u]=c&255;++F<g&&(T*=256);)this[u+F]=c/T&255;return u+g},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(c,u,g,v){if(c=+c,u=u>>>0,g=g>>>0,!v){const pe=Math.pow(2,8*g)-1;X(this,c,u,g,pe,0)}let T=g-1,F=1;for(this[u+T]=c&255;--T>=0&&(F*=256);)this[u+T]=c/F&255;return u+g},a.prototype.writeUint8=a.prototype.writeUInt8=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,1,255,0),this[u]=c&255,u+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,2,65535,0),this[u]=c&255,this[u+1]=c>>>8,u+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,2,65535,0),this[u]=c>>>8,this[u+1]=c&255,u+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,4,4294967295,0),this[u+3]=c>>>24,this[u+2]=c>>>16,this[u+1]=c>>>8,this[u]=c&255,u+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,4,4294967295,0),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4};function fe(d,c,u,g,v){Gt(c,g,v,d,u,7);let T=Number(c&BigInt(4294967295));d[u++]=T,T=T>>8,d[u++]=T,T=T>>8,d[u++]=T,T=T>>8,d[u++]=T;let F=Number(c>>BigInt(32)&BigInt(4294967295));return d[u++]=F,F=F>>8,d[u++]=F,F=F>>8,d[u++]=F,F=F>>8,d[u++]=F,u}function he(d,c,u,g,v){Gt(c,g,v,d,u,7);let T=Number(c&BigInt(4294967295));d[u+7]=T,T=T>>8,d[u+6]=T,T=T>>8,d[u+5]=T,T=T>>8,d[u+4]=T;let F=Number(c>>BigInt(32)&BigInt(4294967295));return d[u+3]=F,F=F>>8,d[u+2]=F,F=F>>8,d[u+1]=F,F=F>>8,d[u]=F,u+8}a.prototype.writeBigUInt64LE=it(function(c,u=0){return fe(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=it(function(c,u=0){return he(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(c,u,g,v){if(c=+c,u=u>>>0,!v){const ke=Math.pow(2,8*g-1);X(this,c,u,g,ke-1,-ke)}let T=0,F=1,pe=0;for(this[u]=c&255;++T<g&&(F*=256);)c<0&&pe===0&&this[u+T-1]!==0&&(pe=1),this[u+T]=(c/F>>0)-pe&255;return u+g},a.prototype.writeIntBE=function(c,u,g,v){if(c=+c,u=u>>>0,!v){const ke=Math.pow(2,8*g-1);X(this,c,u,g,ke-1,-ke)}let T=g-1,F=1,pe=0;for(this[u+T]=c&255;--T>=0&&(F*=256);)c<0&&pe===0&&this[u+T+1]!==0&&(pe=1),this[u+T]=(c/F>>0)-pe&255;return u+g},a.prototype.writeInt8=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},a.prototype.writeInt16LE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},a.prototype.writeInt16BE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},a.prototype.writeInt32LE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,4,2147483647,-2147483648),this[u]=c&255,this[u+1]=c>>>8,this[u+2]=c>>>16,this[u+3]=c>>>24,u+4},a.prototype.writeInt32BE=function(c,u,g){return c=+c,u=u>>>0,g||X(this,c,u,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4},a.prototype.writeBigInt64LE=it(function(c,u=0){return fe(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=it(function(c,u=0){return he(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(d,c,u,g,v,T){if(u+g>d.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function Te(d,c,u,g,v){return c=+c,u=u>>>0,v||ye(d,c,u,4),r.write(d,c,u,g,23,4),u+4}a.prototype.writeFloatLE=function(c,u,g){return Te(this,c,u,!0,g)},a.prototype.writeFloatBE=function(c,u,g){return Te(this,c,u,!1,g)};function q(d,c,u,g,v){return c=+c,u=u>>>0,v||ye(d,c,u,8),r.write(d,c,u,g,52,8),u+8}a.prototype.writeDoubleLE=function(c,u,g){return q(this,c,u,!0,g)},a.prototype.writeDoubleBE=function(c,u,g){return q(this,c,u,!1,g)},a.prototype.copy=function(c,u,g,v){if(!a.isBuffer(c))throw new TypeError("argument should be a Buffer");if(g||(g=0),!v&&v!==0&&(v=this.length),u>=c.length&&(u=c.length),u||(u=0),v>0&&v<g&&(v=g),v===g||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("sourceEnd out of bounds");v>this.length&&(v=this.length),c.length-u<v-g&&(v=c.length-u+g);const T=v-g;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,g,v):Uint8Array.prototype.set.call(c,this.subarray(g,v),u),T},a.prototype.fill=function(c,u,g,v){if(typeof c=="string"){if(typeof u=="string"?(v=u,u=0,g=this.length):typeof g=="string"&&(v=g,g=this.length),v!==void 0&&typeof v!="string")throw new TypeError("encoding must be a string");if(typeof v=="string"&&!a.isEncoding(v))throw new TypeError("Unknown encoding: "+v);if(c.length===1){const F=c.charCodeAt(0);(v==="utf8"&&F<128||v==="latin1")&&(c=F)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(u<0||this.length<u||this.length<g)throw new RangeError("Out of range index");if(g<=u)return this;u=u>>>0,g=g===void 0?this.length:g>>>0,c||(c=0);let T;if(typeof c=="number")for(T=u;T<g;++T)this[T]=c;else{const F=a.isBuffer(c)?c:a.from(c,v),pe=F.length;if(pe===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(T=0;T<g-u;++T)this[T+u]=F[T%pe]}return this};const Ne={};function wt(d,c,u){Ne[d]=class extends u{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${d}]`,this.stack,delete this.name}get code(){return d}set code(v){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:v,writable:!0})}toString(){return`${this.name} [${d}]: ${this.message}`}}}wt("ERR_BUFFER_OUT_OF_BOUNDS",function(d){return d?`${d} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),wt("ERR_INVALID_ARG_TYPE",function(d,c){return`The "${d}" argument must be of type number. Received type ${typeof c}`},TypeError),wt("ERR_OUT_OF_RANGE",function(d,c,u){let g=`The value of "${d}" is out of range.`,v=u;return Number.isInteger(u)&&Math.abs(u)>2**32?v=Qe(String(u)):typeof u=="bigint"&&(v=String(u),(u>BigInt(2)**BigInt(32)||u<-(BigInt(2)**BigInt(32)))&&(v=Qe(v)),v+="n"),g+=` It must be ${c}. Received ${v}`,g},RangeError);function Qe(d){let c="",u=d.length;const g=d[0]==="-"?1:0;for(;u>=g+4;u-=3)c=`_${d.slice(u-3,u)}${c}`;return`${d.slice(0,u)}${c}`}function Ot(d,c,u){Ke(c,"offset"),(d[c]===void 0||d[c+u]===void 0)&&tt(c,d.length-(u+1))}function Gt(d,c,u,g,v,T){if(d>u||d<c){const F=typeof c=="bigint"?"n":"";let pe;throw c===0||c===BigInt(0)?pe=`>= 0${F} and < 2${F} ** ${(T+1)*8}${F}`:pe=`>= -(2${F} ** ${(T+1)*8-1}${F}) and < 2 ** ${(T+1)*8-1}${F}`,new Ne.ERR_OUT_OF_RANGE("value",pe,d)}Ot(g,v,T)}function Ke(d,c){if(typeof d!="number")throw new Ne.ERR_INVALID_ARG_TYPE(c,"number",d)}function tt(d,c,u){throw Math.floor(d)!==d?(Ke(d,u),new Ne.ERR_OUT_OF_RANGE("offset","an integer",d)):c<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,d)}const Rt=/[^+/0-9A-Za-z-_]/g;function Ar(d){if(d=d.split("=")[0],d=d.trim().replace(Rt,""),d.length<2)return"";for(;d.length%4!==0;)d=d+"=";return d}function ft(d,c){c=c||1/0;let u;const g=d.length;let v=null;const T=[];for(let F=0;F<g;++F){if(u=d.charCodeAt(F),u>55295&&u<57344){if(!v){if(u>56319){(c-=3)>-1&&T.push(239,191,189);continue}else if(F+1===g){(c-=3)>-1&&T.push(239,191,189);continue}v=u;continue}if(u<56320){(c-=3)>-1&&T.push(239,191,189),v=u;continue}u=(v-55296<<10|u-56320)+65536}else v&&(c-=3)>-1&&T.push(239,191,189);if(v=null,u<128){if((c-=1)<0)break;T.push(u)}else if(u<2048){if((c-=2)<0)break;T.push(u>>6|192,u&63|128)}else if(u<65536){if((c-=3)<0)break;T.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((c-=4)<0)break;T.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return T}function Vt(d){const c=[];for(let u=0;u<d.length;++u)c.push(d.charCodeAt(u)&255);return c}function Er(d,c){let u,g,v;const T=[];for(let F=0;F<d.length&&!((c-=2)<0);++F)u=d.charCodeAt(F),g=u>>8,v=u%256,T.push(v),T.push(g);return T}function ht(d){return t.toByteArray(Ar(d))}function Nt(d,c,u,g){let v;for(v=0;v<g&&!(v+u>=c.length||v>=d.length);++v)c[v+u]=d[v];return v}function Xe(d,c){return d instanceof c||d!=null&&d.constructor!=null&&d.constructor.name!=null&&d.constructor.name===c.name}function sr(d){return d!==d}const cn=(function(){const d="0123456789abcdef",c=new Array(256);for(let u=0;u<16;++u){const g=u*16;for(let v=0;v<16;++v)c[g+v]=d[u]+d[v]}return c})();function it(d){return typeof BigInt>"u"?un:d}function un(){throw new Error("BigInt not supported")}})(xn)),xn}var si=Tl(),Xi=["software","ledger","keystone"],tr=Si(Xi),rr=(e=>(e.Ordinals="ordinals",e.Payment="payment",e.Stacks="stacks",e.Starknet="starknet",e.Spark="spark",e))(rr||{}),Jn=(e=>(e.p2pkh="p2pkh",e.p2sh="p2sh",e.p2wpkh="p2wpkh",e.p2wsh="p2wsh",e.p2tr="p2tr",e.stacks="stacks",e.starknet="starknet",e.spark="spark",e))(Jn||{}),At=S({address:m(),publicKey:m(),purpose:je(rr),addressType:je(Jn),walletType:tr}),Bl=async e=>{const t=await It(e.getProvider),{purposes:r}=e.payload;if(!r)throw new Error("Address purposes are required");try{const n=Ct.createUnsecuredToken(e.payload),s=await t.connect(n);e.onFinish?.(s)}catch(n){console.error("[Connect] Error during address request",n),e.onCancel?.()}},Et=(e=>(e.Mainnet="Mainnet",e.Testnet="Testnet",e.Testnet4="Testnet4",e.Signet="Signet",e.Regtest="Regtest",e))(Et||{}),tn=(e=>(e.Mainnet="mainnet",e.Testnet="testnet",e))(tn||{}),Kn=(e=>(e.Mainnet="mainnet",e.Sepolia="sepolia",e))(Kn||{}),Xn=(e=>(e.Mainnet="mainnet",e.Regtest="regtest",e))(Xn||{}),rn=K(Be([m(),ge(),He()])),de=S({jsonrpc:J("2.0"),method:m(),params:K(Be([be(Wr()),xi({}),He()])),id:vc(rn)}),mr=(e=>(e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.USER_REJECTION=-32e3]="USER_REJECTION",e[e.METHOD_NOT_SUPPORTED=-32001]="METHOD_NOT_SUPPORTED",e[e.ACCESS_DENIED=-32002]="ACCESS_DENIED",e))(mr||{}),$n=S({jsonrpc:J("2.0"),result:Gn(Wr()),id:rn}),es=S({jsonrpc:J("2.0"),error:Gn(Wr()),id:rn}),Cl=Be([$n,es]),$i="accountChange",eo=S({type:J($i),addresses:K(be(At))}),to="networkChange",ro=S({type:J(to),bitcoin:S({name:je(Et)}),stacks:S({name:m()}),addresses:K(be(At))}),no="disconnect",so=S({type:J(no)}),Pl=yr("type",[eo,ro,so]);async function It(e){const t=await e?.()||window.XverseProviders?.BitcoinProvider||window.BitcoinProvider;if(!t)throw new Error("No Bitcoin wallet installed");return t}function Ol(){return window.btc_providers||(window.btc_providers=[]),window.btc_providers}function Kt(e){return e?.split(".").reduce((t,r)=>t?.[r],window)}function io(e){return!!Kt(e)}function oo(e){localStorage.setItem("sats-connect_defaultProvider",e)}function _n(){return localStorage.getItem("sats-connect_defaultProvider")}function ao(){localStorage.removeItem("sats-connect_defaultProvider")}function co(){return Object.values(nt).map(t=>({...t,isInstalled:io(t.id)}))}var Rl=(e,t,r)=>{try{const[n,s,o]=r.version.split(".").map(a=>parseInt(a,10)),i=r.platform;if(!i||i==="web"&&n<=1&&s<=4||i==="mobile"&&n<=1&&s<=54){const a=_l(e,t);e=a.method,t=a.params}}catch{}return{method:e,params:t}},_l=(e,t)=>{const r=n=>n?.filter(s=>s!=="spark"&&s!=="starknet");if(e==="wallet_connect"){const n=t;if(!n)return{method:e,params:t};const{addresses:s,...o}=n,i={...o,addresses:r(s)};return{method:e,params:i}}if(e==="getAccounts"){const n=t,{purposes:s,...o}=n,i={...o,purposes:r(s)};return{method:e,params:i}}if(e==="getAddresses"){const n=t,{purposes:s,...o}=n,i={...o,purposes:r(s)};return{method:e,params:i}}return{method:e,params:t}},uo=S({read:K(gt())}),lo=S({readNetwork:K(gt())}),ts=S({type:J("account"),resourceId:m(),clientId:m(),actions:uo}),rs=S({type:J("wallet"),resourceId:m(),clientId:m(),actions:lo}),ns=yr("type",[S({...ms(ts,["clientId"]).entries}),S({...ms(rs,["clientId"]).entries})]),fo=yr("type",[ts,rs]),ho="wallet_requestPermissions",po=Oe(be(ns)),Dl=J(!0),Fl=S({...de.entries,...S({method:J(ho),params:po,id:m()}).entries}),go="wallet_renouncePermissions",mo=Oe(He()),jl=Oe(He()),Ll=S({...de.entries,...S({method:J(go),params:mo,id:m()}).entries}),yo="wallet_disconnect",wo=Oe(He()),zl=Oe(He()),Ul=S({...de.entries,...S({method:J(yo),params:wo,id:m()}).entries}),bo="wallet_getWalletType",xo=Oe(He()),Hl=tr,ql=S({...de.entries,...S({method:J(bo),params:xo,id:m()}).entries}),So="wallet_getCurrentPermissions",vo=Oe(He()),Gl=be(fo),Vl=S({...de.entries,...S({method:J(So),params:vo,id:m()}).entries}),Mo="wallet_getNetwork",Ao=Oe(He()),qt=S({bitcoin:S({name:je(Et)}),stacks:S({name:je(tn)}),spark:S({name:je(Xn)})}),Wl=S({...de.entries,...S({method:J(Mo),params:Ao,id:m()}).entries}),Eo="wallet_changeNetwork",Io=S({name:je(Et)}),Yl=Oe(He()),Ql=S({...de.entries,...S({method:J(Eo),params:Io,id:m()}).entries}),No="wallet_changeNetworkById",ko=S({id:m()}),Zl=Oe(He()),Jl=S({...de.entries,...S({method:J(No),params:ko,id:m()}).entries}),To="wallet_getAccount",Bo=Oe(He()),Kl=S({id:m(),addresses:be(At),walletType:tr,network:qt}),Xl=S({...de.entries,...S({method:J(To),params:Bo,id:m()}).entries}),Co="wallet_connect",Po=Oe(S({permissions:K(be(ns)),addresses:K(be(je(rr))),message:K(Tn(m(),yi(80,"The message must not exceed 80 characters."))),network:K(je(Et))})),$l=S({id:m(),addresses:be(At),walletType:tr,network:qt}),ed=S({...de.entries,...S({method:J(Co),params:Po,id:m()}).entries}),Oo="wallet_addNetwork",Ro=yr("chain",[S({chain:J("bitcoin"),type:je(Et),name:m(),rpcUrl:m(),rpcFallbackUrl:K(m()),indexerUrl:K(m()),blockExplorerUrl:K(m()),switch:K(gt())}),S({chain:J("stacks"),name:m(),type:je(tn),rpcUrl:m(),blockExplorerUrl:K(m()),switch:K(gt())}),S({chain:J("starknet"),name:m(),type:je(Kn),rpcUrl:m(),blockExplorerUrl:K(m()),switch:K(gt())})]),td=S({...de.entries,...S({method:J(Oo),params:Ro,id:m()}).entries}),rd=S({id:m()}),ss=(e=>(e.Web="web",e.Mobile="mobile",e))(ss||{}),_o="getInfo",Do=Oe(He()),nd=S({version:m(),platform:K(je(ss)),methods:K(be(m())),supports:be(m())}),sd=S({...de.entries,...S({method:J(_o),params:Do,id:m()}).entries}),Fo="getAddresses",jo=S({purposes:be(je(rr)),message:K(m())}),id=S({addresses:be(At),network:qt}),od=S({...de.entries,...S({method:J(Fo),params:jo,id:m()}).entries}),Lo="signMessage",nn=(e=>(e.ECDSA="ECDSA",e.BIP322="BIP322",e))(nn||{}),zo=S({address:m(),message:m(),protocol:K(je(nn))}),ad=S({signature:m(),messageHash:m(),address:m(),protocol:je(nn)}),cd=S({...de.entries,...S({method:J(Lo),params:zo,id:m()}).entries}),Uo="sendTransfer",Ho=S({recipients:be(S({address:m(),amount:ge()}))}),ud=S({txid:m()}),ld=S({...de.entries,...S({method:J(Uo),params:Ho,id:m()}).entries}),qo="signPsbt",Go=S({psbt:m(),signInputs:K(vi(m(),be(ge()))),broadcast:K(gt())}),dd=S({psbt:m(),txid:K(m())}),fd=S({...de.entries,...S({method:J(qo),params:Go,id:m()}).entries}),Vo="getAccounts",Wo=S({purposes:be(je(rr)),message:K(m())}),hd=be(S({...At.entries,...S({walletType:tr}).entries})),pd=S({...de.entries,...S({method:J(Vo),params:Wo,id:m()}).entries}),Yo="getBalance",gd=Oe(He()),md=S({confirmed:m(),unconfirmed:m(),total:m()}),yd=S({...de.entries,...S({method:J(Yo),id:m()}).entries}),Qo="ord_getInscriptions",Zo=S({offset:ge(),limit:ge()}),wd=S({total:ge(),limit:ge(),offset:ge(),inscriptions:be(S({inscriptionId:m(),inscriptionNumber:m(),address:m(),collectionName:K(m()),postage:m(),contentLength:m(),contentType:m(),timestamp:ge(),offset:ge(),genesisTransaction:m(),output:m()}))}),bd=S({...de.entries,...S({method:J(Qo),params:Zo,id:m()}).entries}),Jo="ord_sendInscriptions",Ko=S({transfers:be(S({address:m(),inscriptionId:m()}))}),xd=S({txid:m()}),Sd=S({...de.entries,...S({method:J(Jo),params:Ko,id:m()}).entries}),Xo="runes_etch",vd=S({amount:m(),cap:m(),heightStart:K(m()),heightEnd:K(m()),offsetStart:K(m()),offsetEnd:K(m())}),Md=S({contentType:m(),contentBase64:m()}),$o=S({runeName:m(),divisibility:K(ge()),symbol:K(m()),premine:K(m()),isMintable:gt(),delegateInscriptionId:K(m()),destinationAddress:m(),refundAddress:m(),feeRate:ge(),appServiceFee:K(ge()),appServiceFeeAddress:K(m()),terms:K(vd),inscriptionDetails:K(Md),network:K(je(Et))}),Ad=S({orderId:m(),fundTransactionId:m(),fundingAddress:m()}),Ed=S({...de.entries,...S({method:J(Xo),params:$o,id:m()}).entries}),ea="runes_getBalance",ta=Oe(He()),Id=S({balances:be(S({runeName:m(),amount:m(),divisibility:ge(),symbol:m(),inscriptionId:Oe(m()),spendableBalance:m()}))}),Nd=S({...de.entries,...S({method:J(ea),params:ta,id:m()}).entries}),ra="runes_mint",na=S({appServiceFee:K(ge()),appServiceFeeAddress:K(m()),destinationAddress:m(),feeRate:ge(),refundAddress:m(),repeats:ge(),runeName:m(),network:K(je(Et))}),kd=S({orderId:m(),fundTransactionId:m(),fundingAddress:m()}),Td=S({...de.entries,...S({method:J(ra),params:na,id:m()}).entries}),sa="runes_transfer",ia=S({recipients:be(S({runeName:m(),amount:m(),address:m()}))}),Bd=S({txid:m()}),Cd=S({...de.entries,...S({method:J(sa),params:ia,id:m()}).entries}),oa="spark_flashnet_getJwt",aa=He(),Pd=S({jwt:m()}),Od=S({...de.entries,...S({method:J(oa),params:aa,id:m()}).entries}),ca=S({type:J("addLiquidity"),data:S({userPublicKey:m(),poolId:m(),assetAAmount:m(),assetBAmount:m(),assetAMinAmountIn:m(),assetBMinAmountIn:m(),assetATransferId:m(),assetBTransferId:m(),nonce:m()})}),ua=S({type:J("clawback"),data:S({senderPublicKey:m(),sparkTransferId:m(),lpIdentityPublicKey:m(),nonce:m()})}),la=S({type:J("confirmInitialDeposit"),data:S({poolId:m(),assetASparkTransferId:m(),poolOwnerPublicKey:m(),nonce:m()})}),da=S({type:J("createConstantProductPool"),data:S({poolOwnerPublicKey:m(),assetAAddress:m(),assetBAddress:m(),lpFeeRateBps:Be([ge(),m()]),totalHostFeeRateBps:Be([ge(),m()]),nonce:m()})}),fa=S({type:J("createSingleSidedPool"),data:S({assetAAddress:m(),assetBAddress:m(),assetAInitialReserve:m(),virtualReserveA:Be([ge(),m()]),virtualReserveB:Be([ge(),m()]),threshold:Be([ge(),m()]),lpFeeRateBps:Be([ge(),m()]),totalHostFeeRateBps:Be([ge(),m()]),poolOwnerPublicKey:m(),nonce:m()})}),ha=S({type:J("removeLiquidity"),data:S({userPublicKey:m(),poolId:m(),lpTokensToRemove:m(),nonce:m()})}),pa=S({type:J("executeRouteSwap"),data:S({userPublicKey:m(),initialSparkTransferId:m(),hops:be(S({poolId:m(),inputAssetAddress:m(),outputAssetAddress:m(),hopIntegratorFeeRateBps:K(Be([ge(),m()]))})),inputAmount:m(),maxRouteSlippageBps:Be([ge(),m()]),minAmountOut:m(),defaultIntegratorFeeRateBps:K(Be([ge(),m()])),nonce:m()})}),ga=S({type:J("executeSwap"),data:S({userPublicKey:m(),poolId:m(),transferId:m(),assetInAddress:m(),assetOutAddress:m(),amountIn:m(),maxSlippageBps:Be([ge(),m()]),minAmountOut:m(),totalIntegratorFeeRateBps:K(Be([ge(),m()])),nonce:m()})}),ma="spark_flashnet_signIntent",ya=Be([ga,pa,ca,ua,la,da,fa,ha]),Rd=S({signature:m()}),_d=S({...de.entries,...S({method:J(ma),params:ya,id:m()}).entries}),wa="spark_flashnet_signStructuredMessage",ba=S({message:m()}),Dd=S({message:m(),signature:m()}),Fd=S({...de.entries,...S({method:J(wa),params:ba,id:m()}).entries}),xa="spark_getAddresses",Sa=Oe(S({message:K(m())})),jd=S({addresses:be(At),network:qt}),Ld=S({...de.entries,...S({method:J(xa),params:Sa,id:m()}).entries}),va="spark_getBalance",Ma=Oe(He()),zd=S({balance:m(),tokenBalances:be(S({balance:m(),tokenMetadata:S({tokenIdentifier:m(),tokenName:m(),tokenTicker:m(),decimals:ge(),maxSupply:m()})}))}),Ud=S({...de.entries,...S({method:J(va),params:Ma,id:m()}).entries}),Aa="spark_signMessage",Ea=S({message:m()}),Hd=S({signature:m()}),qd=S({...de.entries,...S({method:J(Aa),params:Ea,id:m()}).entries}),Ia="spark_transfer",Na=S({amountSats:Be([ge(),m()]),receiverSparkAddress:m()}),Gd=S({id:m()}),Vd=S({...de.entries,...S({method:J(Ia),params:Na,id:m()}).entries}),ka="spark_transferToken",Ta=S({tokenAmount:Be([ge(),m()]),tokenIdentifier:m(),receiverSparkAddress:m()}),Wd=S({id:m()}),Yd=S({...de.entries,...S({method:J(ka),params:Ta,id:m()}).entries}),Ba="stx_callContract",Ca=S({contract:m(),functionName:m(),arguments:K(be(m())),functionArgs:K(be(m())),postConditions:K(be(m())),postConditionMode:K(Be([J("allow"),J("deny")]))}),Qd=S({txid:m(),transaction:m()}),Zd=S({...de.entries,...S({method:J(Ba),params:Ca,id:m()}).entries}),Pa="stx_deployContract",Oa=S({name:m(),clarityCode:m(),clarityVersion:K(ge()),postConditions:K(be(m())),postConditionMode:K(Be([J("allow"),J("deny")]))}),Jd=S({txid:m(),transaction:m()}),Kd=S({...de.entries,...S({method:J(Pa),params:Oa,id:m()}).entries}),Ra="stx_getAccounts",_a=Oe(He()),Xd=S({addresses:be(S({address:m(),publicKey:m(),gaiaHubUrl:m(),gaiaAppKey:m()})),network:qt}),$d=S({...de.entries,...S({method:J(Ra),params:_a,id:m()}).entries}),Da="stx_getAddresses",Fa=Oe(S({message:K(m())})),ef=S({addresses:be(At),network:qt}),tf=S({...de.entries,...S({method:J(Da),params:Fa,id:m()}).entries}),ja="stx_signMessage",La=S({message:m()}),rf=S({signature:m(),publicKey:m()}),nf=S({...de.entries,...S({method:J(ja),params:La,id:m()}).entries}),za="stx_signStructuredMessage",Ua=S({domain:m(),message:m(),publicKey:K(m())}),sf=S({signature:m(),publicKey:m()}),of=S({...de.entries,...S({method:J(za),params:Ua,id:m()}).entries}),Ha="stx_signTransaction",qa=S({transaction:m(),pubkey:K(m()),broadcast:K(gt())}),af=S({transaction:m()}),cf=S({...de.entries,...S({method:J(Ha),params:qa,id:m()}).entries}),Ga="stx_signTransactions",Va=S({transactions:Tn(be(Tn(m(),mi(e=>!0,"Invalid hex-encoded Stacks transaction."))),wi(1)),broadcast:K(gt())}),uf=S({transactions:be(m())}),lf=S({...de.entries,...S({method:J(Ga),params:Va,id:m()}).entries}),Wa="stx_transferStx",Ya=S({amount:Be([ge(),m()]),recipient:m(),memo:K(m()),version:K(m()),postConditionMode:K(ge()),postConditions:K(be(m())),pubkey:K(m())}),df=S({txid:m(),transaction:m()}),ff=S({...de.entries,...S({method:J(Wa),params:Ya,id:m()}).entries}),hr={},ii=async(e,t,r)=>{const n=await e.request(t,r);return ps(es,n)?{status:"error",error:n.error}:ps($n,n)?{status:"success",result:n.result}:{status:"error",error:{code:-32603,message:"Received unknown response from provider.",data:n}}},is=async(e,t,r)=>{let n=window.XverseProviders?.BitcoinProvider||window.BitcoinProvider;if(r&&(n=await Kt(r)),!n)throw new Error("no wallet provider was found");if(!e)throw new Error("A wallet method is required");if(!hr.providerInfo){const s=await ii(n,"getInfo",null);s.status==="success"&&(hr.providerInfo=s.result)}if(hr.providerInfo){if(e==="getInfo")return{status:"success",result:hr.providerInfo};const s=Rl(e,t,hr.providerInfo);if(s.overrideResponse)return s.overrideResponse;e=s.method,t=s.params}return ii(n,e,t)},Qa=(...e)=>{const[t,r]=(()=>{if(e.length===1)return[e[0],void 0];if(e.length===2)return typeof e[1]=="function"?[{eventName:e[0],cb:e[1]},void 0]:e;if(e.length===3)return[{eventName:e[0],cb:e[1]},e[2]];throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).",{cause:e})})();let n=window.XverseProviders?.BitcoinProvider||window.BitcoinProvider;if(r&&(n=Kt(r)),!n)throw new Error("no wallet provider was found");return n.addListener?n.addListener(t):(console.error("The wallet provider you are using does not support the addListener method. Please update your wallet provider."),()=>{})},hf={Mainnet:"",Testnet:"-testnet",Testnet4:"-testnet4",Signet:"-signet"},pf=(e="Mainnet")=>{if(e==="Regtest")throw new Error(`Ordinals API does not support ${e} network`);return`https://ordinals${hf[e]}.xverse.app/v1`},gr=class{client;constructor(e){this.client=Pe.create({baseURL:pf(e)})}parseError=e=>({code:e.response?.status,message:JSON.stringify(e.response?.data)});estimateMintCost=async e=>{try{return{data:(await this.client.post("/runes/mint/estimate",{...e})).data}}catch(t){const r=t;return{error:this.parseError(r)}}};estimateEtchCost=async e=>{try{return{data:(await this.client.post("/runes/etch/estimate",{...e})).data}}catch(t){const r=t;return{error:this.parseError(r)}}};createMintOrder=async e=>{try{return{data:(await this.client.post("/runes/mint/orders",{...e})).data}}catch(t){const r=t;return{error:this.parseError(r)}}};createEtchOrder=async e=>{try{return{data:(await this.client.post("/runes/etch/orders",{...e})).data}}catch(t){const r=t;return{error:this.parseError(r)}}};executeMint=async(e,t)=>{try{return{data:(await this.client.post(`/runes/mint/orders/${e}/execute`,{fundTransactionId:t})).data}}catch(r){const n=r;return{error:this.parseError(n)}}};executeEtch=async(e,t)=>{try{return{data:(await this.client.post(`/runes/etch/orders/${e}/execute`,{fundTransactionId:t})).data}}catch(r){const n=r;return{error:this.parseError(n)}}};getOrder=async e=>{try{return{data:(await this.client.get(`/orders/${e}`)).data}}catch(t){const r=t;return{error:this.parseError(r)}}};rbfOrder=async e=>{const{orderId:t,newFeeRate:r}=e;try{return{data:(await this.client.post(`/orders/${t}/rbf-estimate`,{newFeeRate:r})).data}}catch(n){const s=n;return{error:this.parseError(s)}}}},Sn={},pr=(e="Mainnet")=>(Sn[e]||(Sn[e]=new gr(e)),Sn[e]),vr=class{async mintRunes(e){try{const t=await this.requestInternal("getInfo",null).catch(()=>null);if(t&&t.status==="success"&&t.result.methods?.includes("runes_mint")){const i=await this.requestInternal("runes_mint",e);if(i&&(i.status==="success"||i.status==="error"&&i.error.code!==-32601))return i}const r={destinationAddress:e.destinationAddress,feeRate:e.feeRate,refundAddress:e.refundAddress,repeats:e.repeats,runeName:e.runeName,appServiceFee:e.appServiceFee,appServiceFeeAddress:e.appServiceFeeAddress},n=await new gr(e.network).createMintOrder(r);if(!n.data)return{status:"error",error:{code:n.error.code===400?-32600:-32603,message:n.error.message}};const s=await this.requestInternal("sendTransfer",{recipients:[{address:n.data.fundAddress,amount:n.data.fundAmount}]});return s.status!=="success"?s:(await new gr(e.network).executeMint(n.data.orderId,s.result.txid),{status:"success",result:{orderId:n.data.orderId,fundTransactionId:s.result.txid,fundingAddress:n.data.fundAddress}})}catch(t){return{status:"error",error:{code:-32603,message:t.message}}}}async etchRunes(e){const t={destinationAddress:e.destinationAddress,refundAddress:e.refundAddress,feeRate:e.feeRate,runeName:e.runeName,divisibility:e.divisibility,symbol:e.symbol,premine:e.premine,isMintable:e.isMintable,terms:e.terms,inscriptionDetails:e.inscriptionDetails,delegateInscriptionId:e.delegateInscriptionId,appServiceFee:e.appServiceFee,appServiceFeeAddress:e.appServiceFeeAddress};try{const r=await this.requestInternal("getInfo",null).catch(()=>null);if(r&&r.status==="success"&&r.result.methods?.includes("runes_etch")){const i=await this.requestInternal("runes_etch",e);if(i&&(i.status==="success"||i.status==="error"&&i.error.code!==-32601))return i}const n=await new gr(e.network).createEtchOrder(t);if(!n.data)return{status:"error",error:{code:n.error.code===400?-32600:-32603,message:n.error.message}};const s=await this.requestInternal("sendTransfer",{recipients:[{address:n.data.fundAddress,amount:n.data.fundAmount}]});return s.status!=="success"?s:(await new gr(e.network).executeEtch(n.data.orderId,s.result.txid),{status:"success",result:{orderId:n.data.orderId,fundTransactionId:s.result.txid,fundingAddress:n.data.fundAddress}})}catch(r){return{status:"error",error:{code:-32603,message:r.message}}}}async estimateMint(e){const t={destinationAddress:e.destinationAddress,feeRate:e.feeRate,repeats:e.repeats,runeName:e.runeName,appServiceFee:e.appServiceFee,appServiceFeeAddress:e.appServiceFeeAddress},r=await pr(e.network).estimateMintCost(t);return r.data?{status:"success",result:r.data}:{status:"error",error:{code:r.error.code===400?-32600:-32603,message:r.error.message}}}async estimateEtch(e){const t={destinationAddress:e.destinationAddress,feeRate:e.feeRate,runeName:e.runeName,divisibility:e.divisibility,symbol:e.symbol,premine:e.premine,isMintable:e.isMintable,terms:e.terms,inscriptionDetails:e.inscriptionDetails,delegateInscriptionId:e.delegateInscriptionId,appServiceFee:e.appServiceFee,appServiceFeeAddress:e.appServiceFeeAddress},r=await pr(e.network).estimateEtchCost(t);return r.data?{status:"success",result:r.data}:{status:"error",error:{code:r.error.code===400?-32600:-32603,message:r.error.message}}}async getOrder(e){const t=await pr(e.network).getOrder(e.id);return t.data?{status:"success",result:t.data}:{status:"error",error:{code:t.error.code===400||t.error.code===404?-32600:-32603,message:t.error.message}}}async estimateRbfOrder(e){const t={newFeeRate:e.newFeeRate,orderId:e.orderId},r=await pr(e.network).rbfOrder(t);return r.data?{status:"success",result:{fundingAddress:r.data.fundingAddress,rbfCost:r.data.rbfCost}}:{status:"error",error:{code:r.error.code===400||r.error.code===404?-32600:-32603,message:r.error.message}}}async rbfOrder(e){try{const t={newFeeRate:e.newFeeRate,orderId:e.orderId},r=await pr(e.network).rbfOrder(t);if(!r.data)return{status:"error",error:{code:r.error.code===400||r.error.code===404?-32600:-32603,message:r.error.message}};const n=await this.requestInternal("sendTransfer",{recipients:[{address:r.data.fundingAddress,amount:r.data.rbfCost}]});return n.status!=="success"?n:{status:"success",result:{fundingAddress:r.data.fundingAddress,orderId:t.orderId,fundRBFTransactionId:n.result.txid}}}catch(t){return{status:"error",error:{code:-32603,message:t.message}}}}async request(e,t){switch(e){case"runes_mint":return this.mintRunes(t);case"runes_etch":return this.etchRunes(t);case"runes_estimateMint":return this.estimateMint(t);case"runes_estimateEtch":return this.estimateEtch(t);case"runes_getOrder":return this.getOrder(t);case"runes_estimateRbfOrder":return this.estimateRbfOrder(t);case"runes_rbfOrder":return this.rbfOrder(t);default:return this.requestInternal(e,t)}}},gf=class extends vr{id=nt.xverse.id;requestInternal=async(e,t)=>is(e,t,this.id);addListener=e=>Qa(e,this.id)};function mf(e){let t=[];if(!e)return t;for(let r in e){let n=e[r];for(let s of n)t.push({index:s,address:r})}return t}var yf=class extends vr{id=nt.unisat.id;async getAccounts(e){const{purposes:t}=e;if(t.includes("stacks")||t.includes("starknet")||t.includes("spark"))throw new Error("Only bitcoin addresses are supported");const r=await window.unisat.requestAccounts(),n=await window.unisat.getPublicKey(),s=r[0],o=ti(r[0]).type,i=o===rt.p2tr?n.slice(2):n,a={address:s,publicKey:i,addressType:o,purpose:"payment",walletType:"software"},h={address:s,publicKey:i,addressType:o,purpose:"ordinals",walletType:"software"},f=[];return t.includes("payment")&&f.push({...a,walletType:"software"}),t.includes("ordinals")&&f.push({...h,walletType:"software"}),f}async signMessage(e){const{message:t,address:r}=e,n=ti(r).type;if([rt.p2wpkh,rt.p2tr].includes(n)){const i=await window.unisat.signMessage(t,"bip322-simple");return{address:r,messageHash:"",signature:i,protocol:"BIP322"}}const o=await window.unisat.signMessage(t,"ecdsa");return{address:r,messageHash:"",signature:o,protocol:"ECDSA"}}async sendTransfer(e){const{recipients:t}=e;if(t.length>1)throw new Error("Only one recipient is supported by this wallet provider");return{txid:await window.unisat.sendBitcoin(t[0].address,t[0].amount)}}async signPsbt(e){const{psbt:t,signInputs:r,broadcast:n}=e,s=si.Buffer.from(t,"base64").toString("hex"),o=await window.unisat.signPsbt(s,{autoFinalized:n,toSignInputs:mf(r)}),i=si.Buffer.from(o,"hex").toString("base64");let a;return n&&(a=await window.unisat.pushPsbt(o)),{psbt:i,txid:a}}requestInternal=async(e,t)=>{try{switch(e){case"getAccounts":return{status:"success",result:await this.getAccounts(t)};case"sendTransfer":return{status:"success",result:await this.sendTransfer(t)};case"signMessage":return{status:"success",result:await this.signMessage(t)};case"signPsbt":return{status:"success",result:await this.signPsbt(t)};default:{const r={code:-32001,message:"Method not supported by the selected wallet"};return console.error("Error calling the method",r),{status:"error",error:r}}}}catch(r){return console.error("Error calling the method",r),{status:"error",error:{code:r.code===4001?-32e3:-32603,message:r.message?r.message:"Wallet method call error",data:r}}}};addListener=({eventName:e,cb:t})=>{switch(e){case"accountChange":{const r=()=>{t({type:"accountChange"})};return window.unisat.on("accountsChanged",r),()=>{window.unisat.removeListener("accountsChanged",r)}}case"networkChange":{const r=()=>{t({type:"networkChange"})};return window.unisat.on("networkChanged",r),()=>{window.unisat.removeListener("networkChanged",r)}}default:return console.error("Event not supported by the selected wallet"),()=>{}}}},wf=class extends vr{id=nt.fordefi.id;requestInternal=async(e,t)=>{const r=Kt(this.id);if(!r)throw new Error("no wallet provider was found");if(!e)throw new Error("A wallet method is required");return await r.request(e,t)};addListener=({eventName:e,cb:t})=>{const r=Kt(this.id);if(!r)throw new Error("no wallet provider was found");return r.addListener?r.addListener(e,t):(console.error("The wallet provider you are using does not support the addListener method. Please update your wallet provider."),()=>{})}},Za=class extends vr{id="";constructor(e){super(),this.id=e}requestInternal=async(e,t)=>is(e,t,this.id);addListener=(...e)=>{throw new Error("Method not supported for `BaseAdapter`.")}},nt={fordefi:{id:"FordefiProviders.UtxoProvider",name:"Fordefi",webUrl:"https://www.fordefi.com/",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/fordefi/hcmehenccjdmfbojapcbcofkgdpbnlle",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzEzNDk0XzY2MjU0KSI+CjxwYXRoIGQ9Ik0xMC44NzY5IDE1LjYzNzhIMS41VjE4LjM5OUMxLjUgMTkuODAxMyAyLjYzNDQ3IDIwLjkzOCA0LjAzMzkyIDIwLjkzOEg4LjI0OTkyTDEwLjg3NjkgMTUuNjM3OFoiIGZpbGw9IiM3OTk0RkYiLz4KPHBhdGggZD0iTTEuNSA5Ljc3NTUxSDE5LjA1MTZMMTcuMDEzOSAxMy44NzExSDEuNVY5Ljc3NTUxWiIgZmlsbD0iIzQ4NkRGRiIvPgo8cGF0aCBkPSJNNy42NTk5NiAzSDEuNTI0NDFWOC4wMDcwNEgyMi40NjEyVjNIMTYuMzI1NlY2LjczOTQ0SDE1LjA2MDZWM0g4LjkyNTAyVjYuNzM5NDRINy42NTk5NlYzWiIgZmlsbD0iIzVDRDFGQSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEzNDk0XzY2MjU0Ij4KPHJlY3Qgd2lkdGg9IjIxIiBoZWlnaHQ9IjE4IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS41IDMpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},xverse:{id:"XverseProviders.BitcoinProvider",name:"Xverse",webUrl:"https://www.xverse.app/",googlePlayStoreUrl:"https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",iOSAppStoreUrl:"https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",chromeWebStoreUrl:"https://chromewebstore.google.com/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgdmlld0JveD0iMCAwIDEwMiAxMDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGlkPSJJY29uX0FydCAoRWRpdCBNZSkiPgo8cmVjdCB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgZmlsbD0iIzE4MTgxOCIvPgo8ZyBpZD0iTG9nby9FbWJsZW0iIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8yMF8xMjIzKSI+CjxwYXRoIGlkPSJWZWN0b3IiIGQ9Ik03NC42NTQyIDczLjg4ODNWNjUuMjMxMkM3NC42NTQyIDY0Ljg4OCA3NC41MTc3IDY0LjU2MDYgNzQuMjc0NSA2NC4zMTc0TDM3LjQzOTcgMjcuNDgyNUMzNy4xOTY1IDI3LjIzOTIgMzYuODY5MSAyNy4xMDI4IDM2LjUyNTggMjcuMTAyOEgyNy44NjlDMjcuNDQxNiAyNy4xMDI4IDI3LjA5MzggMjcuNDUwNiAyNy4wOTM4IDI3Ljg3OFYzNS45MjExQzI3LjA5MzggMzYuMjY0NCAyNy4yMzAyIDM2LjU5MTcgMjcuNDczNCAzNi44MzVMNDAuNjk1MiA1MC4wNTY3QzQwLjk5NzUgNTAuMzU5MSA0MC45OTc1IDUwLjg1MDEgNDAuNjk1MiA1MS4xNTI0TDI3LjMyMTEgNjQuNTI2NUMyNy4xNzU2IDY0LjY3MiAyNy4wOTM4IDY0Ljg2OTggMjcuMDkzOCA2NS4wNzQ0VjczLjg4ODNDMjcuMDkzOCA3NC4zMTUzIDI3LjQ0MTYgNzQuNjYzNSAyNy44NjkgNzQuNjYzNUg0Mi4zMzQyQzQyLjc2MTYgNzQuNjYzNSA0My4xMDk0IDc0LjMxNTMgNDMuMTA5NCA3My44ODgzVjY4LjY5NThDNDMuMTA5NCA2OC40OTEyIDQzLjE5MTIgNjguMjkzNSA0My4zMzY4IDY4LjE0NzlMNTAuNTExNCA2MC45NzMzQzUwLjgxMzggNjAuNjcwOSA1MS4zMDQ4IDYwLjY3MDkgNTEuNjA3MiA2MC45NzMzTDY0LjkxOTggNzQuMjg2MUM2NS4xNjMxIDc0LjUyOTMgNjUuNDkwNCA3NC42NjU4IDY1LjgzMzcgNzQuNjY1OEg3My44NzY3Qzc0LjMwNDIgNzQuNjY1OCA3NC42NTE5IDc0LjMxNzYgNzQuNjUxOSA3My44OTA2TDc0LjY1NDIgNzMuODg4M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGlkPSJWZWN0b3JfMiIgZD0iTTU1LjM1OCAzOC41NjcySDYyLjYwMzFDNjMuMDMyOCAzOC41NjcyIDYzLjM4MjkgMzguOTE3MyA2My4zODI5IDM5LjM0NjlWNDYuNTkyMUM2My4zODI5IDQ3LjI4NzcgNjQuMjI0IDQ3LjYzNTUgNjQuNzE1MSA0Ny4xNDIyTDc0LjY1NDEgMzcuMTg3M0M3NC43OTk0IDM3LjA0MTggNzQuODgxNiAzNi44NDQgNzQuODgxNiAzNi42MzcxVjI3LjkxODlDNzQuODgxNiAyNy40ODkyIDc0LjUzMzQgMjcuMTM5MSA3NC4xMDE3IDI3LjEzOTFMNjUuMjUzOCAyNy4xMjc3QzY1LjA0NyAyNy4xMjc3IDY0Ljg0OTIgMjcuMjA5NiA2NC43MDE0IDI3LjM1NTFMNTQuODA1NiAzNy4yMzVDNTQuMzE0NSAzNy43MjYgNTQuNjYyMyAzOC41NjcyIDU1LjM1NTcgMzguNTY3Mkg1NS4zNThaIiBmaWxsPSIjRUU3QTMwIi8+CjwvZz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yMF8xMjIzIj4KPHJlY3Qgd2lkdGg9IjQ3LjgxMjUiIGhlaWdodD0iNDcuODEyNSIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI3LjA5MzggMjcuMDkzOCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K"},unisat:{id:"unisat",name:"Unisat",webUrl:"https://unisat.io/",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDE4MCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxODAiIGhlaWdodD0iMTgwIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTAwNTBfNDE3MSkiPgo8cGF0aCBkPSJNMTEzLjY2IDI5LjI4OTdMMTQzLjk3IDU5LjMwOTdDMTQ2LjU1IDYxLjg1OTcgMTQ3LjgyIDY0LjQzOTcgMTQ3Ljc4IDY3LjAzOTdDMTQ3Ljc0IDY5LjYzOTcgMTQ2LjYzIDcyLjAwOTcgMTQ0LjQ2IDc0LjE1OTdDMTQyLjE5IDc2LjQwOTcgMTM5Ljc0IDc3LjU0OTcgMTM3LjEyIDc3LjU5OTdDMTM0LjUgNzcuNjM5NyAxMzEuOSA3Ni4zNzk3IDEyOS4zMiA3My44Mjk3TDk4LjMxOTkgNDMuMTI5N0M5NC43OTk5IDM5LjYzOTcgOTEuMzk5OSAzNy4xNjk3IDg4LjEyOTkgMzUuNzE5N0M4NC44NTk5IDM0LjI2OTcgODEuNDE5OSAzNC4wMzk3IDc3LjgxOTkgMzUuMDM5N0M3NC4yMDk5IDM2LjAyOTcgNzAuMzM5OSAzOC41Nzk3IDY2LjE4OTkgNDIuNjc5N0M2MC40Njk5IDQ4LjM0OTcgNTcuNzM5OSA1My42Njk3IDU4LjAxOTkgNTguNjM5N0M1OC4yOTk5IDYzLjYwOTcgNjEuMTM5OSA2OC43Njk3IDY2LjUyOTkgNzQuMDk5N0w5Ny43Nzk5IDEwNS4wNkMxMDAuMzkgMTA3LjY0IDEwMS42NyAxMTAuMjIgMTAxLjYzIDExMi43OEMxMDEuNTkgMTE1LjM1IDEwMC40NyAxMTcuNzIgOTguMjU5OSAxMTkuOTFDOTYuMDU5OSAxMjIuMDkgOTMuNjI5OSAxMjMuMjMgOTAuOTg5OSAxMjMuMzJDODguMzQ5OSAxMjMuNDEgODUuNzE5OSAxMjIuMTYgODMuMTE5OSAxMTkuNThMNTIuODA5OSA4OS41NTk3QzQ3Ljg3OTkgODQuNjc5NyA0NC4zMTk5IDgwLjA1OTcgNDIuMTI5OSA3NS42OTk3QzM5LjkzOTkgNzEuMzM5NyAzOS4xMTk5IDY2LjQwOTcgMzkuNjg5OSA2MC45MDk3QzQwLjE5OTkgNTYuMTk5NyA0MS43MDk5IDUxLjYzOTcgNDQuMjI5OSA0Ny4yMTk3QzQ2LjczOTkgNDIuNzk5NyA1MC4zMzk5IDM4LjI3OTcgNTUuMDA5OSAzMy42NDk3QzYwLjU2OTkgMjguMTM5NyA2NS44Nzk5IDIzLjkxOTcgNzAuOTM5OSAyMC45Nzk3Qzc1Ljk4OTkgMTguMDM5NyA4MC44Nzk5IDE2LjQwOTcgODUuNTk5OSAxNi4wNjk3QzkwLjMyOTkgMTUuNzI5NyA5NC45ODk5IDE2LjY2OTcgOTkuNTk5OSAxOC44ODk3QzEwNC4yMSAyMS4xMDk3IDEwOC44OSAyNC41Njk3IDExMy42NSAyOS4yODk3SDExMy42NloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxKSIvPgo8cGF0aCBkPSJNNjYuMTA5OSAxNTAuNDJMMzUuODA5OSAxMjAuNEMzMy4yMjk5IDExNy44NCAzMS45NTk5IDExNS4yNyAzMS45OTk5IDExMi42N0MzMi4wMzk5IDExMC4wNyAzMy4xNDk5IDEwNy43IDM1LjMxOTkgMTA1LjU1QzM3LjU4OTkgMTAzLjMgNDAuMDM5OSAxMDIuMTYgNDIuNjU5OSAxMDIuMTFDNDUuMjc5OSAxMDIuMDcgNDcuODc5OSAxMDMuMzIgNTAuNDU5OSAxMDUuODhMODEuNDQ5OSAxMzYuNThDODQuOTc5OSAxNDAuMDcgODguMzY5OSAxNDIuNTQgOTEuNjM5OSAxNDMuOTlDOTQuOTA5OSAxNDUuNDQgOTguMzQ5OSAxNDUuNjYgMTAxLjk2IDE0NC42N0MxMDUuNTcgMTQzLjY4IDEwOS40NCAxNDEuMTMgMTEzLjU5IDEzNy4wMkMxMTkuMzEgMTMxLjM1IDEyMi4wNCAxMjYuMDMgMTIxLjc2IDEyMS4wNkMxMjEuNDggMTE2LjA5IDExOC42NCAxMTAuOTMgMTEzLjI1IDEwNS41OUw5Ni41OTk5IDg5LjI0MDFDOTMuOTg5OSA4Ni42NjAxIDkyLjcwOTkgODQuMDgwMSA5Mi43NDk5IDgxLjUyMDFDOTIuNzg5OSA3OC45NTAxIDkzLjkwOTkgNzYuNTgwMSA5Ni4xMTk5IDc0LjM5MDFDOTguMzE5OSA3Mi4yMTAxIDEwMC43NSA3MS4wNzAxIDEwMy4zOSA3MC45ODAxQzEwNi4wMyA3MC44OTAxIDEwOC42NiA3Mi4xNDAxIDExMS4yNiA3NC43MjAxTDEyNi45NiA5MC4xMzAxQzEzMS44OSA5NS4wMTAxIDEzNS40NSA5OS42MzAxIDEzNy42NCAxMDMuOTlDMTM5LjgzIDEwOC4zNSAxNDAuNjUgMTEzLjI4IDE0MC4wOCAxMTguNzhDMTM5LjU3IDEyMy40OSAxMzguMDYgMTI4LjA1IDEzNS41NCAxMzIuNDdDMTMzLjAzIDEzNi44OSAxMjkuNDMgMTQxLjQxIDEyNC43NiAxNDYuMDRDMTE5LjIgMTUxLjU1IDExMy44OSAxNTUuNzcgMTA4LjgzIDE1OC43MUMxMDMuNzcgMTYxLjY1IDk4Ljg3OTkgMTYzLjI5IDk0LjE0OTkgMTYzLjYzQzg5LjQxOTkgMTYzLjk3IDg0Ljc1OTkgMTYzLjAzIDgwLjE0OTkgMTYwLjgxQzc1LjUzOTkgMTU4LjU5IDcwLjg1OTkgMTU1LjEzIDY2LjA5OTkgMTUwLjQxTDY2LjEwOTkgMTUwLjQyWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzEwMDUwXzQxNzEpIi8+CjxwYXRoIGQ9Ik04NS4wMDk5IDcyLjk1OTJDOTEuMTU2OCA3Mi45NTkyIDk2LjEzOTkgNjcuOTc2MSA5Ni4xMzk5IDYxLjgyOTJDOTYuMTM5OSA1NS42ODIzIDkxLjE1NjggNTAuNjk5MiA4NS4wMDk5IDUwLjY5OTJDNzguODYzIDUwLjY5OTIgNzMuODc5OSA1NS42ODIzIDczLjg3OTkgNjEuODI5MkM3My44Nzk5IDY3Ljk3NjEgNzguODYzIDcyLjk1OTIgODUuMDA5OSA3Mi45NTkyWiIgZmlsbD0idXJsKCNwYWludDJfcmFkaWFsXzEwMDUwXzQxNzEpIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iMTM4Ljk4NSIgeTE9IjQ2Ljc3OTUiIHgyPSI0NS4wNTI5IiB5Mj0iODguNTIzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMjAxQzFCIi8+CjxzdG9wIG9mZnNldD0iMC4zNiIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRCODUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iNDMuMzgxMiIgeTE9IjEzNC4xNjciIHgyPSIxNTIuMjMxIiB5Mj0iMTAxLjc3MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMUYxRDFDIi8+CjxzdG9wIG9mZnNldD0iMC4zNyIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRGQjUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF8xMDA1MF80MTcxIiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDg1LjAwOTkgNjEuODM5Mikgc2NhbGUoMTEuMTMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0Y0Qjg1MiIvPgo8c3RvcCBvZmZzZXQ9IjAuMzMiIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIwLjY0IiBzdG9wLWNvbG9yPSIjNzczOTBEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzIxMUMxRCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEwMDUwXzQxNzEiPgo8cmVjdCB3aWR0aD0iMTE1Ljc3IiBoZWlnaHQ9IjE0Ny43IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIgMTYpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="}},Ja={[nt.fordefi.id]:wf,[nt.xverse.id]:gf,[nt.unisat.id]:yf},oi=(e,t)=>{const r=s=>!(!e[s]||t&&!t.has(s)),n={request:r("request"),connect:r("connect"),signMessage:r("signMessage"),signTransaction:r("signTransaction"),sendBtcTransaction:r("sendBtcTransaction"),createInscription:r("createInscription"),createRepeatInscriptions:r("createRepeatInscriptions"),signMultipleTransactions:r("signMultipleTransactions"),addListener:r("addListener")};return Object.entries(n).reduce((s,[o,i])=>i?[...s,o]:s,[])},bf=async e=>{const t=await It(e.getProvider),r=Ct.createUnsecuredToken(e.payload);if(t.getCapabilities)try{const n=await t.getCapabilities(r);e.onFinish?.(oi(t,new Set(n)))}catch(n){console.error("[Connect] Error during capabilities request",n)}try{const n=oi(t);e.onFinish?.(n)}catch(n){console.error("[Connect] Error during capabilities request",n),e.onCancel?.()}},xf=4e5,Sf=6e4,Ka=e=>{const{contentType:t,content:r,payloadType:n,network:s,appFeeAddress:o,appFee:i}=e;if(!/^[a-z]+\/[a-z0-9\-\.\+]+(?=;.*|$)/.test(t))throw new Error("Invalid content type detected");if(!r||r.length===0)throw new Error("Empty content not allowed");if(!n||n!=="BASE_64"&&n!=="PLAIN_TEXT")throw new Error("Empty invalid payloadType specified");if(r.length>(s.type==="Mainnet"?xf:Sf))throw new Error("Content too large");if((o?.length??0)>0&&(i??0)<=0)throw new Error("Invalid combination of app fee address and fee provided")},vf=async e=>{const{getProvider:t}=e,r=await It(t);Ka(e.payload);try{const n=Ct.createUnsecuredToken(e.payload),s=await r.createInscription(n);e.onFinish?.(s)}catch(n){console.error("[Connect] Error during create inscription",n),e.onCancel?.()}},Mf=async e=>{const{getProvider:t}=e,r=await It(t);Ka(e.payload);try{const n=Ct.createUnsecuredToken(e.payload),s=await r.createRepeatInscriptions(n);e.onFinish?.(s)}catch(n){console.error("[Connect] Error during create repeat inscriptions",n),e.onCancel?.()}},Af=async e=>{const t=await It(e.getProvider),{address:r,message:n}=e.payload;if(!r)throw new Error("An address is required to sign a message");if(!n)throw new Error("A message to be signed is required");try{const s=Ct.createUnsecuredToken(e.payload),o=await t.signMessage(s);e.onFinish?.(o)}catch(s){console.error("[Connect] Error during sign message request",s),e.onCancel?.()}},Ef=e=>e.map(t=>{const{address:r,amountSats:n}=t;return{address:r,amountSats:n.toString()}}),If=async e=>{const t=await It(e.getProvider),{recipients:r,senderAddress:n,network:s,message:o}=e.payload;if(!r||r.length===0)throw new Error("At least one recipient is required");if(r.some(i=>typeof i.address!="string"||typeof i.amountSats!="bigint"))throw new Error("Incorrect recipient format");if(!n)throw new Error("The sender address is required");try{const i=Ef(r),a={network:s,senderAddress:n,message:o,recipients:i},h=Ct.createUnsecuredToken(a),f=await t.sendBtcTransaction(h);e.onFinish?.(f)}catch(i){console.error("[Connect] Error during send BTC transaction request",i),e.onCancel?.()}},Nf=async e=>{const t=await It(e.getProvider),{psbtBase64:r,inputsToSign:n}=e.payload;if(!r)throw new Error("A value for psbtBase64 representing the tx hash is required");if(!n)throw new Error("An array specifying the inputs to be signed by the wallet is required");try{const s=Ct.createUnsecuredToken(e.payload),o=await t.signTransaction(s);e.onFinish?.(o)}catch(s){console.error("[Connect] Error during sign transaction request",s),e.onCancel?.()}},kf=async e=>{const t=await It(e.getProvider),{psbts:r}=e.payload;if(!r||!r.length)throw new Error("psbts array is required");if(r.length>100)throw new Error("psbts array must contain less than 100 psbts");try{const n=Ct.createUnsecuredToken(e.payload),s=await t.signMultipleTransactions(n);e.onFinish?.(s)}catch(n){console.error("[Connect] Error during sign Multiple transactions request",n),e.onCancel?.()}};const Tf={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},Xa={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},ce={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},Ve={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},Bt={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class N{static getFirstMatch(t,r){const n=r.match(t);return n&&n.length>0&&n[1]||""}static getSecondMatch(t,r){const n=r.match(t);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(t,r,n){if(t.test(r))return n}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const r=t.split(".").splice(0,2).map(o=>parseInt(o,10)||0);r.push(0);const n=r[0],s=r[1];if(n===10)switch(s){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,r,n=!1){const s=N.getVersionPrecision(t),o=N.getVersionPrecision(r);let i=Math.max(s,o),a=0;const h=N.map([t,r],f=>{const l=i-N.getVersionPrecision(f),y=f+new Array(l+1).join(".0");return N.map(y.split("."),k=>new Array(20-k.length).join("0")+k).reverse()});for(n&&(a=i-Math.min(s,o)),i-=1;i>=a;){if(h[0][i]>h[1][i])return 1;if(h[0][i]===h[1][i]){if(i===a)return 0;i-=1}else if(h[0][i]<h[1][i])return-1}}static map(t,r){const n=[];let s;if(Array.prototype.map)return Array.prototype.map.call(t,r);for(s=0;s<t.length;s+=1)n.push(r(t[s]));return n}static find(t,r){let n,s;if(Array.prototype.find)return Array.prototype.find.call(t,r);for(n=0,s=t.length;n<s;n+=1){const o=t[n];if(r(o,n))return o}}static assign(t,...r){const n=t;let s,o;if(Object.assign)return Object.assign(t,...r);for(s=0,o=r.length;s<o;s+=1){const i=r[s];typeof i=="object"&&i!==null&&Object.keys(i).forEach(h=>{n[h]=i[h]})}return t}static getBrowserAlias(t){return Tf[t]}static getBrowserTypeByAlias(t){return Xa[t]||""}}const oe=/version\/(\d+(\.?_?\d+)+)/i,Bf=[{test:[/gptbot/i],describe(e){const t={name:"GPTBot"},r=N.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/chatgpt-user/i],describe(e){const t={name:"ChatGPT-User"},r=N.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/oai-searchbot/i],describe(e){const t={name:"OAI-SearchBot"},r=N.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(e){const t={name:"ClaudeBot"},r=N.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/omgilibot/i,/webzio-extended/i],describe(e){const t={name:"Omgilibot"},r=N.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/diffbot/i],describe(e){const t={name:"Diffbot"},r=N.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/perplexitybot/i],describe(e){const t={name:"PerplexityBot"},r=N.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/perplexity-user/i],describe(e){const t={name:"Perplexity-User"},r=N.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/youbot/i],describe(e){const t={name:"YouBot"},r=N.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/meta-webindexer/i],describe(e){const t={name:"Meta-WebIndexer"},r=N.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/meta-externalads/i],describe(e){const t={name:"Meta-ExternalAds"},r=N.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/meta-externalagent/i],describe(e){const t={name:"Meta-ExternalAgent"},r=N.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/meta-externalfetcher/i],describe(e){const t={name:"Meta-ExternalFetcher"},r=N.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=N.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/amazonbot/i],describe(e){const t={name:"AmazonBot"},r=N.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/bingbot/i],describe(e){const t={name:"BingCrawler"},r=N.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/baiduspider/i],describe(e){const t={name:"BaiduSpider"},r=N.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/duckduckbot/i],describe(e){const t={name:"DuckDuckBot"},r=N.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/ia_archiver/i],describe(e){const t={name:"InternetArchiveCrawler"},r=N.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{name:"FacebookExternalHit"}}},{test:[/yahoo!?[\s/]*slurp/i],describe(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe(){return{name:"PingdomBot"}}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=N.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/PaleMoon/i],describe(e){const t={name:"Pale Moon"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=N.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=N.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=N.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},r=N.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=N.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=N.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=N.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=N.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=N.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=N.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=N.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=N.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=N.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=N.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=N.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=N.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=N.getFirstMatch(oe,e)||N.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=N.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=N.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=N.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/librewolf/i],describe(e){const t={name:"LibreWolf"},r=N.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=N.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=N.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(e){const t={name:"Sogou Browser"},r=N.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),n=N.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),s=N.getFirstMatch(/se ([\d.]+)x/i,e),o=r||n||s;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},r=N.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=N.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=N.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=N.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=N.getFirstMatch(oe,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,s=e.search("\\(")!==-1?r:t;return{name:N.getFirstMatch(s,e),version:N.getSecondMatch(s,e)}}}],Cf=[{test:[/Roku\/DVP/],describe(e){const t=N.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Ve.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=N.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Ve.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=N.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=N.getWindowsVersionName(t);return{name:Ve.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Ve.iOS},r=N.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe(e){const t=N.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=N.getMacOSVersionName(t),n={name:Ve.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=N.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Ve.iOS,version:t}}},{test:[/OpenHarmony/i],describe(e){const t=N.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:Ve.HarmonyOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=N.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=N.getAndroidVersionName(t),n={name:Ve.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=N.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:Ve.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=N.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||N.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||N.getFirstMatch(/\bbb(\d+)/i,e);return{name:Ve.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=N.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Ve.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=N.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Ve.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:Ve.Linux}}},{test:[/CrOS/],describe(){return{name:Ve.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=N.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Ve.PlayStation4,version:t}}}],Pf=[{test:[/googlebot/i],describe(){return{type:ce.bot,vendor:"Google"}}},{test:[/amazonbot/i],describe(){return{type:ce.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe(){return{type:ce.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe(){return{type:ce.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe(){return{type:ce.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe(){return{type:ce.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe(){return{type:ce.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe(){return{type:ce.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(){return{type:ce.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe(){return{type:ce.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe(){return{type:ce.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe(){return{type:ce.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe(){return{type:ce.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe(){return{type:ce.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe(){return{type:ce.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe(){return{type:ce.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe(){return{type:ce.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe(){return{type:ce.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe(){return{type:ce.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{type:ce.bot,vendor:"Meta"}}},{test:[/yahoo/i],describe(){return{type:ce.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{type:ce.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe(){return{type:ce.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe(e){const t=N.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:ce.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:ce.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:ce.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:ce.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:ce.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:ce.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:ce.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=N.getFirstMatch(/(ipod|iphone)/i,e);return{type:ce.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:ce.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe(e){const t=N.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),r={type:ce.mobile,vendor:"Nokia"};return t&&(r.model=t),r}},{test:[/[^-]mobi/i],describe(){return{type:ce.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:ce.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:ce.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:ce.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:ce.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:ce.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:ce.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:ce.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:ce.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:ce.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:ce.tv}}}],Of=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:Bt.Blink};const r=N.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Bt.EdgeHTML,version:r}}},{test:[/trident/i],describe(e){const t={name:Bt.Trident},r=N.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:Bt.Presto},r=N.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:Bt.Gecko},r=N.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:Bt.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:Bt.WebKit},r=N.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class ai{constructor(t,r=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},r!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=N.find(Bf,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=N.find(Cf,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:r}=this.getOS();return t?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:r}=this.getPlatform();return t?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};const t=N.find(Pf,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=N.find(Of,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return N.assign({},this.parsedResult)}satisfies(t){const r={};let n=0;const s={};let o=0;if(Object.keys(t).forEach(a=>{const h=t[a];typeof h=="string"?(s[a]=h,o+=1):typeof h=="object"&&(r[a]=h,n+=1)}),n>0){const a=Object.keys(r),h=N.find(a,l=>this.isOS(l));if(h){const l=this.satisfies(r[h]);if(l!==void 0)return l}const f=N.find(a,l=>this.isPlatform(l));if(f){const l=this.satisfies(r[f]);if(l!==void 0)return l}}if(o>0){const a=Object.keys(s),h=N.find(a,f=>this.isBrowser(f,!0));if(h!==void 0)return this.compareVersion(s[h])}}isBrowser(t,r=!1){const n=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const o=N.getBrowserTypeByAlias(s);return r&&o&&(s=o.toLowerCase()),s===n}compareVersion(t){let r=[0],n=t,s=!1;const o=this.getBrowserVersion();if(typeof o=="string")return t[0]===">"||t[0]==="<"?(n=t.substr(1),t[1]==="="?(s=!0,n=t.substr(2)):r=[],t[0]===">"?r.push(1):r.push(-1)):t[0]==="="?n=t.substr(1):t[0]==="~"&&(s=!0,n=t.substr(1)),r.indexOf(N.compareVersions(o,n,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,r=!1){return this.isBrowser(t,r)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(r=>this.is(r))}}class Rf{static getParser(t,r=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new ai(t,r)}static parse(t){return new ai(t).getResult()}static get BROWSER_MAP(){return Xa}static get ENGINE_MAP(){return Bt}static get OS_MAP(){return Ve}static get PLATFORMS_MAP(){return ce}}function _f(){return typeof window.ReactNativeWebView<"u"}function Df(e){const t=Rf.getParser(window.navigator.userAgent);if(t.satisfies({desktop:{chrome:">=1"}}))return e.chromeWebStoreUrl;if(t.satisfies({desktop:{firefox:">=1"}}))return e.mozillaAddOnsUrl;if(t.satisfies({android:{chrome:">=1",safari:">=1"}}))return e.googlePlayStoreUrl;if(t.satisfies({ios:{chrome:">=1",safari:">=1"}}))return e.iOSAppStoreUrl}function ci(e){const t=Df(e);return t?{installPrompt:{url:t}}:(console.error(`[makeDefaultConfig]: No app store URL found for ${e.name}.`),{})}function Ff(e){const t={options:[]},r=e.find(s=>s.id===nt.xverse.id);if(t.options.push(r||{...nt.xverse,...ci(nt.xverse)}),_f())return t;const n=e.find(s=>s.id==="unisat");return n&&n.isInstalled&&t.options.push(n),t.options=t.options.concat(e.filter(s=>s.id!==nt.xverse.id&&s.id!=="unisat").map(s=>({...s,...s.isInstalled?{}:ci(s)}))),t}function jf(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return t[r]=Object.assign({},n),ec(n.value)&&!qf(n.value)&&!Array.isArray(n.value)&&(t[r].value=Object.assign({},n.value)),Array.isArray(n.value)&&(t[r].value=n.value.slice(0)),t},{})}function Lf(e){return e?Object.keys(e).reduce((t,r)=>{const n=e[r];return t[r]=ec(n)&&"value"in n?n:{value:n},t[r].attribute||(t[r].attribute=Hf(r)),t[r].parse="parse"in t[r]?t[r].parse:typeof t[r].value!="string",t},{}):{}}function zf(e){return Object.keys(e).reduce((t,r)=>(t[r]=e[r].value,t),{})}function Uf(e,t){const r=jf(t);return Object.keys(t).forEach(n=>{const s=r[n],o=e.getAttribute(s.attribute),i=e[n];o&&(s.value=s.parse?$a(o):o),i!=null&&(s.value=Array.isArray(i)?i.slice(0):i),s.reflect&&ui(e,s.attribute,s.value),Object.defineProperty(e,n,{get(){return s.value},set(a){const h=s.value;s.value=a,s.reflect&&ui(this,s.attribute,s.value);for(let f=0,l=this.__propertyChangedCallbacks.length;f<l;f++)this.__propertyChangedCallbacks[f](n,a,h)},enumerable:!0,configurable:!0})}),r}function $a(e){if(e)try{return JSON.parse(e)}catch{return e}}function ui(e,t,r){if(r==null||r===!1)return e.removeAttribute(t);let n=JSON.stringify(r);e.__updating[t]=!0,n==="true"&&(n=""),e.setAttribute(t,n),Promise.resolve().then(()=>delete e.__updating[t])}function Hf(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function ec(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function qf(e){return Object.prototype.toString.call(e)==="[object Function]"}function Gf(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let vn;function Vf(e,t){const r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(n=>t[n].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Uf(this,t);const n=zf(this.props),s=this.Component,o=vn;try{vn=this,this.__initialized=!0,Gf(s)?new s(n,{element:this}):s(n,{element:this})}finally{vn=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let n=null;for(;n=this.__releaseCallbacks.pop();)n(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(n,s,o){if(this.__initialized&&!this.__updating[n]&&(n=this.lookupProp(n),n in t)){if(o==null&&!this[n])return;this[n]=t[n].parse?$a(o):o}}lookupProp(n){if(t)return r.find(s=>n===s||n===t[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(n){this.__releaseCallbacks.push(n)}addPropertyChangedCallback(n){this.__propertyChangedCallbacks.push(n)}}}function Wf(e,t={},r={}){const{BaseElement:n=HTMLElement,extension:s}=r;return o=>{let i=customElements.get(e);return i?(i.prototype.Component=o,i):(i=Vf(n,Lf(t)),i.prototype.Component=o,i.prototype.registeredTag=e,customElements.define(e,i,s),i)}}const Yf=(e,t)=>e===t,Dn=Symbol("solid-proxy"),Qf=Symbol("solid-track"),jr={equals:Yf};let tc=ac;const Pt=1,Lr=2,rc={owned:null,cleanups:null,context:null,owner:null};var ze=null;let Mn=null,De=null,Ye=null,vt=null,sn=0;function Dr(e,t){const r=De,n=ze,s=e.length===0,o=t===void 0?n:t,i=s?rc:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=s?e:()=>e(()=>yt(()=>on(i)));ze=i,De=null;try{return nr(a,!0)}finally{De=r,ze=n}}function ut(e,t){t=t?Object.assign({},jr,t):jr;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=s=>(typeof s=="function"&&(s=s(r.value)),oc(r,s));return[ic.bind(r),n]}function lt(e,t,r){const n=os(e,t,!1,Pt);Mr(n)}function nc(e,t,r){tc=eh;const n=os(e,t,!1,Pt);n.user=!0,vt?vt.push(n):Mr(n)}function Mt(e,t,r){r=r?Object.assign({},jr,r):jr;const n=os(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Mr(n),ic.bind(n)}function Zf(e){return nr(e,!1)}function yt(e){if(De===null)return e();const t=De;De=null;try{return e()}finally{De=t}}function Jf(e){nc(()=>yt(e))}function sc(e){return ze===null||(ze.cleanups===null?ze.cleanups=[e]:ze.cleanups.push(e)),e}function Kf(e){const t=Mt(e),r=Mt(()=>Fn(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function ic(){if(this.sources&&this.state)if(this.state===Pt)Mr(this);else{const e=Ye;Ye=null,nr(()=>Ur(this),!1),Ye=e}if(De){const e=this.observers?this.observers.length:0;De.sources?(De.sources.push(this),De.sourceSlots.push(e)):(De.sources=[this],De.sourceSlots=[e]),this.observers?(this.observers.push(De),this.observerSlots.push(De.sources.length-1)):(this.observers=[De],this.observerSlots=[De.sources.length-1])}return this.value}function oc(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&nr(()=>{for(let s=0;s<e.observers.length;s+=1){const o=e.observers[s],i=Mn&&Mn.running;i&&Mn.disposed.has(o),(i?!o.tState:!o.state)&&(o.pure?Ye.push(o):vt.push(o),o.observers&&cc(o)),i||(o.state=Pt)}if(Ye.length>1e6)throw Ye=[],new Error},!1)),t}function Mr(e){if(!e.fn)return;on(e);const t=sn;Xf(e,e.value,t)}function Xf(e,t,r){let n;const s=ze,o=De;De=ze=e;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=Pt,e.owned&&e.owned.forEach(on),e.owned=null),e.updatedAt=r+1,uc(i)}finally{De=o,ze=s}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?oc(e,n):e.value=n,e.updatedAt=r)}function os(e,t,r,n=Pt,s){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ze,context:ze?ze.context:null,pure:r};return ze===null||ze!==rc&&(ze.owned?ze.owned.push(o):ze.owned=[o]),o}function zr(e){if(e.state===0)return;if(e.state===Lr)return Ur(e);if(e.suspense&&yt(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<sn);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===Pt)Mr(e);else if(e.state===Lr){const n=Ye;Ye=null,nr(()=>Ur(e,t[0]),!1),Ye=n}}function nr(e,t){if(Ye)return e();let r=!1;t||(Ye=[]),vt?r=!0:vt=[],sn++;try{const n=e();return $f(r),n}catch(n){r||(vt=null),Ye=null,uc(n)}}function $f(e){if(Ye&&(ac(Ye),Ye=null),e)return;const t=vt;vt=null,t.length&&nr(()=>tc(t),!1)}function ac(e){for(let t=0;t<e.length;t++)zr(e[t])}function eh(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:zr(n)}for(t=0;t<r;t++)zr(e[t])}function Ur(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const s=n.state;s===Pt?n!==t&&(!n.updatedAt||n.updatedAt<sn)&&zr(n):s===Lr&&Ur(n,t)}}}function cc(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=Lr,r.pure?Ye.push(r):vt.push(r),r.observers&&cc(r))}}function on(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),s=r.observers;if(s&&s.length){const o=s.pop(),i=r.observerSlots.pop();n<s.length&&(o.sourceSlots[i]=n,s[n]=o,r.observerSlots[n]=i)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)on(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function th(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function uc(e,t=ze){throw th(e)}function Fn(e){if(typeof e=="function"&&!e.length)return Fn(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Fn(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}const rh=Symbol("fallback");function li(e){for(let t=0;t<e.length;t++)e[t]()}function nh(e,t,r={}){let n=[],s=[],o=[],i=0,a=t.length>1?[]:null;return sc(()=>li(o)),()=>{let h=e()||[],f,l;return h[Qf],yt(()=>{let k=h.length,I,x,M,E,U,j,O,G,L;if(k===0)i!==0&&(li(o),o=[],n=[],s=[],i=0,a&&(a=[])),r.fallback&&(n=[rh],s[0]=Dr(_=>(o[0]=_,r.fallback())),i=1);else if(i===0){for(s=new Array(k),l=0;l<k;l++)n[l]=h[l],s[l]=Dr(y);i=k}else{for(M=new Array(k),E=new Array(k),a&&(U=new Array(k)),j=0,O=Math.min(i,k);j<O&&n[j]===h[j];j++);for(O=i-1,G=k-1;O>=j&&G>=j&&n[O]===h[G];O--,G--)M[G]=s[O],E[G]=o[O],a&&(U[G]=a[O]);for(I=new Map,x=new Array(G+1),l=G;l>=j;l--)L=h[l],f=I.get(L),x[l]=f===void 0?-1:f,I.set(L,l);for(f=j;f<=O;f++)L=n[f],l=I.get(L),l!==void 0&&l!==-1?(M[l]=s[f],E[l]=o[f],a&&(U[l]=a[f]),l=x[l],I.set(L,l)):o[f]();for(l=j;l<k;l++)l in M?(s[l]=M[l],o[l]=E[l],a&&(a[l]=U[l],a[l](l))):s[l]=Dr(y);s=s.slice(0,i=k),n=h.slice(0)}return s});function y(k){if(o[l]=k,a){const[I,x]=ut(l);return a[l]=x,t(h[l],I)}return t(h[l])}}}function _e(e,t){return yt(()=>e(t||{}))}function Cr(){return!0}const sh={get(e,t,r){return t===Dn?r:e.get(t)},has(e,t){return t===Dn?!0:e.has(t)},set:Cr,deleteProperty:Cr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Cr,deleteProperty:Cr}},ownKeys(e){return e.keys()}};function An(e){return(e=typeof e=="function"?e():e)?e:{}}function ih(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function oh(...e){let t=!1;for(let i=0;i<e.length;i++){const a=e[i];t=t||!!a&&Dn in a,e[i]=typeof a=="function"?(t=!0,Mt(a)):a}if(t)return new Proxy({get(i){for(let a=e.length-1;a>=0;a--){const h=An(e[a])[i];if(h!==void 0)return h}},has(i){for(let a=e.length-1;a>=0;a--)if(i in An(e[a]))return!0;return!1},keys(){const i=[];for(let a=0;a<e.length;a++)i.push(...Object.keys(An(e[a])));return[...new Set(i)]}},sh);const r={},n=Object.create(null);for(let i=e.length-1;i>=0;i--){const a=e[i];if(!a)continue;const h=Object.getOwnPropertyNames(a);for(let f=h.length-1;f>=0;f--){const l=h[f];if(l==="__proto__"||l==="constructor")continue;const y=Object.getOwnPropertyDescriptor(a,l);if(!n[l])n[l]=y.get?{enumerable:!0,configurable:!0,get:ih.bind(r[l]=[y.get.bind(a)])}:y.value!==void 0?y:void 0;else{const k=r[l];k&&(y.get?k.push(y.get.bind(a)):y.value!==void 0&&k.push(()=>y.value))}}}const s={},o=Object.keys(n);for(let i=o.length-1;i>=0;i--){const a=o[i],h=n[a];h&&h.get?Object.defineProperty(s,a,h):s[a]=h?h.value:void 0}return s}const lc=e=>`Stale read from <${e}>.`;function ah(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Mt(nh(()=>e.each,e.children,t||void 0))}function En(e){const t=e.keyed,r=Mt(()=>e.when,void 0,{equals:(n,s)=>t?n===s:!n==!s});return Mt(()=>{const n=r();if(n){const s=e.children;return typeof s=="function"&&s.length>0?yt(()=>s(t?n:()=>{if(!yt(r))throw lc("Show");return e.when})):s}return e.fallback},void 0,void 0)}function ch(e){let t=!1;const r=(o,i)=>(t?o[1]===i[1]:!o[1]==!i[1])&&o[2]===i[2],n=Kf(()=>e.children),s=Mt(()=>{let o=n();Array.isArray(o)||(o=[o]);for(let i=0;i<o.length;i++){const a=o[i].when;if(a)return t=!!o[i].keyed,[i,a,o[i]]}return[-1]},void 0,{equals:r});return Mt(()=>{const[o,i,a]=s();if(o<0)return e.fallback;const h=a.children;return typeof h=="function"&&h.length>0?yt(()=>h(t?i:()=>{if(yt(s)[0]!==o)throw lc("Match");return a.when})):h},void 0,void 0)}function In(e){return e}const uh=new Set(["innerHTML","textContent","innerText","children"]),lh=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),dh=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),fh={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function hh(e,t,r){let n=r.length,s=t.length,o=n,i=0,a=0,h=t[s-1].nextSibling,f=null;for(;i<s||a<o;){if(t[i]===r[a]){i++,a++;continue}for(;t[s-1]===r[o-1];)s--,o--;if(s===i){const l=o<n?a?r[a-1].nextSibling:r[o-a]:h;for(;a<o;)e.insertBefore(r[a++],l)}else if(o===a)for(;i<s;)(!f||!f.has(t[i]))&&t[i].remove(),i++;else if(t[i]===r[o-1]&&r[a]===t[s-1]){const l=t[--s].nextSibling;e.insertBefore(r[a++],t[i++].nextSibling),e.insertBefore(r[--o],l),t[s]=r[o]}else{if(!f){f=new Map;let y=a;for(;y<o;)f.set(r[y],y++)}const l=f.get(t[i]);if(l!=null)if(a<l&&l<o){let y=i,k=1,I;for(;++y<s&&y<o&&!((I=f.get(t[y]))==null||I!==l+k);)k++;if(k>l-a){const x=t[i];for(;a<l;)e.insertBefore(r[a++],x)}else e.replaceChild(r[a++],t[i++])}else i++;else t[i++].remove()}}}const di="_$DX_DELEGATE";function qe(e,t,r){let n;const s=()=>{const i=document.createElement("template");return i.innerHTML=e,i.content.firstChild},o=()=>(n||(n=s())).cloneNode(!0);return o.cloneNode=o,o}function ph(e,t=window.document){const r=t[di]||(t[di]=new Set);for(let n=0,s=e.length;n<s;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,vh))}}function mt(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function gh(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function mh(e,t){t==null?e.removeAttribute("class"):e.className=t}function yh(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const s=r[0];e.addEventListener(t,r[0]=o=>s.call(e,r[1],o))}else e.addEventListener(t,r)}function wh(e,t,r={}){const n=Object.keys(t||{}),s=Object.keys(r);let o,i;for(o=0,i=s.length;o<i;o++){const a=s[o];!a||a==="undefined"||t[a]||(fi(e,a,!1),delete r[a])}for(o=0,i=n.length;o<i;o++){const a=n[o],h=!!t[a];!a||a==="undefined"||r[a]===h||!h||(fi(e,a,!0),r[a]=h)}return r}function st(e,t,r){if(!t)return r?mt(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let s,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)s=t[o],s!==r[o]&&(n.setProperty(o,s),r[o]=s);return r}function bh(e,t={},r,n){const s={};return lt(()=>t.ref&&t.ref(e)),lt(()=>xh(e,t,r,!0,s,!0)),s}function Nn(e,t,r){return yt(()=>e(t,r))}function Fe(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return Hr(e,t,n,r);lt(s=>Hr(e,t(),s,r),n)}function xh(e,t,r,n,s={},o=!1){t||(t={});for(const i in s)if(!(i in t)){if(i==="children")continue;s[i]=hi(e,i,null,s[i],r,o)}for(const i in t){if(i==="children")continue;const a=t[i];s[i]=hi(e,i,a,s[i],r,o)}}function Sh(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function fi(e,t,r){const n=t.trim().split(/\s+/);for(let s=0,o=n.length;s<o;s++)e.classList.toggle(n[s],r)}function hi(e,t,r,n,s,o){let i,a,h,f;if(t==="style")return st(e,r,n);if(t==="classList")return wh(e,r,n);if(r===n)return n;if(t==="ref")o||r(e);else if(t.slice(0,3)==="on:"){const l=t.slice(3);n&&e.removeEventListener(l,n),r&&e.addEventListener(l,r)}else if(t.slice(0,10)==="oncapture:"){const l=t.slice(10);n&&e.removeEventListener(l,n,!0),r&&e.addEventListener(l,r,!0)}else if(t.slice(0,2)==="on"){const l=t.slice(2).toLowerCase(),y=dh.has(l);if(!y&&n){const k=Array.isArray(n)?n[0]:n;e.removeEventListener(l,k)}(y||r)&&(yh(e,l,r,y),y&&ph([l]))}else if(t.slice(0,5)==="attr:")mt(e,t.slice(5),r);else if((f=t.slice(0,5)==="prop:")||(h=uh.has(t))||(i=e.nodeName.includes("-")))f&&(t=t.slice(5),a=!0),t==="class"||t==="className"?mh(e,r):i&&!a&&!h?e[Sh(t)]=r:e[t]=r;else{const l=t.indexOf(":")>-1&&fh[t.split(":")[0]];l?gh(e,l,t,r):mt(e,lh[t]||t,r)}return r}function vh(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}});r;){const n=r[t];if(n&&!r.disabled){const s=r[`${t}Data`];if(s!==void 0?n.call(r,s,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function Hr(e,t,r,n,s){for(;typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,i=n!==void 0;if(e=i&&r[0]&&r[0].parentNode||e,o==="string"||o==="number")if(o==="number"&&(t=t.toString()),i){let a=r[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),r=Zt(e,r,n,a)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t;else if(t==null||o==="boolean")r=Zt(e,r,n);else{if(o==="function")return lt(()=>{let a=t();for(;typeof a=="function";)a=a();r=Hr(e,a,r,n)}),()=>r;if(Array.isArray(t)){const a=[],h=r&&Array.isArray(r);if(jn(a,t,r,s))return lt(()=>r=Hr(e,a,r,n,!0)),()=>r;if(a.length===0){if(r=Zt(e,r,n),i)return r}else h?r.length===0?pi(e,a,n):hh(e,r,a):(r&&Zt(e),pi(e,a));r=a}else if(t.nodeType){if(Array.isArray(r)){if(i)return r=Zt(e,r,n,t);Zt(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function jn(e,t,r,n){let s=!1;for(let o=0,i=t.length;o<i;o++){let a=t[o],h=r&&r[e.length],f;if(!(a==null||a===!0||a===!1))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))s=jn(e,a,h)||s;else if(f==="function")if(n){for(;typeof a=="function";)a=a();s=jn(e,Array.isArray(a)?a:[a],Array.isArray(h)?h:[h])||s}else e.push(a),s=!0;else{const l=String(a);h&&h.nodeType===3&&h.data===l?e.push(h):e.push(document.createTextNode(l))}}return s}function pi(e,t,r=null){for(let n=0,s=t.length;n<s;n++)e.insertBefore(t[n],r)}function Zt(e,t,r,n){if(r===void 0)return e.textContent="";const s=n||document.createTextNode("");if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(s!==a){const h=a.parentNode===e;!o&&!i?h?e.replaceChild(s,a):e.insertBefore(s,r):h&&a.remove()}else o=!0}}else e.insertBefore(s,r);return[s]}function Mh(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const[s,o]=ut(e[t[n]]);Object.defineProperty(r,t[n],{get:s,set(i){o(()=>i)}})}return r}function Ah(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Eh(e){return(t,r)=>{const{element:n}=r;return Dr(s=>{const o=Mh(t);n.addPropertyChangedCallback((a,h)=>o[a]=h),n.addReleaseCallback(()=>{n.renderRoot.textContent="",s()});const i=e(o,r);return Fe(n.renderRoot,i)},Ah(n))}}function Ih(e,t,r){return arguments.length===2&&(r=t,t={}),Wf(e,t)(Eh(r))}const Ln="sats-connect_wallet-provider-selector_select",zn="sats-connect_wallet-provider-selector_cancel",Un="sats-connect_wallet-provider-selector_open",Hn="sats-connect_wallet-provider-selector_close",dc="sats-connect_wallet-provider-selector_walletOpen",fc="sats-connect_wallet-provider-selector_walletClose",an={color:"#181818","font-size":"18px","font-weight":"700","line-height":"1.4"},Xt={color:"#181818","font-size":"14px","font-weight":"400","line-height":"1.4"},Nh={color:"#181818","font-size":"14px","font-weight":"500"};var kh=qe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><g id=XCircle><path id=Vector d="M12 2.25C10.0716 2.25 8.18657 2.82183 6.58319 3.89317C4.97982 4.96451 3.73013 6.48726 2.99218 8.26884C2.25422 10.0504 2.06114 12.0108 2.43735 13.9021C2.81355 15.7934 3.74215 17.5307 5.10571 18.8943C6.46928 20.2579 8.20656 21.1865 10.0979 21.5627C11.9892 21.9389 13.9496 21.7458 15.7312 21.0078C17.5127 20.2699 19.0355 19.0202 20.1068 17.4168C21.1782 15.8134 21.75 13.9284 21.75 12C21.745 9.41566 20.7162 6.93859 18.8888 5.11118C17.0614 3.28378 14.5843 2.25496 12 2.25ZM15.5344 14.4656C15.6752 14.6078 15.7542 14.7999 15.7542 15C15.7542 15.2001 15.6752 15.3922 15.5344 15.5344C15.391 15.673 15.1994 15.7505 15 15.7505C14.8006 15.7505 14.609 15.673 14.4656 15.5344L12 13.0594L9.53438 15.5344C9.39102 15.673 9.19942 15.7505 9 15.7505C8.80059 15.7505 8.60898 15.673 8.46563 15.5344C8.32479 15.3922 8.24578 15.2001 8.24578 15C8.24578 14.7999 8.32479 14.6078 8.46563 14.4656L10.9406 12L8.46563 9.53437C8.34603 9.38865 8.28491 9.20366 8.29416 9.01537C8.30341 8.82708 8.38236 8.64896 8.51566 8.51566C8.64896 8.38236 8.82708 8.3034 9.01537 8.29416C9.20366 8.28491 9.38866 8.34603 9.53438 8.46563L12 10.9406L14.4656 8.46563C14.6114 8.34603 14.7963 8.28491 14.9846 8.29416C15.1729 8.3034 15.351 8.38236 15.4843 8.51566C15.6176 8.64896 15.6966 8.82708 15.7058 9.01537C15.7151 9.20366 15.654 9.38865 15.5344 9.53437L13.0594 12L15.5344 14.4656Z"fill=black fill-opacity=0.3>'),Th=qe(`<style>
7
+ .close-selector-button:focus-visible {
8
+ outline: 2px solid #181818;
9
+ outline-offset: -0.25px;
10
+ }
11
+ `),Bh=qe("<div role=button tabindex=0 class=close-selector-button>");function Ch(e){return(()=>{var t=kh();return t.style.setProperty("display","block"),bh(t,e,!0),t})()}function Ph(e){function t(r){(r.key==="Enter"||r.key===" ")&&e.onClose()}return[Th(),(()=>{var r=Bh();return r.style.setProperty("position","absolute"),r.style.setProperty("top","16px"),r.style.setProperty("right","16px"),r.style.setProperty("background","none"),r.style.setProperty("border","none"),r.style.setProperty("cursor","pointer"),r.style.setProperty("padding","0"),r.style.setProperty("margin","0"),r.style.setProperty("border-radius","50%"),r.addEventListener("click",e.onClose),r.addEventListener("keydown",t),Fe(r,_e(Ch,{})),r})()]}var Oh=qe(`<style>
12
+ /*! modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
13
+
14
+ /*
15
+ Document
16
+ ========
17
+ */
18
+
19
+ /**
20
+ Use a better box model (opinionated).
21
+ */
22
+
23
+ *,
24
+ ::before,
25
+ ::after {
26
+ box-sizing: border-box;
27
+ margin: 0; /* Remove all margins from everywhere. */
28
+ }
29
+
30
+ :host {
31
+ /* Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) */
32
+ font-family:
33
+ 'DM Sans', /* Note: not part of modern-normalize, added specifically for this project. */
34
+ system-ui,
35
+ 'Segoe UI',
36
+ Roboto,
37
+ Helvetica,
38
+ Arial,
39
+ sans-serif,
40
+ 'Apple Color Emoji',
41
+ 'Segoe UI Emoji';
42
+ line-height: 1.15; /* 1. Correct the line height in all browsers. */
43
+ -webkit-text-size-adjust: 100%; /* 2. Prevent adjustments of font size after orientation changes in iOS. */
44
+ -moz-tab-size: 4; /* 3. Use a more readable tab size (opinionated). */
45
+ tab-size: 4; /* 3 */
46
+ }
47
+
48
+ /*
49
+ Sections
50
+ ========
51
+ */
52
+
53
+ :host {
54
+ margin: 0; /* Remove the margin in all browsers. */
55
+ }
56
+
57
+ /*
58
+ Grouping content
59
+ ================
60
+ */
61
+
62
+ /**
63
+ 1. Add the correct height in Firefox.
64
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
65
+ */
66
+
67
+ hr {
68
+ height: 0; /* 1 */
69
+ color: inherit; /* 2 */
70
+ }
71
+
72
+ /*
73
+ Text-level semantics
74
+ ====================
75
+ */
76
+
77
+ /**
78
+ Add the correct text decoration in Chrome, Edge, and Safari.
79
+ */
80
+
81
+ abbr[title] {
82
+ text-decoration: underline dotted;
83
+ }
84
+
85
+ /**
86
+ Add the correct font weight in Edge and Safari.
87
+ */
88
+
89
+ b,
90
+ strong {
91
+ font-weight: bolder;
92
+ }
93
+
94
+ /**
95
+ 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
96
+ 2. Correct the odd 'em' font sizing in all browsers.
97
+ */
98
+
99
+ code,
100
+ kbd,
101
+ samp,
102
+ pre {
103
+ font-family:
104
+ ui-monospace,
105
+ SFMono-Regular,
106
+ Consolas,
107
+ 'Liberation Mono',
108
+ Menlo,
109
+ monospace; /* 1 */
110
+ font-size: 1em; /* 2 */
111
+ }
112
+
113
+ /**
114
+ Add the correct font size in all browsers.
115
+ */
116
+
117
+ small {
118
+ font-size: 80%;
119
+ }
120
+
121
+ /**
122
+ Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
123
+ */
124
+
125
+ sub,
126
+ sup {
127
+ font-size: 75%;
128
+ line-height: 0;
129
+ position: relative;
130
+ vertical-align: baseline;
131
+ }
132
+
133
+ sub {
134
+ bottom: -0.25em;
135
+ }
136
+
137
+ sup {
138
+ top: -0.5em;
139
+ }
140
+
141
+ /*
142
+ Tabular data
143
+ ============
144
+ */
145
+
146
+ /**
147
+ 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
148
+ 2. Correct table border color inheritance in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
149
+ */
150
+
151
+ table {
152
+ text-indent: 0; /* 1 */
153
+ border-color: inherit; /* 2 */
154
+ }
155
+
156
+ /*
157
+ Forms
158
+ =====
159
+ */
160
+
161
+ /**
162
+ 1. Change the font styles in all browsers.
163
+ 2. Remove the margin in Firefox and Safari.
164
+ */
165
+
166
+ button,
167
+ input,
168
+ optgroup,
169
+ select,
170
+ textarea {
171
+ font-family: inherit; /* 1 */
172
+ font-size: 100%; /* 1 */
173
+ line-height: 1.15; /* 1 */
174
+ margin: 0; /* 2 */
175
+ }
176
+
177
+ /**
178
+ Remove the inheritance of text transform in Edge and Firefox.
179
+ */
180
+
181
+ button,
182
+ select {
183
+ text-transform: none;
184
+ }
185
+
186
+ /**
187
+ Correct the inability to style clickable types in iOS and Safari.
188
+ */
189
+
190
+ button,
191
+ [type='button'],
192
+ [type='reset'],
193
+ [type='submit'] {
194
+ -webkit-appearance: button;
195
+ }
196
+
197
+ /**
198
+ Remove the inner border and padding in Firefox.
199
+ */
200
+
201
+ ::-moz-focus-inner {
202
+ border-style: none;
203
+ padding: 0;
204
+ }
205
+
206
+ /**
207
+ Restore the focus styles unset by the previous rule.
208
+ */
209
+
210
+ :-moz-focusring {
211
+ outline: 1px dotted ButtonText;
212
+ }
213
+
214
+ /**
215
+ Remove the additional ':invalid' styles in Firefox.
216
+ See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
217
+ */
218
+
219
+ :-moz-ui-invalid {
220
+ box-shadow: none;
221
+ }
222
+
223
+ /**
224
+ Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
225
+ */
226
+
227
+ legend {
228
+ padding: 0;
229
+ }
230
+
231
+ /**
232
+ Add the correct vertical alignment in Chrome and Firefox.
233
+ */
234
+
235
+ progress {
236
+ vertical-align: baseline;
237
+ }
238
+
239
+ /**
240
+ Correct the cursor style of increment and decrement buttons in Safari.
241
+ */
242
+
243
+ ::-webkit-inner-spin-button,
244
+ ::-webkit-outer-spin-button {
245
+ height: auto;
246
+ }
247
+
248
+ /**
249
+ 1. Correct the odd appearance in Chrome and Safari.
250
+ 2. Correct the outline style in Safari.
251
+ */
252
+
253
+ [type='search'] {
254
+ -webkit-appearance: textfield; /* 1 */
255
+ outline-offset: -2px; /* 2 */
256
+ }
257
+
258
+ /**
259
+ Remove the inner padding in Chrome and Safari on macOS.
260
+ */
261
+
262
+ ::-webkit-search-decoration {
263
+ -webkit-appearance: none;
264
+ }
265
+
266
+ /**
267
+ 1. Correct the inability to style clickable types in iOS and Safari.
268
+ 2. Change font properties to 'inherit' in Safari.
269
+ */
270
+
271
+ ::-webkit-file-upload-button {
272
+ -webkit-appearance: button; /* 1 */
273
+ font: inherit; /* 2 */
274
+ }
275
+
276
+ /*
277
+ Interactive
278
+ ===========
279
+ */
280
+
281
+ /*
282
+ Add the correct display in Chrome and Safari.
283
+ */
284
+
285
+ summary {
286
+ display: list-item;
287
+ }
288
+ `);function Rh(){return Oh()}var _h=qe("<div class=divider><div>");function Dh(){return(()=>{var e=_h(),t=e.firstChild;return t.style.setProperty("height","100%"),t.style.setProperty("width","1px"),t.style.setProperty("background","#dcdcdc"),e})()}var Fh=qe("<div>");function jh(e){return(()=>{var t=Fh();return t.style.setProperty("padding","24px"),t.style.setProperty("height","100%"),Fe(t,()=>e.children),t})()}var Lh=qe("<div>");function zh(e){return(()=>{var t=Lh();return t.style.setProperty("display","flex"),t.style.setProperty("flex-direction","column"),t.style.setProperty("justify-content","center"),t.style.setProperty("align-items","center"),t.style.setProperty("height","100%"),Fe(t,()=>e.children),t})()}var Uh=qe("<div><div>🤔</div><div>What is a wallet?</div><p>Wallets let you send, receive, store and display digital assets like Bitcoin, Stacks, Ordinals & NFTs.</p><p>Explore Bitcoin apps by connecting your wallet.");function Hh(){return(()=>{var e=Uh(),t=e.firstChild,r=t.nextSibling,n=r.nextSibling,s=n.nextSibling;return e.style.setProperty("display","flex"),e.style.setProperty("flex-direction","column"),e.style.setProperty("row-gap","8px"),e.style.setProperty("justify-content","center"),e.style.setProperty("align-items","center"),t.style.setProperty("font-size","50px"),t.style.setProperty("line-height","140%"),lt(o=>{var i=an,a=Xt,h=Xt;return o.e=st(r,i,o.e),o.t=st(n,a,o.t),o.a=st(s,h,o.a),o},{e:void 0,t:void 0,a:void 0}),e})()}function qn(e){var t;const r=(t=e.installPrompt)==null?void 0:t.url;if(!r){console.error("No install prompt URL found for",e.id);return}window.open(r,"_blank")}var qh=qe(`<style>
289
+ .install-prompt-button:focus-visible {
290
+ outline: 2px solid #181818;
291
+ outline-offset: 2px;
292
+ }
293
+ `),Gh=qe("<div><img><h1>Don't have <!>?</h1><p>Download it on the Chrome web store.</p><div class=install-prompt-button role=button tabindex=0>Get");function Vh(e){function t(n){(n.key==="Enter"||n.key===" ")&&qn(e.option)}function r(){qn(e.option)}return[qh(),(()=>{var n=Gh(),s=n.firstChild,o=s.nextSibling,i=o.firstChild,a=i.nextSibling;a.nextSibling;var h=o.nextSibling,f=h.nextSibling;return n.style.setProperty("display","flex"),n.style.setProperty("flex-direction","column"),n.style.setProperty("align-items","center"),n.style.setProperty("row-gap","16px"),s.style.setProperty("border-radius","12px"),s.style.setProperty("height","64px"),s.style.setProperty("width","64px"),s.style.setProperty("object-fit","cover"),Fe(o,()=>e.option.name,a),f.addEventListener("click",r),f.addEventListener("keydown",t),lt(l=>{var y=e.option.icon,k=e.option.name,I={...an,"text-align":"center"},x=Xt,M={...Nh,cursor:"pointer","border-radius":"12px",background:"#181818",color:"white",padding:"12px 16px"};return y!==l.e&&mt(s,"src",l.e=y),k!==l.t&&mt(s,"alt",l.t=k),l.a=st(o,I,l.a),l.o=st(h,x,l.o),l.i=st(f,M,l.i),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()]}var Wh=qe('<svg width=20 height=20 viewBox="0 0 20 20"xmlns=http://www.w3.org/2000/svg><circle cx=10 cy=10 r=9.05 stroke=black stroke-width=1.9 fill=none stroke-dasharray="42.65 14.22"stroke-dashoffset=0><animateTransform attributeName=transform attributeType=XML type=rotate from="0 10 10"to="360 10 10"dur=0.75s repeatCount=indefinite>'),Yh=qe("<div>");const Qh=()=>Wh();function Zh(){return(()=>{var e=Yh();return e.style.setProperty("display","flex"),e.style.setProperty("justify-content","center"),e.style.setProperty("align-items","center"),e.style.setProperty("height","100%"),e.style.setProperty("animation","spin 1s linear infinite"),Fe(e,_e(Qh,{})),e})()}var Jh=qe("<div><img><h1>Opening <!>...</h1><p>Confirm the operation in ");function Kh(e){return(()=>{var t=Jh(),r=t.firstChild,n=r.nextSibling,s=n.firstChild,o=s.nextSibling;o.nextSibling;var i=n.nextSibling;return i.firstChild,t.style.setProperty("display","flex"),t.style.setProperty("flex-direction","column"),t.style.setProperty("align-items","center"),t.style.setProperty("row-gap","16px"),r.style.setProperty("border-radius","12px"),r.style.setProperty("height","64px"),r.style.setProperty("width","64px"),r.style.setProperty("object-fit","cover"),Fe(n,()=>e.option.name,o),Fe(i,()=>e.option.name,null),Fe(t,_e(Zh,{}),null),lt(a=>{var h=e.option.icon,f=e.option.name,l={...an,"text-align":"center"},y=Xt;return h!==a.e&&mt(r,"src",a.e=h),f!==a.t&&mt(r,"alt",a.t=f),a.a=st(n,l,a.a),a.o=st(i,y,a.o),a},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}var Xh=qe("<div><div tabindex=0><img><div>");function $h(e){function t(){e.onProviderSelected(e.id)}const r=Mt(()=>cs(e)?"button":"link");function n(y){if(r()==="link"){y.key==="Enter"&&t();return}if(r()==="button"){(y.key==="Enter"||y.key===" ")&&t();return}}const[s,o]=ut(!1),[i,a]=ut(!1),h=()=>s()||i(),f="rgba(24, 24, 24, 0.20)",l="rgba(24, 24, 24, 0.60)";return(()=>{var y=Xh(),k=y.firstChild,I=k.firstChild,x=I.nextSibling;return y.style.setProperty("aspect-ratio","1 / 1"),y.style.setProperty("overflow","hidden"),k.style.setProperty("display","flex"),k.style.setProperty("flex-direction","column"),k.style.setProperty("row-gap","12px"),k.style.setProperty("align-items","center"),k.style.setProperty("cursor","pointer"),k.style.setProperty("outline","none"),k.style.setProperty("padding-top","10px"),k.addEventListener("click",t),k.addEventListener("keydown",n),k.addEventListener("mouseenter",()=>o(!0)),k.addEventListener("mouseleave",()=>o(!1)),k.addEventListener("focus",()=>a(!0)),k.addEventListener("blur",()=>a(!1)),I.style.setProperty("width","56px"),I.style.setProperty("height","56px"),I.style.setProperty("object-fit","cover"),I.style.setProperty("border-radius","12px"),Fe(x,()=>e.name),lt(M=>{var E=r(),U=h()?`6px solid ${f}`:"none",j=e.icon,O=e.name,G={...Xt,color:h()?l:void 0,"text-align":"center"};return E!==M.e&&mt(k,"role",M.e=E),U!==M.t&&((M.t=U)!=null?I.style.setProperty("outline",U):I.style.removeProperty("outline")),j!==M.a&&mt(I,"src",M.a=j),O!==M.o&&mt(I,"alt",M.o=O),M.i=st(x,G,M.i),M},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),y})()}var ep=qe('<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&amp;display=swap"rel=stylesheet>'),tp=qe("<div class=side-panel>"),rp=qe('<div><div></div><div><div class=card-width-container><div class=card-height-container><div class=card><div class=card-grid><div class=main-panel><div></div><div></div><div class=wallets-grid-container data-desc="wallet grid container for padding"><div class=wallets-grid data-desc="wallet grid container">'),np=qe(`<div><style>
294
+ @keyframes wallet-selector-fade-in {
295
+ from {opacity: 0; transform: translateY(40px);}
296
+ to {opacity: 1; transform: translateY(0);}
297
+ }
298
+
299
+ @keyframes wallet-selector-fade-out {
300
+ from {opacity: 1; transform: translateY(0);}
301
+ to {opacity: 0; transform: translateY(40px);}
302
+ }
303
+ @keyframes wallet-selector-blur-in {
304
+ from {opacity: 0; backdrop-filter: blur(0px);}
305
+ to {opacity: 1; backdrop-filter: blur(10px);}
306
+ }
307
+
308
+ @keyframes wallet-selector-blur-out {
309
+ from {opacity: 1; backdrop-filter: blur(10px);}
310
+ to {opacity: 0; backdrop-filter: blur(0px);}
311
+ }
312
+ </style><style>`);const Pr="24px";function sp(){const[e,t]=ut(),[r,n]=ut(),[s,o]=ut();function i(){const B=e(),D=s();return!(!B||!D||!B.contains(D)||getComputedStyle(D).display==="none")}const[a,h]=ut(!1),[f,l]=ut(!1),[y,k]=ut([]),[I,x]=ut({type:"none"}),M=()=>y().some(B=>ap(B)),E=()=>h(!1);function U(){const B=new CustomEvent(zn,{bubbles:!0,composed:!0});window.dispatchEvent(B),E()}function j(B){B.key==="Escape"&&U()}nc(()=>{if(a()){window.addEventListener("keydown",j);return}window.removeEventListener("keydown",j)});function O(B){const D=y().find(Q=>Q.id===B);if(cs(D)){i()?x({type:"install-wallet-prompt",option:D}):qn(D);return}const ee=new CustomEvent(Ln,{detail:B,bubbles:!0,composed:!0});window.dispatchEvent(ee)}function G(B){Zf(()=>{h(!0),l(!0);const D=B.detail.options;k(D),D.some(ee=>!ee.installPrompt)?x({type:"explainer"}):x({type:"none"})})}function L(){h(!1)}const _=()=>{a()||l(!1)};function $(B){const D=B.detail;x({type:"opening-wallet",option:y().find(ee=>ee.id===D)})}function te(){x({type:"explainer"})}Jf(()=>{window.addEventListener(Un,G),window.addEventListener(Hn,L),window.addEventListener(dc,$),window.addEventListener(fc,te),document.head.appendChild(ep())}),sc(()=>{window.removeEventListener(Un,G),window.removeEventListener(Hn,L)});function H(B){const D=B.target;if(!D)return;const ee=r();ee&&(ee.contains(D)||U())}return(()=>{var B=np(),D=B.firstChild,ee=D.nextSibling;return Nn(t,B),B.style.setProperty("inset","0"),B.addEventListener("click",H),B.addEventListener("keydown",()=>{console.log("Inside root keydown")}),Fe(B,_e(Rh,{}),D),Fe(ee,()=>`
313
+ .card-width-container {
314
+ container: card-width-container / inline-size;
315
+ display: flex;
316
+ justify-content: center;
317
+ align-items: center;
318
+ height: 100%;
319
+ width: 740px;
320
+ }
321
+
322
+ .card-height-container {
323
+ display: flex;
324
+ flex-direction: column;
325
+ align-items: center;
326
+ justify-content: flex-end;
327
+ height: 100%;
328
+ width: 100%;
329
+ }
330
+
331
+ .card {
332
+ min-height: 340px;
333
+ max-height: calc(100vh - 8rem);
334
+ width: 100%;
335
+ border-top-left-radius: ${Pr};
336
+ border-top-right-radius: ${Pr};
337
+
338
+ background: rgb(196, 177, 217);
339
+ overflow: hidden;
340
+
341
+ display: flex;
342
+ flex-direction: column;
343
+
344
+ position: "relative"; /* For the close button */
345
+ background-color: #ffffff;
346
+ display: ${f()?"block":"none"};
347
+
348
+ box-shadow: 0px 8px 64px 0px rgba(0, 0, 0, 0.25);
349
+ animation: ${a()?"wallet-selector-fade-in 0.4s cubic-bezier(.05, .7, .1, 1) forwards":"wallet-selector-fade-out 0.2s cubic-bezier(.3, 0, .8, .15) forwards"};
350
+ }
351
+
352
+ .card-grid {
353
+ flex-grow: 1;
354
+ height: 100%;
355
+
356
+ display: grid;
357
+ grid-template-columns: 1fr;
358
+ grid-template-areas: "mainPanel";
359
+ }
360
+
361
+ .main-panel {
362
+ height: 100%;
363
+ overflow: hidden;
364
+ display: flex;
365
+ flex-direction: column;
366
+ grid-area: mainPanel;
367
+ }
368
+
369
+ .wallets-grid-container {
370
+ overflow: auto;
371
+ flex-grow: 1;
372
+ }
373
+
374
+ .wallets-grid {
375
+ display: grid;
376
+ grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
377
+ align-content: start;
378
+
379
+ padding-left: 24px;
380
+ padding-right: 24px;
381
+ padding-bottom: 40px;
382
+ }
383
+
384
+ .divider {
385
+ display: none;
386
+ grid-area: divider;
387
+ }
388
+
389
+ .side-panel {
390
+ display: none;
391
+ grid-area: sidePanel;
392
+ }
393
+
394
+ @container card-width-container (width > 400px) {
395
+ .card-height-container {
396
+ justify-content: center;
397
+ }
398
+
399
+ .card {
400
+ max-width: calc(100vw - 2rem);
401
+ max-height: 460px;
402
+ ${M()?"":"width: 360px;"}
403
+ border-bottom-left-radius: ${Pr};
404
+ border-bottom-right-radius: ${Pr};
405
+ }
406
+
407
+ .card-grid {
408
+ grid-template-columns: ${M()?"5fr auto 4fr":"1fr"};
409
+ grid-template-areas: ${M()?'"mainPanel divider sidePanel"':'"mainPanel"'};
410
+ }
411
+
412
+ .divider {
413
+ display: block;
414
+ }
415
+
416
+ .side-panel {
417
+ display: flex;
418
+ flex-direction: column;
419
+ justify-content: center;
420
+ align-items: center;
421
+ }
422
+ }
423
+ `),Fe(B,_e(En,{get when(){return f()},get children(){var Q=rp(),re=Q.firstChild,se=re.nextSibling,me=se.firstChild,xe=me.firstChild,ve=xe.firstChild,C=ve.firstChild,W=C.firstChild,V=W.firstChild,X=V.nextSibling,fe=X.nextSibling,he=fe.firstChild;return Q.style.setProperty("position","fixed"),Q.style.setProperty("inset","0"),re.style.setProperty("background-color","#FFFFFF80"),re.style.setProperty("position","absolute"),re.style.setProperty("inset","0"),se.style.setProperty("display","flex"),se.style.setProperty("justify-content","center"),se.style.setProperty("align-items","center"),se.style.setProperty("height","100%"),Nn(n,ve),ve.addEventListener("animationend",_),Fe(V,()=>M()?"Choose wallet to connect":"Don't have a wallet?"),Fe(X,()=>M()?"Start by selecting one of the wallets below and confirming the connection.":"Start by installing one of the wallets below."),Fe(he,_e(ah,{get each(){return y()},children:ye=>_e($h,oh(ye,{onProviderSelected:O}))})),Fe(C,_e(En,{get when(){return I().type!=="none"},get children(){return _e(Dh,{})}}),null),Fe(C,_e(En,{get when(){return I().type!=="none"},get children(){var ye=tp();return Nn(o,ye),Fe(ye,_e(jh,{get children(){return _e(zh,{get children(){return _e(ch,{fallback:null,get children(){return[_e(In,{get when(){return I().type==="install-wallet-prompt"},get children(){return _e(Vh,{get option(){return I().option}})}}),_e(In,{get when(){return I().type==="explainer"},get children(){return _e(Hh,{})}}),_e(In,{get when(){return I().type==="opening-wallet"},get children(){return _e(Kh,{get option(){return I().option}})}})]}})}})}})),ye}}),null),Fe(ve,_e(Ph,{onClose:U}),null),lt(ye=>{var Te=a()?"wallet-selector-blur-in 0.2s cubic-bezier(.05, .7, .1, 1) forwards":"wallet-selector-blur-out 0.2s cubic-bezier(.3, 0, .8, .15) forwards",q={...an,margin:"0","padding-top":"24px","padding-left":"24px","padding-right":"24px","padding-bottom":"16px"},Ne={...Xt,"padding-left":"24px","padding-right":"24px","padding-bottom":"30px"};return Te!==ye.e&&((ye.e=Te)!=null?re.style.setProperty("animation",Te):re.style.removeProperty("animation")),ye.t=st(V,q,ye.t),ye.a=st(X,Ne,ye.a),ye},{e:void 0,t:void 0,a:void 0}),Q}}),null),lt(()=>(f()?"fixed":"static")!=null?B.style.setProperty("position",f()?"fixed":"static"):B.style.removeProperty("position")),B})()}const as="sats-connect-wallet-provider-selector",kn=as;function ip(){return document.getElementById(as)}function op(){if(customElements.get(kn))return;Ih(kn,sp);const e=document.createElement(kn);e.id=as,e.style.position="relative",e.style.zIndex="999999",document.body.appendChild(e)}function cs(e){return!!e.installPrompt}function ap(e){return!cs(e)}function cp(e){return new Promise((t,r)=>{if(!ip()){r("Failed to detect the wallet provider selector.");return}function n(){window.removeEventListener(Ln,s),window.removeEventListener(zn,o)}function s(a){t(a.detail),n()}function o(){r(),n()}window.addEventListener(Ln,s),window.addEventListener(zn,o);const i=new CustomEvent(Un,{detail:e});window.dispatchEvent(i)})}function up(e){const t=new CustomEvent(dc,{detail:e});window.dispatchEvent(t)}function lp(){const e=new CustomEvent(fc);window.dispatchEvent(e)}function dp(){const e=new CustomEvent(Hn);window.dispatchEvent(e)}var fp=class{providerId;defaultAdapters=Ja;createCustomConfig;isProviderSet(){return!!this.providerId}setCreateCustomConfig(e){this.createCustomConfig=e}async selectProvider(){const e=co();if(e.length===0)throw new Error("No wallets detected, may want to prompt user to install a wallet.");const t=this.createCustomConfig?this.createCustomConfig(e):Ff(e),r=await cp(t);this.providerId=r}async disconnect(){await this.request("wallet_renouncePermissions",void 0),this.providerId=void 0,ao()}async request(e,t){op();const r=_n();if(!this.isProviderSet())if(r)this.providerId=r;else try{await this.selectProvider()}catch{return{status:"error",error:{code:mr.INTERNAL_ERROR,message:"Failed to select the provider. User may have cancelled the selection prompt."}}}const n=this.defaultAdapters[this.providerId];up(this.providerId);const s=n?await new n().request(e,t):await new Za(this.providerId).request(e,t);return lp(),s?.status==="error"&&s.error?.code===mr.USER_REJECTION?r||(this.providerId=void 0):oo(this.providerId),dp(),s||{status:"error",error:{code:mr.INTERNAL_ERROR,message:"Wallet Error processing the request"}}}addListener=(...e)=>{const t=(()=>{if(e.length===1)return e[0];const s=e;return{eventName:s[0],cb:s[1]}})(),r=_n();if(!this.isProviderSet()&&r&&(this.providerId=r),!this.isProviderSet())return console.error("No wallet provider selected. The user must first select a wallet before adding listeners to wallet events."),()=>{};const n=this.defaultAdapters[this.providerId];return!n||!new n().addListener?(console.error("The wallet provider you are using does not support the addListener method. Please update your wallet provider."),()=>{}):new n().addListener(t)}},hp=new fp;exports.AddressPurpose=rr;exports.AddressType=Jn;exports.BaseAdapter=Za;exports.BitcoinNetworkType=Et;exports.DefaultAdaptersInfo=nt;exports.MessageSigningProtocols=nn;exports.PermissionRequestParams=ns;exports.ProviderPlatform=ss;exports.RpcErrorCode=mr;exports.RpcIdSchema=rn;exports.SatsConnectAdapter=vr;exports.SparkNetworkType=Xn;exports.StacksNetworkType=tn;exports.StarknetNetworkType=Kn;exports.accountActionsSchema=uo;exports.accountChangeEventName=$i;exports.accountChangeSchema=eo;exports.accountPermissionSchema=ts;exports.addListener=Qa;exports.addNetworkMethodName=Oo;exports.addNetworkParamsSchema=Ro;exports.addNetworkRequestMessageSchema=td;exports.addNetworkResultSchema=rd;exports.addressSchema=At;exports.changeNetworkByIdMethodName=No;exports.changeNetworkByIdParamsSchema=ko;exports.changeNetworkByIdRequestMessageSchema=Jl;exports.changeNetworkByIdResultSchema=Zl;exports.changeNetworkMethodName=Eo;exports.changeNetworkParamsSchema=Io;exports.changeNetworkRequestMessageSchema=Ql;exports.changeNetworkResultSchema=Yl;exports.connectMethodName=Co;exports.connectParamsSchema=Po;exports.connectRequestMessageSchema=ed;exports.connectResultSchema=$l;exports.createInscription=vf;exports.createRepeatInscriptions=Mf;exports.default=hp;exports.defaultAdapters=Ja;exports.disconnectEventName=no;exports.disconnectMethodName=yo;exports.disconnectParamsSchema=wo;exports.disconnectRequestMessageSchema=Ul;exports.disconnectResultSchema=zl;exports.disconnectSchema=so;exports.getAccountMethodName=To;exports.getAccountParamsSchema=Bo;exports.getAccountRequestMessageSchema=Xl;exports.getAccountResultSchema=Kl;exports.getAccountsMethodName=Vo;exports.getAccountsParamsSchema=Wo;exports.getAccountsRequestMessageSchema=pd;exports.getAccountsResultSchema=hd;exports.getAddress=Bl;exports.getAddressesMethodName=Fo;exports.getAddressesParamsSchema=jo;exports.getAddressesRequestMessageSchema=od;exports.getAddressesResultSchema=id;exports.getBalanceMethodName=Yo;exports.getBalanceParamsSchema=gd;exports.getBalanceRequestMessageSchema=yd;exports.getBalanceResultSchema=md;exports.getCapabilities=bf;exports.getCurrentPermissionsMethodName=So;exports.getCurrentPermissionsParamsSchema=vo;exports.getCurrentPermissionsRequestMessageSchema=Vl;exports.getCurrentPermissionsResultSchema=Gl;exports.getDefaultProvider=_n;exports.getInfoMethodName=_o;exports.getInfoParamsSchema=Do;exports.getInfoRequestMessageSchema=sd;exports.getInfoResultSchema=nd;exports.getInscriptionsMethodName=Qo;exports.getInscriptionsParamsSchema=Zo;exports.getInscriptionsRequestMessageSchema=bd;exports.getInscriptionsResultSchema=wd;exports.getNetworkMethodName=Mo;exports.getNetworkParamsSchema=Ao;exports.getNetworkRequestMessageSchema=Wl;exports.getNetworkResultSchema=qt;exports.getProviderById=Kt;exports.getProviderOrThrow=It;exports.getProviders=Ol;exports.getSupportedWallets=co;exports.getWalletTypeMethodName=bo;exports.getWalletTypeParamsSchema=xo;exports.getWalletTypeRequestMessageSchema=ql;exports.getWalletTypeResultSchema=Hl;exports.isProviderInstalled=io;exports.networkChangeEventName=to;exports.networkChangeSchema=ro;exports.permission=fo;exports.removeDefaultProvider=ao;exports.renouncePermissionsMethodName=go;exports.renouncePermissionsParamsSchema=mo;exports.renouncePermissionsRequestMessageSchema=Ll;exports.renouncePermissionsResultSchema=jl;exports.request=is;exports.requestPermissionsMethodName=ho;exports.requestPermissionsParamsSchema=po;exports.requestPermissionsRequestMessageSchema=Fl;exports.requestPermissionsResultSchema=Dl;exports.rpcErrorResponseMessageSchema=es;exports.rpcRequestMessageSchema=de;exports.rpcResponseMessageSchema=Cl;exports.rpcSuccessResponseMessageSchema=$n;exports.runesEtchMethodName=Xo;exports.runesEtchParamsSchema=$o;exports.runesEtchRequestMessageSchema=Ed;exports.runesEtchResultSchema=Ad;exports.runesGetBalanceMethodName=ea;exports.runesGetBalanceParamsSchema=ta;exports.runesGetBalanceRequestMessageSchema=Nd;exports.runesGetBalanceResultSchema=Id;exports.runesMintMethodName=ra;exports.runesMintParamsSchema=na;exports.runesMintRequestMessageSchema=Td;exports.runesMintResultSchema=kd;exports.runesTransferMethodName=sa;exports.runesTransferParamsSchema=ia;exports.runesTransferRequestMessageSchema=Cd;exports.runesTransferResultSchema=Bd;exports.sendBtcTransaction=If;exports.sendInscriptionsMethodName=Jo;exports.sendInscriptionsParamsSchema=Ko;exports.sendInscriptionsRequestMessageSchema=Sd;exports.sendInscriptionsResultSchema=xd;exports.sendTransferMethodName=Uo;exports.sendTransferParamsSchema=Ho;exports.sendTransferRequestMessageSchema=ld;exports.sendTransferResultSchema=ud;exports.setDefaultProvider=oo;exports.signMessage=Af;exports.signMessageMethodName=Lo;exports.signMessageParamsSchema=zo;exports.signMessageRequestMessageSchema=cd;exports.signMessageResultSchema=ad;exports.signMultipleTransactions=kf;exports.signPsbtMethodName=qo;exports.signPsbtParamsSchema=Go;exports.signPsbtRequestMessageSchema=fd;exports.signPsbtResultSchema=dd;exports.signTransaction=Nf;exports.sparkFlashnetAddLiquidityIntentSchema=ca;exports.sparkFlashnetClawbackIntentSchema=ua;exports.sparkFlashnetConfirmInitialDepositIntentSchema=la;exports.sparkFlashnetCreateConstantProductPoolIntentSchema=da;exports.sparkFlashnetCreateSingleSidedPoolIntentSchema=fa;exports.sparkFlashnetGetJwtMethodName=oa;exports.sparkFlashnetGetJwtParamsSchema=aa;exports.sparkFlashnetGetJwtRequestMessageSchema=Od;exports.sparkFlashnetGetJwtResultSchema=Pd;exports.sparkFlashnetRemoveLiquidityIntentSchema=ha;exports.sparkFlashnetRouteSwapIntentSchema=pa;exports.sparkFlashnetSignIntentMethodName=ma;exports.sparkFlashnetSignIntentParamsSchema=ya;exports.sparkFlashnetSignIntentRequestMessageSchema=_d;exports.sparkFlashnetSignIntentResultSchema=Rd;exports.sparkFlashnetSignStructuredMessageMethodName=wa;exports.sparkFlashnetSignStructuredMessageParamsSchema=ba;exports.sparkFlashnetSignStructuredMessageRequestMessageSchema=Fd;exports.sparkFlashnetSignStructuredMessageResultSchema=Dd;exports.sparkFlashnetSwapIntentSchema=ga;exports.sparkGetAddressesMethodName=xa;exports.sparkGetAddressesParamsSchema=Sa;exports.sparkGetAddressesRequestMessageSchema=Ld;exports.sparkGetAddressesResultSchema=jd;exports.sparkGetBalanceMethodName=va;exports.sparkGetBalanceParamsSchema=Ma;exports.sparkGetBalanceRequestMessageSchema=Ud;exports.sparkGetBalanceResultSchema=zd;exports.sparkSignMessageMethodName=Aa;exports.sparkSignMessageParamsSchema=Ea;exports.sparkSignMessageRequestMessageSchema=qd;exports.sparkSignMessageResultSchema=Hd;exports.sparkTransferMethodName=Ia;exports.sparkTransferParamsSchema=Na;exports.sparkTransferRequestMessageSchema=Vd;exports.sparkTransferResultSchema=Gd;exports.sparkTransferTokenMethodName=ka;exports.sparkTransferTokenParamsSchema=Ta;exports.sparkTransferTokenRequestMessageSchema=Yd;exports.sparkTransferTokenResultSchema=Wd;exports.stxCallContractMethodName=Ba;exports.stxCallContractParamsSchema=Ca;exports.stxCallContractRequestMessageSchema=Zd;exports.stxCallContractResultSchema=Qd;exports.stxDeployContractMethodName=Pa;exports.stxDeployContractParamsSchema=Oa;exports.stxDeployContractRequestMessageSchema=Kd;exports.stxDeployContractResultSchema=Jd;exports.stxGetAccountsMethodName=Ra;exports.stxGetAccountsParamsSchema=_a;exports.stxGetAccountsRequestMessageSchema=$d;exports.stxGetAccountsResultSchema=Xd;exports.stxGetAddressesMethodName=Da;exports.stxGetAddressesParamsSchema=Fa;exports.stxGetAddressesRequestMessageSchema=tf;exports.stxGetAddressesResultSchema=ef;exports.stxSignMessageMethodName=ja;exports.stxSignMessageParamsSchema=La;exports.stxSignMessageRequestMessageSchema=nf;exports.stxSignMessageResultSchema=rf;exports.stxSignStructuredMessageMethodName=za;exports.stxSignStructuredMessageParamsSchema=Ua;exports.stxSignStructuredMessageRequestMessageSchema=of;exports.stxSignStructuredMessageResultSchema=sf;exports.stxSignTransactionMethodName=Ha;exports.stxSignTransactionParamsSchema=qa;exports.stxSignTransactionRequestMessageSchema=cf;exports.stxSignTransactionResultSchema=af;exports.stxSignTransactionsMethodName=Ga;exports.stxSignTransactionsParamsSchema=Va;exports.stxSignTransactionsRequestMessageSchema=lf;exports.stxSignTransactionsResultSchema=uf;exports.stxTransferStxMethodName=Wa;exports.stxTransferStxParamsSchema=Ya;exports.stxTransferStxRequestMessageSchema=ff;exports.stxTransferStxResultSchema=df;exports.walletActionsSchema=lo;exports.walletEventSchema=Pl;exports.walletPermissionSchema=rs;exports.walletTypeSchema=tr;exports.walletTypes=Xi;
424
+ //# sourceMappingURL=index-CaV3F1Nm.js.map