@stellar-agent-services/provider-kit 0.0.0-stage → 0.1.1

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 (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +508 -2
  3. package/dist/approve/assets/index-BazIJAI2.css +1 -0
  4. package/dist/approve/assets/index-CL28cSJy.js +420 -0
  5. package/dist/approve/favicon.svg +1 -0
  6. package/dist/approve/index.html +18 -0
  7. package/dist/cli/approval-view.d.ts +80 -0
  8. package/dist/cli/approval-view.d.ts.map +1 -0
  9. package/dist/cli/approval-view.js +5 -0
  10. package/dist/cli/approval-view.js.map +1 -0
  11. package/dist/cli/approval.d.ts +132 -0
  12. package/dist/cli/approval.d.ts.map +1 -0
  13. package/dist/cli/approval.js +542 -0
  14. package/dist/cli/approval.js.map +1 -0
  15. package/dist/cli/check.d.ts +3 -0
  16. package/dist/cli/check.d.ts.map +1 -0
  17. package/dist/cli/check.js +137 -0
  18. package/dist/cli/check.js.map +1 -0
  19. package/dist/cli/dev-account.d.ts +28 -0
  20. package/dist/cli/dev-account.d.ts.map +1 -0
  21. package/dist/cli/dev-account.js +62 -0
  22. package/dist/cli/dev-account.js.map +1 -0
  23. package/dist/cli/dev.d.ts +27 -0
  24. package/dist/cli/dev.d.ts.map +1 -0
  25. package/dist/cli/dev.js +226 -0
  26. package/dist/cli/dev.js.map +1 -0
  27. package/dist/cli/discovery.d.ts +20 -0
  28. package/dist/cli/discovery.d.ts.map +1 -0
  29. package/dist/cli/discovery.js +202 -0
  30. package/dist/cli/discovery.js.map +1 -0
  31. package/dist/cli/env-file.d.ts +16 -0
  32. package/dist/cli/env-file.d.ts.map +1 -0
  33. package/dist/cli/env-file.js +77 -0
  34. package/dist/cli/env-file.js.map +1 -0
  35. package/dist/cli/fly.d.ts +28 -0
  36. package/dist/cli/fly.d.ts.map +1 -0
  37. package/dist/cli/fly.js +92 -0
  38. package/dist/cli/fly.js.map +1 -0
  39. package/dist/cli/index.d.ts +3 -0
  40. package/dist/cli/index.d.ts.map +1 -0
  41. package/dist/cli/index.js +11 -0
  42. package/dist/cli/index.js.map +1 -0
  43. package/dist/cli/init.d.ts +3 -0
  44. package/dist/cli/init.d.ts.map +1 -0
  45. package/dist/cli/init.js +170 -0
  46. package/dist/cli/init.js.map +1 -0
  47. package/dist/cli/launch.d.ts +21 -0
  48. package/dist/cli/launch.d.ts.map +1 -0
  49. package/dist/cli/launch.js +627 -0
  50. package/dist/cli/launch.js.map +1 -0
  51. package/dist/cli/main.d.ts +2 -0
  52. package/dist/cli/main.d.ts.map +1 -0
  53. package/dist/cli/main.js +158 -0
  54. package/dist/cli/main.js.map +1 -0
  55. package/dist/cli/owner-chain.d.ts +88 -0
  56. package/dist/cli/owner-chain.d.ts.map +1 -0
  57. package/dist/cli/owner-chain.js +284 -0
  58. package/dist/cli/owner-chain.js.map +1 -0
  59. package/dist/cli/owner-steps.d.ts +33 -0
  60. package/dist/cli/owner-steps.d.ts.map +1 -0
  61. package/dist/cli/owner-steps.js +121 -0
  62. package/dist/cli/owner-steps.js.map +1 -0
  63. package/dist/cli/processes.d.ts +47 -0
  64. package/dist/cli/processes.d.ts.map +1 -0
  65. package/dist/cli/processes.js +129 -0
  66. package/dist/cli/processes.js.map +1 -0
  67. package/dist/cli/reconcile.d.ts +3 -0
  68. package/dist/cli/reconcile.d.ts.map +1 -0
  69. package/dist/cli/reconcile.js +76 -0
  70. package/dist/cli/reconcile.js.map +1 -0
  71. package/dist/cli/register.d.ts +9 -0
  72. package/dist/cli/register.d.ts.map +1 -0
  73. package/dist/cli/register.js +209 -0
  74. package/dist/cli/register.js.map +1 -0
  75. package/dist/cli/request-validation.d.ts +5 -0
  76. package/dist/cli/request-validation.d.ts.map +1 -0
  77. package/dist/cli/request-validation.js +144 -0
  78. package/dist/cli/request-validation.js.map +1 -0
  79. package/dist/cli/serve.d.ts +25 -0
  80. package/dist/cli/serve.d.ts.map +1 -0
  81. package/dist/cli/serve.js +73 -0
  82. package/dist/cli/serve.js.map +1 -0
  83. package/dist/cli/shared.d.ts +142 -0
  84. package/dist/cli/shared.d.ts.map +1 -0
  85. package/dist/cli/shared.js +110 -0
  86. package/dist/cli/shared.js.map +1 -0
  87. package/dist/cli/status.d.ts +32 -0
  88. package/dist/cli/status.d.ts.map +1 -0
  89. package/dist/cli/status.js +248 -0
  90. package/dist/cli/status.js.map +1 -0
  91. package/dist/cli/target.d.ts +14 -0
  92. package/dist/cli/target.d.ts.map +1 -0
  93. package/dist/cli/target.js +43 -0
  94. package/dist/cli/target.js.map +1 -0
  95. package/dist/cli/trustline.d.ts +3 -0
  96. package/dist/cli/trustline.d.ts.map +1 -0
  97. package/dist/cli/trustline.js +114 -0
  98. package/dist/cli/trustline.js.map +1 -0
  99. package/dist/cli/try.d.ts +54 -0
  100. package/dist/cli/try.d.ts.map +1 -0
  101. package/dist/cli/try.js +450 -0
  102. package/dist/cli/try.js.map +1 -0
  103. package/dist/cli/tunnel.d.ts +13 -0
  104. package/dist/cli/tunnel.d.ts.map +1 -0
  105. package/dist/cli/tunnel.js +43 -0
  106. package/dist/cli/tunnel.js.map +1 -0
  107. package/dist/cli/validators.d.ts +6 -0
  108. package/dist/cli/validators.d.ts.map +1 -0
  109. package/dist/cli/validators.js +14 -0
  110. package/dist/cli/validators.js.map +1 -0
  111. package/dist/define-service.d.ts +71 -0
  112. package/dist/define-service.d.ts.map +1 -0
  113. package/dist/define-service.js +86 -0
  114. package/dist/define-service.js.map +1 -0
  115. package/dist/gateway/config.d.ts +88 -0
  116. package/dist/gateway/config.d.ts.map +1 -0
  117. package/dist/gateway/config.js +201 -0
  118. package/dist/gateway/config.js.map +1 -0
  119. package/dist/gateway/openapi.d.ts +69 -0
  120. package/dist/gateway/openapi.d.ts.map +1 -0
  121. package/dist/gateway/openapi.js +677 -0
  122. package/dist/gateway/openapi.js.map +1 -0
  123. package/dist/gateway/upstream.d.ts +15 -0
  124. package/dist/gateway/upstream.d.ts.map +1 -0
  125. package/dist/gateway/upstream.js +95 -0
  126. package/dist/gateway/upstream.js.map +1 -0
  127. package/dist/http/bounded.d.ts +3 -0
  128. package/dist/http/bounded.d.ts.map +1 -0
  129. package/dist/http/bounded.js +23 -0
  130. package/dist/http/bounded.js.map +1 -0
  131. package/dist/http/node-server.d.ts +15 -0
  132. package/dist/http/node-server.d.ts.map +1 -0
  133. package/dist/http/node-server.js +120 -0
  134. package/dist/http/node-server.js.map +1 -0
  135. package/dist/http/rate-limit.d.ts +11 -0
  136. package/dist/http/rate-limit.d.ts.map +1 -0
  137. package/dist/http/rate-limit.js +35 -0
  138. package/dist/http/rate-limit.js.map +1 -0
  139. package/dist/http/router.d.ts +29 -0
  140. package/dist/http/router.d.ts.map +1 -0
  141. package/dist/http/router.js +329 -0
  142. package/dist/http/router.js.map +1 -0
  143. package/dist/index.d.ts +20 -0
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +31 -0
  146. package/dist/index.js.map +1 -0
  147. package/dist/jobs/memory-store.d.ts +3 -0
  148. package/dist/jobs/memory-store.d.ts.map +1 -0
  149. package/dist/jobs/memory-store.js +121 -0
  150. package/dist/jobs/memory-store.js.map +1 -0
  151. package/dist/jobs/reconcile.d.ts +22 -0
  152. package/dist/jobs/reconcile.d.ts.map +1 -0
  153. package/dist/jobs/reconcile.js +82 -0
  154. package/dist/jobs/reconcile.js.map +1 -0
  155. package/dist/jobs/recovery.d.ts +19 -0
  156. package/dist/jobs/recovery.d.ts.map +1 -0
  157. package/dist/jobs/recovery.js +65 -0
  158. package/dist/jobs/recovery.js.map +1 -0
  159. package/dist/jobs/runner.d.ts +38 -0
  160. package/dist/jobs/runner.d.ts.map +1 -0
  161. package/dist/jobs/runner.js +194 -0
  162. package/dist/jobs/runner.js.map +1 -0
  163. package/dist/jobs/scheduler.d.ts +66 -0
  164. package/dist/jobs/scheduler.d.ts.map +1 -0
  165. package/dist/jobs/scheduler.js +197 -0
  166. package/dist/jobs/scheduler.js.map +1 -0
  167. package/dist/jobs/sqlite-store.d.ts +8 -0
  168. package/dist/jobs/sqlite-store.d.ts.map +1 -0
  169. package/dist/jobs/sqlite-store.js +231 -0
  170. package/dist/jobs/sqlite-store.js.map +1 -0
  171. package/dist/jobs/store.d.ts +118 -0
  172. package/dist/jobs/store.d.ts.map +1 -0
  173. package/dist/jobs/store.js +36 -0
  174. package/dist/jobs/store.js.map +1 -0
  175. package/dist/manifest.d.ts +11 -0
  176. package/dist/manifest.d.ts.map +1 -0
  177. package/dist/manifest.js +99 -0
  178. package/dist/manifest.js.map +1 -0
  179. package/dist/payments/chain.d.ts +23 -0
  180. package/dist/payments/chain.d.ts.map +1 -0
  181. package/dist/payments/chain.js +108 -0
  182. package/dist/payments/chain.js.map +1 -0
  183. package/dist/payments/facilitator.d.ts +44 -0
  184. package/dist/payments/facilitator.d.ts.map +1 -0
  185. package/dist/payments/facilitator.js +125 -0
  186. package/dist/payments/facilitator.js.map +1 -0
  187. package/dist/payments/onchain.d.ts +36 -0
  188. package/dist/payments/onchain.d.ts.map +1 -0
  189. package/dist/payments/onchain.js +191 -0
  190. package/dist/payments/onchain.js.map +1 -0
  191. package/dist/payments/payload-checks.d.ts +22 -0
  192. package/dist/payments/payload-checks.d.ts.map +1 -0
  193. package/dist/payments/payload-checks.js +113 -0
  194. package/dist/payments/payload-checks.js.map +1 -0
  195. package/dist/payments/settlement.d.ts +22 -0
  196. package/dist/payments/settlement.d.ts.map +1 -0
  197. package/dist/payments/settlement.js +65 -0
  198. package/dist/payments/settlement.js.map +1 -0
  199. package/dist/payments/x402-server.d.ts +8 -0
  200. package/dist/payments/x402-server.d.ts.map +1 -0
  201. package/dist/payments/x402-server.js +74 -0
  202. package/dist/payments/x402-server.js.map +1 -0
  203. package/dist/provider.d.ts +63 -0
  204. package/dist/provider.d.ts.map +1 -0
  205. package/dist/provider.js +177 -0
  206. package/dist/provider.js.map +1 -0
  207. package/dist/registration.d.ts +86 -0
  208. package/dist/registration.d.ts.map +1 -0
  209. package/dist/registration.js +162 -0
  210. package/dist/registration.js.map +1 -0
  211. package/dist/testing.d.ts +13 -0
  212. package/dist/testing.d.ts.map +1 -0
  213. package/dist/testing.js +48 -0
  214. package/dist/testing.js.map +1 -0
  215. package/dist/validation-request.d.ts +36 -0
  216. package/dist/validation-request.d.ts.map +1 -0
  217. package/dist/validation-request.js +101 -0
  218. package/dist/validation-request.js.map +1 -0
  219. package/package.json +55 -4
  220. package/schemas/gateway-config.schema.json +140 -0
@@ -0,0 +1,420 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){for(var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),d=o((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),f=o((e=>{var t=u(),n=d(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.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 a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(Se(e,ArrayBuffer)||e&&Se(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Se(e,SharedArrayBuffer)||e&&Se(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return f(e,t,n)};function p(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(Se(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Ce(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(Se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),Se(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(Se(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Se(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return _e(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return be(e).length;default:if(i)return r?-1:_e(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ne(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return re(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(Se(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Ce(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o=0;for(;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(Ce(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return xe(_e(t,e.length-n),e,n,r)}function O(e,t,n,r){return xe(ve(t),e,n,r)}function k(e,t,n,r){return xe(be(t),e,n,r)}function A(e,t,n,r){return xe(ye(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function M(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return te(r)}var ee=4096;function te(e){let t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ne(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=we[e[r]];return i}function re(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function F(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Te(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(e,this.length-8);let r=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*256+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Te(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*256+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Te(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(e,this.length-8);let r=this[e+4]+this[e+5]*256+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=Te(function(e){e>>>=0,pe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&me(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!1,52,8)};function I(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;I(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;I(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function L(e,t,n,r,i){fe(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ie(e,t,n,r,i){fe(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=Te(function(e,t=0){return L(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Te(function(e,t=0){return ie(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);I(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);I(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=Te(function(e,t=0){return L(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Te(function(e,t=0){return ie(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function ae(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function oe(e,t,r,i,a){return t=+t,r>>>=0,a||ae(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return oe(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return oe(this,e,t,!1,n)};function se(e,t,r,i,a){return t=+t,r>>>=0,a||ae(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return se(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return se(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var ce={};function le(e,t,n){ce[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}le(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),le(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),le(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ue(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ue(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ue(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function de(e,t,n){pe(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&me(t,e.length-(n+1))}function fe(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new ce.ERR_OUT_OF_RANGE(`value`,i,e)}de(r,i,a)}function pe(e,t){if(typeof e!=`number`)throw new ce.ERR_INVALID_ARG_TYPE(t,`number`,e)}function me(e,t,n){throw Math.floor(e)===e?t<0?new ce.ERR_BUFFER_OUT_OF_BOUNDS:new ce.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(pe(e,n),new ce.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var he=/[^+/0-9A-Za-z-_]/g;function ge(e){if(e=e.split(`=`)[0],e=e.trim().replace(he,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function _e(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319||o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function ve(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ye(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function be(e){return t.toByteArray(ge(e))}function xe(e,t,n,r){let i=0;for(;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Se(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ce(e){return e!==e}var we=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function Te(e){return typeof BigInt>`u`?R:e}function R(){throw Error(`BigInt not supported`)}}))();globalThis.Buffer??=f.Buffer;var p=Array.isArray,m=Array.prototype.indexOf,h=Array.prototype.includes,g=Array.from,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,b=Object.prototype,x=Array.prototype,S=Object.getPrototypeOf,C=Object.isExtensible,w=()=>{};function T(e){for(var t=0;t<e.length;t++)e[t]()}function E(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var D=1024,O=2048,k=4096,A=8192,j=16384,M=32768,ee=1<<25,te=65536,N=1<<19,P=1<<20,ne=1<<25,re=1<<21,F=1<<22,I=1<<23,L=Symbol(`$state`),ie=Symbol(`component`),ae=Symbol(`legacy props`),oe=Symbol(``),se=Symbol(`attributes`),ce=Symbol(`class`),le=Symbol(`style`),ue=Symbol(`text`),de=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),pe={},me=Symbol(`uninitialized`),he=`http://www.w3.org/1999/xhtml`,ge=`http://www.w3.org/2000/svg`,_e=`http://www.w3.org/1998/Math/MathML`;function ve(){console.warn(`https://svelte.dev/e/derived_inert`)}function ye(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function be(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var xe=!1;function Se(e){xe=e}var Ce;function we(e){if(e===null)throw ye(),pe;return Ce=e}function Te(){return we(rn(Ce))}function R(e){if(xe){if(rn(Ce)!==null)throw ye(),pe;Ce=e}}function Ee(e=1){if(xe){for(var t=e,n=Ce;t--;)n=rn(n);Ce=n}}function De(e=!0){for(var t=0,n=Ce;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=rn(n);e&&n.remove(),n=i}}function Oe(e){if(!e||e.nodeType!==8)throw ye(),pe;return e.data}function ke(e){return e===this.v}function Ae(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function je(e){return!Ae(e,this.v)}function Me(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ne(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ie(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Le(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Re(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ve(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ue(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var We=null;function Ge(e){We=e}function Ke(e,t=!1,n){We={p:We,i:!1,c:null,e:null,s:e,x:null,r:Un,l:null}}function qe(e){var t=We,n=t.e;if(n!==null){t.e=null;for(var r of n)yn(r)}return e!==void 0&&(t.x=e),t.i=!0,We=t.p,Je(e)}function Je(e={}){return _(e,ie,{value:!0}),e}function Ye(){return!0}var Xe=[];function Ze(){var e=Xe;Xe=[],T(e)}function Qe(e){if(Xe.length===0&&!Ct){var t=Xe;queueMicrotask(()=>{t===Xe&&Ze()})}Xe.push(e)}var $e=~(O|k|D);function et(e,t){e.f=e.f&$e|t}function tt(e){e.f&512||e.deps===null?et(e,D):et(e,k)}function nt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),et(e,D)}function rt(e){var t=Bn,n=Un;Hn(null),Wn(null);try{return e()}finally{Hn(t),Wn(n)}}function it(e,t,n,r){let i=Ye()?ct:ft;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Un,c=at(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){fn(e,s)}ot()}}var d=st();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ut(e))).then(u).catch(e=>fn(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),ot())}):f()}function at(){var e=Un,t=Bn,n=We,r=yt;return function(i=!0){Wn(e),Hn(t),Ge(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ot(e=!0){Wn(null),Hn(null),Ge(null),e&&yt?.deactivate()}function st(){var e=Un,t=e.b,n=yt,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function ct(e){var t=2|O;return Un!==null&&(Un.f|=N),{ctx:We,deps:null,effects:null,equals:ke,f:t,fn:e,reactions:null,rv:0,v:me,wv:0,parent:Un,ac:null}}var lt=Symbol(`obsolete`);function ut(e,t,n){let r=Un;r===null&&Ne();var i=void 0,a=zt(me),o=!Bn,s=new Set;return xn(()=>{var t=Un,n=E();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==de&&n.reject(e)}).finally(ot)}catch(e){n.reject(e),ot()}var c=yt;if(o){if(t.f&32768)var l=st();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(lt);else for(let e of s.values())e.reject(lt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==lt&&(c.activate(),t?(a.f|=I,Gt(a,t)):(a.f&8388608&&(a.f^=I),Gt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),_n(()=>{for(let e of s)e.reject(lt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function dt(e){let t=ct(e);return Kn(t),t}function ft(e){let t=ct(e);return t.equals=je,t}function pt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)kn(t[n])}}function mt(e){var t,n=Un,r=e.parent;if(!Rn&&r!==null&&e.v!==me&&r.f&24576)return ve(),e.v;Wn(r);try{pt(e),t=ir(e)}finally{Wn(n)}return t}function ht(e){var t=mt(e);!e.equals(t)&&(e.wv=tr(),(!yt?.is_fork||e.deps===null)&&(yt===null?e.v=t:(yt.capture(e,t,!0),bt?.capture(e,t,!0)),e.deps===null))?et(e,D):Rn||(xt===null?tt(e):(gn()||yt?.is_fork)&&xt.set(e,t))}function gt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&rt(()=>{t.ac.abort(de),t.ac=null}),t.fn!==null&&(t.teardown=w),sr(t,0),Dn(t))}function _t(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&cr(t)}var vt=null,yt=null,bt=null,xt=null,St=null,Ct=!1,wt=!1,Tt=null,Et=null,Dt=0,Ot=1,kt=class e{id=Ot++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){vt===null?vt=this:(vt.#n=this,this.#t=vt),vt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)et(r,O),t(r);for(r of n.m)et(r,k),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=D}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),et(e,O),this.schedule(e);for(let e of this.#d)et(e,k),this.schedule(e);this.apply();for(var t=Tt=[],n=[],r=Et=[];this.#c.length>0;){Dt++>1e3&&(this.#S(),At());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw Ft(e),this.#h()||this.discard(),t}}if(yt=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Tt=null,Et=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Pt(e,t);r.length>0&&yt.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),bt=this,Mt(n),Mt(t),bt=null,this.#s?.resolve();var o=yt;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Lt.clear(),o.#_())}}#v(e,t,n){e.f^=D;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=D:i&4?t.push(r):nr(r)&&(i&16&&this.#d.add(r),cr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),et(i,O),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),yt=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)nt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==me&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),xt?.set(e,t)),this.is_fork||(e.v=t)}activate(){yt=this}deactivate(){yt=null,xt=null}flush(){try{wt=!0,yt=this,this.#_()}finally{Dt=0,St=null,Tt=null,Et=null,wt=!1,yt=null,xt=null,Lt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(lt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Qe(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=E()).promise}static ensure(){if(yt===null){let t=yt=new e;!wt&&Qe(()=>{t.#e||t.flush()})}return yt}apply(){xt=null}schedule(e){St=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?vt=e:t.#t=e,this.linked=!1}}};function At(){try{Re()}catch(e){fn(e,St)}}var jt=null;function Mt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&nr(r)&&(jt=new Set,cr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&jn(r),jt?.size>0)){Lt.clear();for(let e of jt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)jt.has(n)&&(jt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||cr(n)}}jt.clear()}}jt=null}}function Nt(e){yt.schedule(e)}function Pt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),et(e,D);for(var n=e.first;n!==null;)Pt(n,t),n=n.next}}function Ft(e){et(e,D);for(var t=e.first;t!==null;)Ft(t),t=t.next}var It=new Set,Lt=new Map,Rt=!1;function zt(e,t){return{f:0,v:e,reactions:null,equals:ke,rv:0,wv:0}}function Bt(e,t){let n=zt(e,t);return Kn(n),n}function Vt(e,t=!1,n=!0){let r=zt(e);return t||(r.equals=je),r}function Ht(e,t,n=!1){return Bn!==null&&(!Vn||Bn.f&131072)&&Ye()&&Bn.f&4325394&&(Gn===null||!Gn.has(e))&&He(),Gt(e,n?Yt(t):t,Et)}var Ut=null,Wt=0;function Gt(e,t,n=null){if(!e.equals(t)){Rn?Lt.set(e,t):Lt.has(e)||Lt.set(e,e.v);var r=kt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&mt(t),xt===null&&tt(t)}e.wv=tr(),Ut=null,Wt=0,Jt(e,O,n),Ut=null,Ye()&&Un!==null&&Un.f&1024&&!(Un.f&96)&&(Yn===null?Xn([e]):Yn.push(e)),!r.is_fork&&It.size>0&&!Rt&&Kt()}return t}function Kt(){Rt=!1;for(let e of It){e.f&1024&&et(e,k);let t;try{t=nr(e)}catch{t=!0}t&&cr(e)}It.clear()}function qt(e){Ht(e,e.v+1)}function Jt(e,t,n){var r=e.reactions;if(r!==null){var i=Ye(),a=r.length;if(Wt+=a,Wt>1e5&&Ut===null&&(Ut=new Set),Ut!==null){if(Ut.has(e))return;Ut.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==Un){var l=(c&O)===0;if(l&&et(s,t),c&131072)It.add(s);else if(c&2){var u=s;xt?.delete(u),Jt(u,k,n)}else if(l){var d=s;c&16&&jt!==null&&jt.add(d),n===null?Nt(d):n.push(d)}}}}}function Yt(e){if(typeof e!=`object`||!e||L in e||ie in e)return e;let t=S(e);if(t!==b&&t!==x)return e;var n=new Map,r=p(e),i=Bt(0),a=null,o=$n,s=e=>{if($n===o)return e();var t=Bn,n=$n;Hn(null),er(o);var r=e();return Hn(t),er(n),r};return r&&n.set(`length`,Bt(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Be();var i=n.get(t);return i===void 0?s(()=>{var e=Bt(r.value,a);return n.set(t,e),e}):Ht(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>Bt(me,a));n.set(t,e),qt(i)}}else Ht(r,me),qt(i);return!0},get(t,r,i){if(r===L)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||v(t,r)?.writable)&&(o=s(()=>Bt(Yt(c?t[r]:me),a)),n.set(r,o)),o!==void 0){var l=V(o);return l===me?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=V(i);if(a===me)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===L)return!0;var r=n.get(t),i=r!==void 0&&r.v!==me||Reflect.has(e,t);return(r!==void 0||Un!==null&&(!i||v(e,t)?.writable))&&(r===void 0&&(r=s(()=>Bt(i?Yt(e[t]):me,a)),n.set(t,r)),V(r)===me)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>Bt(me,a)),n.set(d+``,f)):Ht(f,me)}if(l===void 0)(!u||v(e,t)?.writable)&&(l=s(()=>Bt(void 0,a)),Ht(l,Yt(o)),n.set(t,l));else{u=l.v!==me;var p=s(()=>Yt(o));Ht(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&Ht(h,g+1)}qt(i)}return!0},ownKeys(e){V(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==me});for(var[r,a]of n)a.v!==me&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Ve()}})}var Xt,Zt,Qt,$t;function en(){if(Xt===void 0){Xt=window,Zt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Qt=v(t,`firstChild`).get,$t=v(t,`nextSibling`).get,C(e)&&(e[ce]=void 0,e[se]=null,e[le]=void 0,e.__e=void 0),C(n)&&(n[ue]=void 0)}}function tn(e=``){return document.createTextNode(e)}function nn(e){return Qt.call(e)}function rn(e){return $t.call(e)}function z(e,t){if(!xe)return nn(e);var n=nn(Ce);if(n===null)n=Ce.appendChild(tn());else if(t&&n.nodeType!==3){var r=tn();return n?.before(r),we(r),r}return t&&un(n),we(n),n}function an(e,t=!1){if(!xe){var n=nn(e);return n instanceof Comment&&n.data===``?rn(n):n}if(t){if(Ce?.nodeType!==3){var r=tn();return Ce?.before(r),we(r),r}un(Ce)}return Ce}function on(e,t=!1){if(!xe)return nn(e);var n=z(e,t);return R(e),n}function B(e,t=1,n=!1){let r=xe?Ce:e;for(var i;t--;)i=r,r=rn(r);if(!xe)return r;if(n){if(r?.nodeType!==3){var a=tn();return r===null?i?.after(a):r.before(a),we(a),a}un(r)}return we(r),r}function sn(e){e.textContent=``}function cn(){return!1}function ln(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function un(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function dn(e){var t=Un;if(t===null)return Bn.f|=I,e;if(!(t.f&32768)&&!(t.f&4))throw e;fn(e,t)}function fn(e,t){if(e===pe)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function pn(e){Un===null&&(Bn===null&&Le(e),Ie()),Rn&&Fe(e)}function mn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function hn(e,t){var n=Un;n!==null&&n.f&8192&&(e|=A);var r={ctx:We,deps:null,nodes:null,f:e|O|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};yt?.register_created_effect(r);var i=r;if(e&4)Tt===null?kt.ensure().schedule(r):Tt.push(r);else if(t!==null){try{cr(r)}catch(e){throw kn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=te))}if(i!==null&&(i.parent=n,n!==null&&mn(i,n),Bn!==null&&Bn.f&2&&!(e&64))){var a=Bn;(a.effects??=[]).push(i)}return r}function gn(){return Bn!==null&&!Vn}function _n(e){let t=hn(8,null);return et(t,D),t.teardown=e,t}function vn(e){pn(`$effect`);var t=Un.f;if(!Bn&&t&32&&We!==null&&!We.i){var n=We;(n.e??=[]).push(e)}else return yn(e)}function yn(e){return hn(4|P,e)}function bn(e){kt.ensure();let t=hn(64|N,e);return(e={})=>new Promise(n=>{e.outro?Mn(t,()=>{kn(t),n(void 0)}):(kn(t),n(void 0))})}function xn(e){return hn(F|N,e)}function Sn(e,t=0){return hn(8|t,e)}function Cn(e,t=[],n=[],r=[]){it(r,t,n,t=>{hn(8,()=>{e(...t.map(V))})})}function wn(e,t=0){return hn(16|t,e)}function Tn(e){return hn(32|N,e)}function En(e){var t=e.teardown;if(t!==null){let n=Rn,r=Bn;zn(!0),Hn(null);try{t.call(null)}catch(t){fn(t,e.parent)}finally{zn(n),Hn(r)}}}function Dn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&rt(()=>{e.abort(de)});var r=n.next;n.f&64?n.parent=null:kn(n,t),n=r}}function On(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||kn(t),t=n}}function kn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(An(e.nodes.start,e.nodes.end),n=!0),e.f|=ee,Dn(e,t&&!n),sr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();En(e),e.f^=ee,e.f|=j;var i=e.parent;i!==null&&i.first!==null&&jn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function An(e,t){for(;e!==null;){var n=e===t?null:rn(e);e.remove(),e=n}}function jn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Mn(e,t,n=!0){var r=[];e.f|=256,Nn(e,r,!0);var i=()=>{n&&kn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Nn(e,t,n){if(!(e.f&8192)){e.f^=A;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Nn(i,t,o?n:!1)}i=a}}}function Pn(e){e.f&=-257,Fn(e,!0)}function Fn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=A,e.f&1024||(et(e,O),kt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Fn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function In(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:rn(n);t.append(n),n=i}}var Ln=null,Rn=!1;function zn(e){Rn=e}var Bn=null,Vn=!1;function Hn(e){Bn=e}var Un=null;function Wn(e){Un=e}var Gn=null;function Kn(e){Bn!==null&&(Bn.f&2097152||Bn.f&2)&&(Gn??=new Set).add(e)}var qn=null,Jn=0,Yn=null;function Xn(e){Yn=e}var Zn=1,Qn=0,$n=Qn;function er(e){$n=e}function tr(){return++Zn}function nr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(nr(a)&&ht(a),a.wv>e.wv)return!0}t&512&&xt===null&&et(e,D)}return!1}function rr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Gn!==null&&Gn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?rr(a,t,!1):t===a&&(n?et(a,O):a.f&1024&&et(a,k),Nt(a))}}function ir(e){var t=qn,n=Jn,r=Yn,i=Bn,a=Gn,o=We,s=Vn,c=$n,l=e.f;qn=null,Jn=0,Yn=null,Bn=l&96?null:e,Gn=null,Ge(e.ctx),Vn=!1,$n=++Qn,e.ac!==null&&(rt(()=>{e.ac.abort(de)}),e.ac=null);try{e.f|=re;var u=e.fn,d=u();e.f|=M;var f=ar(e);if(Ye()&&Yn!==null&&!Vn&&f!==null&&!(e.f&6146))for(var p=0;p<Yn.length;p++)rr(Yn[p],e);if(i!==null&&i!==e){if(Qn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Qn;if(t!==null)for(let e of t)e.rv=Qn;Yn!==null&&(r===null?r=Yn:r.push(...Yn))}return e.f&8388608&&(e.f^=I),d}catch(t){return ar(e),dn(t)}finally{e.f^=re,qn=t,Jn=n,Yn=r,Bn=i,Gn=a,Ge(o),Vn=s,$n=c}}function ar(e){var t=e.deps,n=yt?.is_fork;if(qn!==null){var r;if(n||sr(e,Jn),t!==null&&Jn>0)for(t.length=Jn+qn.length,r=0;r<qn.length;r++)t[Jn+r]=qn[r];else e.deps=t=qn;if(gn()&&e.f&512)for(r=Jn;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Jn<t.length&&(sr(e,Jn),t.length=Jn);return t}function or(e,t){let n=t.reactions;if(n!==null){var r=m.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(qn===null||!h.call(qn,t))){var a=t;a.f&512&&(a.f^=512),a.v!==me&&tt(a),a.ac!==null&&rt(()=>{a.ac.abort(de),a.ac=null,et(a,O)}),gt(a),sr(a,0)}}function sr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)or(e,n[r])}function cr(e){var t=e.f;if(!(t&16384)){et(e,D);var n=Un;Un=e;try{t&16777232?On(e):Dn(e),En(e);var r=ir(e);e.teardown=typeof r==`function`?r:null,e.wv=Zn}finally{Un=n}}}function V(e){var t=!!(e.f&2);if(Ln?.add(e),Bn!==null&&!Vn&&!(Un!==null&&Un.f&16384)&&(Gn===null||!Gn.has(e))){var n=Bn.deps;if(Bn.f&2097152)e.rv<Qn&&(e.rv=Qn,qn===null&&n!==null&&n[Jn]===e?Jn++:qn===null?qn=[e]:qn.push(e));else{Bn.deps??=[],h.call(Bn.deps,e)||Bn.deps.push(e);var r=e.reactions;r===null?e.reactions=[Bn]:h.call(r,Bn)||r.push(Bn)}}if(Rn&&Lt.has(e))return Lt.get(e);if(t){var i=e;if(Rn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||ur(i))&&(a=mt(i)),Lt.set(i,a),a}var o=!(i.f&512)&&!Vn&&Bn!==null&&!!(Bn.f&512),s=(i.f&M)===0;nr(i)&&(o&&(i.f|=512),ht(i)),o&&!s&&(_t(i),lr(i))}if(xt?.has(e))return xt.get(e);if(e.f&8388608)throw e.v;return e.v}function lr(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:h.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(_t(n),lr(n))}}function ur(e){if(e.v===me)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Lt.has(t)||t.f&2&&ur(t))return!0;return!1}function dr(e){var t=Vn;try{return Vn=!0,e()}finally{Vn=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var fr=[`touchstart`,`touchmove`];function pr(e){return fr.includes(e)}var mr=Symbol(`events`),hr=new Set,gr=new Set;function _r(e,t,n){(t[mr]??={})[e]=n}function vr(e){for(var t=0;t<e.length;t++)hr.add(e[t]);for(var n of gr)n(e)}var yr=null,br=!1;function xr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;yr=e,br||(br=!0,setTimeout(()=>{br=!1,yr=null}));var o=0,s=yr===e&&e[mr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[mr]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){_(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Bn,d=Un;Hn(null),Wn(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[mr]?.[r];m!=null&&(!a.disabled||e.target===a)&&m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[mr]=t,delete e.currentTarget,Hn(u),Wn(d)}}}var Sr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Cr(e){return Sr?.createHTML(e)??e}function wr(e){var t=ln(`template`);return t.innerHTML=Cr(e.replaceAll(`<!>`,`<!---->`)),t.content}function Tr(e,t){var n=Un;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Er(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(xe)return Tr(Ce,null),Ce;i===void 0&&(i=wr(a?e:`<!>`+e),n||(i=nn(i)));var t=r||Zt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=nn(t),s=t.lastChild;Tr(o,s)}else Tr(t,t);return t}}function Dr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=!!(t&1),a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(xe)return Tr(Ce,null),Ce;if(!o){var e=nn(wr(a));if(i)for(o=document.createDocumentFragment();nn(e);)o.appendChild(nn(e));else o=nn(e)}var t=o.cloneNode(!0);if(i){var n=nn(t),r=t.lastChild;Tr(n,r)}else Tr(t,t);return t}}function Or(e,t){return Dr(e,t,`svg`)}function kr(e=``){if(!xe){var t=tn(e+``);return Tr(t,t),t}var n=Ce;return n.nodeType===3?un(n):(n.before(n=tn()),we(n)),Tr(n,n),n}function Ar(e,t){if(xe){var n=Un;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Ce),Te()}else e!==null&&e.before(t)}function jr(e){let t=0,n=zt(0),r;return()=>{gn()&&(V(n),Sn(()=>(t===0&&(r=dr(()=>e(()=>qt(n)))),t+=1,()=>{Qe(()=>{--t,t===0&&(r?.(),r=void 0,qt(n))})})))}}var Mr=te|N;function Nr(e,t,n,r){new Pr(e,t,n,r)}var Pr=class{parent;is_pending=!1;transform_error;#e;#t=xe?Ce:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=jr(()=>(this.#m=zt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Un;t.b=this,t.f|=128,n(e)},this.parent=Un.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=wn(()=>{if(xe){let e=Oe(this.#t);Te();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},Mr),xe&&(this.#e=Ce)}#g(){try{this.#a=Tn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Qe(r),t&&(this.#s=Tn(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?be():(t=!0,n&&Ue(),this.#s!==null&&Mn(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){fn(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(j|ee))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Tn(()=>e(this.#e)),Qe(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=tn(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return Tn(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){fn(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(yt)):this.#u===0&&(this.#e.before(e),this.#c=null,Mn(this.#o,()=>{this.#o=null}),this.#S(yt))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Tn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();In(this.#a,e);let t=this.#n.pending;this.#o=Tn(()=>t(this.#e))}else this.#S(yt)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){nt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=Un,n=Bn,r=We;Wn(this.#i),Hn(this.#i),Ge(this.#i.ctx);try{return kt.ensure(),e()}finally{Wn(t),Hn(n),Ge(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&Mn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Qe(()=>{this.#d=!1,this.#m&&Gt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),V(this.#m)}error(e){if(e===pe||!this.#n.onerror&&!this.#n.failed)throw e;yt?.is_fork?(this.#a&&yt.skip_effect(this.#a),this.#o&&yt.skip_effect(this.#o),this.#s&&yt.skip_effect(this.#s),yt.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(kn(this.#a),null),this.#o&&=(kn(this.#o),null),this.#s&&=(kn(this.#s),null),xe&&(we(this.#t),Ee(),we(De()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return Tn(()=>{var r=Un;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return fn(e,this.#i.parent),null}}))};Qe(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){fn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>fn(e,this.#i&&this.#i.parent)):n(t)}})}};function Fr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ue]??=e.nodeValue)&&(e[ue]=n,e.nodeValue=`${n}`)}function Ir(e,t){return Rr(e,t)}var Lr=new Map;function Rr(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){en();var c=void 0,l=bn(()=>{var o=n??t.appendChild(tn());Nr(o,{pending:()=>{}},t=>{Ke({});var n=We;if(a&&(n.c=a),i&&(r.$$events=i),xe&&Tr(t,null),c=e(t,r)||Je(),xe&&(Un.nodes.end=Ce,Ce===null||Ce.nodeType!==8||Ce.data!==`]`))throw ye(),pe;qe()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=pr(r);for(let e of[t,document]){var a=Lr.get(e);a===void 0&&(a=new Map,Lr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,xr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(g(hr)),gr.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=Lr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,xr),r.delete(e),r.size===0&&Lr.delete(n)):r.set(e,i)}gr.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return zr.set(c,l),c}var zr=new WeakMap,Br=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Pn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Pn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(kn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();In(r,t),t.append(tn()),this.#n.set(e,{effect:r,fragment:t})}else kn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Mn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(kn(n.effect),this.#n.delete(e))};ensure(e,t){var n=yt,r=cn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=tn();i.append(a),this.#n.set(e,{effect:Tn(()=>t(a)),fragment:i})}else this.#t.set(e,Tn(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else xe&&(this.anchor=Ce),this.#a(n)}};function Vr(e,t,n=!1){var r;xe&&(r=Ce,Te());var i=new Br(e),a=n?te:0;function o(e,t){if(xe){var n=Oe(r);if(e!==parseInt(n.substring(1))){var a=De();we(a),i.anchor=a,Se(!1),i.ensure(e,t),Se(!0);return}}i.ensure(e,t)}wn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Hr(e,t){return t}function Ur(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Mn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Wr(e,g(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;sn(u),u.append(l),e.items.clear()}Wr(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Wr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ne,In(a,document.createDocumentFragment())):kn(t[i],n)}}var Gr;function Kr(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=xe?we(nn(c)):c.appendChild(tn())}xe&&Te();var l=null,u=ft(()=>{var e=n();return p(e)?e:e==null?[]:g(e)}),d=new Map,f=!0;function m(e){if(!(_.effect.f&16384)){_.pending.delete(e);var n=V(u);_.fallback=l,Jr(_,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=ne,Xr(l,null,o)):Pn(l):Mn(l,()=>{l=null}))}}function h(e){_.pending.delete(e)}var _={effect:wn(()=>{var e=V(u),c=e.length;let p=!1;xe&&Oe(o)===`[!`!=(c===0)&&(o=De(),we(o),Se(!1),p=!0);for(var g=new Set,_=yt,v=cn(),y=0;y<c;y+=1){xe&&Ce.nodeType===8&&Ce.data===`]`&&(o=Ce,p=!0,Se(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&Gt(S.v,b),S.i&&Gt(S.i,y),v&&_.unskip_effect(S.e)):(S=Yr(s,f?o:Gr??=tn(),b,x,y,i,t,n),f||(S.e.f|=ne),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=Tn(()=>a(o)):(l=Tn(()=>a(Gr??=tn())),l.f|=ne)),c>g.size&&Pe(``,``,``),xe&&c>0&&we(De()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(m),_.ondiscard(h)}else m(_)}p&&Se(!0),V(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,xe&&(o=Ce)}function qr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Jr(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=qr(e.effect.first),l,u=null,d,f=[],p=[],m,h,_,v;if(a)for(v=0;v<o;v+=1)m=t[v],h=i(m,v),_=s.get(h).e,_.f&33554432||(_.nodes?.a?.measure(),(d??=new Set).add(_));for(v=0;v<o;v+=1){if(m=t[v],h=i(m,v),_=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Pn(_),a&&(_.nodes?.a?.unfix(),(d??=new Set).delete(_))),_.f&33554432){if(_.f^=ne,_===c)Xr(_,null,n);else{var y=u?u.next:c;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Zr(e,u,_),Zr(e,_,y),Xr(_,y,n),u=_,f=[],p=[],c=qr(u.next);continue}}if(_!==c){if(l!==void 0&&l.has(_)){if(f.length<p.length){var b=p[0],x;u=b.prev;var S=f[0],C=f[f.length-1];for(x=0;x<f.length;x+=1)Xr(f[x],b,n);for(x=0;x<p.length;x+=1)l.delete(p[x]);Zr(e,S.prev,C.next),Zr(e,u,S),Zr(e,C,b),c=b,u=C,--v,f=[],p=[]}else l.delete(_),Xr(_,c,n),Zr(e,_.prev,_.next),Zr(e,_,u===null?e.effect.first:u.next),Zr(e,u,_),u=_;continue}for(f=[],p=[];c!==null&&c!==_;)(l??=new Set).add(c),p.push(c),c=qr(c.next);if(c===null)continue}_.f&33554432||f.push(_),u=_,c=qr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Wr(e,g(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var w=[];if(l!==void 0)for(_ of l)_.f&8192||w.push(_);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&w.push(c),c=qr(c.next);var T=w.length;if(T>0){var E=r&4&&o===0?n:null;if(a){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}Ur(e,w,E)}}a&&Qe(()=>{if(d!==void 0)for(_ of d)_.nodes?.a?.apply()})}function Yr(e,t,n,r,i,a,o,s){var c=o&1?o&16?zt(n):Vt(n,!1,!1):null,l=o&2?zt(i):null;return{v:c,i:l,e:Tn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Xr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=rn(r);if(a.before(r),r===i)return;r=o}}function Zr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Qr(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;xe&&(o=we(nn(c)))}Cn(()=>{var e=Un;if(s===(s=t()??``))xe&&Te();else if(n&&!xe)e.nodes=null,c.innerHTML=s,s!==``&&Tr(nn(c),c.lastChild);else if(e.nodes!==null&&(An(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(xe){for(var a=Ce.data,l=Te(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=rn(l);if(l===null)throw ye(),pe;Tr(Ce,u),o=we(l)}else{var d=ln(r?`svg`:i?`math`:`template`,r?ge:i?_e:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(Tr(nn(f),f.lastChild),r||i)for(;nn(f);)o.before(nn(f));else o.before(f)}}})}function $r(e,t,...n){var r=new Br(e);wn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},te)}var ei=[...`
2
+ \r\f\xA0\v`];function ti(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ei.includes(r[o-1]))&&(s===r.length||ei.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ni(e,t,n,r,i,a){var o=e[ce];if(xe||o!==n||o===void 0){var s=ti(n,r,a);(!xe||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[ce]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}var ri=Symbol(`is custom element`),ii=Symbol(`is html`),ai=fe?`link`:`LINK`;function oi(e,t,n,r){var i=si(e);xe&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ai)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[oe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&li(e).has(t)?e[t]=n:e.setAttribute(t,n))}function si(e){return e[se]??={[ri]:e.nodeName.includes(`-`),[ii]:e.namespaceURI===he}}var ci=new Map;function li(e){var t=e.getAttribute(`is`)||e.nodeName,n=ci.get(t);if(n)return n;ci.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=y(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=S(i)}return n}var ui=!1;function di(e){var t=ui;try{return ui=!1,[e(),ui]}finally{ui=t}}function fi(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=ct(r),V(l)):(c&&(c=!1,s=o?dr(r):r),s);let d;if(a){var f=L in e||ae in e;d=v(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=di(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&ze(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,y=(n&1?ct:ft)(()=>(_=!1,h()));a&&V(y);var b=Un;return(function(e,t){if(arguments.length>0){let n=t?V(y):i&&a?Yt(e):e;return Ht(y,n),_=!0,s!==void 0&&(s=n),e}return Rn&&_||b.f&16384?y.v:V(y)})}function pi(e){We===null&&Me(`onMount`),vn(()=>{let t=dr(e);if(typeof t==`function`)return t})}function mi(e){We===null&&Me(`onDestroy`),pi(()=>()=>dr(e))}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var hi={check:`<path d="M20 6 9 17l-5-5"/>`,x:`<path d="M18 6 6 18M6 6l12 12"/>`,alert:`<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><path d="M12 9v4M12 17h.01"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/>`,external:`<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3"/>`,copy:`<rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>`,shield:`<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="m9 12 2 2 4-4"/>`,wallet:`<path d="M20 12V8H6a2 2 0 0 1 0-4h12v4"/><path d="M4 6v12a2 2 0 0 0 2 2h14v-4"/><path d="M18 12a2 2 0 0 0 0 4h4v-4z"/>`,arrow:`<path d="M5 12h14M12 5l7 7-7 7"/>`,refresh:`<path d="M21 12a9 9 0 1 1-2.64-6.36L21 8"/><path d="M21 3v5h-5"/>`,clock:`<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>`,lock:`<rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,terminal:`<path d="m4 17 6-6-6-6M12 19h8"/>`,chevron:`<path d="m9 18 6-6-6-6"/>`},gi=Or(`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-16un51p"></svg>`);function _i(e,t){let n=fi(t,`size`,3,16);var r=gi();Qr(r,()=>hi[t.name],!0),R(r),Cn(()=>{oi(r,`width`,n()),oi(r,`height`,n()),oi(r,`role`,t.label===void 0?void 0:`img`),oi(r,`aria-hidden`,t.label===void 0?`true`:void 0),oi(r,`aria-label`,t.label)}),Ar(e,r)}var vi=Er(`<p class="message svelte-1bpvs6g"> </p>`),yi=Er(`<div><!> <div class="body svelte-1bpvs6g"><p class="alert-title"> </p> <!> <!></div></div>`);function bi(e,t){var n=yi(),r=z(n);{let e=dt(()=>t.tone===`danger`?`alert`:`info`);_i(r,{get name(){return V(e)},size:16})}var i=B(r,2),a=z(i),o=on(a,!0),s=B(a,2),c=e=>{var n=vi(),r=on(n,!0);Cn(()=>Fr(r,t.message)),Ar(e,n)};Vr(s,e=>{t.message!==void 0&&e(c)}),$r(B(s,2),()=>t.children??w),R(i),R(n),Cn(()=>{ni(n,1,`alert alert-${t.tone??``}`,`svelte-1bpvs6g`),oi(n,`role`,t.tone===`danger`?`alert`:`status`),Fr(o,t.title)}),Ar(e,n)}var xi=Er(`<button type="button" class="btn btn-ghost btn-icon"><!></button>`);function Si(e,t){let n=fi(t,`label`,3,`Copy`),r=Bt(!1);async function i(){try{await navigator.clipboard.writeText(t.value),Ht(r,!0),setTimeout(()=>Ht(r,!1),1500)}catch{}}var a=xi(),o=z(a);{let e=dt(()=>V(r)?`check`:`copy`);_i(o,{get name(){return V(e)},size:15})}R(a),Cn(()=>{oi(a,`title`,V(r)?`Copied`:n()),oi(a,`aria-label`,V(r)?`Copied`:n())}),_r(`click`,a,i),Ar(e,a)}vr([`click`]);var Ci=Er(`<div class="account svelte-1mh64aq"><span class="account-label svelte-1mh64aq"> </span> <div class="address-line svelte-1mh64aq"><span class="address mono svelte-1mh64aq"> </span> <!></div> <p class="reason svelte-1mh64aq"> </p></div>`),wi=Er(`<span class="spinner" aria-hidden="true"></span> Waiting for your wallet…`,1),Ti=Er(`<!> Connect wallet`,1),Ei=Er(`<div class="panel svelte-1mh64aq"><div class="head"><h2 class="panel-title">Connect your wallet</h2> <p class="panel-lead"> </p></div> <!> <!> <div class="actions svelte-1mh64aq"><button type="button" class="btn btn-primary btn-lg btn-block"><!></button> <p class="wallets svelte-1mh64aq">Freighter, xBull, Albedo, Rabet, Hana, MetaMask, Ledger and more.</p> <button type="button" class="link-button cancel svelte-1mh64aq">Cancel and return to the terminal</button></div></div>`);function Di(e,t){Ke(t,!0);var n=Ei(),r=z(n),i=on(B(z(r),2),!0);R(r);var a=B(r,2),o=e=>{var n=Ci(),r=z(n),i=on(r,!0),a=B(r,2),o=z(a),s=on(o,!0);Si(B(o,2),{get value(){return t.view.account.address},label:`Copy the address`}),R(a);var c=on(B(a,2),!0);R(n),Cn(()=>{Fr(i,t.view.account.label),Fr(s,t.view.account.address),Fr(c,t.view.account.reason)}),Ar(e,n)};Vr(a,e=>{t.view.account!==void 0&&e(o)});var s=B(a,2),c=e=>{bi(e,{tone:`danger`,get title(){return t.view.error.title},get message(){return t.view.error.message}})},l=e=>{bi(e,{tone:`danger`,get title(){return t.notice.title},get message(){return t.notice.message}})};Vr(s,e=>{t.view.error===void 0?t.notice!==void 0&&e(l,1):e(c)});var u=B(s,2),d=z(u),f=z(d),p=e=>{var t=wi();Ee(),Ar(e,t)},m=e=>{var t=Ti();_i(an(t),{name:`wallet`,size:18}),Ee(),Ar(e,t)};Vr(f,e=>{t.connecting?e(p):e(m,-1)}),R(d);var h=B(d,4);R(u),R(n),Cn(()=>{Fr(i,t.view.account===void 0?`Use the wallet you already have. provider-kit asks it to sign, and never sees your key.`:`Use the wallet that holds this account. provider-kit asks it to sign, and never sees your key.`),d.disabled=t.connecting,h.disabled=t.connecting}),_r(`click`,d,function(...e){t.onconnect?.apply(this,e)}),_r(`click`,h,function(...e){t.oncancel?.apply(this,e)}),Ar(e,n),qe()}vr([`click`]);var Oi=Er(`<div class="panel svelte-lag6xc" role="status"><span class="badge svelte-lag6xc"><!></span> <h1 class="panel-title"> </h1> <p class="panel-lead svelte-lag6xc"> </p></div>`);function ki(e,t){var n=Oi(),r=z(n);_i(z(r),{name:`terminal`,size:24}),R(r);var i=B(r,2),a=on(i,!0),o=on(B(i,2),!0);R(n),Cn(()=>{Fr(a,t.title),Fr(o,t.message)}),Ar(e,n)}function Ai(e){return e.length>12?`${e.slice(0,4)}…${e.slice(-4)}`:e}function ji(e){let t=Math.max(0,Math.ceil(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function Mi(e){return e.replace(/^Stellar /,``)}var Ni=Er(`<span class="divider svelte-75mo91" aria-hidden="true"></span> <span class="command mono svelte-75mo91" title="The command that opened this page"> </span>`,1),Pi=Er(`<span class="wallet svelte-75mo91"> </span>`),Fi=Er(`<span class="account svelte-75mo91"><!> <span class="mono svelte-75mo91"> </span> <!></span>`),Ii=Er(`<div class="status svelte-75mo91"><span><span class="dot"></span> </span> <!></div>`),Li=Er(`<header class="header svelte-75mo91"><div class="inner svelte-75mo91"><div class="brand svelte-75mo91"><span class="logo svelte-75mo91"><!></span> <span class="name svelte-75mo91">Provider Kit</span> <!></div> <!></div></header>`);function Ri(e,t){Ke(t,!0);let n=dt(()=>t.view?.network.id===`stellar:pubnet`);var r=Li(),i=z(r),a=z(i),o=z(a);_i(z(o),{name:`shield`,size:17}),R(o);var s=B(o,4),c=e=>{var n=Ni(),r=on(B(an(n),2),!0);Cn(()=>Fr(r,t.view.command)),Ar(e,n)};Vr(s,e=>{t.view!==void 0&&e(c)}),R(a);var l=B(a,2),u=e=>{var r=Ii(),i=z(r),a=B(z(i),1,!0);R(i);var o=B(i,2),s=e=>{var n=Fi(),r=z(n);_i(r,{name:`wallet`,size:14});var i=B(r,2),a=on(i,!0),o=B(i,2),s=e=>{var n=Pi(),r=on(n,!0);Cn(()=>Fr(r,t.view.connected.wallet)),Ar(e,n)};Vr(o,e=>{t.view.connected.wallet!==void 0&&e(s)}),R(n),Cn(e=>{oi(n,`title`,t.view.connected.address),Fr(a,e)},[()=>Ai(t.view.connected.address)]),Ar(e,n)};Vr(o,e=>{t.view.connected!==void 0&&e(s)}),R(r),Cn(e=>{ni(i,1,`pill ${V(n)?`pill-success`:`pill-warning`}`),oi(i,`title`,t.view.network.name),Fr(a,e)},[()=>Mi(t.view.network.name)]),Ar(e,r)};Vr(l,e=>{t.view!==void 0&&e(u)}),R(i),R(r),Ar(e,r),qe()}var zi=Er(`<a target="_blank" rel="noopener noreferrer"> <!></a>`),Bi=Er(`<span> </span>`),Vi=Er(`<div class="row svelte-1iabob4"><dt class="svelte-1iabob4"> </dt> <dd><!> <!></dd></div>`),Hi=Er(`<dl class="details svelte-1iabob4"></dl>`);function Ui(e,t){var n=Hi();Kr(n,21,()=>t.rows,Hr,(e,t)=>{var n=Vi(),r=z(n),i=on(r,!0),a=B(r,2);let o;var s=z(a),c=e=>{var n=zi();let r;var i=z(n,!0);_i(B(i),{name:`external`,size:12}),R(n),Cn(()=>{r=ni(n,1,`value svelte-1iabob4`,null,r,{mono:V(t).mono}),oi(n,`href`,V(t).href),Fr(i,V(t).value)}),Ar(e,n)},l=e=>{var n=Bi();let r;var i=on(n,!0);Cn(()=>{r=ni(n,1,`value svelte-1iabob4`,null,r,{mono:V(t).mono}),Fr(i,V(t).value)}),Ar(e,n)};Vr(s,e=>{V(t).href===void 0?e(l,-1):e(c)});var u=B(s,2),d=e=>{{let n=dt(()=>V(t).label.toLowerCase());Si(e,{get value(){return V(t).value},get label(){return`Copy ${V(n)??``}`}})}};Vr(u,e=>{V(t).mono&&V(t).value.length>24&&e(d)}),R(a),R(n),Cn(()=>{Fr(i,V(t).label),o=ni(a,1,`svelte-1iabob4`,null,o,{"mono-row":V(t).mono})}),Ar(e,n)}),R(n),Ar(e,n)}var Wi=Er(`<p class="panel-lead message svelte-o1kohj"> </p>`),Gi=Er(`<div class="panel svelte-o1kohj" role="status" aria-live="polite"><div class="hero svelte-o1kohj"><span><!></span> <h2 class="title svelte-o1kohj"> </h2> <!></div> <!> <div class="closing svelte-o1kohj"><!> <span>You can close this tab. Your terminal shows what happened and what to do next.</span></div></div>`);function Ki(e,t){Ke(t,!0);let n=dt(()=>t.view.state===`done`?`success`:t.view.state===`failed`?`danger`:`neutral`),r=dt(()=>t.view.result??{title:`Finished`,message:``,details:[]}),i=dt(()=>[...V(r).details,...t.view.steps.flatMap(e=>e.transaction===void 0?[]:[{label:e.title,value:e.transaction.hash,mono:!0,href:e.transaction.url}])]);var a=Gi(),o=z(a),s=z(o),c=z(s);{let e=dt(()=>V(n)===`success`?`check`:V(n)===`danger`?`alert`:`x`);_i(c,{get name(){return V(e)},size:26})}R(s);var l=B(s,2),u=on(l,!0),d=B(l,2),f=e=>{var t=Wi(),n=on(t,!0);Cn(()=>Fr(n,V(r).message)),Ar(e,t)};Vr(d,e=>{V(r).message!==``&&e(f)}),R(o);var p=B(o,2),m=e=>{Ui(e,{get rows(){return V(i)}})};Vr(p,e=>{V(i).length>0&&e(m)});var h=B(p,2);_i(z(h),{name:`terminal`,size:16}),Ee(2),R(h),R(a),Cn(()=>{ni(s,1,`badge ${V(n)??``}`,`svelte-o1kohj`),Fr(u,V(r).title)}),Ar(e,a),qe()}var qi=Er(`<div class="head svelte-kh3r8c"><span class="head-icon svelte-kh3r8c"><!></span> <div><h2 class="panel-title"> </h2> <p class="panel-lead"> </p></div></div> <!> <!> <!> <details class="raw svelte-kh3r8c"><summary class="svelte-kh3r8c"><!> Transaction details</summary> <div class="raw-body svelte-kh3r8c"><div class="raw-field"><span class="raw-label svelte-kh3r8c">Hash</span> <div class="raw-value svelte-kh3r8c"><code class="mono svelte-kh3r8c"> </code> <!></div></div> <div class="raw-field"><span class="raw-label svelte-kh3r8c">XDR</span> <div class="raw-value svelte-kh3r8c"><code class="mono xdr svelte-kh3r8c"> </code> <!></div></div></div></details>`,1),Ji=Er(`<div class="head svelte-kh3r8c"><span class="head-icon blocked svelte-kh3r8c"><!></span> <div><h2 class="panel-title"> </h2> <p class="panel-lead">The transaction needs to be prepared again.</p></div></div>`),Yi=Er(`<button type="button" class="btn btn-primary btn-lg grow svelte-kh3r8c"><!> Prepare it again</button>`),Xi=Er(`<span class="spinner" aria-hidden="true"></span> `,1),Zi=Er(` <!>`,1),Qi=Er(`<button type="button" class="btn btn-primary btn-lg grow svelte-kh3r8c"><!></button>`),$i=Er(`<p><!> <!></p>`),ea=Er(`<div class="panel svelte-kh3r8c"><!> <!> <div class="foot svelte-kh3r8c"><div class="actions svelte-kh3r8c"><button type="button" class="btn btn-secondary btn-lg svelte-kh3r8c">Cancel</button> <!></div> <!></div></div>`);function ta(e,t){Ke(t,!0);let n=Bt(Yt(Date.now())),r=setInterval(()=>Ht(n,Date.now(),!0),1e3);mi(()=>clearInterval(r));let i=dt(()=>t.view.review),a=dt(()=>t.view.connected?.wallet??`your wallet`),o=dt(()=>V(i)===void 0?0:V(i).expiresAt-V(n)),s=dt(()=>V(i)!==void 0&&V(o)<=0),c=dt(()=>t.view.steps.find(e=>e.status===`active`)),l=dt(()=>t.view.network.id===`stellar:pubnet`),u=dt(()=>V(i)===void 0?[]:[{label:`Network`,value:t.view.network.name},{label:`Signed by`,value:t.view.connected?.address??``,mono:!0},...V(i).details,{label:`Network fee`,value:`Up to ${V(i).maxFee}`}]);var d=ea(),f=z(d),p=e=>{var n=qi(),r=an(n),a=z(r);_i(z(a),{name:`shield`,size:18}),R(a);var o=B(a,2),s=z(o),c=on(s,!0),d=on(B(s,2),!0);R(o),R(r);var f=B(r,2),p=e=>{bi(e,{tone:`warning`,title:`This is Stellar Mainnet`,message:`The transaction is real, and its fee is paid in XLM from this account.`})};Vr(f,e=>{V(l)&&e(p)});var m=B(f,2),h=e=>{bi(e,{tone:`warning`,title:`Check your wallet's network`,get message(){return t.networkWarning}})};Vr(m,e=>{t.networkWarning!==void 0&&e(h)});var g=B(m,2);Ui(g,{get rows(){return V(u)}});var _=B(g,2),v=z(_);_i(z(v),{name:`chevron`,size:14}),Ee(),R(v);var y=B(v,2),b=z(y),x=B(z(b),2),S=z(x),C=on(S,!0);Si(B(S,2),{get value(){return V(i).hash},label:`Copy the transaction hash`}),R(x),R(b);var w=B(b,2),T=B(z(w),2),E=z(T),D=on(E,!0);Si(B(E,2),{get value(){return V(i).xdr},label:`Copy the transaction XDR`}),R(T),R(w),R(y),R(_),Cn(()=>{Fr(c,V(i).title),Fr(d,V(i).summary),Fr(C,V(i).hash),Fr(D,V(i).xdr)}),Ar(e,n)},m=e=>{var t=Ji(),n=z(t);_i(z(n),{name:`alert`,size:18}),R(n);var r=B(n,2),i=on(z(r),!0);Ee(2),R(r),R(t),Cn(()=>Fr(i,V(c)?.title??`Review`)),Ar(e,t)};Vr(f,e=>{V(i)===void 0?e(m,-1):e(p)});var h=B(f,2),g=e=>{bi(e,{tone:`danger`,get title(){return t.view.error.title},get message(){return t.view.error.message}})},_=e=>{bi(e,{tone:`danger`,get title(){return t.notice.title},get message(){return t.notice.message}})};Vr(h,e=>{t.view.error===void 0?t.notice!==void 0&&e(_,1):e(g)});var v=B(h,2),y=z(v),b=z(y),x=B(b,2),S=e=>{var n=Yi();_i(z(n),{name:`refresh`,size:16}),Ee(),R(n),Cn(()=>n.disabled=V(c)===void 0),_r(`click`,n,()=>V(c)&&t.onrebuild(V(c).id)),Ar(e,n)},C=e=>{var n=Qi(),r=z(n),i=e=>{var t=Xi(),n=B(an(t));Cn(()=>Fr(n,` Confirm in ${V(a)??``}…`)),Ar(e,t)},o=e=>{var t=Zi(),n=an(t);_i(B(n),{name:`arrow`,size:16}),Cn(()=>Fr(n,`Approve in ${V(a)??``} `)),Ar(e,t)};Vr(r,e=>{t.signing?e(i):e(o,-1)}),R(n),Cn(()=>n.disabled=t.signing),_r(`click`,n,function(...e){t.onapprove?.apply(this,e)}),Ar(e,n)};Vr(x,e=>{V(i)===void 0||V(s)?e(S):e(C,-1)}),R(y);var w=B(y,2),T=e=>{var n=$i();let r;var i=z(n);_i(i,{name:`clock`,size:13});var a=B(i,2),c=e=>{Ar(e,kr(`This transaction expired before it was signed. Prepare it again: nothing was sent.`))},l=e=>{var n=kr();Cn((e,t)=>Fr(n,`Valid for ${e??``}. Your wallet shows the same transaction on ${t??``}: check it there too.`),[()=>ji(V(o)),()=>Mi(t.view.network.name)]),Ar(e,n)};Vr(a,e=>{V(s)?e(c):e(l,-1)}),R(n),Cn(()=>r=ni(n,1,`hint svelte-kh3r8c`,null,r,{expired:V(s)})),Ar(e,n)};Vr(w,e=>{V(i)!==void 0&&e(T)}),R(v),R(d),Cn(()=>b.disabled=t.signing),_r(`click`,b,function(...e){t.oncancel?.apply(this,e)}),Ar(e,d),qe()}vr([`click`]);var na=Er(`· <a target="_blank" rel="noopener noreferrer">View transaction</a>`,1),ra=Er(`<span class="note svelte-1wezgpx"> <!></span>`),ia=Er(`<span> </span>`),aa=Er(`<li><span class="marker svelte-1wezgpx"><!></span> <div class="text svelte-1wezgpx"><span class="title svelte-1wezgpx"> </span> <!></div> <span class="visually-hidden"> </span></li>`),oa=Er(`<ol class="steps svelte-1wezgpx"></ol>`);function sa(e,t){var n=oa();Kr(n,23,()=>t.steps,e=>e.id,(e,n,r)=>{var i=aa();let a;var o=z(i),s=z(o),c=e=>{_i(e,{name:`check`,size:14})},l=e=>{var t=kr();Cn(()=>Fr(t,V(r)+1)),Ar(e,t)};Vr(s,e=>{V(n).status===`done`?e(c):e(l,-1)}),R(o);var u=B(o,2),d=z(u),f=on(d,!0),p=B(d,2),m=e=>{var t=ra(),r=z(t),i=B(r),a=e=>{var t=na(),r=B(an(t));Cn(()=>oi(r,`href`,V(n).transaction.url)),Ar(e,t)};Vr(i,e=>{V(n).transaction!==void 0&&e(a)}),R(t),Cn(()=>Fr(r,`${V(n).note??``} `)),Ar(e,t)},h=e=>{var n=ia();let r;var i=on(n,!0);Cn(()=>{r=ni(n,1,`note svelte-1wezgpx`,null,r,{current:t.ended===void 0}),Fr(i,t.ended??`In progress`)}),Ar(e,n)};Vr(p,e=>{V(n).note===void 0?V(n).status===`active`&&e(h,1):e(m)}),R(u);var g=on(B(u,2),!0);R(i),Cn(()=>{a=ni(i,1,`step ${V(n).status??``}`,`svelte-1wezgpx`,a,{halted:t.ended!==void 0&&V(n).status===`active`}),oi(i,`aria-current`,V(n).status===`active`?`step`:void 0),Fr(f,V(n).title),Fr(g,V(n).status===`done`?`Done`:V(n).status===`active`?`Current step`:`Not started`)}),Ar(e,i)}),R(n),Ar(e,n)}var ca=Er(`<div class="panel svelte-audtxj" role="status" aria-live="polite"><span class="ring svelte-audtxj" aria-hidden="true"></span> <h2 class="panel-title"> </h2> <p class="panel-lead svelte-audtxj"> </p></div>`);function la(e,t){var n=ca(),r=B(z(n),2),i=on(r),a=on(B(r,2),!0);R(n),Cn(()=>{Fr(i,`${t.title??``}…`),Fr(a,t.message)}),Ar(e,n)}var ua=class extends Error{name=`SessionEnded`},da=`provider-kit:approval-token`;function fa(){let e=location.hash.slice(1);if(e!==``){history.replaceState(null,``,`${location.pathname}${location.search}`);try{sessionStorage.setItem(da,e)}catch{}return e}try{return sessionStorage.getItem(da)??void 0}catch{return}}function pa(e){async function t(t,n){let r;try{r=await fetch(t,{method:n===void 0?`GET`:`POST`,headers:n===void 0?{Authorization:`Bearer ${e}`}:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},...n===void 0?{}:{body:JSON.stringify(n)},cache:`no-store`})}catch{throw new ua(`The terminal isn't answering.`)}if(r.status===401)throw new ua(`This link isn't valid anymore.`);let i=await r.json().catch(()=>void 0);if(r.ok&&i!==void 0)return i;if(r.status===409&&i?.view!==void 0)return i.view;throw Error(i?.message??`The terminal answered ${r.status}.`)}return{session:()=>t(`/api/session`),connect:(e,n)=>t(`/api/connect`,{address:e,wallet:n}),submit:(e,n)=>t(`/api/submit`,{stepId:e,signedTxXdr:n}),rebuild:e=>t(`/api/rebuild`,{stepId:e}),cancel:()=>t(`/api/cancel`,{})}}function ma(){let e=new Uint32Array(4);if(typeof crypto<`u`&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*4294967295);return Array.from(e).map(e=>e.toString(36)).join(``)}var ha={public_key:{title:`View public key`,description:`Requests account public key. It's a simple way of authentication for Stellar-based applications. The response ensures that a user owns the corresponding secret key.`,implicitFlow:!1,params:{token:{description:`Verification token generated by the application (should be unique or random).`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST a signed token and public key.`,type:`string`,required:!1},require_existing:{description:`Allow existing Albedo accounts only.`,type:`boolean`,required:!1}},returns:{pubkey:{description:`User-selected public key.`,type:`string`},signed_message:{description:`HEX-encoded authentication message derived from the public key and verification token.`,type:`string`},signature:{description:`HEX-encoded ED25519 signature of the authentication message that can be further used to verify user's keypair ownership.`,type:`string`}}},sign_message:{title:`Sign text message`,description:`Requests arbitrary message signing. Can be used to implement identity/ownership verification.`,implicitFlow:!0,params:{message:{description:`Text message to sign.`,type:`string`,required:!0},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST a signed message.`,type:`string`,required:!1}},returns:{pubkey:{description:`User-selected public key.`,type:`string`},original_message:{description:`Text message to sign from request.`,type:`string`},signed_message:{description:`HEX-encoded message derived from the public key and original message.`,type:`string`},message_signature:{description:`HEX-encoded ED25519 signature of the signed message.`,type:`string`}}},tx:{title:`Sign transaction`,description:`Requests a signature for the transaction. Returns the signed transaction envelope that can be submitted to the network or used for multi-sig coordination.`,implicitFlow:!0,params:{xdr:{description:`XDR-encoded transaction envelope to sign.`,type:`string`,required:!0},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},network:{description:`Stellar network identifier.`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.`,type:`string`,required:!1},description:{description:`Optional human-friendly short transaction description provided by developers.`,type:`string`,required:!1},submit:{description:`If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.`,type:`boolean`,required:!1}},returns:{xdr:{description:`XDR-encoded transaction envelope from request.`,type:`string`},tx_hash:{description:`HEX-encoded transaction hash.`,type:`string`},signed_envelope_xdr:{description:`XDR-encoded transaction envelope with new signatures.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`},result:{description:`Optional response from Horizon if the transaction has been submitted automatically.`,type:`object`}}},pay:{title:`Make payment`,description:`Requests a payment from a user. Works with any Stellar asset, supports transaction memo.`,implicitFlow:!0,params:{amount:{description:`Requested payment amount.`,type:`string`,required:!0},destination:{description:`Payment destination address.`,type:`string`,required:!0},asset_code:{description:`Asset code (skip for XLM).`,type:`string`,required:!1},asset_issuer:{description:`Asset issuer (skip for XLM).`,type:`string`,required:!1},memo:{description:`Transaction memo (required for exchanges and some anchors).`,type:`string`,required:!1},memo_type:{description:`Transaction memo type.`,type:`string`,required:!1},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon. `,type:`string`,required:!1},submit:{description:`If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.`,type:`boolean`,required:!1}},returns:{amount:{description:`Payment amount from request.`,type:`string`},destination:{description:`Payment destination address from request.`,type:`string`},asset_code:{description:`Asset code from request.`,type:`string`},asset_issuer:{description:`Asset issuer from request.`,type:`string`},memo:{description:`Transaction memo from request.`,type:`string`},memo_type:{description:`Transaction memo type from request.`,type:`string`},tx_hash:{description:`HEX-encoded transaction hash.`,type:`string`},signed_envelope_xdr:{description:`XDR-encoded transaction envelope with new signatures.`,type:`string`},pubkey:{description:`User-selected public key.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`},result:{description:`Optional response from Horizon if the transaction has been submitted automatically.`,type:`object`}}},trust:{title:`Establish trustline`,description:`Requests permission to create a trustline to a given Stellar asset. Gradually simplifies the process of creating trustlines for anchors, ICOs, and airdrops.`,implicitFlow:!0,params:{asset_code:{description:`Trustline asset code.`,type:`string`,required:!0},asset_issuer:{description:`Trustline asset issuer address.`,type:`string`,required:!0},limit:{description:`Trust limit.`,type:`string`,required:!1},memo:{description:`Transaction memo (required for exchanges and some anchors).`,type:`string`,required:!1},memo_type:{description:`Transaction memo type.`,type:`string`,required:!1},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon. `,type:`string`,required:!1},submit:{description:`If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.`,type:`boolean`,required:!1}},returns:{asset_code:{description:`Trustline asset code from request.`,type:`string`},asset_issuer:{description:`Trustline asset issuer address from request.`,type:`string`},limit:{description:`Trust limit from request.`,type:`string`},tx_hash:{description:`HEX-encoded transaction hash.`,type:`string`},signed_envelope_xdr:{description:`XDR-encoded transaction envelope with new signatures.`,type:`string`},pubkey:{description:`User-selected public key.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`},result:{description:`Optional response from Horizon if the transaction has been submitted automatically.`,type:`object`}}},exchange:{title:`Swap tokens`,description:`Requests permission to buy tokens on Stellar DEX at market price.`,implicitFlow:!1,params:{amount:{description:`The amount of asset to buy.`,type:`string`,required:!0},max_price:{description:`Maximum price the user willing to pay.`,type:`string`,required:!0},sell_asset_code:{description:`Asset code of the asset to sell.`,type:`string`,required:!1},sell_asset_issuer:{description:`Issuer account of the asset to sell.`,type:`string`,required:!1},buy_asset_code:{description:`Asset code of the asset to buy.`,type:`string`,required:!1},buy_asset_issuer:{description:`Issuer account of the asset to buy.`,type:`string`,required:!1},memo:{description:`Transaction memo (required for exchanges and some anchors).`,type:`string`,required:!1},memo_type:{description:`Transaction memo type.`,type:`string`,required:!1},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1},callback:{description:`Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.`,type:`string`,required:!1},submit:{description:`If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.`,type:`boolean`,required:!1}},returns:{amount:{description:`The amount of asset to buy from request.`,type:`string`},max_price:{description:`Maximum price the user willing to pay from request.`,type:`string`},sell_asset_code:{description:`Asset code of the asset to sell from request.`,type:`string`},sell_asset_issuer:{description:`Issuer account of the asset to sell from request.`,type:`string`},buy_asset_code:{description:`Asset code of the asset to buy from request.`,type:`string`},buy_asset_issuer:{description:`Issuer account of the asset to buy from request.`,type:`string`},tx_hash:{description:`HEX-encoded transaction hash.`,type:`string`},signed_envelope_xdr:{description:`XDR-encoded transaction envelope with new signatures.`,type:`string`},pubkey:{description:`User-selected public key.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`},result:{description:`Optional response from Horizon if the transaction has been submitted automatically.`,type:`object`}}},implicit_flow:{title:`Implicit permissions`,description:`Requests temporary access token for one or more intents that can be used to execute actions without explicit confirmation from the user. In order to be executed implicitly, an implicit flow permissions for a given intent should be granted and "pubkey" parameter set.`,implicitFlow:!1,params:{intents:{description:`Requested implicit flow intents.`,type:`string|string[]`,required:!0},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1}},returns:{granted:{description:`Whether a user granted permissions or not.`,type:`boolean`},intents:{description:`Requested implicit flow intents.`,type:`string[]`},grants:{description:`Implicit flow intents that have been granted.`,type:`string[]`},session:{description:`Unique implicit session id.`,type:`string`},valid_until:{description:`Session expiration timestamp.`,type:`number`},pubkey:{description:`User-selected public key.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`}}},manage_account:{title:`Open account settings`,description:`Opens account settings window for a given account.`,implicitFlow:!1,params:{pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!0},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1}},returns:{pubkey:{description:`Public key from intent request.`,type:`string`}}},batch:{title:`Intents batch`,description:`Requests execution of several tx intents bundled together. This intent is atomic – a user confirms or rejects all bundled requests at once, with the same account and the same Stellar network.`,implicitFlow:!0,params:{intents:{description:`Requested tx intents that should be executed together.`,type:`object[]`,required:!0},pubkey:{description:`Specific public key requested by the application.`,type:`string`,required:!1},network:{description:`Stellar network identifier or private network passphrase.`,type:`string`,required:!1}},returns:{intents:{description:`Requested tx intents.`,type:`object[]`},results:{description:`Array of results for each requested intent.`,type:`object[]`},pubkey:{description:`User-selected public key.`,type:`string`},network:{description:`Stellar network identifier.`,type:`string`}}}},ga={unhandledError:{message:`Unhandled error occurred. If this error persists, please contact Albedo support.`,code:-1},externalError:{message:`External error occurred.`,code:-2},invalidIntentRequest:{message:`Intent request is invalid.`,code:-3},actionRejectedByUser:{message:`Action request was rejected by the user.`,code:-4},horizonError:{message:`Transaction failed when submitted to Stellar network.`,code:-5},callbackError:{message:`Callback redirect failed.`,code:-6}};function _a(e,t=!1){this.windowHandler=e,this.ephemeral=!!t,this.isLoaded=!1,this.pendingRequests={},this.preprocessRequestParams=null,this.onLoaded=new Promise((e,t)=>this.onLoadedCallback=e).then(()=>this),this.messageHandler=this.messageHandler.bind(this),window.addEventListener(`message`,this.messageHandler,!1)}_a.prototype={isLoaded:!1,protocolVersion:3,markLoaded(){let{onLoadedCallback:e}=this;e&&(this.onLoadedCallback=null,this.isLoaded=!0,e())},messageHandler({data:e}){if(e.albedo)return this.matchProtocolVersion(e.albedo.protocol),this.markLoaded();if(e.albedoIntentResult){let{__reqid:t,...n}=e.albedoIntentResult,r=this.pendingRequests[t];r&&(delete this.pendingRequests[t],r(n),this.ephemeral&&(window.removeEventListener(`message`,this.messageHandler,!1),this.windowHandler.close()))}},transportCloseHandler(){for(let e in this.pendingRequests)if(this.pendingRequests.hasOwnProperty(e)){let t=this.pendingRequests[e];delete this.pendingRequests[e],t(ga.actionRejectedByUser)}},postMessage(e){let t=ma();return new Promise((n,r)=>{this.onLoaded.then(()=>{this.pendingRequests[t]=va.bind(this,n,r),e=Object.assign({__reqid:t,__albedo_intent_version:this.protocolVersion},e),this.preprocessRequestParams&&(e=this.preprocessRequestParams(e)),this.windowHandler.postMessage(e,`*`)})})},matchProtocolVersion(e){let t=e-this.protocolVersion;if(t===0)return;let n=`@albedo-link/intent module protocol version (${this.protocolVersion}) is incompatible with current Albedo protocol version ${e}.`;if(t>0)console.warn(n+` Please update @albedo-link/intent module to avoid possible connection problems.`);else if(t<0)throw this.windowHandler.close(),Error(n)}};function va(e,t,n){n.error?t(n):e(n)}function ya(e){let t=`${e}/confirm`,n=window.screenLeft===void 0?window.screenX:window.screenLeft,r=window.screenTop===void 0?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,o=i/2-240+n,s=a/2-300+r;return new _a(window.open(t,`auth.albedo.link`,`height=600,width=480,top=${s},left=${o},menubar=0,toolbar=0,location=0,status=0,personalbar=0,scrollbars=0,dependent=1`),!0).onLoaded}var ba=null;function xa(e){if(!ba){let t=document.createElement(`iframe`);t.style.border=`none`,Object.assign(t,{width:`0`,height:`0`,frameBorder:`0`,referrerPolicy:`origin`,src:`${e}`}),document.body.appendChild(t),ba=new _a(t.contentWindow)}return ba.onLoaded}function Sa({session:e,pubkey:t,grants:n,valid_until:r}){this.key=e,this.pubkey=t,this.grants=n.slice(),this.validUntil=r,Object.freeze(this),Object.freeze(this.grants)}Sa.prototype={key:``,pubkey:``,grants:[],validUntil:0,get isExpired(){return this.validUntil-2e3<new Date().getTime()},toJSON(){return{session:this.key,pubkey:this.pubkey,grants:this.grants.slice(),valid_until:this.validUntil}}};var Ca=`albedo_session_`;function wa(){return window.sessionStorage}function Ta(e){let t=new Sa(e);wa().setItem(Ca+t.pubkey,JSON.stringify(t))}function Ea(e){let t;{let n=wa().getItem(Ca+e);n&&(t=new Sa(JSON.parse(n)))}return t?t.isExpired?(ka(e),null):t:null}function Da(e,t){let n=Ea(t);return!n||!n.grants.includes(e)?null:n}function Oa(){let e=wa();return Object.keys(e).filter(e=>e.indexOf(Ca)===0).map(e=>Ea(e.substr(15))).filter(e=>!!e)}function ka(e){wa().removeItem(Ca+e)}function Aa(e){return Object.assign(Error(),ga.invalidIntentRequest,{ext:e})}function ja(e,t){try{let{intent:n}=e;if(!n)throw Aa(`Parameter "intent" is required.`);let r=ha[n];if(!r)throw Aa(`Unknown intent: "${n}".`);let i=Pa(r,e);return Ma(i,t).then(e=>Na(i,e))}catch(e){let{code:t=-1,message:n,ext:r}=e,i={message:n,code:t};return r&&(i.ext=r),Promise.reject(i)}}function Ma(e,t){if(e.pubkey){let n=Da(e.intent,e.pubkey);if(n)return e.session=n.key,xa(t)}return setTimeout(()=>{e.intent===`implicit_flow`&&xa(t)},200),ya(t)}function Na(e,t){return t.postMessage(e).then(e=>(e.intent===`implicit_flow`&&e.granted&&Ta(e),e))}function Pa(e,t){if(typeof t!=`object`)throw Aa(`Intent parameters expected.`);let{intent:n,pubkey:r}=t,i={intent:n};if(r&&!/^G[0-9A-Z]{55}$/.test(r))throw Aa(`Invalid "pubkey" parameter. Stellar account public key expected.`);for(let r in e.params){let a=e.params[r],o=t[r];if(o)i[r]=o;else if(a.required)throw Aa(`Parameter "${r}" is required for intent "${n}".`)}return i}function Fa(e=null){e===null&&(e=window.location.search),e[0]===`?`&&(e=e.substr(1));let t={};for(let n of e.split(`&`)){let[e,r]=n.split(`=`).map(e=>decodeURIComponent(e));t[e]=r}return t}function Ia(e){typeof document<`u`&&document.addEventListener&&document.addEventListener(`click`,function(t){if(t.target.tagName!==`A`||(t.target.href||``).indexOf(`web+stellar:`)!==0)return;t.preventDefault(),t.stopImmediatePropagation();let{pathname:n,search:r}=new URL(t.target.href);if(![`tx`,`pay`].includes(n)){alert(`Invalid operation requested: ${n}. It's likely an external application error. Please contact support team of ${window.location.origin}.`);return}let i=Fa(r);e.request(n,i)},!1)}if(typeof window==`object`&&typeof window.fetch!=`function`)throw Error(`Browser FetchAPI is not available. For legacy browsers support use polyfills such as whatwg-fetch.`);function La(){}La.prototype={frontendUrl:`https://albedo.link`,intentInterface:ha,intentErrors:ga,request(e,t){return ja(Object.assign(t||{},{intent:e}),this.frontendUrl)},implicitFlow(e){return this.request(`implicit_flow`,e)},publicKey(e){return e=Object.assign({},e),e.token||(e.token=ma()),this.request(`public_key`,e)},tx(e){return this.request(`tx`,e)},batch(e){return this.request(`batch`,e)},pay(e){return this.request(`pay`,e)},trust(e){return this.request(`trust`,e)},exchange(e){return this.request(`exchange`,e)},signMessage(e){return e=Object.assign({},e,{message:Ra(e.message)}),this.request(`sign_message`,e)},manageAccount(e){return this.request(`manage_account`,e)},generateRandomToken(){return ma()},isImplicitSessionAllowed(e,t){return!!Da(e,t)},listImplicitSessions(){return Oa()},forgetImplicitSession(e){ka(e)}};function Ra(e){switch(typeof e){case`string`:return e;case`undefined`:return``}return JSON.stringify(e)}var za=new La;za.default=za,Ia(za);var Ba;(function(e){e.AUTH_OPTIONS=`AUTH_OPTIONS`,e.HELP_PAGE=`HELP_PAGE`,e.PROFILE_PAGE=`PROFILE_PAGE`,e.HW_ACCOUNTS_FETCHER=`HW_ACCOUNTS_FETCHER`})(Ba||={});var Va;(function(e){e.FIXED=`FIXED`,e.BLOCK=`BLOCK`,e.HIDDEN=`HIDDEN`})(Va||={});var Ha={background:`#fcfcfcff`,"background-secondary":`#f8f8f8ff`,"foreground-strong":`#000000`,foreground:`#161619ff`,"foreground-secondary":`#2d2d31ff`,primary:`#3b82f6`,"primary-foreground":`#ffffff`,transparent:`rgba(0, 0, 0, 0)`,lighter:`#fcfcfc`,light:`#f8f8f8`,"light-gray":`oklch(0.800 0.006 286.033)`,gray:`oklch(0.600 0.006 286.033)`,danger:`oklch(57.7% 0.245 27.325)`,border:`rgba(0, 0, 0, 0.15)`,shadow:`0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)`,"border-radius":`0.5rem`,"font-family":`sans-serif`},Ua;(function(e){e.usedWalletsIds=`@StellarWalletsKit/usedWalletsIds`,e.activeAddress=`@StellarWalletsKit/activeAddress`,e.selectedModuleId=`@StellarWalletsKit/selectedModuleId`,e.hardwareWalletPaths=`@StellarWalletsKit/hardwareWalletPaths`,e.wcSessionPaths=`@StellarWalletsKit/wcSessionPaths`})(Ua||={});var Wa;(function(e){e.PUBLIC=`Public Global Stellar Network ; September 2015`,e.TESTNET=`Test SDF Network ; September 2015`,e.FUTURENET=`Test SDF Future Network ; October 2022`,e.SANDBOX=`Local Sandbox Stellar Network ; September 2022`,e.STANDALONE=`Standalone Network ; February 2017`})(Wa||={});var Ga;(function(e){e.HW_WALLET=`HW_WALLET`,e.HOT_WALLET=`HOT_WALLET`,e.BRIDGE_WALLET=`BRIDGE_WALLET`,e.AIR_GAPED_WALLET=`AIR_GAPED_WALLET`})(Ga||={});var Ka;(function(e){e.STATE_UPDATED=`STATE_UPDATE`,e.WALLET_SELECTED=`WALLET_SELECTED`,e.DISCONNECT=`DISCONNECT`})(Ka||={});var qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co={},lo=[],uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fo=Array.isArray;function po(e,t){for(var n in t)e[n]=t[n];return e}function mo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ho(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?qa.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return go(e,o,r,i,null)}function go(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ya,__i:-1,__u:0};return i==null&&Ja.vnode!=null&&Ja.vnode(a),a}function _o(e){return e.children}function vo(e,t){this.props=e,this.context=t}function yo(e,t){if(t==null)return e.__?yo(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?yo(e):null}function bo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=po({},t);a.__v=t.__v+1,Ja.vnode&&Ja.vnode(a),jo(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??yo(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,No(r,a,i),t.__e=t.__=null,a.__e!=n&&xo(a)}}function xo(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),xo(e)}function So(e){(!e.__d&&(e.__d=!0)&&Za.push(e)&&!Co.__r++||Qa!=Ja.debounceRendering)&&((Qa=Ja.debounceRendering)||$a)(Co)}function Co(){try{for(var e,t=1;Za.length;)Za.length>t&&Za.sort(eo),e=Za.shift(),t=Za.length,bo(e)}finally{Za.length=Co.__r=0}}function wo(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||lo,v=t.length;for(c=To(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||co,p.__i=d,g=jo(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Io(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=Eo(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function To(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=go(null,o,null,null,null):fo(o)?o=e.__k[a]=go(_o,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=go(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=Do(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=yo(s)),Lo(s,s));return r}function Eo(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Eo(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=yo(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Do(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Oo(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||uo.test(t)?n:n+`px`}function ko(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Oo(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Oo(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(io,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[ro]=r[ro]:(n[ro]=ao,e.addEventListener(t,a?so:oo,a)):e.removeEventListener(t,a?so:oo,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Ao(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[no]==null)t[no]=ao++;else if(t[no]<n[ro])return;return n(Ja.event?Ja.event(t):t)}}}function jo(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=Ja.__b)&&u(t);n:if(typeof E==`function`){d=o.length;try{if(v=t.props,y=E.prototype&&E.prototype.render,b=(u=E.contextType)&&r[u.__c],x=u?b?b.props.value:u.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new E(v,x):(t.__c=f=new vo(v,x),f.constructor=E,f.render=Ro),b&&b.sub(f),f.state||(f.state={}),f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&E.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=po({},f.__s)),po(f.__s,E.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&E.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&E.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),lo.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=yo(n);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__e=!1,S=Ja.__r,C=0,y)f.state=f.__s,f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),lo.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(r=po(po({},r),f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=u!=null&&u.type===_o&&u.key==null?Po(u.props.children):u,s=wo(e,fo(w)?w:[w],t,n,r,i,a,o,s,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a!=null&&(a[a.indexOf(s)]=null),t.__e=s}else if(a!=null)for(T=a.length;T--;)mo(a[T])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||Mo(t),Ja.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Fo(n.__e,t,n,r,i,a,o,c,l);return(u=Ja.diffed)&&u(t),128&t.__u?void 0:s}function Mo(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Mo))}function No(e,t,n){for(var r=0;r<n.length;r++)Io(n[r],n[++r],n[++r]);Ja.__c&&Ja.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Ja.__e(e,t.__v)}})}function Po(e){return typeof e!=`object`||!e||e.__b>0?e:fo(e)?e.map(Po):e.constructor===void 0?po({},e):null}function Fo(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||co,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&=(Ja.__m&&Ja.__m(t,a),!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=v==`textarea`&&_.defaultValue!=null?null:a&&qa.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`dangerouslySetInnerHTML`?d=p:l==`children`||l in _||l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _||ko(e,l,null,p,i);for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||ko(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),wo(t.type==`template`?e.content:e,fo(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&yo(n,0),s,c),a!=null)for(l=a.length;l--;)mo(a[l]);s&&v!=`textarea`||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&ko(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&ko(e,l,h,g[l],i))}return e}function Io(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){Ja.__e(e,n)}}function Lo(e,t,n){var r,i;if(Ja.unmount&&Ja.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Io(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Ja.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Lo(r[i],t,n||typeof e.type!=`function`);n||mo(e.__e),e.__c=e.__=e.__e=void 0}function Ro(e,t,n){return this.constructor(e,n)}function zo(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),Ja.__&&Ja.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],jo(t,e=(!r&&n||t).__k=ho(_o,null,[e]),i||co,co,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?qa.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),No(a,e,o),e.props.children=null}qa=lo.slice,Ja={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Ya=0,Xa=function(e){return e!=null&&e.constructor===void 0},vo.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=po({},this.state);typeof e==`function`&&(e=e(po({},n),this.props)),e&&po(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),So(this))},vo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),So(this))},vo.prototype.render=_o,Za=[],$a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,eo=function(e,t){return e.__v.__b-t.__v.__b},Co.__r=0,to=Math.random().toString(8),no=`__d`+to,ro=`__a`+to,io=/(PointerCapture)$|Capture$/i,ao=0,oo=Ao(!1),so=Ao(!0);var Bo,Vo,Ho,Uo,Wo=0,Go=[],Ko=Ja,qo=Ko.__b,Jo=Ko.__r,Yo=Ko.diffed,Xo=Ko.__c,Zo=Ko.unmount,Qo=Ko.__;function $o(e,t){Ko.__h&&Ko.__h(Vo,e,Wo||t),Wo=0;var n=Vo.__H||(Vo.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function es(e){return Wo=1,ts(us,e)}function ts(e,t,n){var r=$o(Bo++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):us(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Vo,!Vo.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};Vo.__f=!0;var a=Vo.shouldComponentUpdate,o=Vo.componentWillUpdate;Vo.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Vo.shouldComponentUpdate=i}return r.__N||r.__}function ns(e,t){var n=$o(Bo++,3);!Ko.__s&&ls(n.__H,t)&&(n.__=e,n.u=t,Vo.__H.__h.push(n))}function rs(e,t){var n=$o(Bo++,7);return ls(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function is(){for(var e;e=Go.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ss),t.__h.some(cs),t.__h=[]}catch(n){t.__h=[],Ko.__e(n,e.__v)}}}Ko.__b=function(e){Vo=null,qo&&qo(e)},Ko.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Qo&&Qo(e,t)},Ko.__r=function(e){Jo&&Jo(e),Bo=0;var t=(Vo=e.__c).__H;t&&(Ho===Vo?(t.__h=[],Vo.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(ss),t.__h.some(cs),t.__h=[],Bo=0)),Ho=Vo},Ko.diffed=function(e){Yo&&Yo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Go.push(t)!==1&&Uo===Ko.requestAnimationFrame||((Uo=Ko.requestAnimationFrame)||os)(is)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),Ho=Vo=null},Ko.__c=function(e,t){t.some(function(e){try{e.__h.some(ss),e.__h=e.__h.filter(function(e){return!e.__||cs(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Ko.__e(n,e.__v)}}),Xo&&Xo(e,t)},Ko.unmount=function(e){Zo&&Zo(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{ss(e)}catch(e){t=e}}),n.__H=void 0,t&&Ko.__e(t,n.__v))};var as=typeof requestAnimationFrame==`function`;function os(e){var t,n=function(){clearTimeout(r),as&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);as&&(t=requestAnimationFrame(n))}function ss(e){var t=Vo,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Vo=t}function cs(e){var t=Vo;e.__c=e.__(),Vo=t}function ls(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function us(e,t){return typeof t==`function`?t(e):t}var ds=Symbol.for(`preact-signals`);function fs(){if(vs>1)vs--;else{var e,t=!1;for((function(){var e=Ss;for(Ss=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();_s!==void 0;){var n=_s;for(_s=void 0,ys++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ds(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ys=0,vs--,t)throw e}}function ps(e){if(vs>0)return e();xs=++bs,vs++;try{return e()}finally{fs()}}var ms,hs=void 0;function gs(e){var t=hs,n=ms;hs=void 0,ms=void 0;try{return e()}finally{hs=t,ms=n}}var _s=void 0,vs=0,ys=0,bs=0,xs=0,Ss=void 0,Cs=0;function ws(e){if(hs!==void 0){var t=e.n;if(t===void 0||t.t!==hs)return t={i:0,S:e,p:hs.s,n:void 0,t:hs,e:void 0,x:void 0,r:t},hs.s!==void 0&&(hs.s.n=t),hs.s=t,e.n=t,32&hs.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=hs.s,t.n=void 0,hs.s.n=t,hs.s=t),t}}function Ts(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Ts.prototype.brand=ds,Ts.prototype.h=function(){return!0},Ts.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?gs(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},Ts.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&gs(function(){var e;(e=t.Z)==null||e.call(t)}))}},Ts.prototype.subscribe=function(e){var t=this;return Is(function(){var n=t.value;gs(function(){return e(n)})},{name:`sub`})},Ts.prototype.valueOf=function(){return this.value},Ts.prototype.toString=function(){return this.value+``},Ts.prototype.toJSON=function(){return this.value},Ts.prototype.peek=function(){var e=this;return gs(function(){return e.value})},Object.defineProperty(Ts.prototype,"value",{get:function(){var e=ws(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ys>100)throw Error(`Cycle detected`);(function(e){vs!==0&&ys===0&&e.l!==xs&&(e.l=xs,Ss={S:e,v:e.v,i:e.i,o:Ss})})(this),this.v=e,this.i++,Cs++,vs++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{fs()}}}});function Es(e,t){return new Ts(e,t)}function Ds(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Os(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ks(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function As(e,t){Ts.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Cs-1,this.f=4}As.prototype=new Ts,As.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cs))return!0;if(this.g=Cs,this.f|=1,this.i>0&&!Ds(this))return this.f&=-2,!0;var e=hs;try{Os(this),hs=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return hs=e,ks(this),this.f&=-2,!0},As.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ts.prototype.S.call(this,e)},As.prototype.U=function(e){if(this.t!==void 0&&(Ts.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},As.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(As.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=ws(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function js(e,t){return new As(e,t)}function Ms(e){var t=e.j;if(e.j=void 0,typeof t==`function`){vs++;var n=hs;hs=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Ns(e),t}finally{hs=n,fs()}}}function Ns(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ms(e)}function Ps(e){if(hs!==this)throw Error(`Out-of-order effect`);ks(this),hs=e,this.f&=-2;try{8&this.f&&Ns(this)}finally{fs()}}function Fs(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ms&&ms.push(this)}Fs.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},Fs.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Ms(this),Os(this),vs++;var e=hs;return hs=this,Ps.bind(this,e)},Fs.prototype.N=function(){2&this.f||(this.f|=2,this.u=_s,_s=this)},Fs.prototype.d=function(){this.f|=8,1&this.f||Ns(this)},Fs.prototype.dispose=function(){this.d()};function Is(e,t){var n=new Fs(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ls,Rs,zs=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,Bs=[];Is(function(){Ls=this.N})();function Vs(e,t){Ja[e]=t.bind(null,Ja[e]||function(){})}function Hs(e){if(Rs){var t=Rs;Rs=void 0,t()}Rs=e&&e.S()}function Us(e){var t=this,n=e.data,r=Gs(n);r.value=n;var i=rs(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var i=js(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),a=js(function(){return!Array.isArray(i.value)&&!Xa(i.value)}),o=Is(function(){if(this.N=Js,a.value){var t=i.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),s=t.__$u.d;return t.__$u.d=function(){o(),s.call(this)},[a,i]},[]),a=i[0],o=i[1];return a.value?o.peek():o.value}Us.displayName=`ReactiveTextNode`,Object.defineProperties(Ts.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Us},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),Vs(`__b`,function(e,t){if(typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof Ts&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),Vs(`__r`,function(e,t){if(e(t),t.type!==_o){Hs();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return Is(function(){n=this},{name:t}),n.c=e,n}(function(){var e;zs&&((e=n.y)==null||e.call(n)),r.__$f|=1,r.setState({})},typeof t.type==`function`?t.type.displayName||t.type.name:``))),Hs(n)}}),Vs(`__e`,function(e,t,n,r){Hs(),e(t,n,r)}),Vs(`diffed`,function(e,t){Hs();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props;if(r){var a=n.U;if(a)for(var o in a){var s=a[o];s!==void 0&&!(o in r)&&(s.d(),a[o]=void 0)}else a={},n.U=a;for(var c in r){var l=a[c],u=r[c];l===void 0?(l=Ws(n,c,u),a[c]=l):l.o(u,i)}for(var d in r)i[d]=r[d]}}e(t)});function Ws(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=Es(n),o=n.peek();return{o:function(e,t){a.value=e,o=e.peek()},d:Is(function(){this.N=Js;var n=a.value.value;o===n?o=void 0:(o=void 0,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}Vs(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}t.__np=void 0}else{var o=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)}),Vs(`__h`,function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)}),vo.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Gs(e,t){return rs(function(){return Es(e,t)},[])}var Ks=function(e){queueMicrotask(function(){queueMicrotask(e)})};function qs(){ps(function(){for(var e;e=Bs.shift();)Ls.call(e)})}function Js(){Bs.push(this)===1&&(Ja.requestAnimationFrame||Ks)(qs)}var Ys=globalThis.localStorage,Xs=Es(Va.FIXED),Zs=Es(`Connect a Wallet`),Qs=Es(!0),$s=Es(!0),ec=Es(`Install`);Es(`https://horizon.stellar.org`);var tc=Es(Wa.PUBLIC),nc=Es(Ha),rc=Es(Ba.AUTH_OPTIONS),ic=Es([Ba.AUTH_OPTIONS]),ac=Es(Ys?.getItem(Ua.activeAddress)||void 0),oc=Es(Ys?.getItem(Ua.selectedModuleId)||void 0),sc=Es([]),cc=Es([]),lc=js(()=>cc.value.find(e=>e.productId===oc.value)),uc=Ys?.getItem(Ua.hardwareWalletPaths),dc=Es(JSON.parse(uc||`[]`)),fc=js(()=>{let e=dc.value.find(({publicKey:e})=>e===ac.value);if(e)return`44'/148'/${e.index}'`}),pc=Ys?.getItem(Ua.wcSessionPaths),mc=Es(JSON.parse(pc||`[]`));function hc(){ic.value=[],dc.value=[],mc.value=[],ac.value=void 0,oc.value=void 0}function gc(){let e=Es(null),t=`active`,n=null,r=new Set,i=new Set,a=new Set;Is(()=>{if(t===`active`&&e.value!==null){let t=e.value;e.value=null;for(let e of r)e(t)}});function o(){r.clear(),i.clear(),a.clear()}return{next(n){t===`active`&&(e.value=n)},error(e){if(t===`active`){t=`error`,n=e;for(let t of i)t(e);o()}},complete(){if(t===`active`){t=`completed`;for(let e of a)e();o()}},subscribe(e,o,s){return t===`error`?(o?.(n),()=>{}):t===`completed`?(s?.(),()=>{}):(e&&r.add(e),o&&i.add(o),s&&a.add(s),()=>{e&&r.delete(e),o&&i.delete(o),s&&a.delete(s)})},isCompleted(){return t===`completed`},hasError(){return t===`error`}}}var _c=gc(),vc=gc(),yc=gc(),bc=gc();function H(e){return{code:e?.error?.code||e?.code||-1,message:e?.error?.message||e?.message||typeof e==`string`&&e||`Unhandled error from the wallet`,ext:e?.error?.ext||e?.ext}}function xc(){lc.value?.disconnect&&lc.value.disconnect(),hc(),bc.next(),yc.next()}var Sc=za.default,Cc=`albedo`,wc=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Cc}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Albedo`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://albedo.link/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/albedo.png`})}async isAvailable(){return!0}async getAddress(){try{return{address:(await Sc.publicKey({})).pubkey}}catch(e){throw H(e)}}async signTransaction(e,t){try{let{signed_envelope_xdr:n}=await Sc.tx({xdr:e,pubkey:t?.address,network:t?.networkPassphrase?t.networkPassphrase===Wa.PUBLIC?Tc.PUBLIC:Tc.TESTNET:void 0});return{signedTxXdr:n,signerAddress:t?.address}}catch(e){throw H(e)}}async signAuthEntry(){throw{code:-3,message:`Albedo does not support the "signAuthEntry" function`}}async signMessage(){throw{code:-3,message:`Albedo does not support the "signMessage" function`}}async getNetwork(){throw{code:-3,message:`Albedo does not support the "getNetwork" function`}}},Tc;(function(e){e.PUBLIC=`public`,e.TESTNET=`testnet`})(Tc||={});var Ec=`BitgetWallet`,Dc=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Ec}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Bitget Wallet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://web3.bitget.com`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/bitget.png`}),Object.defineProperty(this,"provider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.provider=typeof window<`u`?window.bitkeep?.stellar:void 0}async runChecks(){if(!await this.isAvailable())throw Error(`${this.productName} is not connected`)}async isAvailable(){return!!this.provider}async getAddress(){try{return await this.runChecks(),{address:await this.provider.connect()}}catch(e){throw H(e)}}async signMessage(e,t){try{return await this.runChecks(),{signedMessage:await this.provider.signMessage(e,t?.address)}}catch(e){throw H(e)}}async signTransaction(e,t){try{return await this.runChecks(),{signedTxXdr:await this.provider.signTransaction(e,t)}}catch(e){throw H(e)}}async signAuthEntry(){throw{code:-3,message:`${this.productName} does not support the "signAuthEntry" function`}}async getNetwork(){try{return await this.runChecks(),this.provider.network()}catch(e){throw H(e)}}},Oc=`cactuslink`,kc=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Oc}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Cactus Link`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://www.mycactus.com`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/cactuslink.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Cactus Link is not installed`)}async isAvailable(){return typeof window<`u`&&!!window.cactuslink_stellar}async getAddress(e){try{if(await this.runChecks(),e?.skipRequestAccess!==!0){let e=await window.cactuslink_stellar.requestAccess();if(e.error)return Promise.reject(H(e.error))}let{address:t}=await window.cactuslink_stellar.getAddress();return t?{address:t}:Promise.reject({code:-3,message:`Getting the address from Cactus Link is not allowed, please request access first.`})}catch(e){throw H(e)}}async signTransaction(e,t){try{await this.runChecks();let{signedTxXdr:n}=await window.cactuslink_stellar.signTransaction(e,t);return{signedTxXdr:n}}catch(e){throw H(e)}}async signAuthEntry(e,t){try{await this.runChecks();let{signedAuthEntry:n}=await window.cactuslink_stellar.signAuthEntry(e,t);return n?{signedAuthEntry:n}:Promise.reject({code:-3,message:`signedAuthEntry returned from Cactus Link is undefined.`})}catch(e){throw H(e)}}async signMessage(e,t){try{await this.runChecks();let{signedMessage:n}=await window.cactuslink_stellar.signMessage(e,t);return n?{signedMessage:n}:Promise.reject({code:-3,message:`signedMessage returned from Cactus Link is undefined.`})}catch(e){throw H(e)}}async getNetwork(){try{await this.runChecks();let{network:e,networkPassphrase:t,error:n}=await window.cactuslink_stellar.getNetwork();return n?Promise.reject(n):{network:e,networkPassphrase:t}}catch(e){throw H(e)}}},Ac=`dcent`,jc=800,Mc=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Ac}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`D'CENT Wallet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://dcentwallet.com`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iYmciIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzIxMjIyNSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxYjFjMWUiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgPC9kZWZzPgoKICA8IS0tIERhcmsgYmFja2dyb3VuZCAtLT4KICA8cmVjdCB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHJ4PSI3IiBmaWxsPSIjMWIxYzFlIi8+CgogIDwhLS0KICAgIEQnQ0VOVCBsb2dvIHBhdGhzIOKAlCBvcmlnaW5hbCB2aWV3Qm94OiAwIDAgNjQgNzIKICAgIFNjYWxlOiAyMi82NCDiiYggMC4zNDM4LCBjZW50ZXJlZCBpbiAzMngzMjoKICAgICAgeCBvZmZzZXQgPSAoMzIgLSAyMikgLyAyID0gNQogICAgICB5IG9mZnNldCA9ICgzMiAtIDIyICogNzIvNjQpIC8gMiA9ICgzMiAtIDI0Ljc1KSAvIDIg4omIIDMuNjMKICAgIENvbG9ycyBmcm9tIGxpZ2h0LW1vZGUgdG9rZW5zIChzdGFuZGFsb25lIFNWRywgbm8gQ1NTIHZhcnMpOgogICAgICBtaW50ICA9ICMyN2M0YjggKGdyYXBoaWNfbG9nb19taW50KQogICAgICBncmV5MSA9ICNhNGE3YTkgKGdyYXBoaWNfbG9nb19ncmV5KQogICAgICBncmV5MiA9ICM2ZDZlNzEgKGdyYXBoaWNfbG9nb19ncmV5XzIpCiAgLS0+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSwgMy42Mykgc2NhbGUoMC4zNDM4KSI+CiAgICA8IS0tIFRvcC1yaWdodCBzbWFsbCBwaWVjZTogZ3JleTEgLS0+CiAgICA8cGF0aCBkPSJNMzIuODgyOCAxMy41OTgyTDM4LjIzNzYgMTAuNDk5OVYzLjA5ODMyTDMyLjg4MjggMFYxMy41OTgyWiIgZmlsbD0iI2E0YTdhOSIvPgogICAgPCEtLSBMYXJnZSBsZWZ0IGJvZHk6IEQnQ0VOVCBncmVlbiAtLT4KICAgIDxwYXRoIGQ9Ik0xMy4xNjE1IDQ1LjgwNjVWMjQuOTk5MkwzMS4xMDUyIDE0LjY0MVYwTDEuNDcxODQgMTcuMTQyQzEuMTk1OSAxNy4zMDI4IDAuOTY2NzE1IDE3LjUzMzIgMC44MDcxOTkgMTcuODEwNEMwLjY0NzY4MiAxOC4wODc1IDAuNTYzMzExIDE4LjQwMTYgMC41NjI1IDE4LjcyMTVWNTMuMTQ3M0wxMy4xNjE1IDQ1LjgwNjVaIiBmaWxsPSIjMGRiMjYzIi8+CiAgICA8IS0tIEJvdHRvbSB3aWRlIHNoYXBlOiBncmV5MiAtLT4KICAgIDxwYXRoIGQ9Ik00OS44NzcyIDQ3LjI3MzRMMzEuOTYzNCA1Ny42MzE2TDE0LjE2MTIgNDcuMzM0MkwxLjUxMTcyIDU0LjY1NDdMMzEuMTA0NiA3MS43NTYyQzMxLjM4MTQgNzEuOTE1NCAzMS42OTQ4IDcxLjk5OTEgMzIuMDEzOSA3MS45OTkyQzMyLjMzMzIgNzIuMDAwNSAzMi42NDcgNzEuOTE2NyAzMi45MjMzIDcxLjc1NjJMNjIuNTY2NiA1NC42MDQxTDQ5Ljg3NzIgNDcuMjczNFoiIGZpbGw9IiM2ZDZlNzEiLz4KICAgIDwhLS0gUmlnaHQgdGFsbCBzaGFwZTogZ3JleTEgLS0+CiAgICA8cGF0aCBkPSJNNjIuNTE0NiAxNy4xMzc5TDUwLjc2NDMgMTAuMzQzOFYxNy43NDUzTDM4LjE3NTggMjUuMDQ1Nkw1MC44MDQ5IDMyLjM0NTlWNDUuNjgwOUw2My40MzQzIDUzLjA0MTlWMTguNzE3NEM2My40MzIzIDE4LjM5NjQgNjMuMzQ2MSAxOC4wODE3IDYzLjE4NDkgMTcuODA0NEM2My4wMjM2IDE3LjUyNzMgNjIuNzkyNCAxNy4yOTc0IDYyLjUxNDYgMTcuMTM3OVoiIGZpbGw9IiNhNGE3YTkiLz4KICAgIDwhLS0gQ2VudGVyIGRpYW1vbmQ6IGdyZXkyIC0tPgogICAgPHBhdGggZD0iTTI1LjY5OTIgMzIuMjU4NkwyNS43MDkzIDQ2Ljc1OEwzNy45OTUxIDM5LjY1VjI1LjE0MDZMMjUuNjk5MiAzMi4yNTg2WiIgZmlsbD0iIzZkNmU3MSIvPgogIDwvZz4KPC9zdmc+Cg==`})}getProvider(){let e=window.dcentStellarProvider;if(!e)throw H({code:-1,message:`D'CENT Stellar provider is not available`});return e}async isAvailable(){return this.isSentinelReady()||await new Promise(e=>{let t=setTimeout(()=>e(!1),jc),n=()=>{clearTimeout(t),e(!0)};window.addEventListener(`dcent#initialized`,n,{once:!0}),this.isSentinelReady()&&(clearTimeout(t),window.removeEventListener(`dcent#initialized`,n),e(!0))})&&this.isSentinelReady()?this.connected():!1}isSentinelReady(){return window.stellar?.provider===`dcent`&&!!window.dcentStellarProvider}async connected(){try{let{isConnected:e}=await this.getProvider().isConnected();return e}catch(e){return console.error(e),!1}}isPlatformWrapper(){return Promise.resolve(window.stellar?.provider===`dcent`&&window.stellar?.platform===`mobile`)}async getAddress(e){try{let t=this.getProvider();e?.skipRequestAccess!==!0&&await t.requestAccess().catch(()=>void 0);let{address:n,error:r}=await t.getAddress();return r?Promise.reject(H(r)):n?{address:n}:Promise.reject({code:-3,message:`Getting the address from D'CENT is not allowed, please request access first.`})}catch(e){throw H(e)}}async signTransaction(e,t){try{let{signedTxXdr:n,signerAddress:r,error:i}=await this.getProvider().signTransaction(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(H(i)):{signedTxXdr:n,signerAddress:r}}catch(e){throw H(e)}}async signAuthEntry(e,t){try{let{signedAuthEntry:n,signerAddress:r,error:i}=await this.getProvider().signAuthEntry(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(H(i)):n?{signedAuthEntry:n,signerAddress:r}:Promise.reject({code:-3,message:`signedAuthEntry returned from D'CENT is undefined.`})}catch(e){throw H(e)}}async signMessage(e,t){try{let{signedMessage:n,signerAddress:r,error:i}=await this.getProvider().signMessage(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(H(i)):n?{signedMessage:n,signerAddress:r}:Promise.reject({code:-3,message:`signedMessage returned from D'CENT is undefined.`})}catch(e){throw H(e)}}async getNetwork(){try{let{network:e,networkPassphrase:t,error:n}=await this.getProvider().getNetwork();return n?Promise.reject(H(n)):{network:e,networkPassphrase:t}}catch(e){throw H(e)}}},Nc=`FREIGHTER_EXTERNAL_MSG_REQUEST`,Pc=`FREIGHTER_EXTERNAL_MSG_RESPONSE`,Fc=0;function Ic(e,t){return new Promise((n,r)=>{let i=++Fc,a=e=>{e.source===window&&e.data?.source===Pc&&e.data?.messagedId===i&&(window.removeEventListener(`message`,a),e.data.apiError?r(e.data.apiError):n(e.data))};window.addEventListener(`message`,a),window.postMessage({source:Nc,messageId:i,type:e,...t},window.location.origin)})}var Lc=`fordefi`,Rc=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Lc}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Fordefi`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://www.fordefi.com`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/fordefi.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Fordefi is not installed`)}async isAvailable(){return typeof window<`u`&&!!window.FordefiProviders?.StellarProvider}async getAddress(){try{await this.runChecks();let{publicKey:e}=await Ic(`REQUEST_ACCESS`);return e?{address:e}:Promise.reject({code:-3,message:`Failed to get address from Fordefi.`})}catch(e){throw H(e)}}async signTransaction(e,t){try{await this.runChecks();let{signedTransaction:n,signerAddress:r}=await Ic(`SUBMIT_TRANSACTION`,{transactionXdr:e,networkPassphrase:t?.networkPassphrase,accountToSign:t?.address});return n?{signedTxXdr:n,signerAddress:r}:Promise.reject({code:-3,message:`Failed to sign transaction with Fordefi.`})}catch(e){throw H(e)}}signAuthEntry(){return Promise.reject({code:-3,message:`Fordefi does not support the "signAuthEntry" function`})}async signMessage(e,t){try{await this.runChecks();let{signedBlob:n,signerAddress:r}=await Ic(`SUBMIT_BLOB`,{blob:e,networkPassphrase:t?.networkPassphrase,accountToSign:t?.address});return n?{signedMessage:n,signerAddress:r}:Promise.reject({code:-3,message:`Failed to sign message with Fordefi.`})}catch(e){throw H(e)}}async getNetwork(){try{await this.runChecks();let{networkDetails:e}=await Ic(`REQUEST_NETWORK_DETAILS`);return{network:e.network,networkPassphrase:e.networkPassphrase}}catch(e){throw H(e)}}},zc=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.freighterApi=r():n.freighterApi=r()})(n,()=>(()=>{var e,t,n={d:(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};n.r(r),n.d(r,{WatchWalletChanges:()=>S,addToken:()=>f,default:()=>w,getAddress:()=>d,getNetwork:()=>_,getNetworkDetails:()=>v,isAllowed:()=>y,isBrowser:()=>C,isConnected:()=>g,requestAccess:()=>x,setAllowed:()=>b,signAuthEntry:()=>h,signMessage:()=>m,signTransaction:()=>p}),function(e){e.CREATE_ACCOUNT=`CREATE_ACCOUNT`,e.FUND_ACCOUNT=`FUND_ACCOUNT`,e.ADD_ACCOUNT=`ADD_ACCOUNT`,e.IMPORT_ACCOUNT=`IMPORT_ACCOUNT`,e.IMPORT_HARDWARE_WALLET=`IMPORT_HARDWARE_WALLET`,e.LOAD_ACCOUNT=`LOAD_ACCOUNT`,e.MAKE_ACCOUNT_ACTIVE=`MAKE_ACCOUNT_ACTIVE`,e.UPDATE_ACCOUNT_NAME=`UPDATE_ACCOUNT_NAME`,e.GET_MNEMONIC_PHRASE=`GET_MNEMONIC_PHRASE`,e.CONFIRM_MNEMONIC_PHRASE=`CONFIRM_MNEMONIC_PHRASE`,e.CONFIRM_MIGRATED_MNEMONIC_PHRASE=`CONFIRM_MIGRATED_MNEMONIC_PHRASE`,e.RECOVER_ACCOUNT=`RECOVER_ACCOUNT`,e.CONFIRM_PASSWORD=`CONFIRM_PASSWORD`,e.REJECT_ACCESS=`REJECT_ACCESS`,e.GRANT_ACCESS=`GRANT_ACCESS`,e.ADD_TOKEN=`ADD_TOKEN`,e.SIGN_TRANSACTION=`SIGN_TRANSACTION`,e.SIGN_BLOB=`SIGN_BLOB`,e.SIGN_AUTH_ENTRY=`SIGN_AUTH_ENTRY`,e.HANDLE_SIGNED_HW_PAYLOAD=`HANDLE_SIGNED_HW_PAYLOAD`,e.REJECT_TRANSACTION=`REJECT_TRANSACTION`,e.SIGN_FREIGHTER_TRANSACTION=`SIGN_FREIGHTER_TRANSACTION`,e.SIGN_FREIGHTER_SOROBAN_TRANSACTION=`SIGN_FREIGHTER_SOROBAN_TRANSACTION`,e.ADD_RECENT_ADDRESS=`ADD_RECENT_ADDRESS`,e.LOAD_RECENT_ADDRESSES=`LOAD_RECENT_ADDRESSES`,e.LOAD_LAST_USED_ACCOUNT=`LOAD_LAST_USED_ACCOUNT`,e.SIGN_OUT=`SIGN_OUT`,e.SHOW_BACKUP_PHRASE=`SHOW_BACKUP_PHRASE`,e.SAVE_ALLOWLIST=`SAVE_ALLOWLIST`,e.SAVE_SETTINGS=`SAVE_SETTINGS`,e.SAVE_EXPERIMENTAL_FEATURES=`SAVE_EXPERIMENTAL_FEATURES`,e.LOAD_SETTINGS=`LOAD_SETTINGS`,e.GET_CACHED_ASSET_ICON=`GET_CACHED_ASSET_ICON`,e.CACHE_ASSET_ICON=`CACHE_ASSET_ICON`,e.GET_CACHED_ASSET_DOMAIN=`GET_CACHED_ASSET_DOMAIN`,e.CACHE_ASSET_DOMAIN=`CACHE_ASSET_DOMAIN`,e.GET_MEMO_REQUIRED_ACCOUNTS=`GET_MEMO_REQUIRED_ACCOUNTS`,e.ADD_CUSTOM_NETWORK=`ADD_CUSTOM_NETWORK`,e.CHANGE_NETWORK=`CHANGE_NETWORK`,e.REMOVE_CUSTOM_NETWORK=`REMOVE_CUSTOM_NETWORK`,e.EDIT_CUSTOM_NETWORK=`EDIT_CUSTOM_NETWORK`,e.RESET_EXP_DATA=`RESET_EXP_DATA`,e.ADD_TOKEN_ID=`ADD_TOKEN_ID`,e.GET_TOKEN_IDS=`GET_TOKEN_IDS`,e.REMOVE_TOKEN_ID=`REMOVE_TOKEN_ID`,e.GET_MIGRATABLE_ACCOUNTS=`GET_MIGRATABLE_ACCOUNTS`,e.GET_MIGRATED_MNEMONIC_PHRASE=`GET_MIGRATED_MNEMONIC_PHRASE`,e.MIGRATE_ACCOUNTS=`MIGRATE_ACCOUNTS`,e.ADD_ASSETS_LIST=`ADD_ASSETS_LIST`,e.MODIFY_ASSETS_LIST=`MODIFY_ASSETS_LIST`,e.CHANGE_ASSET_VISIBILITY=`CHANGE_ASSET_VISIBILITY`,e.GET_HIDDEN_ASSETS=`GET_HIDDEN_ASSETS`,e.GET_IS_ACCOUNT_MISMATCH=`GET_IS_ACCOUNT_MISMATCH`}(e||={}),function(e){e.REQUEST_ACCESS=`REQUEST_ACCESS`,e.REQUEST_PUBLIC_KEY=`REQUEST_PUBLIC_KEY`,e.SUBMIT_TOKEN=`SUBMIT_TOKEN`,e.SUBMIT_TRANSACTION=`SUBMIT_TRANSACTION`,e.SUBMIT_BLOB=`SUBMIT_BLOB`,e.SUBMIT_AUTH_ENTRY=`SUBMIT_AUTH_ENTRY`,e.REQUEST_NETWORK=`REQUEST_NETWORK`,e.REQUEST_NETWORK_DETAILS=`REQUEST_NETWORK_DETAILS`,e.REQUEST_CONNECTION_STATUS=`REQUEST_CONNECTION_STATUS`,e.REQUEST_ALLOWED_STATUS=`REQUEST_ALLOWED_STATUS`,e.SET_ALLOWED_STATUS=`SET_ALLOWED_STATUS`,e.REQUEST_USER_INFO=`REQUEST_USER_INFO`}(t||={});let i=e=>{let n=Date.now()+Math.random();return window.postMessage({source:`FREIGHTER_EXTERNAL_MSG_REQUEST`,messageId:n,...e},window.location.origin),new Promise(r=>{let i=0;e.type!==t.REQUEST_CONNECTION_STATUS&&e.type!==t.REQUEST_PUBLIC_KEY||(i=setTimeout(()=>{r({isConnected:!1,publicKey:``}),window.removeEventListener(`message`,a)},2e3));let a=e=>{e.source===window&&e?.data?.source===`FREIGHTER_EXTERNAL_MSG_RESPONSE`&&e?.data?.messagedId===n&&(r(e.data),window.removeEventListener(`message`,a),clearTimeout(i))};window.addEventListener(`message`,a,!1)})},a={code:-1,message:`Node environment is not supported`},o={code:-1,message:`The wallet encountered an internal error. Please try again or contact the wallet if the problem persists.`},s=async()=>{let e;try{e=await i({type:t.REQUEST_ACCESS})}catch(e){console.error(e)}let{publicKey:n}=e||{publicKey:``};return{publicKey:n,error:e?.apiError}},c=async()=>{let e;try{e=await i({type:t.REQUEST_PUBLIC_KEY})}catch(e){console.error(e)}return{publicKey:e?.publicKey||``,error:e?.apiError}},l=async()=>{let e;try{e=await i({type:t.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}let{networkDetails:n,apiError:r}=e||{networkDetails:{network:``,networkName:``,networkUrl:``,networkPassphrase:``,sorobanRpcUrl:void 0,apiError:``}},{network:a,networkUrl:o,networkPassphrase:s,sorobanRpcUrl:c}=n;return{network:a,networkUrl:o,networkPassphrase:s,sorobanRpcUrl:c,error:r}},u=async()=>{let e;try{e=await i({type:t.REQUEST_ALLOWED_STATUS})}catch(e){console.error(e)}let{isAllowed:n}=e||{isAllowed:!1};return{isAllowed:n,error:e?.apiError}},d=async()=>{let e=``;if(C){let t=await c();return e=t.publicKey,t.error?{address:e,error:t.error}:{address:e}}return{address:e,error:a}},f=async e=>{if(C){let n=await(async e=>{let n;try{n=await i({contractId:e.contractId,networkPassphrase:e.networkPassphrase,type:t.SUBMIT_TOKEN})}catch{return{error:o}}return{contractId:n.contractId,error:n?.apiError}})(e);return n.error?{contractId:``,error:n.error}:{contractId:n.contractId||``}}return{contractId:``,error:a}},p=async(e,n)=>{if(C){let r=await(async(e,n)=>{let r,a,s,c;typeof n==`object`?(a=n.accountToSign,s=n.networkPassphrase):(r=n,a=void 0);try{c=await i({transactionXdr:e,network:r,networkPassphrase:s,accountToSign:a,type:t.SUBMIT_TRANSACTION})}catch{return{signedTransaction:``,signerAddress:``,error:o}}let{signedTransaction:l,signerAddress:u}=c;return{signedTransaction:l,signerAddress:u,error:c?.apiError}})(e,n);return r.error?{signedTxXdr:``,signerAddress:``,error:r.error}:{signedTxXdr:r.signedTransaction,signerAddress:r.signerAddress}}return{signedTxXdr:``,signerAddress:``,error:a}},m=async(e,n)=>{if(C){let{isAllowed:r}=await u();if(!r){let e=await s();if(e.error)return{signedMessage:null,signerAddress:``,error:e.error}}let a=await(async(e,n,r)=>{let a,s=(r||{}).address;try{a=await i({blob:e,accountToSign:s,apiVersion:`6.0.0`,networkPassphrase:r?.networkPassphrase,type:t.SUBMIT_BLOB})}catch{return{signedMessage:null,signerAddress:``,error:o}}let{signedBlob:c,signerAddress:l}=a;return{signedMessage:c||null,signerAddress:l,error:a?.apiError}})(e,0,n);return a.error?{signedMessage:null,signerAddress:``,error:a.error}:{signedMessage:a.signedMessage,signerAddress:a.signerAddress}}return{signedMessage:null,signerAddress:``,error:a}},h=async(e,n)=>{if(C){let{isAllowed:r}=await u();if(!r){let e=await s();if(e.error)return{signedAuthEntry:null,signerAddress:``,error:e.error}}let a=await(async(e,n,r)=>{let a=(r||{}).address,s;try{s=await i({entryXdr:e,accountToSign:a,apiVersion:`6.0.0`,networkPassphrase:r?.networkPassphrase,type:t.SUBMIT_AUTH_ENTRY})}catch(e){return console.error(e),{signedAuthEntry:null,signerAddress:``,error:o}}let{signedAuthEntry:c,signerAddress:l}=s;return{signedAuthEntry:c||null,signerAddress:l,error:s?.apiError}})(e,0,n);return a.error?{signedAuthEntry:null,signerAddress:``,error:a.error}:{signedAuthEntry:a.signedAuthEntry,signerAddress:a.signerAddress}}return{signedAuthEntry:null,signerAddress:``,error:a}},g=async()=>C?window.freighter?Promise.resolve({isConnected:window.freighter}):(async()=>{let e={isConnected:!1};try{e=await i({type:t.REQUEST_CONNECTION_STATUS})}catch(e){console.error(e)}return{isConnected:e.isConnected}})():{isConnected:!1,error:a},_=async()=>{if(C){let e=await(async()=>{let e;try{e=await i({type:t.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}let{networkDetails:n}=e||{networkDetails:{network:``,networkPassphrase:``}};return{network:n?.network,networkPassphrase:n?.networkPassphrase,error:e?.apiError}})();return e.error?{network:``,networkPassphrase:``,error:e.error}:{network:e.network,networkPassphrase:e.networkPassphrase}}return{network:``,networkPassphrase:``,error:a}},v=async()=>{if(C){let e=await l();return e.error?{network:``,networkUrl:``,networkPassphrase:``,error:e.error}:{network:e.network,networkUrl:e.networkUrl,networkPassphrase:e.networkPassphrase,sorobanRpcUrl:e.sorobanRpcUrl}}return{network:``,networkUrl:``,networkPassphrase:``,error:a}},y=async()=>{let e=!1;if(C){let t=await u();return e=t.isAllowed,t.error?{isAllowed:e,error:t.error}:{isAllowed:e}}return{isAllowed:e,error:a}},b=async()=>{let e=!1;if(C){let n=await(async()=>{let e;try{e=await i({type:t.SET_ALLOWED_STATUS})}catch(e){console.error(e)}let{isAllowed:n}=e||{isAllowed:!1};return{isAllowed:n,error:e?.apiError}})();return e=n.isAllowed,n.error?{isAllowed:e,error:n.error}:{isAllowed:e}}return{isAllowed:e,error:a}},x=async()=>{let e=``;if(C){let t=await s();return e=t.publicKey,t.error?{address:e,error:t.error}:{address:e}}return{address:e,error:a}};class S{constructor(e=3e3){this.fetchInfo=async e=>{if(!this.isRunning)return;let t=await c(),n=await l();(t.error||n.error)&&e({address:``,network:``,networkPassphrase:``,error:t.error||n.error}),this.currentAddress===t.publicKey&&this.currentNetwork===n.network&&this.currentNetworkPassphrase===n.networkPassphrase||(this.currentAddress=t.publicKey,this.currentNetwork=n.network,this.currentNetworkPassphrase=n.networkPassphrase,e({address:t.publicKey,network:n.network,networkPassphrase:n.networkPassphrase})),setTimeout(()=>this.fetchInfo(e),this.timeout)},this.timeout=e,this.currentAddress=``,this.currentNetwork=``,this.currentNetworkPassphrase=``,this.isRunning=!1}watch(e){return C?(this.isRunning=!0,this.fetchInfo(e),{}):{error:a}}stop(){this.isRunning=!1}}let C=typeof window<`u`,w={getAddress:d,addToken:f,signTransaction:p,signMessage:m,signAuthEntry:h,isConnected:g,getNetwork:_,getNetworkDetails:v,isAllowed:y,setAllowed:b,requestAccess:x,WatchWalletChanges:S};return r})())}))();new TextEncoder;var Bc={base32:new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),base32hex:new TextEncoder().encode(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),base32crockford:new TextEncoder().encode(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`)},Vc={base32:new Uint8Array(128).fill(32),base32hex:new Uint8Array(128).fill(32),base32crockford:new Uint8Array(128).fill(32)};Bc.base32.forEach((e,t)=>Vc.base32[e]=t),Bc.base32hex.forEach((e,t)=>Vc.base32hex[e]=t),Bc.base32crockford.forEach((e,t)=>Vc.base32crockford[e]=t);function Hc(e,t){let n=e.length;if(e.byteOffset){let t=new Uint8Array(e.buffer);t.set(e),e=t.subarray(0,n)}return e=new Uint8Array(e.buffer.transfer(t)),e.set(e.subarray(0,n),t-n),[e,t-n]}var Uc=new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),Wc=new Uint8Array(128).fill(32);Uc.forEach((e,t)=>Wc[e]=t),`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`.split(``);var Gc={base64:new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),base64url:new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`)},Kc={base64:new Uint8Array(128).fill(64),base64url:new Uint8Array(128).fill(64)};Gc.base64.forEach((e,t)=>Kc.base64[e]=t),Gc.base64url.forEach((e,t)=>Kc.base64url[e]=t);function qc(e){return((e+2)/3|0)*4}function Jc(e,t,n,r,i){for(t+=2;t<e.length;t+=3){let i=e[t-2]<<16|e[t-1]<<8|e[t];e[n++]=r[i>>18],e[n++]=r[i>>12&63],e[n++]=r[i>>6&63],e[n++]=r[i&63]}switch(t){case e.length+1:{let a=e[t-2]<<16;e[n++]=r[a>>18],e[n++]=r[a>>12&63],e[n++]=i,e[n++]=i;break}case e.length:{let a=e[t-2]<<16|e[t-1]<<8;e[n++]=r[a>>18],e[n++]=r[a>>12&63],e[n++]=r[a>>6&63],e[n++]=i;break}}return n}var Yc=61,Xc=new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),Zc=new Uint8Array(128).fill(64);Xc.forEach((e,t)=>Zc[e]=t);function Qc(e){e=typeof e==`string`?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e).slice():e.slice();let[t,n]=Hc(e,qc(e.length));return Jc(t,n,0,Xc,Yc),new TextDecoder().decode(t)}var $c=new TextEncoder().encode(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),el=new Uint8Array(128).fill(64);$c.forEach((e,t)=>el[e]=t);var tl=new TextEncoder().encode(`0123456789abcdef`),nl=new Uint8Array(128).fill(16);tl.forEach((e,t)=>nl[e]=t),new TextEncoder().encode(`ABCDEF`).forEach((e,t)=>nl[e]=t+10);var rl=new TextEncoder().encode(`0123456789abcdef`),il=new Uint8Array(128).fill(16);rl.forEach((e,t)=>il[e]=t),new TextEncoder().encode(`ABCDEF`).forEach((e,t)=>il[e]=t+10);var al=new ArrayBuffer(8);new Uint32Array(al),new BigUint64Array(al);var ol=`freighter`,sl=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:ol}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Freighter`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://freighter.app`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/freighter.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Freighter is not connected`)}async isAvailable(){if(window.stellar?.provider===`freighter`&&window.stellar?.platform===`mobile`)return!1;try{let e=await(0,zc.isConnected)();return!e.error&&e.isConnected}catch(e){return console.error(e),!1}}async getAddress(e){try{if(await this.runChecks(),e?.skipRequestAccess!==!0){let e=await(0,zc.requestAccess)();if(e.error)return Promise.reject(H(e.error))}let{address:t,error:n}=await(0,zc.getAddress)();return n?Promise.reject(n):t?{address:t}:Promise.reject({code:-3,message:`Getting the address from Freighter is not allowed, please request access first.`})}catch(e){throw H(e)}}async signTransaction(e,t){try{await this.runChecks();let{signedTxXdr:n,signerAddress:r,error:i}=await(0,zc.signTransaction)(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(i):{signedTxXdr:n,signerAddress:r}}catch(e){throw H(e)}}async signAuthEntry(e,t){try{await this.runChecks();let{signedAuthEntry:n,signerAddress:r,error:i}=await(0,zc.signAuthEntry)(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(i):n?{signedAuthEntry:typeof n==`string`?n:Qc(new Uint8Array(n)),signerAddress:r}:Promise.reject({code:-3,message:`signedAuthEntry returned from Freighter is undefined.`})}catch(e){throw H(e)}}async signMessage(e,t){try{await this.runChecks();let{signedMessage:n,signerAddress:r,error:i}=await(0,zc.signMessage)(e,{address:t?.address,networkPassphrase:t?.networkPassphrase});return i?Promise.reject(i):n?{signedMessage:typeof n==`string`?n:Qc(new Uint8Array(n)),signerAddress:r}:Promise.reject({code:-3,message:`signedMessage returned from Freighter is undefined.`})}catch(e){throw H(e)}}async getNetwork(){try{await this.runChecks();let{network:e,networkPassphrase:t,error:n}=await(0,zc.getNetwork)();return n?Promise.reject(n):{network:e,networkPassphrase:t}}catch(e){throw H(e)}}},cl=`ghostsig`,ll=[`offline`,`unsent`,`locked`,`moved`,`handOver`],ul={[Wa.PUBLIC]:{id:`mainnet`,name:`PUBLIC`},[Wa.TESTNET]:{id:`testnet`,name:`TESTNET`},[Wa.FUTURENET]:{id:`futurenet`,name:`FUTURENET`}},dl=class{constructor(e={}){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:cl}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`GHOSTSIG`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://ghostsig.dev`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:fl}),Object.defineProperty(this,"address",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"passphrase",{enumerable:!0,configurable:!0,writable:!0,value:Wa.PUBLIC}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let{network:t,...n}=e;t&&(this.passphrase=t),this.page=n}async isAvailable(){return typeof globalThis.window?.open==`function`}async getAddress(){let e=await this.request(`connect`,{},void 0);return this.address=e.address,{address:e.address}}async signTransaction(e,t){let n={payload:e,submit:!1,address:this.signer(t)},r=await this.request(`sign`,n,t?.networkPassphrase);return{signedTxXdr:r.blob,signerAddress:r.address}}async signAuthEntry(e,t){let n={payload:e,address:this.signer(t)},r=await this.request(`signAuthEntry`,n,t?.networkPassphrase);return{signedAuthEntry:r.signature,signerAddress:r.address}}async signMessage(e,t){let n={message:e,address:this.signer(t)},r=await this.request(`signMessage`,n,t?.networkPassphrase);return{signedMessage:r.signature,signerAddress:r.address}}async signAndSubmitTransaction(e,t){let n={payload:e,submit:!0,address:this.signer(t)},{handOver:r,submitted:i,hash:a}=await this.request(`sign`,n,t?.networkPassphrase);if(r||i&&ll.includes(i.kind))throw{code:-2,message:`Nothing was submitted: ${r||i?.kind}. Transaction hash: ${a}`};if(i?.ok===!1)throw{code:-2,message:`The transaction failed: ${i.code??i.kind}. Transaction hash: ${a}`};return{status:i?.ok===!0?`success`:`pending`}}async getNetwork(){return{network:this.network().name,networkPassphrase:this.passphrase}}async disconnect(){this.address=null}signer(e){return e?.address??this.address??void 0}network(e){let t=e||this.passphrase,n=ul[t];if(!n)throw{code:-3,message:`GHOSTSIG does not know the network "${t}"`};return this.passphrase=t,n}async request(e,t,n){let{id:r}=this.network(n);try{return await wl({chain:`stellar`,network:r,method:e,params:t,...this.page})}catch(e){throw e instanceof vl?{code:e.code,message:e.message,ext:e.ext}:{code:-1,message:e instanceof Error?e.message:String(e)}}}},fl=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NCIgaGVpZ2h0PSI0NCIgdmlld0JveD0iMCAwIDQ0IDQ0IiBmaWxsPSJub25lIiByb2xlPSJpbWciIGFyaWEtbGFiZWw9IkdIT1NUU0lHIj48ZyBzaGFwZS1yZW5kZXJpbmc9ImNyaXNwRWRnZXMiIGZpbGw9IiNGRjJFODgiPjxyZWN0IHg9IjEyIiB5PSIwIiAgd2lkdGg9IjIwIiBoZWlnaHQ9IjQiLz48cmVjdCB4PSI4IiAgeT0iNCIgIHdpZHRoPSIyOCIgaGVpZ2h0PSI0Ii8+PHJlY3QgeD0iNCIgIHk9IjgiICB3aWR0aD0iMzYiIGhlaWdodD0iNCIvPjxyZWN0IHg9IjAiICB5PSIxMiIgd2lkdGg9IjQ0IiBoZWlnaHQ9IjQiLz48cmVjdCB4PSIwIiAgeT0iMTYiIHdpZHRoPSI4IiAgaGVpZ2h0PSI0Ii8+PHJlY3QgeD0iMzYiIHk9IjE2IiB3aWR0aD0iOCIgIGhlaWdodD0iNCIvPjxyZWN0IHg9IjAiICB5PSIyMCIgd2lkdGg9IjQ0IiBoZWlnaHQ9IjE2Ii8+PHJlY3QgeD0iMCIgIHk9IjM2IiB3aWR0aD0iOCIgIGhlaWdodD0iOCIvPjxyZWN0IHg9IjEyIiB5PSIzNiIgd2lkdGg9IjgiICBoZWlnaHQ9IjgiLz48cmVjdCB4PSIyNCIgeT0iMzYiIHdpZHRoPSI4IiAgaGVpZ2h0PSI4Ii8+PHJlY3QgeD0iMzYiIHk9IjM2IiB3aWR0aD0iOCIgIGhlaWdodD0iOCIvPjwvZz48cmVjdCB4PSI4IiB5PSIxNiIgd2lkdGg9IjI4IiBoZWlnaHQ9IjQiIGZpbGw9IiNDOEZGMDAiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjwvc3ZnPg==`,pl=1,ml=`https://ghostsig.dev/?connect`,hl=1500,gl=1e4,_l=6e4,vl=class extends Error{constructor(e,t,n){super(t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=`GhostsigError`,this.code=e,n&&(this.ext=n)}},yl=new WeakMap;function bl(e){let t;try{t=new URL(e??ml)}catch{return new vl(-3,`"${String(e)}" is not a URL`)}return t.origin===new URL(ml).origin||t.hostname===`localhost`&&t.protocol===`http:`?t:new vl(-3,`GHOSTSIG is at ${new URL(ml).origin}. A copy at ${t.origin} is not opened`)}function xl(e){let t=e.outerWidth||e.screen?.width||420,n=e.outerHeight||e.screen?.height||720;return`popup=yes,width=420,height=720,left=${Math.max(0,Math.round((e.screenX||0)+(t-420)/2))},top=${Math.max(0,Math.round((e.screenY||0)+(n-720)/2))},resizable=yes,scrollbars=yes`}function Sl(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Cl(e,t,n){let r=n,i=e=>typeof r?.[e]==`string`&&r[e].length>0;return!r||typeof r!=`object`||!i(`address`)||!/^[0-9a-f]{64}$/i.test(String(r.publicKey))?new vl(-1,`GHOSTSIG answered without an address and a public key`,`bad_reply`):e!==`connect`&&!i(`signature`)?new vl(-1,`GHOSTSIG answered without a signature`,`bad_reply`):e===`sign`&&!(i(`hash`)&&i(`blob`))?new vl(-1,`GHOSTSIG answered without the signed transaction`,`bad_reply`):typeof t.address==`string`&&t.address!==r.address?new vl(-1,`GHOSTSIG signed as ${String(r.address)}, not as ${t.address}`,`account_mismatch`):null}function wl(e){let t=typeof window>`u`?void 0:window;if(!t||typeof t.open!=`function`)return Promise.reject(new vl(-1,`This environment cannot open a popup`,`popup_blocked`));let n=bl(e.url);if(n instanceof vl)return Promise.reject(n);let r=n.href,i=n.origin,a=e.params??{},o=e.timeoutMs??_l,s=yl.get(t);yl.delete(t);let c=s!==void 0&&!s.popup.closed&&s.origin===i&&s.chain===e.chain&&s.network===e.network&&Date.now()-s.at<hl,l;if(c)l=s.popup;else{try{l=t.open(r,`ghostsig-${Sl()}`,xl(t))}catch{l=null}if(!l||l.closed)return Promise.reject(new vl(-1,`The browser blocked the GHOSTSIG popup. Allow popups for this site and try again`,`popup_blocked`))}let u=l,d=Sl(),f={ghostsig:pl,id:d,type:`request`,method:e.method,chain:e.chain,network:e.network,params:a};return new Promise((n,r)=>{let s=!1,l=c,p=(a,o)=>{if(!s){if(s=!0,t.removeEventListener(`message`,m),clearInterval(h),clearTimeout(g),clearTimeout(_),!a&&e.method===`connect`)yl.set(t,{popup:u,origin:i,chain:e.chain,network:e.network,at:Date.now()});else if(a?.ext)try{u.closed||u.close()}catch{}a?r(a):n(o)}},m=t=>{if(t.origin!==i||t.source!==u)return;let n=t.data;if(n&&typeof n==`object`&&n.ghostsig===pl){if(n.type===`ready`)l=!0,u.postMessage(f,i);else if(n.id===d){if(n.type===`result`){let t=Cl(e.method,a,n.result);t?p(t):p(null,n.result)}else if(n.type===`error`){let e=n.error,t=[-1,-2,-3,-4].find(t=>t===e?.code)??-1;p(new vl(t,typeof e?.message==`string`?e.message:`GHOSTSIG refused the request`))}}}};t.addEventListener(`message`,m),c&&u.postMessage(f,i);let h=setInterval(()=>{u.closed&&p(new vl(-4,`The GHOSTSIG popup was closed before it answered`,`popup_closed`))},500),g=setTimeout(()=>{l||p(new vl(-1,`GHOSTSIG did not answer. The popup lost its opener (a Cross-Origin-Opener-Policy of same-origin does that), or the page is not GHOSTSIG`,`unreachable`))},Math.min(gl,o)),_=setTimeout(()=>p(new vl(-1,`GHOSTSIG did not answer in time`,`timeout`)),o)})}var Tl=`hana`,El=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Tl}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Hana Wallet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://hanawallet.io/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/hana.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Hana Wallet is not installed`)}async isAvailable(){return typeof window<`u`&&!!window.hanaWallet?.stellar}async getAddress(){try{return await this.runChecks(),{address:await window.hanaWallet.stellar.getPublicKey()}}catch(e){throw H(e)}}async signTransaction(e,t){try{return await this.runChecks(),{signedTxXdr:await window.hanaWallet.stellar.signTransaction({xdr:e,accountToSign:t?.address,networkPassphrase:t?.networkPassphrase}),signerAddress:t?.address}}catch(e){throw H(e)}}async signAuthEntry(e,t){try{return await this.runChecks(),{signedAuthEntry:await window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t?.address}),signerAddress:t?.address}}catch(e){throw H(e)}}async signMessage(e,t){try{return await this.runChecks(),{signedMessage:await window.hanaWallet.stellar.signMessage({message:e,accountToSign:t?.address}),signerAddress:t?.address}}catch(e){throw H(e)}}async getNetwork(){throw{code:-3,message:`Hana does not support the "getNetwork" function`}}},Dl=`klever`,Ol=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:Dl}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Klever Wallet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://klever.io/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/klever.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Klever Wallet is not installed`)}async isAvailable(){return typeof window<`u`&&!!window.kleverWallet?.stellar}async getAddress(){return this.runChecks().then(()=>window.kleverWallet.stellar.getAddress()).catch(e=>{throw H(e)})}async signTransaction(e,t){return this.runChecks().then(()=>window.kleverWallet.stellar.signTransaction(e,t)).catch(e=>{throw H(e)})}async signAuthEntry(e,t){return this.runChecks().then(()=>window.kleverWallet.stellar.signAuthEntry(e,t)).catch(e=>{throw H(e)})}async signMessage(e,t){return this.runChecks().then(()=>window.kleverWallet.stellar.signMessage(e,t)).catch(e=>{throw H(e)})}async getNetwork(){return this.runChecks().then(()=>window.kleverWallet.stellar.getNetwork()).catch(e=>{throw H(e)})}},kl=c(o(((e,t)=>{var n=2147483648,r=function(e){if(!Array.isArray(e))throw Error(`Input must be an Array`);if(e.length===0)throw Error(`Path must contain at least one level`);for(var t=0;t<e.length;t++)if(typeof e[t]!=`number`)throw Error(`Path element is not a number`);this.path=e};r.validatePathArray=function(e){try{return r.fromPathArray(e),!0}catch{return!1}},r.validateString=function(e,t){try{return r.fromString(e,t),!0}catch{return!1}},r.fromPathArray=function(e){return new r(e)},r.fromString=function(e,t){if(/^m\//i.test(e))e=e.slice(2);else if(t)throw Error(`Root element is required`);for(var i=e.split(`/`),a=Array(i.length),o=0;o<i.length;o++){var s=/(\d+)([hH\']?)/.exec(i[o]);if(s===null)throw Error(`Invalid input`);if(a[o]=parseInt(s[1],10),a[o]>=n)throw Error(`Invalid child index`);if(s[2]===`h`||s[2]===`H`||s[2]===`'`)a[o]+=n;else if(s[2].length!=0)throw Error(`Invalid modifier`)}return new r(a)},r.prototype.toPathArray=function(){return this.path},r.prototype.toString=function(e,t){for(var r=Array(this.path.length),i=0;i<this.path.length;i++){var a=this.path[i];a&n?r[i]=(a&2147483647)+(t?`h`:`'`):r[i]=a}return(e?``:`m/`)+r.join(`/`)},r.prototype.inspect=function(){return`BIPPath <`+this.toString()+`>`},t.exports=r}))()),Al={},jl={},Ml=(e,t)=>{jl[e]=t},U=e=>{class t extends Error{cause;constructor(n,r,i){if(super(n||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,r)for(let e in r)this[e]=r[e];if(i&&Nl(i)&&`cause`in i&&!this.cause){let e=i.cause;this.cause=e,`stack`in e&&(this.stack=this.stack+`
3
+ CAUSE: `+e.stack)}}}return Al[e]=t,t};function Nl(e){return typeof e==`object`}U(`AccountNameRequired`),U(`AccountNotSupported`),U(`AccountAwaitingSendPendingOperations`),U(`AmountRequired`),U(`BluetoothRequired`),U(`BtcUnmatchedApp`),U(`CantOpenDevice`),U(`CashAddrNotSupported`),U(`ClaimRewardsFeesWarning`),U(`CurrencyNotSupported`),U(`DeviceAppVerifyNotSupported`),U(`DeviceGenuineSocketEarlyClose`),U(`DeviceNotGenuine`),U(`DeviceOnDashboardExpected`),U(`DeviceOnDashboardUnexpected`),U(`DeviceInOSUExpected`),U(`DeviceHalted`),U(`DeviceNameInvalid`),U(`DeviceSocketFail`),U(`DeviceSocketNoBulkStatus`),U(`DeviceSocketNoBulkStatus`),U(`UnresponsiveDeviceError`);var Pl=U(`DisconnectedDevice`),Fl=U(`DisconnectedDeviceDuringOperation`);U(`DeviceExtractOnboardingStateError`),U(`DeviceOnboardingStatePollingError`),U(`EnpointConfig`),U(`EthAppPleaseEnableContractData`),U(`SolAppPleaseEnableContractData`),U(`CeloAppPleaseEnableContractData`),U(`FeeEstimationFailed`),U(`FirmwareNotRecognized`),U(`HardResetFail`),U(`InvalidXRPTag`),U(`InvalidAddress`),U(`InvalidTransactionError`),U(`InvalidNonce`),U(`InvalidAddressBecauseDestinationIsAlsoSource`),U(`LatestMCUInstalledError`),U(`LatestFirmwareVersionRequired`),U(`UnsupportedFeatureError`),U(`NanoSNotSupported`),U(`UnknownMCU`),U(`LedgerAPIError`),U(`LedgerAPIErrorWithMessage`),U(`LedgerAPINotAvailable`),U(`ManagerAppAlreadyInstalled`),U(`ManagerAppRelyOnBTC`),U(`ManagerAppDepInstallRequired`),U(`ManagerAppDepUninstallRequired`),U(`ManagerDeviceLocked`),U(`ManagerFirmwareNotEnoughSpace`),U(`ManagerNotEnoughSpace`),U(`ManagerUninstallBTCDep`),U(`NetworkDown`),U(`NetworkError`),U(`NoAddressesFound`),U(`NotEnoughBalance`),U(`NotEnoughBalanceFees`),U(`NotEnoughBalanceSwap`),U(`NotEnoughBalanceToDelegate`),U(`UnstakeNotEnoughStakedBalanceLeft`),U(`RestakeNotEnoughStakedBalanceLeft`),U(`NotEnoughToRestake`),U(`NotEnoughToUnstake`),U(`NotEnoughBalanceInParentAccount`),U(`NotEnoughSpendableBalance`),U(`NotEnoughBalanceBecauseDestinationNotCreated`),U(`NotEnoughToStake`),U(`NoAccessToCamera`),U(`NotEnoughGas`),U(`NotEnoughGasSwap`),U(`TronEmptyAccount`),U(`MaybeKeepTronAccountAlive`),U(`NotSupportedLegacyAddress`),U(`GasLessThanEstimate`),U(`PriorityFeeTooLow`),U(`PriorityFeeTooHigh`),U(`PriorityFeeHigherThanMaxFee`),U(`MaxFeeTooLow`),U(`PasswordsDontMatch`),U(`PasswordIncorrect`),U(`RecommendSubAccountsToEmpty`),U(`RecommendUndelegation`),U(`TimeoutTagged`),U(`UnexpectedBootloader`),U(`MCUNotGenuineToDashboard`),U(`RecipientRequired`),U(`UnavailableTezosOriginatedAccountReceive`),U(`UnavailableTezosOriginatedAccountSend`),U(`UpdateFetchFileFail`),U(`UpdateIncorrectHash`),U(`UpdateIncorrectSig`),U(`UpdateYourApp`),U(`UserRefusedDeviceNameChange`),U(`UserRefusedAddress`),U(`UserRefusedFirmwareUpdate`),U(`UserRefusedAllowManager`),U(`UserRefusedOnDevice`),U(`PinNotSet`),U(`ExpertModeRequired`);var Il=U(`TransportOpenUserCancelled`),Ll=U(`TransportInterfaceNotAvailable`),Rl=U(`TransportRaceCondition`),zl=U(`TransportWebUSBGestureRequired`);U(`TransactionHasBeenValidatedError`),U(`TransportExchangeTimeoutError`),U(`DeviceShouldStayInApp`),U(`WebsocketConnectionError`),U(`WebsocketConnectionFailed`),U(`WrongDeviceForAccount`),U(`WrongDeviceForAccountPayout`),U(`MissingSwapPayloadParamaters`),U(`WrongDeviceForAccountRefund`),U(`WrongAppForCurrency`),U(`ETHAddressNonEIP`),U(`CantScanQRCode`),U(`FeeNotLoaded`),U(`FeeNotLoadedSwap`),U(`FeeRequired`),U(`FeeTooHigh`),U(`ValAddressRequired`),U(`RedelegateDstValAddressRequired`),U(`PendingOperation`),U(`SyncError`),U(`PairingFailed`),U(`PeerRemovedPairing`),U(`GenuineCheckFailed`),U(`LedgerAPI4xx`),U(`LedgerAPI5xx`),U(`FirmwareOrAppUpdateRequired`),U(`ReplacementTransactionUnderpriced`),U(`OpReturnSizeLimit`),U(`DustLimit`),U(`ConcordiumInsufficientFunds`),U(`ConcordiumMemoTooLong`),U(`ConcordiumPairingExpiredError`),U(`ConcordiumSessionExpiredError`),U(`ConcordiumTrustedMetadataServiceError`),U(`ConcordiumAddressVerificationFailedError`),U(`ConcordiumInvalidMaxFeeError`),U(`LanguageNotFound`),U(`NoDBPathGiven`),U(`DBWrongPassword`),U(`DBNotReset`),U(`SequenceNumberError`),U(`DisabledTransactionBroadcastError`),U(`InvalidParameterError`);var Bl;(function(e){e.Unknown=`Unknown`,e.LocationServicesDisabled=`LocationServicesDisabled`,e.LocationServicesUnauthorized=`LocationServicesUnauthorized`,e.BluetoothScanStartFailed=`BluetoothScanStartFailed`})(Bl||={});var Vl=class extends Error{id;constructor(e,t){let n=`TransportError`;super(e||n),this.name=n,this.message=e,this.stack=Error(e).stack,this.id=t}};Ml(`TransportError`,e=>new Vl(e.message,e.id));var Hl={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CLA_NOT_SUPPORTED_BOOTLOADER:28161,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,SW_BAD_STATE:45063};function Ul(e){switch(e){case 26368:return`Incorrect length`;case 26624:return`Missing critical parameter`;case 27010:return`Security not satisfied (dongle locked or have invalid access rights)`;case 27013:return`Condition of use not satisfied (denied by the user?)`;case 27264:return`Invalid data received`;case 27392:return`Invalid parameter received`;case 21781:return`Locked device`;case 45063:return`Unexpected state on the device`}if(28416<=e&&e<=28671)return`Internal error, please report`}var Wl=class e extends Error{statusCode;statusText;constructor(t,{canBeMappedToChildError:n=!0}={}){let r=Object.keys(Hl).find(e=>Hl[e]===t)||`UNKNOWN_ERROR`,i=`Ledger device: ${Ul(t)||r} (0x${t.toString(16)})`;if(super(i),this.name=`TransportStatusError`,this.statusCode=t,this.statusText=r,Object.setPrototypeOf(this,e.prototype),n&&t===Hl.LOCKED_DEVICE)return new Gl(i)}},Gl=class e extends Wl{constructor(t){super(Hl.LOCKED_DEVICE,{canBeMappedToChildError:!1}),t&&(this.message=t),this.name=`LockedDeviceError`,Object.setPrototypeOf(this,e.prototype)}};Ml(`TransportStatusError`,e=>new Wl(e.statusCode));var Kl=U(`StellarHashSigningNotEnabledError`),ql=U(`StellarDataParsingFailedError`),Jl=U(`StellarUserRefusedError`),Yl=U(`StellarDataTooLargeError`),Xl=224,Zl=0,Ql=128,$l=0,eu=128,tu=0,nu=1,ru=2,iu=4,au=6,ou=8,su=10,cu=255,lu=27013,uu=27750,du=45060,fu=45061,pu=class{transport;constructor(e,t=`l0v`){this.transport=e,e.decorateAppAPIMethods(this,[`getAppConfiguration`,`getPublicKey`,`signTransaction`,`signSorobanAuthorization`,`signHash`],t)}async getAppConfiguration(){let e=await this.sendToDevice(au,Buffer.alloc(0)),[t,n,r,i,a,o]=e;return{hashSigningEnabled:t===1,version:`${n}.${r}.${i}`,maxDataSize:e.length>4?a<<8|o:void 0}}async getPublicKey(e,t=!1){let n=hu(e),r=t?nu:tu;try{return{rawPublicKey:(await this.transport.send(Xl,ru,Zl,r,n)).slice(0,-2)}}catch(e){throw mu(e)}}async signTransaction(e,t){let n=hu(e),r=Buffer.concat([n,t]);return{signature:await this.sendToDevice(iu,r)}}async signSorobanAuthorization(e,t){let n=hu(e),r=Buffer.concat([n,t]);return{signature:await this.sendToDevice(su,r)}}async signHash(e,t){let n=hu(e),r=Buffer.concat([n,t]);return{signature:await this.sendToDevice(ou,r)}}async sendToDevice(e,t){let n=Buffer.alloc(0),r=t.length;for(;;){let i=r>cu?cu:r,a=r===t.length?Zl:Ql,o=r-i===0?$l:eu,s=t.slice(t.length-r,t.length-r+i);if(n=await this.transport.send(Xl,e,a,o,s).catch(e=>{throw mu(e)}),r-=i,r===0)break}return n.slice(0,-2)}},mu=e=>{if(e)switch(e.statusCode){case lu:return new Jl(`User refused the request`,void 0,{cause:e});case fu:return new ql(`Unable to parse the provided data`,void 0,{cause:e});case uu:return new Kl(`Hash signing not allowed. Have you enabled it in the app settings?`,void 0,{cause:e});case du:return new Yl(`The provided data is too large for the device to process`,void 0,{cause:e})}return e},hu=e=>{let t=e.split(`/`).map(e=>e.endsWith(`'`)||e.endsWith(`h`)?e:`${e}'`).join(`/`);return gu(kl.default.fromString(t).toPathArray())},gu=e=>{let t=Buffer.alloc(1+e.length*4);t.writeUInt8(e.length,0);for(let[n,r]of e.entries())t.writeUInt32BE(r,1+n*4);return t},_u=c(o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))()),vu=0,yu=[],bu=(e,t,n)=>{let r={type:e,id:String(++vu),date:new Date};t&&(r.message=t),n&&(r.data=n),wu(r)},xu=({type:e,message:t,data:n,context:r})=>{let i={type:e,id:String(++vu),date:new Date};t&&(i.message=t),n&&(i.data=n),r&&(i.context=r),wu(i)},Su=class e{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){xu({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(t){return new e(t,this.context)}withContext(t){return new e(this.type,t)}withUpdatedContext(t){return new e(this.type,{...this.context,...t})}},Cu=e=>(yu.push(e),()=>{let t=yu.indexOf(e);t!==-1&&(yu[t]=yu[yu.length-1],yu.pop())});function wu(e){for(let t=0;t<yu.length;t++)try{yu[t](e)}catch(e){console.error(e)}}typeof window<`u`&&(window.__ledgerLogsListen=Cu);var Tu=`transport`,Eu=class{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new Su(t??Tu,e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw Error(`exchange not implemented`)}exchangeBulk(e,t){let n=!1;return(async()=>{if(!n)for(let r of e){let e=await this.exchange(r);if(n)return;let i=e.readUInt16BE(e.length-2);if(i!==Hl.OK)throw new Wl(i);t.next(e)}})().then(()=>!n&&t.complete(),e=>!n&&t.error(e)),{unsubscribe:()=>{n=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new _u.default;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn(`setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.`)}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,n,r,i=Buffer.alloc(0),a=[Hl.OK],{abortTimeoutMs:o}={})=>{let s=this.tracer.withUpdatedContext({function:`send`});if(i.length>=256)throw s.trace(`data.length exceeded 256 bytes limit`,{dataLength:i.length}),new Vl(`data.length exceed 256 bytes limit. Got: `+i.length,`DataLengthTooBig`);s.trace(`Starting an exchange`,{abortTimeoutMs:o});let c=await this.exchange(Buffer.concat([Buffer.from([e,t,n,r]),Buffer.from([i.length]),i]),{abortTimeoutMs:o});s.trace(`Received response from exchange`);let l=c.readUInt16BE(c.length-2);if(!a.some(e=>e===l))throw new Wl(l);return c};static create(e=3e3,t){return new Promise((n,r)=>{let i=!1,a=this.listen({next:t=>{i=!0,a&&a.unsubscribe(),o&&clearTimeout(o),this.open(t.descriptor,e).then(n,r)},error:e=>{o&&clearTimeout(o),r(e)},complete:()=>{o&&clearTimeout(o),i||r(new Vl(this.ErrorMessage_NoDeviceFound,`NoDeviceFound`))}}),o=t?setTimeout(()=>{a.unsubscribe(),r(new Vl(this.ErrorMessage_ListenTimeout,`ListenTimeout`))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){let t=this.tracer.withUpdatedContext({function:`exchangeAtomicImpl`,unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace(`Atomic exchange is already busy`),new Rl(`An action was already pending on the Ledger device. Please deny or reconnect.`);let n,r=new Promise(e=>{n=e});this.exchangeBusyPromise=r;let i=!1,a=setTimeout(()=>{t.trace(`Timeout reached, emitting Transport event "unresponsive"`,{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit(`unresponsive`)},this.unresponsiveTimeout);try{let n=await e();return i&&(t.trace(`Device was unresponsive, emitting responsive`),this.emit(`responsive`)),n}finally{t.trace(`Finalize, clearing busy guard`),clearTimeout(a),n&&n(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,n){for(let r of t)e[r]=this.decorateAppAPIMethod(r,e[r],e,n)}_appAPIlock=null;decorateAppAPIMethod(e,t,n,r){return async(...i)=>{let{_appAPIlock:a}=this;if(a)return Promise.reject(new Vl(`Ledger Device is busy (lock `+a+`)`,`TransportLocked`));try{return this._appAPIlock=e,this.setScrambleKey(r),await t.apply(n,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout=`No Ledger device found (timeout)`;static ErrorMessage_NoDeviceFound=`No Ledger device found`},Du=5;function Ou(e){let t=Buffer.alloc(2);return t.writeUInt16BE(e,0),t}var ku={data:Buffer.alloc(0),dataLength:0,sequence:0},Au=(e,t)=>({makeBlocks(n){let r=Buffer.concat([Ou(n.length),n]),i=t-5,a=Math.ceil(r.length/i);r=Buffer.concat([r,Buffer.alloc(a*i-r.length+1).fill(0)]);let o=[];for(let t=0;t<a;t++){let n=Buffer.alloc(5);n.writeUInt16BE(e,0),n.writeUInt8(Du,2),n.writeUInt16BE(t,3);let a=r.slice(t*i,(t+1)*i);o.push(Buffer.concat([n,a]))}return o},reduceResponse(t,n){let{data:r,dataLength:i,sequence:a}=t||ku;if(n.readUInt16BE(0)!==e)throw new Vl(`Invalid channel`,`InvalidChannel`);if(n.readUInt8(2)!==Du)throw new Vl(`Invalid tag`,`InvalidTag`);if(n.readUInt16BE(3)!==a)throw new Vl(`Invalid sequence`,`InvalidSequence`);t||(i=n.readUInt16BE(5)),a++;let o=n.slice(t?5:7);return r=Buffer.concat([r,o]),r.length>i&&(r=r.slice(0,i)),{data:r,dataLength:i,sequence:a}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}),ju=o(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Mu=o(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Nu=o(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ju(),a=Mu();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Pu=o(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Fu=o(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Iu=o(((e,t)=>{var n=Mu(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ju(),{safeRe:a,t:o}=Nu(),s=Pu(),{compareIdentifiers:c}=Fu(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Lu=o(((e,t)=>{var n=Iu();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Ru=o(((e,t)=>{var n=Lu();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),zu=o(((e,t)=>{var n=Lu();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Bu=o(((e,t)=>{var n=Iu();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Vu=o(((e,t)=>{var n=Lu();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),Hu=o(((e,t)=>{var n=Iu();t.exports=(e,t)=>new n(e,t).major})),Uu=o(((e,t)=>{var n=Iu();t.exports=(e,t)=>new n(e,t).minor})),Wu=o(((e,t)=>{var n=Iu();t.exports=(e,t)=>new n(e,t).patch})),Gu=o(((e,t)=>{var n=Lu();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Ku=o(((e,t)=>{var n=Iu();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),qu=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(t,e,r)})),Ju=o(((e,t)=>{var n=Ku();t.exports=(e,t)=>n(e,t,!0)})),Yu=o(((e,t)=>{var n=Iu();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Xu=o(((e,t)=>{var n=Yu();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Zu=o(((e,t)=>{var n=Yu();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Qu=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)>0})),$u=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)<0})),ed=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)===0})),td=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)!==0})),nd=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)>=0})),rd=o(((e,t)=>{var n=Ku();t.exports=(e,t,r)=>n(e,t,r)<=0})),id=o(((e,t)=>{var n=ed(),r=td(),i=Qu(),a=nd(),o=$u(),s=rd();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ad=o(((e,t)=>{var n=Iu(),r=Lu(),{safeRe:i,t:a}=Nu();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),od=o(((e,t)=>{var n=Lu(),r=ju(),i=Iu(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=o(e,n);return i&&s(i,t)},o=(e,t)=>n(e instanceof i?e.version:e,t),s=(e,t)=>{if(c(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},c=e=>e.startsWith(`pre`);t.exports=a})),sd=o(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),cd=o(((e,t)=>{var n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(g,``);let t=((this.options.includePrerelease&&m)|(this.options.loose&&h))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,j(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>A(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let v=new Map,y=l.map(e=>new a(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}};var r=new(sd()),i=Pu(),a=ld(),o=Mu(),s=Iu(),{safeRe:c,src:l,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=Nu(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=ju(),g=new RegExp(l[u.BUILD],`g`),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=T(e,t),o(`caret`,e),e=C(e,t),o(`tildes`,e),e=D(e,t),o(`xrange`,e),e=k(e,t),o(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t,n)=>x(e)&&!x(t)||x(t)&&n&&!x(n),C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(` `),E=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},D=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>O(e,t)).join(` `)),O=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),S(i,a,s))return e;let l=x(i),u=l||x(a),d=u||x(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},k=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),A=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),j=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),ld=o(((e,t)=>{var n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(t.value,n).test(this.value):t.operator===``?t.value===``||new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var r=Pu(),{safeRe:i,t:a}=Nu(),o=id(),s=Mu(),c=Iu(),l=cd()})),ud=o(((e,t)=>{var n=cd();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),dd=o(((e,t)=>{var n=cd();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),fd=o(((e,t)=>{var n=Iu(),r=cd();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),pd=o(((e,t)=>{var n=Iu(),r=cd();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),md=o(((e,t)=>{var n=Iu(),r=cd(),i=Qu();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),hd=o(((e,t)=>{var n=cd();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),gd=o(((e,t)=>{var n=Iu(),r=ld(),{ANY:i}=r,a=cd(),o=ud(),s=Qu(),c=$u(),l=rd(),u=nd();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),_d=o(((e,t)=>{var n=gd();t.exports=(e,t,r)=>n(e,t,`>`,r)})),vd=o(((e,t)=>{var n=gd();t.exports=(e,t,r)=>n(e,t,`<`,r)})),yd=o(((e,t)=>{var n=cd();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),bd=o(((e,t)=>{var n=ud(),r=Ku();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),xd=o(((e,t)=>{var n=cd(),r=ld(),{ANY:i}=r,a=ud(),o=Ku(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Sd=c(o(((e,t)=>{var n=Nu(),r=ju(),i=Iu(),a=Fu();t.exports={parse:Lu(),valid:Ru(),clean:zu(),inc:Bu(),diff:Vu(),major:Hu(),minor:Uu(),patch:Wu(),prerelease:Gu(),compare:Ku(),rcompare:qu(),compareLoose:Ju(),compareBuild:Yu(),sort:Xu(),rsort:Zu(),gt:Qu(),lt:$u(),eq:ed(),neq:td(),gte:nd(),lte:rd(),cmp:id(),coerce:ad(),truncate:od(),Comparator:ld(),Range:cd(),satisfies:ud(),toComparators:dd(),maxSatisfying:fd(),minSatisfying:pd(),minVersion:md(),validRange:hd(),outside:gd(),gtr:_d(),ltr:vd(),intersects:yd(),simplifyRange:bd(),subset:xd(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))()),Cd;(function(e){e.blue=`blue`,e.nanoS=`nanoS`,e.nanoSP=`nanoSP`,e.nanoX=`nanoX`,e.stax=`stax`,e.europa=`europa`,e.apex=`apex`})(Cd||={});var wd={[Cd.blue]:{id:Cd.blue,productName:`Ledger\xA0Blue`,productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[Cd.nanoS]:{id:Cd.nanoS,productName:`Ledger\xA0Nano\xA0S`,productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>Sd.default.lt(Sd.default.coerce(e)??``,`2.0.0`)?4096:2048},[Cd.nanoX]:{id:Cd.nanoX,productName:`Ledger\xA0Nano\xA0X`,productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:`13d63400-2c97-0004-0000-4c6564676572`,notifyUuid:`13d63400-2c97-0004-0001-4c6564676572`,writeUuid:`13d63400-2c97-0004-0002-4c6564676572`,writeCmdUuid:`13d63400-2c97-0004-0003-4c6564676572`}]},[Cd.nanoSP]:{id:Cd.nanoSP,productName:`Ledger Nano S Plus`,productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[Cd.apex]:{id:Cd.apex,productName:`Ledger Apex`,productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:`13d63400-2c97-8004-0000-4c6564676572`,notifyUuid:`13d63400-2c97-8004-0001-4c6564676572`,writeUuid:`13d63400-2c97-8004-0002-4c6564676572`,writeCmdUuid:`13d63400-2c97-8004-0003-4c6564676572`}]},[Cd.stax]:{id:Cd.stax,productName:`Ledger\xA0Stax`,productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:`13d63400-2c97-6004-0000-4c6564676572`,notifyUuid:`13d63400-2c97-6004-0001-4c6564676572`,writeUuid:`13d63400-2c97-6004-0002-4c6564676572`,writeCmdUuid:`13d63400-2c97-6004-0003-4c6564676572`}]},[Cd.europa]:{id:Cd.europa,productName:`Ledger\xA0Flex`,productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:`13d63400-2c97-3004-0000-4c6564676572`,notifyUuid:`13d63400-2c97-3004-0001-4c6564676572`,writeUuid:`13d63400-2c97-3004-0002-4c6564676572`,writeCmdUuid:`13d63400-2c97-3004-0003-4c6564676572`}]}};Cd.blue,Cd.nanoS,Cd.nanoSP,Cd.nanoX,Cd.stax,Cd.europa;var Td=Object.values(wd),Ed=11415,Dd=e=>{let t=Td.find(t=>t.legacyUsbProductId===e);if(t)return t;let n=e>>8;return Td.find(e=>e.productIdMM===n)},Od=[],kd={};for(let e in wd){let t=wd[e],{bluetoothSpec:n}=t;if(n)for(let e=0;e<n.length;e++){let r=n[e];Od.push(r.serviceUuid),kd[r.serviceUuid]=kd[r.serviceUuid.replace(/-/g,``)]={deviceModel:t,...r}}}var Ad=[{vendorId:Ed}];async function jd(){return await navigator.usb.requestDevice({filters:Ad})}async function Md(){return(await navigator.usb.getDevices()).filter(e=>e.vendorId===Ed)}async function Nd(){let e=await Md();return e.length>0?e[0]:jd()}var Pd=()=>Promise.resolve(!!navigator&&!!navigator.usb&&typeof navigator.usb.getDevices==`function`),Fd=1,Id=3,Ld=class e extends Eu{device;deviceModel;channel=Math.floor(Math.random()*65535);packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Dd(e.productId)}static isSupported=Pd;static list=Md;static listen=e=>{let t=!1;Nd().then(n=>{if(!t){let t=Dd(n.productId);e.next({type:`add`,descriptor:n,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&t.code===18?e.error(new zl(t.message)):e.error(new Il(t.message))});function n(){t=!0}return{unsubscribe:n}};static async request(){let t=await jd();return e.open(t)}static async openConnected(){let t=await Md();return t.length===0?null:e.open(t[0])}static async open(t){await t.open(),t.configuration===null&&await t.selectConfiguration(Fd),await Rd(t);let n=t.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>e.interfaceClass===255));if(!n)throw new Ll(`No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.`);let r=n.interfaceNumber;try{await t.claimInterface(r)}catch(e){throw await t.close(),new Ll(e.message)}let i=new e(t,r),a=e=>{t===e.device&&(navigator.usb.removeEventListener(`disconnect`,a),i._emitDisconnect(new Pl))};return navigator.usb.addEventListener(`disconnect`,a),i}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit(`disconnect`,e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await Rd(this.device),await this.device.close()}async exchange(e){return await this.exchangeAtomicImpl(async()=>{let{channel:t,packetSize:n}=this;bu(`apdu`,`=> `+e.toString(`hex`));let r=Au(t,n),i=r.makeBlocks(e);for(let e=0;e<i.length;e++)await this.device.transferOut(Id,i[e]);let a,o;for(;!(a=r.getReducedResult(o));){let e=await this.device.transferIn(Id,n),t=Buffer.from(e.data.buffer);o=r.reduceResponse(o,t)}return bu(`apdu`,`<= `+a.toString(`hex`)),a}).catch(e=>{throw e&&e.message&&e.message.includes(`disconnected`)?(this._emitDisconnect(e),new Fl(e.message)):e})}setScrambleKey(){}};async function Rd(e){try{await e.reset()}catch(e){console.warn(e)}}var zd=`XdrError`,W=class extends Error{constructor(e){super(e),this.name=zd}static[Symbol.hasInstance](e){return e instanceof Error&&e.name===zd}};function Bd(e){return(4-e%4)%4}function Vd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Hd(e,t){if(!Number.isInteger(e)||e<0||e>4294967295)throw new W(`${t}: expected uint32 length`)}function Ud(e,t,n,r){if(typeof e!=`number`||!Number.isInteger(e)||e<t||e>n)throw new W(`${r}: expected integer in range ${t}..${n}`)}function Wd(e,t,n,r){if(typeof e!=`bigint`||e<t||e>n)throw new W(`${r}: expected bigint in range ${t}..${n}`)}function Gd(e,t){if(!(e instanceof Uint8Array))throw new W(`${t}: expected Uint8Array`);try{Uint8Array.prototype.at.call(e,0)}catch{throw new W(`${t}: Uint8Array is detached or out of bounds`)}}function Kd(e,t){if(!Array.isArray(e))throw new W(`${t}: expected array`)}var qd=1500,Jd=class{#e=0;#t=0;#n;#r;#i;bytes;constructor(e,t=qd){if(t<0||!Number.isInteger(t))throw new W(`invalid maxDepth ${t}`);if(this.#n=t,!ArrayBuffer.isView(e)||e.BYTES_PER_ELEMENT!==1)throw TypeError(`Reader expects a Uint8Array`);this.bytes=Object.getPrototypeOf(e)===Uint8Array.prototype?e:e.byteLength===0?new Uint8Array:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.#r=this.bytes.buffer?.detached?new DataView(new ArrayBuffer(0)):new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.#i=this.#r.byteLength}#a(e,t){if(this.remaining<e)throw new W(`${t}: incomplete XDR data at offset ${this.#e}, expected ${e} byte(s)`);let n=this.#e;return this.#e+=e,n}get offset(){return this.#e}get remaining(){return this.#i-this.#e}enter(e){if(this.#t+=1,this.#t>this.#n)throw--this.#t,new W(`${e}: max recursion depth ${this.#n} exceeded`)}exit(){--this.#t}done(e){if(this.remaining!==0)throw new W(`${e}: trailing ${this.remaining} byte(s) after XDR value`)}readBytes(e,t){if(e<0||!Number.isInteger(e))throw new W(`${t}: invalid byte length ${e}`);if(this.remaining<e)throw new W(`${t}: incomplete XDR data at offset ${this.#e}, expected ${e} byte(s)`);let n=this.bytes.slice(this.#e,this.#e+e);if(n.length!==e)throw new W(`${t}: input shrank during decode`);return this.#e+=e,n}skipPadding(e,t){if(e<0||!Number.isInteger(e))throw new W(`${t}: invalid byte length ${e}`);let n=Bd(e);if(n===0)return;let r=this.#a(n,t);for(let e=0;e<n;e++)if(this.bytes[r+e]!==0)throw this.#e=r,new W(`${t}: non-zero XDR padding`)}readInt32(e){return this.#r.getInt32(this.#a(4,e),!1)}readUint32(e){return this.#r.getUint32(this.#a(4,e),!1)}readBigInt64(e){return this.#r.getBigInt64(this.#a(8,e),!1)}readBigUint64(e){return this.#r.getBigUint64(this.#a(8,e),!1)}readFloat32(e){return this.#r.getFloat32(this.#a(4,e),!1)}readFloat64(e){return this.#r.getFloat64(this.#a(8,e),!1)}},Yd=8192,Xd=class{#e=new Uint8Array(Yd);#t=new DataView(this.#e.buffer);#n=0;#r=0;#i;constructor(e=qd){if(e<0||!Number.isInteger(e))throw new W(`invalid maxDepth ${e}`);this.#i=e}get offset(){return this.#n}enter(e){if(this.#r+=1,this.#r>this.#i)throw--this.#r,new W(`${e}: max recursion depth ${this.#i} exceeded`)}exit(){--this.#r}writeBytes(e){this.#o(e.length),this.#e.set(e,this.#n),this.#n+=e.length}writePadding(e){let t=Bd(e);t>0&&(this.#o(t),this.#e.fill(0,this.#n,this.#n+t),this.#n+=t)}writeInt32(e){let t=this.#a(4);this.#t.setInt32(t,e,!1),this.#n+=4}writeUint32(e){let t=this.#a(4);this.#t.setUint32(t,e,!1),this.#n+=4}writeBigInt64(e){let t=this.#a(8);this.#t.setBigInt64(t,e,!1),this.#n+=8}writeBigUint64(e){let t=this.#a(8);this.#t.setBigUint64(t,e,!1),this.#n+=8}writeFloat32(e){let t=this.#a(4);this.#t.setFloat32(t,e,!1),this.#n+=4}writeFloat64(e){let t=this.#a(8);this.#t.setFloat64(t,e,!1),this.#n+=8}#a(e){return this.#o(e),this.#n}toUint8Array(){return this.#e.slice(0,this.#n)}#o(e){let t=this.#n+e;if(t<=this.#e.length)return;let n=this.#e.length;for(;n<t;)n*=2;let r=new Uint8Array(n);r.set(this.#e),this.#e=r,this.#t=new DataView(r.buffer)}},Zd=4294967295,Qd=class{name;constructor(e=void 0){this.name=e}encode(e,t){let n=new Xd(t?.maxDepth);return this._write(e,n,this.name??this.kind),n.toUint8Array()}decode(e,t){let n=new Jd(e,t?.maxDepth),r=this._read(n,this.name??this.kind);return n.done(this.name??this.kind),r}validateXdr(e,t){try{return this.decode(e,t),!0}catch(e){if(e instanceof W)return!1;throw e}}validate(e){try{let t=new Xd;return this._write(e,t,this.name??this.kind),!0}catch(e){if(e instanceof W)return!1;throw e}}},$d=class extends Qd{kind=`array`;element;maxLength;constructor(e,t){super(),Hd(t,`array maxLength`),this.element=e,this.maxLength=t}_read(e,t){e.enter(t);try{let n=e.readUint32(t);if(n>this.maxLength)throw new W(`${t}: array length ${n} exceeds maximum ${this.maxLength}`);if(n>e.remaining)throw new W(`${t}: array length ${n} exceeds remaining ${e.remaining} byte(s)`);return tf(e,n,this.element,t)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(Kd(e,n),e.length>this.maxLength)throw new W(`${n}: array length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),nf(e,t,this.element,n)}finally{t.exit()}}};function ef(e,t){return new $d(e,t)}function tf(e,t,n,r){let i=[];for(let a=0;a<t;a+=1){let t=e.offset,o=n._read(e,`${r}[${a}]`);if(e.offset===t)throw new W(`${r}[${a}]: element type '${n.name??n.kind}' consumed no input; an array element must encode to at least one byte`);i.push(o)}return i}function nf(e,t,n,r){let i=0;for(let a of e){let e=t.offset;if(n._write(a,t,`${r}[${i}]`),t.offset===e)throw new W(`${r}[${i}]: element type '${n.name??n.kind}' encoded to zero bytes; an array element must encode to at least one byte`);i+=1}}var rf=new class extends Qd{kind=`bool`;_read(e,t){let n=e.readUint32(t);if(n===0)return!1;if(n===1)return!0;throw new W(`${t}: invalid bool discriminant ${n}`)}_write(e,t,n){if(typeof e!=`boolean`)throw new W(`${n}: expected boolean`);t.writeUint32(+!!e)}};function af(){return rf}var of=new Set([`__proto__`,`name`,`kind`,`encode`,`decode`,`validate`,`_read`,`_write`,`nameByValue`]),sf=class extends Qd{kind=`enum`;nameByValue;#e=new Set;constructor(e,t){super(e);let n=new Map;for(let[r,i]of Object.entries(t)){if(Ud(i,-2147483648,2147483647,`${e}.${r}`),this.#e.has(i))throw new W(`${e}: duplicate enum value ${i}`);this.#e.add(i),n.set(i,r)}this.nameByValue=n}_read(e,t){let n=e.readInt32(t);if(!this.#e.has(n))throw new W(`${t}: unknown enum value ${n}`);return n}_write(e,t,n){if(typeof e!=`number`||!this.#e.has(e))throw new W(`${n}: unknown enum value ${String(e)}`);t.writeInt32(e)}};function cf(e,t){for(let n of Object.getOwnPropertyNames(t))if(of.has(n))throw new W(`${e}: enum member name ${n} collides with reserved property`);let n=new sf(e,t);return Object.assign(n,t)}var lf=class extends Qd{kind=`int32`;_read(e,t){return e.readInt32(t)}_write(e,t,n){Ud(e,-2147483648,2147483647,n),t.writeInt32(e)}};function uf(){return new lf}var df=class extends Qd{kind=`int64`;_read(e,t){return e.readBigInt64(t)}_write(e,t,n){Wd(e,-(1n<<63n),(1n<<63n)-1n,n),t.writeBigInt64(e)}};function ff(){return new df}var pf=class extends Qd{kind=`lazy`;getSchema;constructor(e){super(),this.getSchema=e}_read(e,t){e.enter(t);try{return this.getSchema()._read(e,t)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{this.getSchema()._write(e,t,n)}finally{t.exit()}}};function mf(e){return new pf(()=>e())}var hf=class extends Qd{constructor(e,t){super(t),this.length=e,Hd(e,`opaque length`)}length;kind=`opaque`;_read(e,t){let n=e.readBytes(this.length,t);return e.skipPadding(this.length,t),n}_write(e,t,n){if(Gd(e,n),e.length!==this.length)throw new W(`${n}: expected ${this.length} byte(s), got ${e.length}`);t.writeBytes(e),t.writePadding(e.length)}};function gf(e,t){return new hf(e,t)}var _f=class extends Qd{kind=`option`;element;constructor(e){super(),this.element=e}_read(e,t){e.enter(t);try{if(!rf._read(e,`${t}.present`))return null;let n=this.element._read(e,`${t}.value`);if(n===null)throw new W(`${t}: present option decoded to null, which is how an absent option is represented; wrap the element in a single-field struct to distinguish the two`);return n}finally{e.exit()}}_write(e,t,n){t.enter(n);try{rf._write(e!==null,t,`${n}.present`),e!==null&&this.element._write(e,t,`${n}.value`)}finally{t.exit()}}};function vf(e){if(e.kind===`option`)throw new W("option: cannot nest option directly inside option, since an absent outer option and a present-but-absent inner one are both `null`; wrap the inner option in a single-field struct instead");return new _f(e)}var yf=class extends Qd{constructor(e){super(),this.maxLength=e,Hd(e,`string maxLength`)}maxLength;kind=`string`;_read(e,t){let n=e.readUint32(t);if(n>this.maxLength)throw new W(`${t}: string byte length ${n} exceeds maximum ${this.maxLength}`);let r=e.readBytes(n,t);return e.skipPadding(n,t),r}_write(e,t,n){if(Gd(e,n),e.length>this.maxLength)throw new W(`${n}: string byte length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),t.writeBytes(e),t.writePadding(e.length)}};function bf(e){return new yf(e)}var xf=class extends Qd{kind=`struct`;entries;constructor(e,t){if(super(e),Object.getOwnPropertyNames(t).includes(`__proto__`))throw new W(`${e}: struct field name '__proto__' is not allowed`);this.entries=Object.entries(t)}_read(e,t){e.enter(t);try{let n={};for(let[r,i]of this.entries)n[r]=i._read(e,`${t}.${r}`);return n}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(!Vd(e))throw new W(`${n}: expected plain object`);let r=e;for(let[e,i]of this.entries){if(!Object.prototype.hasOwnProperty.call(r,e))throw new W(`${n}.${e}: missing struct field`);i._write(r[e],t,`${n}.${e}`)}}finally{t.exit()}}};function G(e,t){return new xf(e,t)}var Sf=class extends Qd{kind=`uint32`;_read(e,t){return e.readUint32(t)}_write(e,t,n){Ud(e,0,4294967295,n),t.writeUint32(e)}};function Cf(){return new Sf}var wf=class extends Qd{kind=`uint64`;_read(e,t){return e.readBigUint64(t)}_write(e,t,n){Wd(e,0n,(1n<<64n)-1n,n),t.writeBigUint64(e)}};function Tf(){return new wf}var Ef=`default`,Df=class extends Qd{kind=`union`;switchOn;cases;defaultArm;switchKey;#e=new Map;constructor(e,t,n,r,i){if(super(e),i===`__proto__`)throw new W(`${e}: switchKey '__proto__' is not allowed`);if(this.switchOn=t,this.cases=n,this.defaultArm=r,this.switchKey=i,n.length===0&&r===void 0)throw new W(`${e}: union needs at least one case or a default arm`);let a=new Set;for(let r of n){if(!t.validate(r.discriminant))throw new W(`${e}.${r.name}: case discriminator ${String(r.discriminant)} is not a valid ${t.name??t.kind} value`);if(a.has(r.name))throw new W(`${e}: duplicate union case name ${r.name}`);if(a.add(r.name),this.#e.has(r.discriminant))throw new W(`${e}: duplicate union discriminator ${String(r.discriminant)}`);jf(e,r.name,r.arm,i),this.#e.set(r.discriminant,r)}r!==void 0&&jf(e,Ef,r,i)}_read(e,t){e.enter(t);try{let n=this.switchOn._read(e,`${t}.${this.switchKey}`),r=this.#e.get(n),i=r?.arm??this.defaultArm;if(i===void 0)throw new W(`${t}: no case for union discriminator ${String(n)}`);return kf(n,i,this.switchKey,e,`${t}.${r?.name??Ef}`)}finally{e.exit()}}_write(e,t,n){t.enter(n);try{if(!Vd(e)||!Object.prototype.hasOwnProperty.call(e,this.switchKey))throw new W(`${n}: expected union object with ${this.switchKey} discriminator`);let r=e,i=r[this.switchKey],a=this.#e.get(i),o=a?.arm??this.defaultArm;if(o===void 0)throw new W(`${n}: no case for union discriminator ${String(i)}`);this.switchOn._write(i,t,`${n}.${this.switchKey}`),Af(r,o,t,`${n}.${a?.name??Ef}`)}finally{t.exit()}}};function K(e,t){return{kind:`field`,name:e,schema:t}}function q(e,t,n){return{name:e,discriminant:t,arm:n}}function Of(e,t){let n=t.switchKey??`type`;return new Df(e,t.switchOn,t.cases,t.defaultArm,n)}function kf(e,t,n,r,i){let a={};return a[n]=e,Mf(t)?(a[t.name]=t.schema._read(r,`${i}.${t.name}`),a):(t._read(r,i),a)}function Af(e,t,n,r){if(Mf(t)){if(!Object.prototype.hasOwnProperty.call(e,t.name))throw new W(`${r}.${t.name}: missing union arm payload`);t.schema._write(e[t.name],n,`${r}.${t.name}`)}else t._write(void 0,n,r)}function jf(e,t,n,r){if(Mf(n)&&n.name===r)throw new W(`${e}.${t}: union arm payload field must not be named ${r}`);if(Mf(n)&&n.name===`__proto__`)throw new W(`${e}.${t}: union arm payload field name '__proto__' is not allowed`)}function Mf(e){return`schema`in e}var Nf=class extends Qd{constructor(e,t){super(t),this.maxLength=e,Hd(e,`varOpaque maxLength`)}maxLength;kind=`varOpaque`;_read(e,t){let n=e.readUint32(t);if(n>this.maxLength)throw new W(`${t}: opaque length ${n} exceeds maximum ${this.maxLength}`);let r=e.readBytes(n,t);return e.skipPadding(n,t),r}_write(e,t,n){if(Gd(e,n),e.length>this.maxLength)throw new W(`${n}: opaque length ${e.length} exceeds maximum ${this.maxLength}`);t.writeUint32(e.length),t.writeBytes(e),t.writePadding(e.length)}};function Pf(e,t){return new Nf(e,t)}var Ff=class extends Qd{kind=`void`;_read(){}_write(e,t,n){if(e!==void 0)throw new W(`${n}: expected void`)}};function If(){return new Ff}var Lf=(1n<<64n)-1n,Rf=.30103,zf=2,Bf=1n<<127n,Vf=1n<<255n;function Hf(e,t){let n=BigInt(t);if(e){let e=1n<<n-1n;return[-e,e-1n]}return[0n,(1n<<n)-1n]}function Uf(e,t,n,r){let[i,a]=Hf(t,n);if(e<i||e>a)throw new W(`${r}: value ${e} out of range [${i}, ${a}]`)}function Wf(e,t,n){let r=Math.ceil(t*Rf)+zf;if(e.length>r)throw new W(`${n}: decimal string length ${e.length} exceeds the ${r}-character budget for a ${t}-bit integer`)}var Gf=/^[+-]?[0-9]+$/;function Kf(e,t){if(!Gf.test(e))throw new W(`${t}: "${e}" is not a decimal integer string`)}function qf(e,t,n,r){if(!Number.isInteger(e))throw new W(`${r}: value ${e} is not an integer`);let i=t?2**(n-1)-1:2**n-1,a=t?-2147483648:0;if(e<a||e>i)throw new W(`${r}: value ${e} out of range [${a}, ${i}]`)}function Jf(e,t){let n=t&&e<0n?e+Bf*2n:e,r=n&Lf,i=n>>64n&Lf;return{hi:t?Qf(i):i,lo:r}}function Yf(e,t){let n=(t?$f(e.hi):e.hi)<<64n|e.lo&Lf;return t&&n>=Bf?n-Bf*2n:n}function Xf(e,t){let n=t&&e<0n?e+Vf*2n:e,r=n&Lf,i=n>>64n&Lf,a=n>>128n&Lf,o=n>>192n&Lf;return{hiHi:t?Qf(o):o,hiLo:a,loHi:i,loLo:r}}function Zf(e,t){let n=(t?$f(e.hiHi):e.hiHi)<<192n|(e.hiLo&Lf)<<128n|(e.loHi&Lf)<<64n|e.loLo&Lf;return t&&n>=Vf?n-Vf*2n:n}function Qf(e){return e>=1n<<63n?e-(1n<<64n):e}function $f(e){return e<0n?e+(1n<<64n):e}var ep=Object.prototype.toString,tp=`[object Uint8Array]`,np=`[object ArrayBuffer]`;function rp(e,t,n){return e?e.constructor===t||ep.call(e)===n:!1}function ip(e){return rp(e,Uint8Array,tp)}function ap(e){return rp(e,ArrayBuffer,np)}function op(e){return ip(e)||ap(e)}function sp(e){return ap(e)?new Uint8Array(e):e}function cp(e){if(!op(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function lp(e,t){if(e.length===0)return new Uint8Array;t??=e.reduce((e,t)=>e+t.byteLength,0);let n=new Uint8Array(t),r=0;for(let t of e)cp(t),t=sp(t),n.set(t,r),r+=t.length;return n}function up(e,t){if(cp(e),cp(t),e=sp(e),t=sp(t),e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function dp(e,t){cp(e),cp(t),e=sp(e),t=sp(t);let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r]-t[r];if(n!==0)return Math.sign(n)}return Math.sign(e.length-t.length)}var fp={utf8:new globalThis.TextDecoder(`utf8`)};function pp(e,t=`utf8`){return cp(e),fp[t]??=new globalThis.TextDecoder(t),fp[t].decode(e)}function mp(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}var hp=new globalThis.TextEncoder;function gp(e){return mp(e),hp.encode(e)}var _p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function vp(e){cp(e),e=sp(e);let t=``;for(let n=0;n<e.length;n++)t+=_p[e[n]];return t}var yp={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function bp(e){if(mp(e),e.length%2!=0)throw Error(`Invalid Hex string length.`);let t=e.length/2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=yp[e[r*2]],i=yp[e[r*2+1]];if(t===void 0||i===void 0)throw Error(`Invalid Hex character encountered at position ${r*2}`);n[r]=t<<4|i}return n}function xp(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``);let t=e.includes(`-`)||e.includes(`_`)?e.replace(/-/g,`+`).replace(/_/g,`/`):e,n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);return r}var Sp=65535;function Cp(e){if(!(e instanceof Uint8Array))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``);let t=``;for(let n=0;n<e.length;n+=Sp){let r=e.subarray(n,n+Sp);t+=btoa(String.fromCharCode.apply(null,r))}return t}var wp=`0123456789abcdef`,Tp=class e{bytes;constructor(t){if(t instanceof e)this.bytes=t.bytes.slice();else if(typeof t==`string`)this.bytes=new TextEncoder().encode(t);else if(t instanceof Uint8Array)this.bytes=t;else throw TypeError(`XdrString: expected string, Uint8Array, or XdrString`)}get length(){return this.bytes.length}toStringStrict(){return new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(this.bytes)}toString(){return new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}).decode(this.bytes)}asStringOrBytes(){try{return this.toStringStrict()}catch{return this.bytes}}toJson(){let e=``;for(let t=0;t<this.bytes.length;t+=1){let n=this.bytes[t];switch(n){case 0:e+=`\\0`;break;case 9:e+=`\\t`;break;case 10:e+=`\\n`;break;case 13:e+=`\\r`;break;case 92:e+=`\\\\`;break;default:e+=n>=32&&n<=126?String.fromCharCode(n):`\\x`+wp[n>>4&15]+wp[n&15]}}return e}toJSON(){return this.toJson()}static fromJson(t){let n=[];for(let e=0;e<t.length;e+=1){let r=t.charCodeAt(e);if(r===92)switch(t.charCodeAt(e+1)){case 92:n.push(92),e+=1;break;case 48:n.push(0),e+=1;break;case 116:n.push(9),e+=1;break;case 110:n.push(10),e+=1;break;case 114:n.push(13),e+=1;break;case 120:case 88:{if(e+3>=t.length)throw new W(`XdrString: truncated \\x escape at index ${e}`);let r=Ep(t.charCodeAt(e+2)),i=Ep(t.charCodeAt(e+3));if(r<0||i<0)throw new W(`XdrString: invalid \\x escape "${t.slice(e,e+4)}"`);n.push(r<<4|i),e+=3;break}default:throw new W(`XdrString: unsupported escape \\${t[e+1]??``}`)}else if(r>=32&&r<=126)n.push(r);else throw new W(`XdrString: non-ASCII char (code 0x${r.toString(16)}) at index ${e}`)}return new e(Uint8Array.from(n))}equals(t){return this===t||t instanceof e&&up(this.bytes,t.bytes)}};function Ep(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:-1}var Dp=class extends Qd{kind=`string`;maxLength;#e;constructor(e){super(),this.maxLength=e,this.#e=bf(e)}_read(e,t){return new Tp(this.#e._read(e,t))}_write(e,t,n){if(!(e instanceof Tp)&&typeof e!=`string`&&!(e instanceof Uint8Array))throw new W(`${n}: expected string, Uint8Array, or XdrString`);let r=e instanceof Tp?e:new Tp(e);this.#e._write(r.bytes,t,n)}};function Op(e){return new Dp(e)}function kp(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e[n],i=n>0?e[n-1]:``,a=n+1<e.length?e[n+1]:``,o=Vp(r)&&(Bp(i)||Hp(i)),s=Vp(r)&&Vp(i)&&Bp(a);n>0&&(o||s)&&(t+=`_`),t+=r.toLowerCase()}return t}var Ap=new Set([`type`,`ref`,`move`,`box`,`self`,`match`,`loop`,`fn`,`mod`,`in`,`as`]);function jp(e){return kp(e)}function Mp(e){let t=kp(e);return Ap.has(t)?`${t}_`:void 0}var Np=new WeakMap,Pp=new WeakMap,Fp=new WeakMap;function Ip(e){let t=Fp.get(e);if(t)return t;let n=new Set;for(let[t]of e){n.add(jp(t));let e=Mp(t);e!==void 0&&n.add(e)}return Fp.set(e,n),n}function Lp(e,t){let n=Np.get(t);if(n)return n;let r=new Map,i=new Map;for(let n of t.values()){let t=kp(e&&n.startsWith(e)?n.slice(e.length):n);r.set(n,t),i.set(t,n)}let a={bySource:r,byJson:i};return Np.set(t,a),a}function Rp(e){let t=Pp.get(e);if(t)return t;let n=zp(e);return Pp.set(e,n),n}function zp(e){let t=e.switchOn,n=new Map,r=new Map;if(t.kind===`enum`&&t.nameByValue){let i=Lp(t.memberPrefix,t.nameByValue);for(let a of e.cases){let e=t.nameByValue.get(a.discriminant),o=(e&&i.bySource.get(e))??kp(a.name);n.set(a.name,o),r.set(o,a.name)}return{bySource:n,byJson:r}}if(t.kind===`int32`||t.kind===`uint32`){for(let t of e.cases){let e=typeof t.discriminant==`number`?`v${t.discriminant}`:kp(t.name);n.set(t.name,e),r.set(e,t.name)}return{bySource:n,byJson:r}}for(let t of e.cases){let e=kp(t.name);n.set(t.name,e),r.set(e,t.name)}return{bySource:n,byJson:r}}function Bp(e){return e>=`a`&&e<=`z`}function Vp(e){return e>=`A`&&e<=`Z`}function Hp(e){return e>=`0`&&e<=`9`}function Up(e){if(Object.keys(e).length>0)throw TypeError(`Unexpected extra options`)}Object.getPrototypeOf(Uint8Array);var Wp=new TextEncoder,Gp=new TextDecoder(`utf-8`,{ignoreBOM:!0}),Kp=new TextDecoder(`latin1`,{ignoreBOM:!0}),qp=globalThis.Buffer;function Jp(e){if(!(e&&e instanceof Uint8Array))throw TypeError(`Expected an Uint8Array`)}var Yp=`Input is not a string`;function Xp(e,t){switch(t){case`uint8`:if(e.constructor!==Uint8Array)throw Error(`Unexpected`);return e;case`arraybuffer`:if(e.byteLength!==e.buffer.byteLength)throw Error(`Unexpected`);return e.buffer;case`buffer`:return e.length<=64?qp.from(e):qp.from(e.buffer,e.byteOffset,e.byteLength)}throw TypeError(`Unexpected format`)}var Zp=globalThis.atob,Qp=Uint8Array.prototype.toBase64,$p=8192,em=Qp&&Zp;function tm(e,t=0,n=e.length){t|=0,n|=0;let r=n-t;if(r===0)return``;if(em&&r>=256&&r<1e8&&e.toBase64===Qp&&e.BYTES_PER_ELEMENT===1)return Zp((t===0&&n===e.length?e:e.subarray(t,n)).toBase64());if(r>$p){let r=``;for(let i=t;i<n;){let t=Math.min(n,i+$p);r+=String.fromCharCode.apply(String,e.subarray(i,t)),i=t}return r}let i=t===0&&n===e.length?e:e.subarray(t,n);return String.fromCharCode.apply(String,i)}var nm=Kp?e=>Kp.decode(e):e=>tm(e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),rm=(e,t)=>{let n=Wp.encode(e);if(n.length!==e.length)throw SyntaxError(t);return n},im=[{},{},{}],am=[[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`],[...`0123456789ABCDEFGHIJKLMNOPQRSTUV`],[...`0123456789ABCDEFGHJKMNPQRSTVWXYZ`]],om=`Invalid character in base32 input`,sm=`Invalid base32 padding`,cm=`Invalid base32 length`,lm=`Invalid last chunk`;function um(e,t,n){Jp(e);let r=Math.floor(e.length/5),i=r*5,a=``,o=0,s=am[t],c=im[t];if(!c.pairs){if(c.pairs=[],Gp){c.codepairs=new Uint16Array(1024);let e=c.codepairs,t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<32;e++){let n=s[e].charCodeAt(0);for(let r=0;r<32;r++)t[e<<6|r<<1]=t[r<<6|(e<<1)+1]=n}}else{let e=c.pairs;for(let t=0;t<32;t++)for(let n=0;n<32;n++)e.push(`${s[t]}${s[n]}`)}}let{pairs:l,codepairs:u}=c;if(Gp){let t=new Uint16Array(r*4);for(let n=0;o<i;o+=5){let r=e[o],i=e[o+1],a=e[o+2],s=e[o+3],c=e[o+4],l=r<<2|i>>6,d=(i&63)<<4|a>>4,f=(a&15)<<6|s>>2,p=(s&3)<<8|c;t[n]=u[l],t[n+1]=u[d],t[n+2]=u[f],t[n+3]=u[p],n+=4}a=nm(t)}else for(;o<i;o+=5){let t=e[o],n=e[o+1],r=e[o+2],i=e[o+3],s=e[o+4],c=t<<2|n>>6,u=(n&63)<<4|r>>4,d=(r&15)<<6|i>>2,f=(i&3)<<8|s;a+=l[c],a+=l[u],a+=l[d],a+=l[f]}let d=0,f=3;for(;o<e.length;o++){let t=e[o];a+=s[d|t>>f],f>=5&&(f-=5,a+=s[t>>f&31]),d=t<<5-f&31,f+=3}return f!==3&&(a+=s[d]),n&&(a+=[``,`======`,`====`,`===`,`=`][e.length-i]),a}var dm=Wp?128:65536;function fm(e,t){let n=e.length;for(;e[n-1]===`=`;)n--;let r=e.length-n,i=n%8,a=n-i;if(![0,2,4,5,7].includes(i))throw SyntaxError(cm);if(r>7||r!==0&&e.length%8!=0)throw SyntaxError(sm);let o=am[t],s=im[t];if(!s.fromMap){s.fromMap=new Int8Array(dm).fill(-1);let e=s.fromMap;o.forEach((t,n)=>{e[t.charCodeAt(0)]=e[t.toLowerCase().charCodeAt(0)]=n}),t===2&&(e[73]=e[76]=e[105]=e[108]=e[49],e[79]=e[111]=e[48])}let c=s.fromMap,l=new Uint8Array(Math.floor(n*5/8)),u=0,d=0;if(Wp){let t=rm(e,om);for(;d<a;d+=8){let e=t[d],n=t[d+1],r=t[d+2],i=t[d+3],a=t[d+4],o=t[d+5],s=t[d+6],f=t[d+7],p=c[e]<<15|c[n]<<10|c[r]<<5|c[i],m=c[a]<<15|c[o]<<10|c[s]<<5|c[f];if(p<0||m<0)throw SyntaxError(om);l[u]=p>>12,l[u+1]=p>>4&255,l[u+2]=p<<4&255|m>>16,l[u+3]=m>>8&255,l[u+4]=m&255,u+=5}}else for(;d<a;d+=8){let t=e.charCodeAt(d),n=e.charCodeAt(d+1),r=e.charCodeAt(d+2),i=e.charCodeAt(d+3),a=e.charCodeAt(d+4),o=e.charCodeAt(d+5),s=e.charCodeAt(d+6),f=e.charCodeAt(d+7),p=c[t]<<15|c[n]<<10|c[r]<<5|c[i],m=c[a]<<15|c[o]<<10|c[s]<<5|c[f];if(p<0||m<0)throw SyntaxError(om);l[u]=p>>12,l[u+1]=p>>4&255,l[u+2]=p<<4&255|m>>16,l[u+3]=m>>8&255,l[u+4]=m&255,u+=5}if(i<2)return l;let f=c[e.charCodeAt(d++)]<<5|c[e.charCodeAt(d++)];if(f<0)throw SyntaxError(om);if(l[u++]=f>>2,i<4){if(f&3)throw SyntaxError(lm);return l}let p=c[e.charCodeAt(d++)]<<5|c[e.charCodeAt(d++)];if(p<0)throw SyntaxError(om);if(l[u++]=f<<6&255|p>>4,i<5){if(p&15)throw SyntaxError(lm);return l}let m=c[e.charCodeAt(d++)];if(m<0)throw SyntaxError(om);if(l[u++]=p<<4&255|m>>1,i<7){if(m&1)throw SyntaxError(lm);return l}let h=c[e.charCodeAt(d++)]<<5|c[e.charCodeAt(d++)];if(h<0)throw SyntaxError(om);if(l[u++]=m<<7&255|h>>3,h&7)throw SyntaxError(lm);return l}function pm(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(Yp);if(i!==null&&Up(i),n===!0){if(e.length%8!=0)throw SyntaxError(sm)}else if(n===!1){if(e.endsWith(`=`))throw SyntaxError(`Did not expect padding in base32 input`)}else if(n!==`both`)throw TypeError(`Invalid padding option`);return Xp(fm(e,t),r)}var mm=(e=>(t,n)=>{if(!n)return pm(t,e,`both`,`uint8`,null);let{format:r=`uint8`,padding:i=`both`,...a}=n;return pm(t,e,i,r,a)})(0),hm=(e,{padding:t=!1}={})=>um(e,0,t);function gm(e,t){if(e.length!==t.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}var _m={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16,liquidityPool:88,claimableBalance:8,muxedContract:176},vm={G:`ed25519PublicKey`,S:`ed25519SecretSeed`,M:`med25519PublicKey`,T:`preAuthTx`,X:`sha256Hash`,P:`signedPayload`,C:`contract`,L:`liquidityPool`,B:`claimableBalance`,W:`muxedContract`};function ym(e){return Object.prototype.hasOwnProperty.call(_m,e)}function bm(e){switch(e){case`ed25519PublicKey`:case`ed25519SecretSeed`:case`preAuthTx`:case`sha256Hash`:case`contract`:case`liquidityPool`:return[56,56];case`claimableBalance`:return[58,58];case`med25519PublicKey`:case`muxedContract`:return[69,69];case`signedPayload`:return[56,165]}}function xm(e,t){if(!ym(e))return!1;let[n,r]=bm(e);return t.length>=n&&t.length<=r}function Sm(e,t){if(!ym(e))return Error(`${e} is not a valid version byte name. Expected one of ${Object.keys(_m).join(`, `)}`);let[n,r]=bm(e);return Error(`invalid encoded string length: expected ${n===r?n:`${n}-${r}`}, got ${t.length}`)}function Cm(e){if(e.length<36)throw Error(`signed payload: too short to carry a payload length`);let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(32);if(t<1||t>64)throw Error(`signed payload: declared length ${t} outside 1-64`);let n=36+Math.ceil(t/4)*4;if(e.length!==n)throw Error(`signed payload: declared length ${t} needs ${n} bytes, got ${e.length}`);for(let n=36+t;n<e.length;n++)if(e[n]!==0)throw Error(`signed payload: non-zero padding`)}function wm(e){if(e[0]!==0)throw Error(`claimable balance: unknown discriminant ${e[0]}, expected 0 (CLAIMABLE_BALANCE_ID_TYPE_V0)`)}var J=class{static types=vm;static encodeEd25519PublicKey(e){return Dm(`ed25519PublicKey`,e)}static decodeEd25519PublicKey(e){return Em(`ed25519PublicKey`,e)}static isValidEd25519PublicKey(e){return Tm(`ed25519PublicKey`,e)}static encodeEd25519SecretSeed(e){return Dm(`ed25519SecretSeed`,e)}static decodeEd25519SecretSeed(e){return Em(`ed25519SecretSeed`,e)}static isValidEd25519SecretSeed(e){return Tm(`ed25519SecretSeed`,e)}static encodeMed25519PublicKey(e){return Dm(`med25519PublicKey`,e)}static decodeMed25519PublicKey(e){return Em(`med25519PublicKey`,e)}static isValidMed25519PublicKey(e){return Tm(`med25519PublicKey`,e)}static encodePreAuthTx(e){return Dm(`preAuthTx`,e)}static decodePreAuthTx(e){return Em(`preAuthTx`,e)}static encodeSha256Hash(e){return Dm(`sha256Hash`,e)}static decodeSha256Hash(e){return Em(`sha256Hash`,e)}static encodeSignedPayload(e){return Dm(`signedPayload`,e)}static decodeSignedPayload(e){return Em(`signedPayload`,e)}static isValidSignedPayload(e){return Tm(`signedPayload`,e)}static encodeContract(e){return Dm(`contract`,e)}static decodeContract(e){return Em(`contract`,e)}static isValidContract(e){return Tm(`contract`,e)}static encodeClaimableBalance(e){return Dm(`claimableBalance`,e)}static decodeClaimableBalance(e){return Em(`claimableBalance`,e)}static isValidClaimableBalance(e){return Tm(`claimableBalance`,e)}static encodeMuxedContract(e){return Dm(`muxedContract`,e)}static decodeMuxedContract(e){return Em(`muxedContract`,e)}static isValidMuxedContract(e){return Tm(`muxedContract`,e)}static encodeLiquidityPool(e){return Dm(`liquidityPool`,e)}static decodeLiquidityPool(e){return Em(`liquidityPool`,e)}static isValidLiquidityPool(e){return Tm(`liquidityPool`,e)}static getVersionByteForPrefix(e){return e.length<1?void 0:vm[e[0]]}};function Tm(e,t){if(typeof t!=`string`||!xm(e,t)||vm[t[0]]!==e)return!1;let n;try{n=Em(e,t)}catch{return!1}switch(e){case`ed25519PublicKey`:case`ed25519SecretSeed`:case`preAuthTx`:case`sha256Hash`:case`contract`:case`liquidityPool`:return n.length===32;case`claimableBalance`:return n.length===33;case`med25519PublicKey`:case`muxedContract`:return n.length===40;case`signedPayload`:return!0;default:return!1}}function Em(e,t){if(typeof t!=`string`)throw TypeError(`encoded argument must be of type String`);if(!xm(e,t))throw Sm(e,t);let n=mm(t,{padding:!1}),r=n[0],i=n.slice(0,-2),a=i.slice(1),o=n.slice(-2);if(t!==hm(n))throw Error(`invalid encoded string`);let s=_m[e];if(r!==s)throw Error(`invalid version byte. expected ${s}, got ${r}`);if(!gm(Om(i),o))throw Error(`invalid checksum`);return e===`signedPayload`&&Cm(a),e===`claimableBalance`&&wm(a),a}function Dm(e,t){if(t==null)throw Error(`cannot encode null data`);if(!ym(e))throw Error(`${e} is not a valid version byte name. Expected one of ${Object.keys(_m).join(`, `)}`);let n=_m[e],r=lp([Uint8Array.of(n),t]);return hm(lp([r,Om(r)]))}function Om(e){let t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],n=0;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===void 0)continue;let a=n>>8^i;n=n<<8^(t[a]??0),n&=65535}let r=new Uint8Array(2);return r[0]=n&255,r[1]=n>>8&255,r}function km(e,t){Uf(t,!1,64,`MuxedContract.id`);let n=new Uint8Array(40);return n.set(e,0),new DataView(n.buffer).setBigUint64(32,t),n}function Am(e){return{contractId:e.subarray(0,32),id:new DataView(e.buffer,e.byteOffset,e.byteLength).getBigUint64(32)}}var jm=new Map;function Mm(e,t){let n=t.name?jm.get(t.name):void 0;if(n)return n.toJson(e);let r=t;switch(r.kind){case`bool`:return e;case`void`:return null;case`int32`:case`uint32`:return e;case`float`:case`double`:return e;case`int64`:case`uint64`:return e.toString();case`string`:return e.toJson();case`opaque`:case`varOpaque`:return vp(e);case`enum`:{let n=r,i=n.nameByValue.get(e);if(i===void 0)throw new W(`${t.name??`enum`}: unknown enum value ${String(e)}`);return Lp(n.memberPrefix,n.nameByValue).bySource.get(i)??i}case`option`:return e===null?null:Mm(e,r.element);case`array`:case`fixedArray`:return e.map(e=>Mm(e,r.element));case`struct`:{let t=e,n={};for(let[e,i]of r.entries)n[jp(e)]=Mm(t[e],i);return n}case`union`:{let n=e,i=n[r.switchKey],a=r.cases.find(e=>e.discriminant===i);if(a===void 0)throw r.defaultArm===void 0?new W(`${t.name??`union`}: no case for discriminator ${String(i)}`):new W(`${t.name??`union`}: default arms are not supported in JSON`);let o=a.arm,s=Rp(r).bySource.get(a.name)??a.name;return Fm(o)?{[s]:Mm(n[o.name],o.schema)}:s}case`lazy`:return Mm(e,r.getSchema());default:throw new W(`${t.name??t.kind}: toJson unsupported for kind ${t.kind}`)}}function Nm(e,t){let n=t.name?jm.get(t.name):void 0;if(n)return n.fromJson(e);let r=t;switch(r.kind){case`bool`:return Lm(e,`boolean`,t),e;case`void`:return;case`int32`:case`uint32`:{Lm(e,`number`,t);let n=e,i=r.kind===`int32`,a=i?-2147483648:0,o=i?2**31-1:2**32-1;if(!Number.isInteger(n)||n<a||n>o)throw new W(`${t.name??r.kind}: value ${n} is not a valid ${r.kind}`);return n}case`float`:case`double`:return Lm(e,`number`,t),e;case`int64`:case`uint64`:{Lm(e,`string`,t),Wf(e,64,t.name??r.kind),Kf(e,t.name??r.kind);let n;try{n=BigInt(e)}catch{throw new W(`${t.name??r.kind}: "${e}" is not a valid ${r.kind}`)}return Uf(n,r.kind===`int64`,64,t.name??r.kind),n}case`string`:{Lm(e,`string`,t);let n=Tp.fromJson(e);if(n.length>r.maxLength)throw new W(`${t.name??`string`}: length ${n.length} exceeds max ${r.maxLength}`);return n}case`opaque`:case`varOpaque`:{Lm(e,`string`,t);let n;try{n=bp(e)}catch{throw new W(`${t.name??r.kind}: expected a hex string`)}if(r.kind===`opaque`&&n.length!==r.length)throw new W(`${t.name??`opaque`}: expected ${r.length} byte(s), got ${n.length}`);if(r.kind===`varOpaque`&&n.length>r.maxLength)throw new W(`${t.name??`varOpaque`}: length ${n.length} exceeds max ${r.maxLength}`);return n}case`enum`:{let n=r;Lm(e,`string`,t);let i=e,a=Lp(n.memberPrefix,n.nameByValue).byJson.get(i);if(a!==void 0){for(let[e,t]of n.nameByValue)if(t===a)return e}throw new W(`${t.name??`enum`}: unknown enum name ${i}`)}case`option`:return e===null?null:Nm(e,r.element);case`array`:if(!Array.isArray(e))throw new W(`${t.name??`array`}: expected JSON array, got ${typeof e}`);if(e.length>r.maxLength)throw new W(`${t.name??`array`}: length ${e.length} exceeds max ${r.maxLength}`);return e.map(e=>Nm(e,r.element));case`fixedArray`:if(!Array.isArray(e))throw new W(`${t.name??`fixedArray`}: expected JSON array, got ${typeof e}`);if(e.length!==r.length)throw new W(`${t.name??`fixedArray`}: expected length ${r.length}, got ${e.length}`);return e.map(e=>Nm(e,r.element));case`struct`:{if(!Rm(e))throw new W(`${t.name??`struct`}: expected JSON object`);let n=e,i={},a=Ip(r.entries);for(let e of Object.keys(n))if(!a.has(e))throw new W(`${t.name??`struct`}: unknown field ${e}`);for(let[e,a]of r.entries){let r=jp(e),o=Mp(e);if(o!==void 0&&Object.hasOwn(n,r)&&Object.hasOwn(n,o))throw new W(`${t.name??`struct`}: field ${e} given as both ${r} and ${o}`);let s=Object.hasOwn(n,r)?r:o!==void 0&&Object.hasOwn(n,o)?o:void 0;if(s===void 0){if(Im(a).kind===`option`){i[e]=null;continue}throw new W(`${t.name??`struct`}: missing field ${r}`)}i[e]=Nm(n[s],a)}return i}case`union`:return Pm(e,r);case`lazy`:return Nm(e,r.getSchema());default:throw new W(`${t.name??t.kind}: fromJson unsupported for kind ${t.kind}`)}}function Pm(e,t){let n,r;if(typeof e==`string`)n=e;else if(Rm(e)){let i=Object.keys(e);if(i.length!==1)throw new W(`${t.name??`union`}: expected single-key object, got ${i.length}`);n=i[0],r=e[n]}else throw new W(`${t.name??`union`}: expected string or single-key object`);let i=Rp(t).byJson.get(n),a=i===void 0?void 0:t.cases.find(e=>e.name===i);if(a===void 0)throw t.defaultArm===void 0?new W(`${t.name??`union`}: unknown case ${n}`):new W(`${t.name??`union`}: default arms are not supported in JSON`);let o=a.arm,s=a.discriminant,c={[t.switchKey]:s};if(Fm(o)){if(r===void 0)throw new W(`${t.name??`union`}.${n}: missing arm payload`);c[o.name]=Nm(r,o.schema)}else if(r!=null)throw new W(`${t.name??`union`}.${n}: unexpected payload for void arm`);return c}function Fm(e){return typeof e==`object`&&!!e&&`schema`in e}function Im(e){let t=e;for(;t.kind===`lazy`;)t=t.getSchema();return t}function Lm(e,t,n){if(typeof e!==t)throw new W(`${n.name??n.kind}: expected JSON ${t}, got ${typeof e}`)}function Rm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Uint8Array)}function zm(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Bm(e){Uf(e.id,!1,64,`MuxedEd25519Account.id`);let t=new Uint8Array(40);return t.set(e.ed25519,0),zm(t).setBigUint64(32,e.id),J.encodeMed25519PublicKey(t)}function Vm(e){let t=J.decodeMed25519PublicKey(e);return{id:zm(t).getBigUint64(32),ed25519:t.subarray(0,32)}}function Hm(e){return J.encodeMuxedContract(km(e.contractId,e.id))}function Um(e){return Am(J.decodeMuxedContract(e))}function Wm(e){let t=new Uint8Array(36+Ym(e.payload.length));return t.set(e.ed25519,0),zm(t).setUint32(32,e.payload.length),t.set(e.payload,36),J.encodeSignedPayload(t)}function Gm(e){let t=J.decodeSignedPayload(e);return{ed25519:t.subarray(0,32),payload:t.subarray(36,36+zm(t).getUint32(32))}}jm.set(`PublicKey`,{toJson(e){let t=e;if(t.type!==0)throw new W(`PublicKey: unsupported variant ${t.type} for JSON output`);return J.encodeEd25519PublicKey(t.ed25519)},fromJson(e){if(typeof e!=`string`)throw new W(`PublicKey: expected G-strkey string`);return{type:0,ed25519:J.decodeEd25519PublicKey(e)}}}),jm.set(`MuxedAccount`,{toJson(e){let t=e;return t.type===0?J.encodeEd25519PublicKey(t.ed25519):Bm(t.med25519)},fromJson(e){if(typeof e!=`string`)throw new W(`MuxedAccount: expected strkey string`);if(e.startsWith(`G`))return{type:0,ed25519:J.decodeEd25519PublicKey(e)};if(e.startsWith(`M`))return{type:256,med25519:Vm(e)};throw new W(`MuxedAccount: unsupported strkey prefix in ${e}`)}});var Km={toJson(e){return Bm(e)},fromJson(e){if(typeof e!=`string`)throw new W(`med25519 account: expected M-strkey string`);return Vm(e)}};jm.set(`MuxedEd25519Account`,Km),jm.set(`MuxedAccountMed25519`,Km),jm.set(`MuxedContract`,{toJson(e){return Hm(e)},fromJson(e){if(typeof e!=`string`)throw new W(`MuxedContract: expected W-strkey string`);return Um(e)}}),jm.set(`SignerKey`,{toJson(e){let t=e;switch(t.type){case 0:return J.encodeEd25519PublicKey(t.ed25519);case 1:return J.encodePreAuthTx(t.preAuthTx);case 2:return J.encodeSha256Hash(t.hashX);case 3:return Wm(t.ed25519SignedPayload)}},fromJson(e){if(typeof e!=`string`)throw new W(`SignerKey: expected strkey string`);if(e.startsWith(`G`))return{type:0,ed25519:J.decodeEd25519PublicKey(e)};if(e.startsWith(`T`))return{type:1,preAuthTx:J.decodePreAuthTx(e)};if(e.startsWith(`X`))return{type:2,hashX:J.decodeSha256Hash(e)};if(e.startsWith(`P`))return{type:3,ed25519SignedPayload:Gm(e)};throw new W(`SignerKey: unsupported strkey prefix in ${e}`)}}),jm.set(`SignerKeyEd25519SignedPayload`,{toJson(e){return Wm(e)},fromJson(e){if(typeof e!=`string`)throw new W(`SignerKeyEd25519SignedPayload: expected P-strkey string`);return Gm(e)}}),jm.set(`ScAddress`,{toJson(e){let t=e;switch(t.type){case 0:return J.encodeEd25519PublicKey(t.accountId.ed25519);case 1:return J.encodeContract(t.contractId);case 2:return Bm(t.muxedAccount);case 3:{let e=t.claimableBalanceId,n=new Uint8Array(33);return n.set(e.v0,1),J.encodeClaimableBalance(n)}case 4:return J.encodeLiquidityPool(t.liquidityPoolId);case 5:return Hm(t.muxedContract);default:throw new W(`ScAddress: unsupported type ${t.type}`)}},fromJson(e){if(typeof e!=`string`)throw new W(`ScAddress: expected strkey string`);if(e.startsWith(`G`))return{type:0,accountId:{type:0,ed25519:J.decodeEd25519PublicKey(e)}};if(e.startsWith(`C`))return{type:1,contractId:J.decodeContract(e)};if(e.startsWith(`M`))return{type:2,muxedAccount:Vm(e)};if(e.startsWith(`B`)){let t=J.decodeClaimableBalance(e);return{type:3,claimableBalanceId:{type:t[0],v0:t.subarray(1)}}}if(e.startsWith(`L`))return{type:4,liquidityPoolId:J.decodeLiquidityPool(e)};if(e.startsWith(`W`))return{type:5,muxedContract:Um(e)};throw new W(`ScAddress: unsupported strkey prefix in ${e}`)}}),jm.set(`ClaimableBalanceId`,{toJson(e){let t=e,n=new Uint8Array(33);return n.set(t.v0,1),J.encodeClaimableBalance(n)},fromJson(e){if(typeof e!=`string`)throw new W(`ClaimableBalanceId: expected B-strkey string`);let t=J.decodeClaimableBalance(e);return{type:t[0],v0:t.subarray(1)}}}),jm.set(`PoolId`,{toJson(e){return J.encodeLiquidityPool(e)},fromJson(e){if(typeof e!=`string`)throw new W(`PoolId: expected L-strkey string`);return J.decodeLiquidityPool(e)}}),jm.set(`ContractId`,{toJson(e){return J.encodeContract(e)},fromJson(e){if(typeof e!=`string`)throw new W(`ContractId: expected C-strkey string`);return J.decodeContract(e)}}),jm.set(`AssetCode4`,{toJson(e){return new Tp(qm(e,0)).toJson()},fromJson(e){if(typeof e!=`string`)throw new W(`AssetCode4: expected escaped-string JSON`);return Jm(Tp.fromJson(e).bytes,4)}}),jm.set(`AssetCode12`,{toJson(e){return new Tp(qm(e,5)).toJson()},fromJson(e){if(typeof e!=`string`)throw new W(`AssetCode12: expected escaped-string JSON`);let t=Tp.fromJson(e).bytes;if(t.length<5)throw new W(`AssetCode12: code must be at least 5 bytes; use AssetCode4 for shorter codes`);return Jm(t,12)}}),jm.set(`AssetCode`,{toJson(e){let t=e;return t.assetCode4===void 0?new Tp(qm(t.assetCode12,5)).toJson():new Tp(qm(t.assetCode4,0)).toJson()},fromJson(e){if(typeof e!=`string`)throw new W(`AssetCode: expected escaped-string JSON`);let t=Tp.fromJson(e).bytes;return t.length<=4?{type:1,assetCode4:Jm(t,4)}:{type:2,assetCode12:Jm(t,12)}}});function qm(e,t){let n=e.length;for(;n>t&&e[n-1]===0;)--n;return n===e.length?e:e.slice(0,n)}function Jm(e,t){if(e.length>=t)return e;let n=new Uint8Array(t);return n.set(e),n}jm.set(`Int128Parts`,{toJson(e){return Yf(e,!0).toString()},fromJson(e){if(typeof e!=`string`)throw new W(`Int128Parts: expected decimal string`);Wf(e,128,`Int128Parts`),Kf(e,`Int128Parts`);let t=BigInt(e);return Uf(t,!0,128,`Int128Parts`),Jf(t,!0)}}),jm.set(`Uint128Parts`,{toJson(e){return Yf(e,!1).toString()},fromJson(e){if(typeof e!=`string`)throw new W(`Uint128Parts: expected decimal string`);Wf(e,128,`Uint128Parts`),Kf(e,`Uint128Parts`);let t=BigInt(e);return Uf(t,!1,128,`Uint128Parts`),Jf(t,!1)}}),jm.set(`Int256Parts`,{toJson(e){return Zf(e,!0).toString()},fromJson(e){if(typeof e!=`string`)throw new W(`Int256Parts: expected decimal string`);Wf(e,256,`Int256Parts`),Kf(e,`Int256Parts`);let t=BigInt(e);return Uf(t,!0,256,`Int256Parts`),Xf(t,!0)}}),jm.set(`Uint256Parts`,{toJson(e){return Zf(e,!1).toString()},fromJson(e){if(typeof e!=`string`)throw new W(`Uint256Parts: expected decimal string`);Wf(e,256,`Uint256Parts`),Kf(e,`Uint256Parts`);let t=BigInt(e);return Uf(t,!1,256,`Uint256Parts`),Xf(t,!1)}});function Ym(e){return e+(4-e%4)%4}var Y=class e{toXdr(e=`raw`){let t=this.constructor;if(!t.schema)throw new W(`${t.name}: missing static schema`);return Qm(t.schema.encode(this.toXdrObject()),e)}toXDR(e=`raw`){return Qm(this.toXdr(),e)}toString(){return Cp(this.toXdr())}toJson(){let e=this.constructor;if(!e.schema)throw new W(`${e.name}: missing static schema`);return Mm(this.toXdrObject(),e.schema)}toJSON(){return this.toJson()}equals(t){return this===t?!0:t==null||!(t instanceof e)||this.constructor!==t.constructor?!1:up(this.toXdr(),t.toXdr())}static fromXdr(e,t){Zm(this,`fromXdr`,!0);let n=$m(e,t);return this.fromXdrObject(this.schema.decode(n))}static fromXDR(e,t){let n=$m(e,t);return this.fromXdrObject(this.schema.decode(n))}static validateXdr(e,t){Zm(this,`validateXdr`);let n;try{n=$m(e,t)}catch{return!1}return this.schema.validateXdr(n)}static validateXDR(e,t){let n;try{n=$m(e,t)}catch{return!1}return this.schema.validateXdr(n)}static fromJson(e){return Zm(this,`fromJson`,!0),this.fromXdrObject(Nm(e,this.schema))}};function Xm(e){return typeof e==`function`?e.name||`an anonymous function or class`:e==null?String(e):typeof e==`object`?`an instance of ${e.constructor?.name||`an anonymous object`}`:typeof e==`string`?`the string "${e}"`:`the ${typeof e} ${String(e)}`}function Zm(e,t,n=!1){if(!e?.schema)throw TypeError(`${t}: ${Xm(e)} has no static schema, so it is not a usable XDR type. Pass a generated class such as xdr.ScVal, or declare \`static readonly schema\` on a class of your own.`);if(n&&typeof e.fromXdrObject!=`function`)throw TypeError(`${t}: ${Xm(e)} has a static schema but no static fromXdrObject, so it can encode but not decode. Declare \`static fromXdrObject(wire)\` on it.`)}function Qm(e,t){switch(t){case`raw`:return e;case`hex`:return vp(e);case`base64`:return Cp(e);default:throw new W(`toXdr: unknown format "${String(t)}"`)}}function $m(e,t){if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`fromXdr: expected a string or Uint8Array, got ${typeof e}`);if(t===void 0||t===`raw`)throw new W(`fromXdr: string input requires format ('hex' | 'base64')`);if(t===`hex`||t===`base64`)try{return t===`hex`?bp(e):xp(e)}catch{throw new W(`invalid ${t} input`)}throw new W(`fromXdr: unknown format "${String(t)}"`)}function eh(e,t){return e instanceof Uint8Array?e:t===`ascii`?gp(e):$m(e,t)}function th(e,t){return t===`ascii`?pp(e):Qm(e,t)}var nh=class extends Y{value;constructor(e){super();let t=this.constructor,n=eh(e,t.encoding);if(typeof e==`string`&&t.padTo!==void 0&&n.length<t.padTo){let e=new Uint8Array(t.padTo);e.set(n),n=e}if(t.byteLength!==void 0&&n.length!==t.byteLength)throw new W(`${t.name}: expected ${t.byteLength} byte(s), got ${n.length}`);this.value=n}toString(){let e=this.constructor;return th(this.value,e.encoding)}toXdrObject(){return this.value}toBytes(){return this.value}},rh=class extends Y{name;value;constructor(e,t){super(),this.name=e,this.value=t}toXdrObject(){return this.value}};function ih(e,t){return Object.assign(e,{memberPrefix:t})}function ah(e,t,n,r){let i=t.nameByValue.get(r);if(i===void 0)throw new W(`${e}: unknown enum value ${r}`);return oh(e,n,i)}function oh(e,t,n){let r=t[n];if(!(r instanceof rh))throw new W(`${e}: unknown name ${n}`);return r}var sh=class e extends rh{static publicKeyTypeEd25519=new e(`publicKeyTypeEd25519`,0);static schema=cf(`PublicKeyType`,{publicKeyTypeEd25519:0});static fromValue(t){return ah(`PublicKeyType`,e.schema,e,t)}static fromName(t){return oh(`PublicKeyType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},ch=class e extends nh{static byteLength=32;static encoding=`hex`;static schema=gf(32,`Uint256Bytes`);static fromXdrObject(t){return new e(t)}},lh=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.PublicKey(...) is not supported: XDR unions are built from per-variant factories. Call xdr.PublicKey.publicKeyTypeEd25519(...) (or another arm factory) instead.`)}static schema=Of(`PublicKey`,{switchOn:sh.schema,cases:[q(`publicKeyTypeEd25519`,0,K(`ed25519`,ch.schema))]});static publicKeyTypeEd25519(e){return new uh(e)}static fromXdrObject(e){if(e.type===0)return new uh(ch.fromXdrObject(e.ed25519));throw new W(`PublicKey: unknown type ${e.type}`)}static is(t){return t instanceof e}},uh=class extends lh{type=`publicKeyTypeEd25519`;ed25519;constructor(e){super(),this.ed25519=e instanceof ch?e:new ch(e)}get value(){return this.ed25519}toXdrObject(){return{type:0,ed25519:this.ed25519.toXdrObject()}}},dh=lh,fh=class e extends rh{static signerKeyTypeEd25519=new e(`signerKeyTypeEd25519`,0);static signerKeyTypePreAuthTx=new e(`signerKeyTypePreAuthTx`,1);static signerKeyTypeHashX=new e(`signerKeyTypeHashX`,2);static signerKeyTypeEd25519SignedPayload=new e(`signerKeyTypeEd25519SignedPayload`,3);static schema=ih(cf(`SignerKeyType`,{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),`signerKeyType`);static fromValue(t){return ah(`SignerKeyType`,e.schema,e,t)}static fromName(t){return oh(`SignerKeyType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},ph=class e extends Y{ed25519;payload;static schema=G(`SignerKeyEd25519SignedPayload`,{ed25519:ch.schema,payload:Pf(64)});constructor(e){super(),this.ed25519=e.ed25519 instanceof ch?e.ed25519:new ch(e.ed25519),this.payload=e.payload}toXdrObject(){return{ed25519:this.ed25519.toXdrObject(),payload:this.payload}}static fromXdrObject(t){return new e({ed25519:ch.fromXdrObject(t.ed25519),payload:t.payload})}},mh=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.SignerKey(...) is not supported: XDR unions are built from per-variant factories. Call xdr.SignerKey.signerKeyTypeEd25519(...) (or another arm factory) instead.`)}static schema=Of(`SignerKey`,{switchOn:fh.schema,cases:[q(`signerKeyTypeEd25519`,0,K(`ed25519`,ch.schema)),q(`signerKeyTypePreAuthTx`,1,K(`preAuthTx`,ch.schema)),q(`signerKeyTypeHashX`,2,K(`hashX`,ch.schema)),q(`signerKeyTypeEd25519SignedPayload`,3,K(`ed25519SignedPayload`,ph.schema))]});static signerKeyTypeEd25519(e){return new hh(e)}static signerKeyTypePreAuthTx(e){return new gh(e)}static signerKeyTypeHashX(e){return new _h(e)}static signerKeyTypeEd25519SignedPayload(e){return new vh(e)}static fromXdrObject(e){switch(e.type){case 0:return new hh(ch.fromXdrObject(e.ed25519));case 1:return new gh(ch.fromXdrObject(e.preAuthTx));case 2:return new _h(ch.fromXdrObject(e.hashX));case 3:return new vh(ph.fromXdrObject(e.ed25519SignedPayload))}throw new W(`SignerKey: unknown type ${e.type}`)}static is(t){return t instanceof e}},hh=class extends mh{type=`signerKeyTypeEd25519`;ed25519;constructor(e){super(),this.ed25519=e instanceof ch?e:new ch(e)}get value(){return this.ed25519}toXdrObject(){return{type:0,ed25519:this.ed25519.toXdrObject()}}},gh=class extends mh{type=`signerKeyTypePreAuthTx`;preAuthTx;constructor(e){super(),this.preAuthTx=e instanceof ch?e:new ch(e)}get value(){return this.preAuthTx}toXdrObject(){return{type:1,preAuthTx:this.preAuthTx.toXdrObject()}}},_h=class extends mh{type=`signerKeyTypeHashX`;hashX;constructor(e){super(),this.hashX=e instanceof ch?e:new ch(e)}get value(){return this.hashX}toXdrObject(){return{type:2,hashX:this.hashX.toXdrObject()}}},vh=class extends mh{type=`signerKeyTypeEd25519SignedPayload`;ed25519SignedPayload;constructor(e){super(),this.ed25519SignedPayload=e}get value(){return this.ed25519SignedPayload}toXdrObject(){return{type:3,ed25519SignedPayload:this.ed25519SignedPayload.toXdrObject()}}},yh=mh,bh=class e extends Y{key;weight;static schema=G(`Signer`,{key:yh.schema,weight:Cf()});constructor(e){super(),this.key=e.key,this.weight=e.weight}toXdrObject(){return{key:this.key.toXdrObject(),weight:this.weight}}static fromXdrObject(t){return new e({key:yh.fromXdrObject(t.key),weight:t.weight})}},xh=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ExtensionPoint(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ExtensionPoint.v0() (or another arm factory) instead.`)}static schema=Of(`ExtensionPoint`,{switchOn:uf(),cases:[q(`v0`,0,If())],switchKey:`v`});static v0(){return new Sh}static fromXdrObject(e){if(e.v===0)return new Sh;throw new W(`ExtensionPoint: unknown v ${e.v}`)}static is(t){return t instanceof e}},Sh=class extends xh{type=`v0`;get value(){return null}toXdrObject(){return{v:0}}},Ch=xh,wh=class e extends rh{static assetTypeNative=new e(`assetTypeNative`,0);static assetTypeCreditAlphanum4=new e(`assetTypeCreditAlphanum4`,1);static assetTypeCreditAlphanum12=new e(`assetTypeCreditAlphanum12`,2);static assetTypePoolShare=new e(`assetTypePoolShare`,3);static schema=ih(cf(`AssetType`,{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),`assetType`);static fromValue(t){return ah(`AssetType`,e.schema,e,t)}static fromName(t){return oh(`AssetType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Th=class e extends nh{static byteLength=4;static padTo=4;static encoding=`ascii`;static schema=gf(4,`AssetCode4`);static fromXdrObject(t){return new e(t)}},Eh=class e extends nh{static byteLength=12;static padTo=12;static encoding=`ascii`;static schema=gf(12,`AssetCode12`);static fromXdrObject(t){return new e(t)}},Dh=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.AssetCode(...) is not supported: XDR unions are built from per-variant factories. Call xdr.AssetCode.assetTypeCreditAlphanum4(...) (or another arm factory) instead.`)}static schema=Of(`AssetCode`,{switchOn:wh.schema,cases:[q(`assetTypeCreditAlphanum4`,1,K(`assetCode4`,Th.schema)),q(`assetTypeCreditAlphanum12`,2,K(`assetCode12`,Eh.schema))]});static assetTypeCreditAlphanum4(e){return new Oh(e)}static assetTypeCreditAlphanum12(e){return new kh(e)}static fromXdrObject(e){switch(e.type){case 1:return new Oh(Th.fromXdrObject(e.assetCode4));case 2:return new kh(Eh.fromXdrObject(e.assetCode12))}throw new W(`AssetCode: unknown type ${e.type}`)}static is(t){return t instanceof e}},Oh=class extends Dh{type=`assetTypeCreditAlphanum4`;assetCode4;constructor(e){super(),this.assetCode4=e instanceof Th?e:new Th(e)}get value(){return this.assetCode4}toXdrObject(){return{type:1,assetCode4:this.assetCode4.toXdrObject()}}},kh=class extends Dh{type=`assetTypeCreditAlphanum12`;assetCode12;constructor(e){super(),this.assetCode12=e instanceof Eh?e:new Eh(e)}get value(){return this.assetCode12}toXdrObject(){return{type:2,assetCode12:this.assetCode12.toXdrObject()}}},Ah=Dh,jh=class e extends Y{trustor;asset;authorize;static schema=G(`AllowTrustOp`,{trustor:dh.schema,asset:Ah.schema,authorize:Cf()});constructor(e){super(),this.trustor=e.trustor,this.asset=e.asset,this.authorize=e.authorize}toXdrObject(){return{trustor:this.trustor.toXdrObject(),asset:this.asset.toXdrObject(),authorize:this.authorize}}static fromXdrObject(t){return new e({trustor:dh.fromXdrObject(t.trustor),asset:Ah.fromXdrObject(t.asset),authorize:t.authorize})}},Mh=class e extends Y{assetCode;issuer;static schema=G(`AlphaNum12`,{assetCode:Eh.schema,issuer:dh.schema});constructor(e){super(),this.assetCode=e.assetCode instanceof Eh?e.assetCode:new Eh(e.assetCode),this.issuer=e.issuer}toXdrObject(){return{assetCode:this.assetCode.toXdrObject(),issuer:this.issuer.toXdrObject()}}static fromXdrObject(t){return new e({assetCode:Eh.fromXdrObject(t.assetCode),issuer:dh.fromXdrObject(t.issuer)})}},Nh=class e extends Y{assetCode;issuer;static schema=G(`AlphaNum4`,{assetCode:Th.schema,issuer:dh.schema});constructor(e){super(),this.assetCode=e.assetCode instanceof Th?e.assetCode:new Th(e.assetCode),this.issuer=e.issuer}toXdrObject(){return{assetCode:this.assetCode.toXdrObject(),issuer:this.issuer.toXdrObject()}}static fromXdrObject(t){return new e({assetCode:Th.fromXdrObject(t.assetCode),issuer:dh.fromXdrObject(t.issuer)})}},Ph=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.Asset(...) is not supported: XDR unions are built from per-variant factories. Call xdr.Asset.assetTypeNative() (or another arm factory) instead.`)}static schema=Of(`Asset`,{switchOn:wh.schema,cases:[q(`assetTypeNative`,0,If()),q(`assetTypeCreditAlphanum4`,1,K(`alphaNum4`,Nh.schema)),q(`assetTypeCreditAlphanum12`,2,K(`alphaNum12`,Mh.schema))]});static assetTypeNative(){return new Fh}static assetTypeCreditAlphanum4(e){return new Ih(e)}static assetTypeCreditAlphanum12(e){return new Lh(e)}static fromXdrObject(e){switch(e.type){case 0:return new Fh;case 1:return new Ih(Nh.fromXdrObject(e.alphaNum4));case 2:return new Lh(Mh.fromXdrObject(e.alphaNum12))}throw new W(`Asset: unknown type ${e.type}`)}static is(t){return t instanceof e}},Fh=class extends Ph{type=`assetTypeNative`;get value(){return null}toXdrObject(){return{type:0}}},Ih=class extends Ph{type=`assetTypeCreditAlphanum4`;alphaNum4;constructor(e){super(),this.alphaNum4=e}get value(){return this.alphaNum4}toXdrObject(){return{type:1,alphaNum4:this.alphaNum4.toXdrObject()}}},Lh=class extends Ph{type=`assetTypeCreditAlphanum12`;alphaNum12;constructor(e){super(),this.alphaNum12=e}get value(){return this.alphaNum12}toXdrObject(){return{type:2,alphaNum12:this.alphaNum12.toXdrObject()}}},Rh=Ph,zh=class e extends nh{static encoding=`hex`;static schema=Pf(64,`Signature`);static fromXdrObject(t){return new e(t)}},Bh=class e extends nh{static byteLength=32;static encoding=`hex`;static schema=gf(32,`Hash`);static fromXdrObject(t){return new e(t)}},Vh=class e extends rh{static envelopeTypeTxV0=new e(`envelopeTypeTxV0`,0);static envelopeTypeScp=new e(`envelopeTypeScp`,1);static envelopeTypeTx=new e(`envelopeTypeTx`,2);static envelopeTypeAuth=new e(`envelopeTypeAuth`,3);static envelopeTypeScpvalue=new e(`envelopeTypeScpvalue`,4);static envelopeTypeTxFeeBump=new e(`envelopeTypeTxFeeBump`,5);static envelopeTypeOpId=new e(`envelopeTypeOpId`,6);static envelopeTypePoolRevokeOpId=new e(`envelopeTypePoolRevokeOpId`,7);static envelopeTypeContractId=new e(`envelopeTypeContractId`,8);static envelopeTypeSorobanAuthorization=new e(`envelopeTypeSorobanAuthorization`,9);static envelopeTypeSorobanAuthorizationWithAddress=new e(`envelopeTypeSorobanAuthorizationWithAddress`,10);static schema=ih(cf(`EnvelopeType`,{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9,envelopeTypeSorobanAuthorizationWithAddress:10}),`envelopeType`);static fromValue(t){return ah(`EnvelopeType`,e.schema,e,t)}static fromName(t){return oh(`EnvelopeType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Hh=class e extends Y{minTime;maxTime;static schema=G(`TimeBounds`,{minTime:Tf(),maxTime:Tf()});constructor(e){super(),this.minTime=e.minTime,this.maxTime=e.maxTime}toXdrObject(){return{minTime:this.minTime,maxTime:this.maxTime}}static fromXdrObject(t){return new e({minTime:t.minTime,maxTime:t.maxTime})}},Uh=class e extends rh{static memoNone=new e(`memoNone`,0);static memoText=new e(`memoText`,1);static memoId=new e(`memoId`,2);static memoHash=new e(`memoHash`,3);static memoReturn=new e(`memoReturn`,4);static schema=ih(cf(`MemoType`,{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),`memo`);static fromValue(t){return ah(`MemoType`,e.schema,e,t)}static fromName(t){return oh(`MemoType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Wh=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.Memo(...) is not supported: XDR unions are built from per-variant factories. Call xdr.Memo.memoNone() (or another arm factory) instead.`)}static schema=Of(`Memo`,{switchOn:Uh.schema,cases:[q(`memoNone`,0,If()),q(`memoText`,1,K(`text`,Op(28))),q(`memoId`,2,K(`id`,Tf())),q(`memoHash`,3,K(`hash`,Bh.schema)),q(`memoReturn`,4,K(`retHash`,Bh.schema))]});static memoNone(){return new Gh}static memoText(e){return new Kh(e)}static memoId(e){return new qh(e)}static memoHash(e){return new Jh(e)}static memoReturn(e){return new Yh(e)}static fromXdrObject(e){switch(e.type){case 0:return new Gh;case 1:return new Kh(e.text);case 2:return new qh(e.id);case 3:return new Jh(Bh.fromXdrObject(e.hash));case 4:return new Yh(Bh.fromXdrObject(e.retHash))}throw new W(`Memo: unknown type ${e.type}`)}static is(t){return t instanceof e}},Gh=class extends Wh{type=`memoNone`;get value(){return null}toXdrObject(){return{type:0}}},Kh=class extends Wh{type=`memoText`;text;constructor(e){super(),this.text=e instanceof Tp?e:new Tp(e)}get value(){return this.text.toString()}toXdrObject(){return{type:1,text:this.text}}},qh=class extends Wh{type=`memoId`;id;constructor(e){super(),this.id=e}get value(){return this.id}toXdrObject(){return{type:2,id:this.id}}},Jh=class extends Wh{type=`memoHash`;hash;constructor(e){super(),this.hash=e instanceof Bh?e:new Bh(e)}get value(){return this.hash}toXdrObject(){return{type:3,hash:this.hash.toXdrObject()}}},Yh=class extends Wh{type=`memoReturn`;retHash;constructor(e){super(),this.retHash=e instanceof Bh?e:new Bh(e)}get value(){return this.retHash}toXdrObject(){return{type:4,retHash:this.retHash.toXdrObject()}}},Xh=Wh,Zh=class e extends rh{static keyTypeEd25519=new e(`keyTypeEd25519`,0);static keyTypePreAuthTx=new e(`keyTypePreAuthTx`,1);static keyTypeHashX=new e(`keyTypeHashX`,2);static keyTypeEd25519SignedPayload=new e(`keyTypeEd25519SignedPayload`,3);static keyTypeMuxedEd25519=new e(`keyTypeMuxedEd25519`,256);static schema=ih(cf(`CryptoKeyType`,{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),`keyType`);static fromValue(t){return ah(`CryptoKeyType`,e.schema,e,t)}static fromName(t){return oh(`CryptoKeyType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Qh=class e extends Y{id;ed25519;static schema=G(`MuxedAccountMed25519`,{id:Tf(),ed25519:ch.schema});constructor(e){super(),this.id=e.id,this.ed25519=e.ed25519 instanceof ch?e.ed25519:new ch(e.ed25519)}toXdrObject(){return{id:this.id,ed25519:this.ed25519.toXdrObject()}}static fromXdrObject(t){return new e({id:t.id,ed25519:ch.fromXdrObject(t.ed25519)})}},$h=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.MuxedAccount(...) is not supported: XDR unions are built from per-variant factories. Call xdr.MuxedAccount.keyTypeEd25519(...) (or another arm factory) instead.`)}static schema=Of(`MuxedAccount`,{switchOn:Zh.schema,cases:[q(`keyTypeEd25519`,0,K(`ed25519`,ch.schema)),q(`keyTypeMuxedEd25519`,256,K(`med25519`,Qh.schema))]});static keyTypeEd25519(e){return new eg(e)}static keyTypeMuxedEd25519(e){return new tg(e)}static fromXdrObject(e){switch(e.type){case 0:return new eg(ch.fromXdrObject(e.ed25519));case 256:return new tg(Qh.fromXdrObject(e.med25519))}throw new W(`MuxedAccount: unknown type ${e.type}`)}static is(t){return t instanceof e}},eg=class extends $h{type=`keyTypeEd25519`;ed25519;constructor(e){super(),this.ed25519=e instanceof ch?e:new ch(e)}get value(){return this.ed25519}toXdrObject(){return{type:0,ed25519:this.ed25519.toXdrObject()}}},tg=class extends $h{type=`keyTypeMuxedEd25519`;med25519;constructor(e){super(),this.med25519=e}get value(){return this.med25519}toXdrObject(){return{type:256,med25519:this.med25519.toXdrObject()}}},ng=$h,rg=class e extends rh{static createAccount=new e(`createAccount`,0);static payment=new e(`payment`,1);static pathPaymentStrictReceive=new e(`pathPaymentStrictReceive`,2);static manageSellOffer=new e(`manageSellOffer`,3);static createPassiveSellOffer=new e(`createPassiveSellOffer`,4);static setOptions=new e(`setOptions`,5);static changeTrust=new e(`changeTrust`,6);static allowTrust=new e(`allowTrust`,7);static accountMerge=new e(`accountMerge`,8);static inflation=new e(`inflation`,9);static manageData=new e(`manageData`,10);static bumpSequence=new e(`bumpSequence`,11);static manageBuyOffer=new e(`manageBuyOffer`,12);static pathPaymentStrictSend=new e(`pathPaymentStrictSend`,13);static createClaimableBalance=new e(`createClaimableBalance`,14);static claimClaimableBalance=new e(`claimClaimableBalance`,15);static beginSponsoringFutureReserves=new e(`beginSponsoringFutureReserves`,16);static endSponsoringFutureReserves=new e(`endSponsoringFutureReserves`,17);static revokeSponsorship=new e(`revokeSponsorship`,18);static clawback=new e(`clawback`,19);static clawbackClaimableBalance=new e(`clawbackClaimableBalance`,20);static setTrustLineFlags=new e(`setTrustLineFlags`,21);static liquidityPoolDeposit=new e(`liquidityPoolDeposit`,22);static liquidityPoolWithdraw=new e(`liquidityPoolWithdraw`,23);static invokeHostFunction=new e(`invokeHostFunction`,24);static extendFootprintTtl=new e(`extendFootprintTtl`,25);static restoreFootprint=new e(`restoreFootprint`,26);static schema=cf(`OperationType`,{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26});static fromValue(t){return ah(`OperationType`,e.schema,e,t)}static fromName(t){return oh(`OperationType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},ig=class e extends Y{destination;startingBalance;static schema=G(`CreateAccountOp`,{destination:dh.schema,startingBalance:ff()});constructor(e){super(),this.destination=e.destination,this.startingBalance=e.startingBalance}toXdrObject(){return{destination:this.destination.toXdrObject(),startingBalance:this.startingBalance}}static fromXdrObject(t){return new e({destination:dh.fromXdrObject(t.destination),startingBalance:t.startingBalance})}},ag=class e extends Y{destination;asset;amount;static schema=G(`PaymentOp`,{destination:ng.schema,asset:Rh.schema,amount:ff()});constructor(e){super(),this.destination=e.destination,this.asset=e.asset,this.amount=e.amount}toXdrObject(){return{destination:this.destination.toXdrObject(),asset:this.asset.toXdrObject(),amount:this.amount}}static fromXdrObject(t){return new e({destination:ng.fromXdrObject(t.destination),asset:Rh.fromXdrObject(t.asset),amount:t.amount})}},og=class e extends Y{sendAsset;sendMax;destination;destAsset;destAmount;path;static schema=G(`PathPaymentStrictReceiveOp`,{sendAsset:Rh.schema,sendMax:ff(),destination:ng.schema,destAsset:Rh.schema,destAmount:ff(),path:ef(Rh.schema,5)});constructor(e){super(),this.sendAsset=e.sendAsset,this.sendMax=e.sendMax,this.destination=e.destination,this.destAsset=e.destAsset,this.destAmount=e.destAmount,this.path=e.path}toXdrObject(){return{sendAsset:this.sendAsset.toXdrObject(),sendMax:this.sendMax,destination:this.destination.toXdrObject(),destAsset:this.destAsset.toXdrObject(),destAmount:this.destAmount,path:this.path.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({sendAsset:Rh.fromXdrObject(t.sendAsset),sendMax:t.sendMax,destination:ng.fromXdrObject(t.destination),destAsset:Rh.fromXdrObject(t.destAsset),destAmount:t.destAmount,path:t.path.map(e=>Rh.fromXdrObject(e))})}},sg=class e extends Y{n;d;static schema=G(`Price`,{n:uf(),d:uf()});constructor(e){super(),this.n=e.n,this.d=e.d}toXdrObject(){return{n:this.n,d:this.d}}static fromXdrObject(t){return new e({n:t.n,d:t.d})}},cg=class e extends Y{selling;buying;amount;price;offerId;static schema=G(`ManageSellOfferOp`,{selling:Rh.schema,buying:Rh.schema,amount:ff(),price:sg.schema,offerId:ff()});constructor(e){super(),this.selling=e.selling,this.buying=e.buying,this.amount=e.amount,this.price=e.price,this.offerId=e.offerId}toXdrObject(){return{selling:this.selling.toXdrObject(),buying:this.buying.toXdrObject(),amount:this.amount,price:this.price.toXdrObject(),offerId:this.offerId}}static fromXdrObject(t){return new e({selling:Rh.fromXdrObject(t.selling),buying:Rh.fromXdrObject(t.buying),amount:t.amount,price:sg.fromXdrObject(t.price),offerId:t.offerId})}},lg=class e extends Y{selling;buying;amount;price;static schema=G(`CreatePassiveSellOfferOp`,{selling:Rh.schema,buying:Rh.schema,amount:ff(),price:sg.schema});constructor(e){super(),this.selling=e.selling,this.buying=e.buying,this.amount=e.amount,this.price=e.price}toXdrObject(){return{selling:this.selling.toXdrObject(),buying:this.buying.toXdrObject(),amount:this.amount,price:this.price.toXdrObject()}}static fromXdrObject(t){return new e({selling:Rh.fromXdrObject(t.selling),buying:Rh.fromXdrObject(t.buying),amount:t.amount,price:sg.fromXdrObject(t.price)})}},ug=class e extends Y{inflationDest;clearFlags;setFlags;masterWeight;lowThreshold;medThreshold;highThreshold;homeDomain;signer;static schema=G(`SetOptionsOp`,{inflationDest:vf(dh.schema),clearFlags:vf(Cf()),setFlags:vf(Cf()),masterWeight:vf(Cf()),lowThreshold:vf(Cf()),medThreshold:vf(Cf()),highThreshold:vf(Cf()),homeDomain:vf(Op(32)),signer:vf(bh.schema)});constructor(e){super(),this.inflationDest=e.inflationDest,this.clearFlags=e.clearFlags,this.setFlags=e.setFlags,this.masterWeight=e.masterWeight,this.lowThreshold=e.lowThreshold,this.medThreshold=e.medThreshold,this.highThreshold=e.highThreshold,this.homeDomain=e.homeDomain===null?null:e.homeDomain instanceof Tp?e.homeDomain:new Tp(e.homeDomain),this.signer=e.signer}toXdrObject(){return{inflationDest:this.inflationDest===null?null:this.inflationDest.toXdrObject(),clearFlags:this.clearFlags,setFlags:this.setFlags,masterWeight:this.masterWeight,lowThreshold:this.lowThreshold,medThreshold:this.medThreshold,highThreshold:this.highThreshold,homeDomain:this.homeDomain,signer:this.signer===null?null:this.signer.toXdrObject()}}static fromXdrObject(t){return new e({inflationDest:t.inflationDest===null?null:dh.fromXdrObject(t.inflationDest),clearFlags:t.clearFlags,setFlags:t.setFlags,masterWeight:t.masterWeight,lowThreshold:t.lowThreshold,medThreshold:t.medThreshold,highThreshold:t.highThreshold,homeDomain:t.homeDomain,signer:t.signer===null?null:bh.fromXdrObject(t.signer)})}},dg=class e extends rh{static liquidityPoolConstantProduct=new e(`liquidityPoolConstantProduct`,0);static schema=cf(`LiquidityPoolType`,{liquidityPoolConstantProduct:0});static fromValue(t){return ah(`LiquidityPoolType`,e.schema,e,t)}static fromName(t){return oh(`LiquidityPoolType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},fg=class e extends Y{assetA;assetB;fee;static schema=G(`LiquidityPoolConstantProductParameters`,{assetA:Rh.schema,assetB:Rh.schema,fee:uf()});constructor(e){super(),this.assetA=e.assetA,this.assetB=e.assetB,this.fee=e.fee}toXdrObject(){return{assetA:this.assetA.toXdrObject(),assetB:this.assetB.toXdrObject(),fee:this.fee}}static fromXdrObject(t){return new e({assetA:Rh.fromXdrObject(t.assetA),assetB:Rh.fromXdrObject(t.assetB),fee:t.fee})}},pg=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.LiquidityPoolParameters(...) is not supported: XDR unions are built from per-variant factories. Call xdr.LiquidityPoolParameters.liquidityPoolConstantProduct(...) (or another arm factory) instead.`)}static schema=Of(`LiquidityPoolParameters`,{switchOn:dg.schema,cases:[q(`liquidityPoolConstantProduct`,0,K(`constantProduct`,fg.schema))]});static liquidityPoolConstantProduct(e){return new mg(e)}static fromXdrObject(e){if(e.type===0)return new mg(fg.fromXdrObject(e.constantProduct));throw new W(`LiquidityPoolParameters: unknown type ${e.type}`)}static is(t){return t instanceof e}},mg=class extends pg{type=`liquidityPoolConstantProduct`;constantProduct;constructor(e){super(),this.constantProduct=e}get value(){return this.constantProduct}toXdrObject(){return{type:0,constantProduct:this.constantProduct.toXdrObject()}}},hg=pg,gg=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ChangeTrustAsset(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ChangeTrustAsset.assetTypeNative() (or another arm factory) instead.`)}static schema=Of(`ChangeTrustAsset`,{switchOn:wh.schema,cases:[q(`assetTypeNative`,0,If()),q(`assetTypeCreditAlphanum4`,1,K(`alphaNum4`,Nh.schema)),q(`assetTypeCreditAlphanum12`,2,K(`alphaNum12`,Mh.schema)),q(`assetTypePoolShare`,3,K(`liquidityPool`,hg.schema))]});static assetTypeNative(){return new _g}static assetTypeCreditAlphanum4(e){return new vg(e)}static assetTypeCreditAlphanum12(e){return new yg(e)}static assetTypePoolShare(e){return new bg(e)}static fromXdrObject(e){switch(e.type){case 0:return new _g;case 1:return new vg(Nh.fromXdrObject(e.alphaNum4));case 2:return new yg(Mh.fromXdrObject(e.alphaNum12));case 3:return new bg(hg.fromXdrObject(e.liquidityPool))}throw new W(`ChangeTrustAsset: unknown type ${e.type}`)}static is(t){return t instanceof e}},_g=class extends gg{type=`assetTypeNative`;get value(){return null}toXdrObject(){return{type:0}}},vg=class extends gg{type=`assetTypeCreditAlphanum4`;alphaNum4;constructor(e){super(),this.alphaNum4=e}get value(){return this.alphaNum4}toXdrObject(){return{type:1,alphaNum4:this.alphaNum4.toXdrObject()}}},yg=class extends gg{type=`assetTypeCreditAlphanum12`;alphaNum12;constructor(e){super(),this.alphaNum12=e}get value(){return this.alphaNum12}toXdrObject(){return{type:2,alphaNum12:this.alphaNum12.toXdrObject()}}},bg=class extends gg{type=`assetTypePoolShare`;liquidityPool;constructor(e){super(),this.liquidityPool=e}get value(){return this.liquidityPool}toXdrObject(){return{type:3,liquidityPool:this.liquidityPool.toXdrObject()}}},xg=gg,Sg=class e extends Y{line;limit;static schema=G(`ChangeTrustOp`,{line:xg.schema,limit:ff()});constructor(e){super(),this.line=e.line,this.limit=e.limit}toXdrObject(){return{line:this.line.toXdrObject(),limit:this.limit}}static fromXdrObject(t){return new e({line:xg.fromXdrObject(t.line),limit:t.limit})}},Cg=class e extends nh{static encoding=`hex`;static schema=Pf(64,`DataValue`);static fromXdrObject(t){return new e(t)}},wg=class e extends Y{dataName;dataValue;static schema=G(`ManageDataOp`,{dataName:Op(64),dataValue:vf(Cg.schema)});constructor(e){super(),this.dataName=e.dataName instanceof Tp?e.dataName:new Tp(e.dataName),this.dataValue=e.dataValue===null?null:e.dataValue instanceof Cg?e.dataValue:new Cg(e.dataValue)}toXdrObject(){return{dataName:this.dataName,dataValue:this.dataValue===null?null:this.dataValue.toXdrObject()}}static fromXdrObject(t){return new e({dataName:t.dataName,dataValue:t.dataValue===null?null:Cg.fromXdrObject(t.dataValue)})}},Tg=class e extends Y{bumpTo;static schema=G(`BumpSequenceOp`,{bumpTo:ff()});constructor(e){super(),this.bumpTo=e.bumpTo}toXdrObject(){return{bumpTo:this.bumpTo}}static fromXdrObject(t){return new e({bumpTo:t.bumpTo})}},Eg=class e extends Y{selling;buying;buyAmount;price;offerId;static schema=G(`ManageBuyOfferOp`,{selling:Rh.schema,buying:Rh.schema,buyAmount:ff(),price:sg.schema,offerId:ff()});constructor(e){super(),this.selling=e.selling,this.buying=e.buying,this.buyAmount=e.buyAmount,this.price=e.price,this.offerId=e.offerId}toXdrObject(){return{selling:this.selling.toXdrObject(),buying:this.buying.toXdrObject(),buyAmount:this.buyAmount,price:this.price.toXdrObject(),offerId:this.offerId}}static fromXdrObject(t){return new e({selling:Rh.fromXdrObject(t.selling),buying:Rh.fromXdrObject(t.buying),buyAmount:t.buyAmount,price:sg.fromXdrObject(t.price),offerId:t.offerId})}},Dg=class e extends Y{sendAsset;sendAmount;destination;destAsset;destMin;path;static schema=G(`PathPaymentStrictSendOp`,{sendAsset:Rh.schema,sendAmount:ff(),destination:ng.schema,destAsset:Rh.schema,destMin:ff(),path:ef(Rh.schema,5)});constructor(e){super(),this.sendAsset=e.sendAsset,this.sendAmount=e.sendAmount,this.destination=e.destination,this.destAsset=e.destAsset,this.destMin=e.destMin,this.path=e.path}toXdrObject(){return{sendAsset:this.sendAsset.toXdrObject(),sendAmount:this.sendAmount,destination:this.destination.toXdrObject(),destAsset:this.destAsset.toXdrObject(),destMin:this.destMin,path:this.path.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({sendAsset:Rh.fromXdrObject(t.sendAsset),sendAmount:t.sendAmount,destination:ng.fromXdrObject(t.destination),destAsset:Rh.fromXdrObject(t.destAsset),destMin:t.destMin,path:t.path.map(e=>Rh.fromXdrObject(e))})}},Og=class e extends rh{static claimantTypeV0=new e(`claimantTypeV0`,0);static schema=cf(`ClaimantType`,{claimantTypeV0:0});static fromValue(t){return ah(`ClaimantType`,e.schema,e,t)}static fromName(t){return oh(`ClaimantType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},kg=class e extends rh{static claimPredicateUnconditional=new e(`claimPredicateUnconditional`,0);static claimPredicateAnd=new e(`claimPredicateAnd`,1);static claimPredicateOr=new e(`claimPredicateOr`,2);static claimPredicateNot=new e(`claimPredicateNot`,3);static claimPredicateBeforeAbsoluteTime=new e(`claimPredicateBeforeAbsoluteTime`,4);static claimPredicateBeforeRelativeTime=new e(`claimPredicateBeforeRelativeTime`,5);static schema=ih(cf(`ClaimPredicateType`,{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),`claimPredicate`);static fromValue(t){return ah(`ClaimPredicateType`,e.schema,e,t)}static fromName(t){return oh(`ClaimPredicateType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Ag=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ClaimPredicate(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ClaimPredicate.claimPredicateUnconditional() (or another arm factory) instead.`)}static schema=Of(`ClaimPredicate`,{switchOn:kg.schema,cases:[q(`claimPredicateUnconditional`,0,If()),q(`claimPredicateAnd`,1,K(`andPredicates`,ef(mf(()=>Lg.schema),2))),q(`claimPredicateOr`,2,K(`orPredicates`,ef(mf(()=>Lg.schema),2))),q(`claimPredicateNot`,3,K(`notPredicate`,vf(mf(()=>Lg.schema)))),q(`claimPredicateBeforeAbsoluteTime`,4,K(`absBefore`,ff())),q(`claimPredicateBeforeRelativeTime`,5,K(`relBefore`,ff()))]});static claimPredicateUnconditional(){return new jg}static claimPredicateAnd(e){return new Mg(e)}static claimPredicateOr(e){return new Ng(e)}static claimPredicateNot(e){return new Pg(e)}static claimPredicateBeforeAbsoluteTime(e){return new Fg(e)}static claimPredicateBeforeRelativeTime(e){return new Ig(e)}static fromXdrObject(e){switch(e.type){case 0:return new jg;case 1:return new Mg(e.andPredicates.map(e=>Lg.fromXdrObject(e)));case 2:return new Ng(e.orPredicates.map(e=>Lg.fromXdrObject(e)));case 3:return new Pg(e.notPredicate===null?null:Lg.fromXdrObject(e.notPredicate));case 4:return new Fg(e.absBefore);case 5:return new Ig(e.relBefore)}throw new W(`ClaimPredicate: unknown type ${e.type}`)}static is(t){return t instanceof e}},jg=class extends Ag{type=`claimPredicateUnconditional`;get value(){return null}toXdrObject(){return{type:0}}},Mg=class extends Ag{type=`claimPredicateAnd`;andPredicates;constructor(e){super(),this.andPredicates=e}get value(){return this.andPredicates}toXdrObject(){return{type:1,andPredicates:this.andPredicates.map(e=>e.toXdrObject())}}},Ng=class extends Ag{type=`claimPredicateOr`;orPredicates;constructor(e){super(),this.orPredicates=e}get value(){return this.orPredicates}toXdrObject(){return{type:2,orPredicates:this.orPredicates.map(e=>e.toXdrObject())}}},Pg=class extends Ag{type=`claimPredicateNot`;notPredicate;constructor(e){super(),this.notPredicate=e}get value(){return this.notPredicate}toXdrObject(){return{type:3,notPredicate:this.notPredicate===null?null:this.notPredicate.toXdrObject()}}},Fg=class extends Ag{type=`claimPredicateBeforeAbsoluteTime`;absBefore;constructor(e){super(),this.absBefore=e}get value(){return this.absBefore}toXdrObject(){return{type:4,absBefore:this.absBefore}}},Ig=class extends Ag{type=`claimPredicateBeforeRelativeTime`;relBefore;constructor(e){super(),this.relBefore=e}get value(){return this.relBefore}toXdrObject(){return{type:5,relBefore:this.relBefore}}},Lg=Ag,Rg=class e extends Y{destination;predicate;static schema=G(`ClaimantV0`,{destination:dh.schema,predicate:Lg.schema});constructor(e){super(),this.destination=e.destination,this.predicate=e.predicate}toXdrObject(){return{destination:this.destination.toXdrObject(),predicate:this.predicate.toXdrObject()}}static fromXdrObject(t){return new e({destination:dh.fromXdrObject(t.destination),predicate:Lg.fromXdrObject(t.predicate)})}},zg=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.Claimant(...) is not supported: XDR unions are built from per-variant factories. Call xdr.Claimant.claimantTypeV0(...) (or another arm factory) instead.`)}static schema=Of(`Claimant`,{switchOn:Og.schema,cases:[q(`claimantTypeV0`,0,K(`v0`,Rg.schema))]});static claimantTypeV0(e){return new Bg(e)}static fromXdrObject(e){if(e.type===0)return new Bg(Rg.fromXdrObject(e.v0));throw new W(`Claimant: unknown type ${e.type}`)}static is(t){return t instanceof e}},Bg=class extends zg{type=`claimantTypeV0`;v0;constructor(e){super(),this.v0=e}get value(){return this.v0}toXdrObject(){return{type:0,v0:this.v0.toXdrObject()}}},Vg=zg,Hg=class e extends Y{asset;amount;claimants;static schema=G(`CreateClaimableBalanceOp`,{asset:Rh.schema,amount:ff(),claimants:ef(Vg.schema,10)});constructor(e){super(),this.asset=e.asset,this.amount=e.amount,this.claimants=e.claimants}toXdrObject(){return{asset:this.asset.toXdrObject(),amount:this.amount,claimants:this.claimants.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({asset:Rh.fromXdrObject(t.asset),amount:t.amount,claimants:t.claimants.map(e=>Vg.fromXdrObject(e))})}},Ug=class e extends rh{static claimableBalanceIdTypeV0=new e(`claimableBalanceIdTypeV0`,0);static schema=cf(`ClaimableBalanceIdType`,{claimableBalanceIdTypeV0:0});static fromValue(t){return ah(`ClaimableBalanceIdType`,e.schema,e,t)}static fromName(t){return oh(`ClaimableBalanceIdType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Wg=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ClaimableBalanceId(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ClaimableBalanceId.claimableBalanceIdTypeV0(...) (or another arm factory) instead.`)}static schema=Of(`ClaimableBalanceId`,{switchOn:Ug.schema,cases:[q(`claimableBalanceIdTypeV0`,0,K(`v0`,Bh.schema))]});static claimableBalanceIdTypeV0(e){return new Gg(e)}static fromXdrObject(e){if(e.type===0)return new Gg(Bh.fromXdrObject(e.v0));throw new W(`ClaimableBalanceId: unknown type ${e.type}`)}static is(t){return t instanceof e}},Gg=class extends Wg{type=`claimableBalanceIdTypeV0`;v0;constructor(e){super(),this.v0=e instanceof Bh?e:new Bh(e)}get value(){return this.v0}toXdrObject(){return{type:0,v0:this.v0.toXdrObject()}}},Kg=Wg,qg=class e extends Y{balanceId;static schema=G(`ClaimClaimableBalanceOp`,{balanceId:Kg.schema});constructor(e){super(),this.balanceId=e.balanceId}toXdrObject(){return{balanceId:this.balanceId.toXdrObject()}}static fromXdrObject(t){return new e({balanceId:Kg.fromXdrObject(t.balanceId)})}},Jg=class e extends Y{sponsoredId;static schema=G(`BeginSponsoringFutureReservesOp`,{sponsoredId:dh.schema});constructor(e){super(),this.sponsoredId=e.sponsoredId}toXdrObject(){return{sponsoredId:this.sponsoredId.toXdrObject()}}static fromXdrObject(t){return new e({sponsoredId:dh.fromXdrObject(t.sponsoredId)})}},Yg=class e extends rh{static revokeSponsorshipLedgerEntry=new e(`revokeSponsorshipLedgerEntry`,0);static revokeSponsorshipSigner=new e(`revokeSponsorshipSigner`,1);static schema=ih(cf(`RevokeSponsorshipType`,{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),`revokeSponsorship`);static fromValue(t){return ah(`RevokeSponsorshipType`,e.schema,e,t)}static fromName(t){return oh(`RevokeSponsorshipType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Xg=class e extends rh{static account=new e(`account`,0);static trustline=new e(`trustline`,1);static offer=new e(`offer`,2);static data=new e(`data`,3);static claimableBalance=new e(`claimableBalance`,4);static liquidityPool=new e(`liquidityPool`,5);static contractData=new e(`contractData`,6);static contractCode=new e(`contractCode`,7);static configSetting=new e(`configSetting`,8);static ttl=new e(`ttl`,9);static schema=cf(`LedgerEntryType`,{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9});static fromValue(t){return ah(`LedgerEntryType`,e.schema,e,t)}static fromName(t){return oh(`LedgerEntryType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Zg=class e extends Y{accountId;static schema=G(`LedgerKeyAccount`,{accountId:dh.schema});constructor(e){super(),this.accountId=e.accountId}toXdrObject(){return{accountId:this.accountId.toXdrObject()}}static fromXdrObject(t){return new e({accountId:dh.fromXdrObject(t.accountId)})}},Qg=class e extends nh{static byteLength=32;static encoding=`hex`;static schema=gf(32,`PoolId`);static fromXdrObject(t){return new e(t)}},$g=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.TrustLineAsset(...) is not supported: XDR unions are built from per-variant factories. Call xdr.TrustLineAsset.assetTypeNative() (or another arm factory) instead.`)}static schema=Of(`TrustLineAsset`,{switchOn:wh.schema,cases:[q(`assetTypeNative`,0,If()),q(`assetTypeCreditAlphanum4`,1,K(`alphaNum4`,Nh.schema)),q(`assetTypeCreditAlphanum12`,2,K(`alphaNum12`,Mh.schema)),q(`assetTypePoolShare`,3,K(`liquidityPoolId`,Qg.schema))]});static assetTypeNative(){return new e_}static assetTypeCreditAlphanum4(e){return new t_(e)}static assetTypeCreditAlphanum12(e){return new n_(e)}static assetTypePoolShare(e){return new r_(e)}static fromXdrObject(e){switch(e.type){case 0:return new e_;case 1:return new t_(Nh.fromXdrObject(e.alphaNum4));case 2:return new n_(Mh.fromXdrObject(e.alphaNum12));case 3:return new r_(Qg.fromXdrObject(e.liquidityPoolId))}throw new W(`TrustLineAsset: unknown type ${e.type}`)}static is(t){return t instanceof e}},e_=class extends $g{type=`assetTypeNative`;get value(){return null}toXdrObject(){return{type:0}}},t_=class extends $g{type=`assetTypeCreditAlphanum4`;alphaNum4;constructor(e){super(),this.alphaNum4=e}get value(){return this.alphaNum4}toXdrObject(){return{type:1,alphaNum4:this.alphaNum4.toXdrObject()}}},n_=class extends $g{type=`assetTypeCreditAlphanum12`;alphaNum12;constructor(e){super(),this.alphaNum12=e}get value(){return this.alphaNum12}toXdrObject(){return{type:2,alphaNum12:this.alphaNum12.toXdrObject()}}},r_=class extends $g{type=`assetTypePoolShare`;liquidityPoolId;constructor(e){super(),this.liquidityPoolId=e}get value(){return this.liquidityPoolId}toXdrObject(){return{type:3,liquidityPoolId:this.liquidityPoolId.toXdrObject()}}},i_=$g,a_=class e extends Y{accountId;asset;static schema=G(`LedgerKeyTrustLine`,{accountId:dh.schema,asset:i_.schema});constructor(e){super(),this.accountId=e.accountId,this.asset=e.asset}toXdrObject(){return{accountId:this.accountId.toXdrObject(),asset:this.asset.toXdrObject()}}static fromXdrObject(t){return new e({accountId:dh.fromXdrObject(t.accountId),asset:i_.fromXdrObject(t.asset)})}},o_=class e extends Y{sellerId;offerId;static schema=G(`LedgerKeyOffer`,{sellerId:dh.schema,offerId:ff()});constructor(e){super(),this.sellerId=e.sellerId,this.offerId=e.offerId}toXdrObject(){return{sellerId:this.sellerId.toXdrObject(),offerId:this.offerId}}static fromXdrObject(t){return new e({sellerId:dh.fromXdrObject(t.sellerId),offerId:t.offerId})}},s_=class e extends Y{accountId;dataName;static schema=G(`LedgerKeyData`,{accountId:dh.schema,dataName:Op(64)});constructor(e){super(),this.accountId=e.accountId,this.dataName=e.dataName instanceof Tp?e.dataName:new Tp(e.dataName)}toXdrObject(){return{accountId:this.accountId.toXdrObject(),dataName:this.dataName}}static fromXdrObject(t){return new e({accountId:dh.fromXdrObject(t.accountId),dataName:t.dataName})}},c_=class e extends Y{balanceId;static schema=G(`LedgerKeyClaimableBalance`,{balanceId:Kg.schema});constructor(e){super(),this.balanceId=e.balanceId}toXdrObject(){return{balanceId:this.balanceId.toXdrObject()}}static fromXdrObject(t){return new e({balanceId:Kg.fromXdrObject(t.balanceId)})}},l_=class e extends Y{liquidityPoolId;static schema=G(`LedgerKeyLiquidityPool`,{liquidityPoolId:Qg.schema});constructor(e){super(),this.liquidityPoolId=e.liquidityPoolId}toXdrObject(){return{liquidityPoolId:this.liquidityPoolId.toXdrObject()}}static fromXdrObject(t){return new e({liquidityPoolId:Qg.fromXdrObject(t.liquidityPoolId)})}},u_=class e extends rh{static scAddressTypeAccount=new e(`scAddressTypeAccount`,0);static scAddressTypeContract=new e(`scAddressTypeContract`,1);static scAddressTypeMuxedAccount=new e(`scAddressTypeMuxedAccount`,2);static scAddressTypeClaimableBalance=new e(`scAddressTypeClaimableBalance`,3);static scAddressTypeLiquidityPool=new e(`scAddressTypeLiquidityPool`,4);static scAddressTypeMuxedContract=new e(`scAddressTypeMuxedContract`,5);static schema=ih(cf(`ScAddressType`,{scAddressTypeAccount:0,scAddressTypeContract:1,scAddressTypeMuxedAccount:2,scAddressTypeClaimableBalance:3,scAddressTypeLiquidityPool:4,scAddressTypeMuxedContract:5}),`scAddressType`);static fromValue(t){return ah(`ScAddressType`,e.schema,e,t)}static fromName(t){return oh(`ScAddressType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},d_=class e extends nh{static byteLength=32;static encoding=`hex`;static schema=gf(32,`ContractId`);static fromXdrObject(t){return new e(t)}},f_=class e extends Y{id;ed25519;static schema=G(`MuxedEd25519Account`,{id:Tf(),ed25519:ch.schema});constructor(e){super(),this.id=e.id,this.ed25519=e.ed25519 instanceof ch?e.ed25519:new ch(e.ed25519)}toXdrObject(){return{id:this.id,ed25519:this.ed25519.toXdrObject()}}static fromXdrObject(t){return new e({id:t.id,ed25519:ch.fromXdrObject(t.ed25519)})}},p_=class e extends Y{id;contractId;static schema=G(`MuxedContract`,{id:Tf(),contractId:d_.schema});constructor(e){super(),this.id=e.id,this.contractId=e.contractId}toXdrObject(){return{id:this.id,contractId:this.contractId.toXdrObject()}}static fromXdrObject(t){return new e({id:t.id,contractId:d_.fromXdrObject(t.contractId)})}},m_=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ScAddress(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ScAddress.scAddressTypeAccount(...) (or another arm factory) instead.`)}static schema=Of(`ScAddress`,{switchOn:u_.schema,cases:[q(`scAddressTypeAccount`,0,K(`accountId`,dh.schema)),q(`scAddressTypeContract`,1,K(`contractId`,d_.schema)),q(`scAddressTypeMuxedAccount`,2,K(`muxedAccount`,f_.schema)),q(`scAddressTypeClaimableBalance`,3,K(`claimableBalanceId`,Kg.schema)),q(`scAddressTypeLiquidityPool`,4,K(`liquidityPoolId`,Qg.schema)),q(`scAddressTypeMuxedContract`,5,K(`muxedContract`,p_.schema))]});static scAddressTypeAccount(e){return new h_(e)}static scAddressTypeContract(e){return new g_(e)}static scAddressTypeMuxedAccount(e){return new __(e)}static scAddressTypeClaimableBalance(e){return new v_(e)}static scAddressTypeLiquidityPool(e){return new y_(e)}static scAddressTypeMuxedContract(e){return new b_(e)}static fromXdrObject(e){switch(e.type){case 0:return new h_(dh.fromXdrObject(e.accountId));case 1:return new g_(d_.fromXdrObject(e.contractId));case 2:return new __(f_.fromXdrObject(e.muxedAccount));case 3:return new v_(Kg.fromXdrObject(e.claimableBalanceId));case 4:return new y_(Qg.fromXdrObject(e.liquidityPoolId));case 5:return new b_(p_.fromXdrObject(e.muxedContract))}throw new W(`ScAddress: unknown type ${e.type}`)}static is(t){return t instanceof e}},h_=class extends m_{type=`scAddressTypeAccount`;accountId;constructor(e){super(),this.accountId=e}get value(){return this.accountId}toXdrObject(){return{type:0,accountId:this.accountId.toXdrObject()}}},g_=class extends m_{type=`scAddressTypeContract`;contractId;constructor(e){super(),this.contractId=e}get value(){return this.contractId}toXdrObject(){return{type:1,contractId:this.contractId.toXdrObject()}}},__=class extends m_{type=`scAddressTypeMuxedAccount`;muxedAccount;constructor(e){super(),this.muxedAccount=e}get value(){return this.muxedAccount}toXdrObject(){return{type:2,muxedAccount:this.muxedAccount.toXdrObject()}}},v_=class extends m_{type=`scAddressTypeClaimableBalance`;claimableBalanceId;constructor(e){super(),this.claimableBalanceId=e}get value(){return this.claimableBalanceId}toXdrObject(){return{type:3,claimableBalanceId:this.claimableBalanceId.toXdrObject()}}},y_=class extends m_{type=`scAddressTypeLiquidityPool`;liquidityPoolId;constructor(e){super(),this.liquidityPoolId=e}get value(){return this.liquidityPoolId}toXdrObject(){return{type:4,liquidityPoolId:this.liquidityPoolId.toXdrObject()}}},b_=class extends m_{type=`scAddressTypeMuxedContract`;muxedContract;constructor(e){super(),this.muxedContract=e}get value(){return this.muxedContract}toXdrObject(){return{type:5,muxedContract:this.muxedContract.toXdrObject()}}},x_=m_,S_=class e extends rh{static contractExecutableWasm=new e(`contractExecutableWasm`,0);static contractExecutableStellarAsset=new e(`contractExecutableStellarAsset`,1);static contractExecutableExternalRef=new e(`contractExecutableExternalRef`,2);static schema=ih(cf(`ContractExecutableType`,{contractExecutableWasm:0,contractExecutableStellarAsset:1,contractExecutableExternalRef:2}),`contractExecutable`);static fromValue(t){return ah(`ContractExecutableType`,e.schema,e,t)}static fromName(t){return oh(`ContractExecutableType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},C_=class e extends Y{executableOwner;tag;static schema=G(`ContractExecutableExternalRef`,{executableOwner:x_.schema,tag:Op(Zd)});constructor(e){super(),this.executableOwner=e.executableOwner,this.tag=e.tag instanceof Tp?e.tag:new Tp(e.tag)}toXdrObject(){return{executableOwner:this.executableOwner.toXdrObject(),tag:this.tag}}static fromXdrObject(t){return new e({executableOwner:x_.fromXdrObject(t.executableOwner),tag:t.tag})}},w_=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ContractExecutable(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ContractExecutable.contractExecutableWasm(...) (or another arm factory) instead.`)}static schema=Of(`ContractExecutable`,{switchOn:S_.schema,cases:[q(`contractExecutableWasm`,0,K(`wasmHash`,Bh.schema)),q(`contractExecutableStellarAsset`,1,If()),q(`contractExecutableExternalRef`,2,K(`externalRef`,C_.schema))]});static contractExecutableWasm(e){return new T_(e)}static contractExecutableStellarAsset(){return new E_}static contractExecutableExternalRef(e){return new D_(e)}static fromXdrObject(e){switch(e.type){case 0:return new T_(Bh.fromXdrObject(e.wasmHash));case 1:return new E_;case 2:return new D_(C_.fromXdrObject(e.externalRef))}throw new W(`ContractExecutable: unknown type ${e.type}`)}static is(t){return t instanceof e}},T_=class extends w_{type=`contractExecutableWasm`;wasmHash;constructor(e){super(),this.wasmHash=e instanceof Bh?e:new Bh(e)}get value(){return this.wasmHash}toXdrObject(){return{type:0,wasmHash:this.wasmHash.toXdrObject()}}},E_=class extends w_{type=`contractExecutableStellarAsset`;get value(){return null}toXdrObject(){return{type:1}}},D_=class extends w_{type=`contractExecutableExternalRef`;externalRef;constructor(e){super(),this.externalRef=e}get value(){return this.externalRef}toXdrObject(){return{type:2,externalRef:this.externalRef.toXdrObject()}}},O_=w_,k_=class e extends rh{static scvBool=new e(`scvBool`,0);static scvVoid=new e(`scvVoid`,1);static scvError=new e(`scvError`,2);static scvU32=new e(`scvU32`,3);static scvI32=new e(`scvI32`,4);static scvU64=new e(`scvU64`,5);static scvI64=new e(`scvI64`,6);static scvTimepoint=new e(`scvTimepoint`,7);static scvDuration=new e(`scvDuration`,8);static scvU128=new e(`scvU128`,9);static scvI128=new e(`scvI128`,10);static scvU256=new e(`scvU256`,11);static scvI256=new e(`scvI256`,12);static scvBytes=new e(`scvBytes`,13);static scvString=new e(`scvString`,14);static scvSymbol=new e(`scvSymbol`,15);static scvVec=new e(`scvVec`,16);static scvMap=new e(`scvMap`,17);static scvAddress=new e(`scvAddress`,18);static scvContractInstance=new e(`scvContractInstance`,19);static scvLedgerKeyContractInstance=new e(`scvLedgerKeyContractInstance`,20);static scvLedgerKeyNonce=new e(`scvLedgerKeyNonce`,21);static scvExecutableTag=new e(`scvExecutableTag`,22);static schema=ih(cf(`ScValType`,{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21,scvExecutableTag:22}),`scv`);static fromValue(t){return ah(`ScValType`,e.schema,e,t)}static fromName(t){return oh(`ScValType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},A_=class e extends rh{static sceContract=new e(`sceContract`,0);static sceWasmVm=new e(`sceWasmVm`,1);static sceContext=new e(`sceContext`,2);static sceStorage=new e(`sceStorage`,3);static sceObject=new e(`sceObject`,4);static sceCrypto=new e(`sceCrypto`,5);static sceEvents=new e(`sceEvents`,6);static sceBudget=new e(`sceBudget`,7);static sceValue=new e(`sceValue`,8);static sceAuth=new e(`sceAuth`,9);static schema=ih(cf(`ScErrorType`,{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),`sce`);static fromValue(t){return ah(`ScErrorType`,e.schema,e,t)}static fromName(t){return oh(`ScErrorType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},j_=class e extends rh{static scecArithDomain=new e(`scecArithDomain`,0);static scecIndexBounds=new e(`scecIndexBounds`,1);static scecInvalidInput=new e(`scecInvalidInput`,2);static scecMissingValue=new e(`scecMissingValue`,3);static scecExistingValue=new e(`scecExistingValue`,4);static scecExceededLimit=new e(`scecExceededLimit`,5);static scecInvalidAction=new e(`scecInvalidAction`,6);static scecInternalError=new e(`scecInternalError`,7);static scecUnexpectedType=new e(`scecUnexpectedType`,8);static scecUnexpectedSize=new e(`scecUnexpectedSize`,9);static schema=ih(cf(`ScErrorCode`,{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),`scec`);static fromValue(t){return ah(`ScErrorCode`,e.schema,e,t)}static fromName(t){return oh(`ScErrorCode`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},M_=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ScError(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ScError.sceContract(...) (or another arm factory) instead.`)}static schema=Of(`ScError`,{switchOn:A_.schema,cases:[q(`sceContract`,0,K(`contractCode`,Cf())),q(`sceWasmVm`,1,K(`code`,j_.schema)),q(`sceContext`,2,K(`code`,j_.schema)),q(`sceStorage`,3,K(`code`,j_.schema)),q(`sceObject`,4,K(`code`,j_.schema)),q(`sceCrypto`,5,K(`code`,j_.schema)),q(`sceEvents`,6,K(`code`,j_.schema)),q(`sceBudget`,7,K(`code`,j_.schema)),q(`sceValue`,8,K(`code`,j_.schema)),q(`sceAuth`,9,K(`code`,j_.schema))]});static sceContract(e){return new N_(e)}static sceWasmVm(e){return new P_(e)}static sceContext(e){return new F_(e)}static sceStorage(e){return new I_(e)}static sceObject(e){return new L_(e)}static sceCrypto(e){return new R_(e)}static sceEvents(e){return new z_(e)}static sceBudget(e){return new B_(e)}static sceValue(e){return new V_(e)}static sceAuth(e){return new H_(e)}static fromXdrObject(e){switch(e.type){case 0:return new N_(e.contractCode);case 1:return new P_(j_.fromXdrObject(e.code));case 2:return new F_(j_.fromXdrObject(e.code));case 3:return new I_(j_.fromXdrObject(e.code));case 4:return new L_(j_.fromXdrObject(e.code));case 5:return new R_(j_.fromXdrObject(e.code));case 6:return new z_(j_.fromXdrObject(e.code));case 7:return new B_(j_.fromXdrObject(e.code));case 8:return new V_(j_.fromXdrObject(e.code));case 9:return new H_(j_.fromXdrObject(e.code))}throw new W(`ScError: unknown type ${e.type}`)}static is(t){return t instanceof e}},N_=class extends M_{type=`sceContract`;contractCode;constructor(e){super(),this.contractCode=e}get value(){return this.contractCode}toXdrObject(){return{type:0,contractCode:this.contractCode}}},P_=class extends M_{type=`sceWasmVm`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:1,code:this.code.toXdrObject()}}},F_=class extends M_{type=`sceContext`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:2,code:this.code.toXdrObject()}}},I_=class extends M_{type=`sceStorage`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:3,code:this.code.toXdrObject()}}},L_=class extends M_{type=`sceObject`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:4,code:this.code.toXdrObject()}}},R_=class extends M_{type=`sceCrypto`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:5,code:this.code.toXdrObject()}}},z_=class extends M_{type=`sceEvents`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:6,code:this.code.toXdrObject()}}},B_=class extends M_{type=`sceBudget`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:7,code:this.code.toXdrObject()}}},V_=class extends M_{type=`sceValue`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:8,code:this.code.toXdrObject()}}},H_=class extends M_{type=`sceAuth`;code;constructor(e){super(),this.code=e}get value(){return this.code}toXdrObject(){return{type:9,code:this.code.toXdrObject()}}},U_=M_,W_=class e extends Y{hi;lo;static schema=G(`Uint128Parts`,{hi:Tf(),lo:Tf()});constructor(e){super(),this.hi=e.hi,this.lo=e.lo}toXdrObject(){return{hi:this.hi,lo:this.lo}}static fromXdrObject(t){return new e({hi:t.hi,lo:t.lo})}},G_=class e extends Y{hi;lo;static schema=G(`Int128Parts`,{hi:ff(),lo:Tf()});constructor(e){super(),this.hi=e.hi,this.lo=e.lo}toXdrObject(){return{hi:this.hi,lo:this.lo}}static fromXdrObject(t){return new e({hi:t.hi,lo:t.lo})}},K_=class e extends Y{hiHi;hiLo;loHi;loLo;static schema=G(`Uint256Parts`,{hiHi:Tf(),hiLo:Tf(),loHi:Tf(),loLo:Tf()});constructor(e){super(),this.hiHi=e.hiHi,this.hiLo=e.hiLo,this.loHi=e.loHi,this.loLo=e.loLo}toXdrObject(){return{hiHi:this.hiHi,hiLo:this.hiLo,loHi:this.loHi,loLo:this.loLo}}static fromXdrObject(t){return new e({hiHi:t.hiHi,hiLo:t.hiLo,loHi:t.loHi,loLo:t.loLo})}},q_=class e extends Y{hiHi;hiLo;loHi;loLo;static schema=G(`Int256Parts`,{hiHi:ff(),hiLo:Tf(),loHi:Tf(),loLo:Tf()});constructor(e){super(),this.hiHi=e.hiHi,this.hiLo=e.hiLo,this.loHi=e.loHi,this.loLo=e.loLo}toXdrObject(){return{hiHi:this.hiHi,hiLo:this.hiLo,loHi:this.loHi,loLo:this.loLo}}static fromXdrObject(t){return new e({hiHi:t.hiHi,hiLo:t.hiLo,loHi:t.loHi,loLo:t.loLo})}},J_=class e extends nh{static encoding=`hex`;static schema=Pf(Zd,`ScBytes`);static fromXdrObject(t){return new e(t)}},Y_=class e extends Y{nonce;static schema=G(`ScNonceKey`,{nonce:ff()});constructor(e){super(),this.nonce=e.nonce}toXdrObject(){return{nonce:this.nonce}}static fromXdrObject(t){return new e({nonce:t.nonce})}},X_=class e extends Y{executable;storage;static schema=G(`ScContractInstance`,{executable:O_.schema,storage:vf(ef(mf(()=>Z_.schema),Zd))});constructor(e){super(),this.executable=e.executable,this.storage=e.storage}toXdrObject(){return{executable:this.executable.toXdrObject(),storage:this.storage===null?null:this.storage.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({executable:O_.fromXdrObject(t.executable),storage:t.storage===null?null:t.storage.map(e=>Z_.fromXdrObject(e))})}},Z_=class e extends Y{key;val;static schema=G(`ScMapEntry`,{key:mf(()=>Sv.schema),val:mf(()=>Sv.schema)});constructor(e){super(),this.key=e.key,this.val=e.val}toXdrObject(){return{key:this.key.toXdrObject(),val:this.val.toXdrObject()}}static fromXdrObject(t){return new e({key:Sv.fromXdrObject(t.key),val:Sv.fromXdrObject(t.val)})}},Q_=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ScVal(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ScVal.scvBool(...) (or another arm factory) instead.`)}static schema=Of(`ScVal`,{switchOn:k_.schema,cases:[q(`scvBool`,0,K(`b`,af())),q(`scvVoid`,1,If()),q(`scvError`,2,K(`error`,U_.schema)),q(`scvU32`,3,K(`u32`,Cf())),q(`scvI32`,4,K(`i32`,uf())),q(`scvU64`,5,K(`u64`,Tf())),q(`scvI64`,6,K(`i64`,ff())),q(`scvTimepoint`,7,K(`timepoint`,Tf())),q(`scvDuration`,8,K(`duration`,Tf())),q(`scvU128`,9,K(`u128`,W_.schema)),q(`scvI128`,10,K(`i128`,G_.schema)),q(`scvU256`,11,K(`u256`,K_.schema)),q(`scvI256`,12,K(`i256`,q_.schema)),q(`scvBytes`,13,K(`bytes`,J_.schema)),q(`scvString`,14,K(`str`,Op(Zd))),q(`scvSymbol`,15,K(`sym`,Op(32))),q(`scvVec`,16,K(`vec`,vf(ef(mf(()=>Sv.schema),Zd)))),q(`scvMap`,17,K(`map`,vf(ef(mf(()=>Z_.schema),Zd)))),q(`scvAddress`,18,K(`address`,x_.schema)),q(`scvContractInstance`,19,K(`instance`,mf(()=>X_.schema))),q(`scvLedgerKeyContractInstance`,20,If()),q(`scvLedgerKeyNonce`,21,K(`nonceKey`,Y_.schema)),q(`scvExecutableTag`,22,K(`executableTag`,Op(Zd)))]});static scvBool(e){return new $_(e)}static scvVoid(){return new ev}static scvError(e){return new tv(e)}static scvU32(e){return new nv(e)}static scvI32(e){return new rv(e)}static scvU64(e){return new iv(e)}static scvI64(e){return new av(e)}static scvTimepoint(e){return new ov(e)}static scvDuration(e){return new sv(e)}static scvU128(e){return new cv(e)}static scvI128(e){return new lv(e)}static scvU256(e){return new uv(e)}static scvI256(e){return new dv(e)}static scvBytes(e){return new fv(e)}static scvString(e){return new pv(e)}static scvSymbol(e){return new mv(e)}static scvVec(e){return new hv(e)}static scvMap(e){return new gv(e)}static scvAddress(e){return new _v(e)}static scvContractInstance(e){return new vv(e)}static scvLedgerKeyContractInstance(){return new yv}static scvLedgerKeyNonce(e){return new bv(e)}static scvExecutableTag(e){return new xv(e)}static fromXdrObject(e){switch(e.type){case 0:return new $_(e.b);case 1:return new ev;case 2:return new tv(U_.fromXdrObject(e.error));case 3:return new nv(e.u32);case 4:return new rv(e.i32);case 5:return new iv(e.u64);case 6:return new av(e.i64);case 7:return new ov(e.timepoint);case 8:return new sv(e.duration);case 9:return new cv(W_.fromXdrObject(e.u128));case 10:return new lv(G_.fromXdrObject(e.i128));case 11:return new uv(K_.fromXdrObject(e.u256));case 12:return new dv(q_.fromXdrObject(e.i256));case 13:return new fv(J_.fromXdrObject(e.bytes));case 14:return new pv(e.str);case 15:return new mv(e.sym);case 16:return new hv(e.vec===null?null:e.vec.map(e=>Sv.fromXdrObject(e)));case 17:return new gv(e.map===null?null:e.map.map(e=>Z_.fromXdrObject(e)));case 18:return new _v(x_.fromXdrObject(e.address));case 19:return new vv(X_.fromXdrObject(e.instance));case 20:return new yv;case 21:return new bv(Y_.fromXdrObject(e.nonceKey));case 22:return new xv(e.executableTag)}throw new W(`ScVal: unknown type ${e.type}`)}static is(t){return t instanceof e}},$_=class extends Q_{type=`scvBool`;b;constructor(e){super(),this.b=e}get value(){return this.b}toXdrObject(){return{type:0,b:this.b}}},ev=class extends Q_{type=`scvVoid`;get value(){return null}toXdrObject(){return{type:1}}},tv=class extends Q_{type=`scvError`;error;constructor(e){super(),this.error=e}get value(){return this.error}toXdrObject(){return{type:2,error:this.error.toXdrObject()}}},nv=class extends Q_{type=`scvU32`;u32;constructor(e){super(),this.u32=e}get value(){return this.u32}toXdrObject(){return{type:3,u32:this.u32}}},rv=class extends Q_{type=`scvI32`;i32;constructor(e){super(),this.i32=e}get value(){return this.i32}toXdrObject(){return{type:4,i32:this.i32}}},iv=class extends Q_{type=`scvU64`;u64;constructor(e){super(),this.u64=e}get value(){return this.u64}toXdrObject(){return{type:5,u64:this.u64}}},av=class extends Q_{type=`scvI64`;i64;constructor(e){super(),this.i64=e}get value(){return this.i64}toXdrObject(){return{type:6,i64:this.i64}}},ov=class extends Q_{type=`scvTimepoint`;timepoint;constructor(e){super(),this.timepoint=e}get value(){return this.timepoint}toXdrObject(){return{type:7,timepoint:this.timepoint}}},sv=class extends Q_{type=`scvDuration`;duration;constructor(e){super(),this.duration=e}get value(){return this.duration}toXdrObject(){return{type:8,duration:this.duration}}},cv=class extends Q_{type=`scvU128`;u128;constructor(e){super(),this.u128=e}get value(){return this.u128}toXdrObject(){return{type:9,u128:this.u128.toXdrObject()}}},lv=class extends Q_{type=`scvI128`;i128;constructor(e){super(),this.i128=e}get value(){return this.i128}toXdrObject(){return{type:10,i128:this.i128.toXdrObject()}}},uv=class extends Q_{type=`scvU256`;u256;constructor(e){super(),this.u256=e}get value(){return this.u256}toXdrObject(){return{type:11,u256:this.u256.toXdrObject()}}},dv=class extends Q_{type=`scvI256`;i256;constructor(e){super(),this.i256=e}get value(){return this.i256}toXdrObject(){return{type:12,i256:this.i256.toXdrObject()}}},fv=class extends Q_{type=`scvBytes`;bytes;constructor(e){super(),this.bytes=e instanceof J_?e:new J_(e)}get value(){return this.bytes}toXdrObject(){return{type:13,bytes:this.bytes.toXdrObject()}}},pv=class extends Q_{type=`scvString`;str;constructor(e){super(),this.str=e instanceof Tp?e:new Tp(e)}get value(){return this.str.toString()}toXdrObject(){return{type:14,str:this.str}}},mv=class extends Q_{type=`scvSymbol`;sym;constructor(e){super(),this.sym=e instanceof Tp?e:new Tp(e)}get value(){return this.sym.toString()}toXdrObject(){return{type:15,sym:this.sym}}},hv=class extends Q_{type=`scvVec`;vec;constructor(e){super(),this.vec=e}get value(){return this.vec}toXdrObject(){return{type:16,vec:this.vec===null?null:this.vec.map(e=>e.toXdrObject())}}},gv=class extends Q_{type=`scvMap`;map;constructor(e){super(),this.map=e}get value(){return this.map}toXdrObject(){return{type:17,map:this.map===null?null:this.map.map(e=>e.toXdrObject())}}},_v=class extends Q_{type=`scvAddress`;address;constructor(e){super(),this.address=e}get value(){return this.address}toXdrObject(){return{type:18,address:this.address.toXdrObject()}}},vv=class extends Q_{type=`scvContractInstance`;instance;constructor(e){super(),this.instance=e}get value(){return this.instance}toXdrObject(){return{type:19,instance:this.instance.toXdrObject()}}},yv=class extends Q_{type=`scvLedgerKeyContractInstance`;get value(){return null}toXdrObject(){return{type:20}}},bv=class extends Q_{type=`scvLedgerKeyNonce`;nonceKey;constructor(e){super(),this.nonceKey=e}get value(){return this.nonceKey}toXdrObject(){return{type:21,nonceKey:this.nonceKey.toXdrObject()}}},xv=class extends Q_{type=`scvExecutableTag`;executableTag;constructor(e){super(),this.executableTag=e instanceof Tp?e:new Tp(e)}get value(){return this.executableTag.toString()}toXdrObject(){return{type:22,executableTag:this.executableTag}}},Sv=Q_,Cv=class e extends rh{static temporary=new e(`temporary`,0);static persistent=new e(`persistent`,1);static schema=cf(`ContractDataDurability`,{temporary:0,persistent:1});static fromValue(t){return ah(`ContractDataDurability`,e.schema,e,t)}static fromName(t){return oh(`ContractDataDurability`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},wv=class e extends Y{contract;key;durability;static schema=G(`LedgerKeyContractData`,{contract:x_.schema,key:Sv.schema,durability:Cv.schema});constructor(e){super(),this.contract=e.contract,this.key=e.key,this.durability=e.durability}toXdrObject(){return{contract:this.contract.toXdrObject(),key:this.key.toXdrObject(),durability:this.durability.toXdrObject()}}static fromXdrObject(t){return new e({contract:x_.fromXdrObject(t.contract),key:Sv.fromXdrObject(t.key),durability:Cv.fromXdrObject(t.durability)})}},Tv=class e extends Y{hash;static schema=G(`LedgerKeyContractCode`,{hash:Bh.schema});constructor(e){super(),this.hash=e.hash instanceof Bh?e.hash:new Bh(e.hash)}toXdrObject(){return{hash:this.hash.toXdrObject()}}static fromXdrObject(t){return new e({hash:Bh.fromXdrObject(t.hash)})}},Ev=class e extends rh{static configSettingContractMaxSizeBytes=new e(`configSettingContractMaxSizeBytes`,0);static configSettingContractComputeV0=new e(`configSettingContractComputeV0`,1);static configSettingContractLedgerCostV0=new e(`configSettingContractLedgerCostV0`,2);static configSettingContractHistoricalDataV0=new e(`configSettingContractHistoricalDataV0`,3);static configSettingContractEventsV0=new e(`configSettingContractEventsV0`,4);static configSettingContractBandwidthV0=new e(`configSettingContractBandwidthV0`,5);static configSettingContractCostParamsCpuInstructions=new e(`configSettingContractCostParamsCpuInstructions`,6);static configSettingContractCostParamsMemoryBytes=new e(`configSettingContractCostParamsMemoryBytes`,7);static configSettingContractDataKeySizeBytes=new e(`configSettingContractDataKeySizeBytes`,8);static configSettingContractDataEntrySizeBytes=new e(`configSettingContractDataEntrySizeBytes`,9);static configSettingStateArchival=new e(`configSettingStateArchival`,10);static configSettingContractExecutionLanes=new e(`configSettingContractExecutionLanes`,11);static configSettingLiveSorobanStateSizeWindow=new e(`configSettingLiveSorobanStateSizeWindow`,12);static configSettingEvictionIterator=new e(`configSettingEvictionIterator`,13);static configSettingContractParallelComputeV0=new e(`configSettingContractParallelComputeV0`,14);static configSettingContractLedgerCostExtV0=new e(`configSettingContractLedgerCostExtV0`,15);static configSettingScpTiming=new e(`configSettingScpTiming`,16);static configSettingFrozenLedgerKeys=new e(`configSettingFrozenLedgerKeys`,17);static configSettingFrozenLedgerKeysDelta=new e(`configSettingFrozenLedgerKeysDelta`,18);static configSettingFreezeBypassTxs=new e(`configSettingFreezeBypassTxs`,19);static configSettingFreezeBypassTxsDelta=new e(`configSettingFreezeBypassTxsDelta`,20);static schema=ih(cf(`ConfigSettingId`,{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingLiveSorobanStateSizeWindow:12,configSettingEvictionIterator:13,configSettingContractParallelComputeV0:14,configSettingContractLedgerCostExtV0:15,configSettingScpTiming:16,configSettingFrozenLedgerKeys:17,configSettingFrozenLedgerKeysDelta:18,configSettingFreezeBypassTxs:19,configSettingFreezeBypassTxsDelta:20}),`configSetting`);static fromValue(t){return ah(`ConfigSettingId`,e.schema,e,t)}static fromName(t){return oh(`ConfigSettingId`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Dv=class e extends Y{configSettingId;static schema=G(`LedgerKeyConfigSetting`,{configSettingId:Ev.schema});constructor(e){super(),this.configSettingId=e.configSettingId}toXdrObject(){return{configSettingId:this.configSettingId.toXdrObject()}}static fromXdrObject(t){return new e({configSettingId:Ev.fromXdrObject(t.configSettingId)})}},Ov=class e extends Y{keyHash;static schema=G(`LedgerKeyTtl`,{keyHash:Bh.schema});constructor(e){super(),this.keyHash=e.keyHash instanceof Bh?e.keyHash:new Bh(e.keyHash)}toXdrObject(){return{keyHash:this.keyHash.toXdrObject()}}static fromXdrObject(t){return new e({keyHash:Bh.fromXdrObject(t.keyHash)})}},kv=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.LedgerKey(...) is not supported: XDR unions are built from per-variant factories. Call xdr.LedgerKey.account(...) (or another arm factory) instead.`)}static schema=Of(`LedgerKey`,{switchOn:Xg.schema,cases:[q(`account`,0,K(`account`,Zg.schema)),q(`trustline`,1,K(`trustLine`,a_.schema)),q(`offer`,2,K(`offer`,o_.schema)),q(`data`,3,K(`data`,s_.schema)),q(`claimableBalance`,4,K(`claimableBalance`,c_.schema)),q(`liquidityPool`,5,K(`liquidityPool`,l_.schema)),q(`contractData`,6,K(`contractData`,wv.schema)),q(`contractCode`,7,K(`contractCode`,Tv.schema)),q(`configSetting`,8,K(`configSetting`,Dv.schema)),q(`ttl`,9,K(`ttl`,Ov.schema))]});static account(e){return new Av(e)}static trustline(e){return new jv(e)}static offer(e){return new Mv(e)}static data(e){return new Nv(e)}static claimableBalance(e){return new Pv(e)}static liquidityPool(e){return new Fv(e)}static contractData(e){return new Iv(e)}static contractCode(e){return new Lv(e)}static configSetting(e){return new Rv(e)}static ttl(e){return new zv(e)}static fromXdrObject(e){switch(e.type){case 0:return new Av(Zg.fromXdrObject(e.account));case 1:return new jv(a_.fromXdrObject(e.trustLine));case 2:return new Mv(o_.fromXdrObject(e.offer));case 3:return new Nv(s_.fromXdrObject(e.data));case 4:return new Pv(c_.fromXdrObject(e.claimableBalance));case 5:return new Fv(l_.fromXdrObject(e.liquidityPool));case 6:return new Iv(wv.fromXdrObject(e.contractData));case 7:return new Lv(Tv.fromXdrObject(e.contractCode));case 8:return new Rv(Dv.fromXdrObject(e.configSetting));case 9:return new zv(Ov.fromXdrObject(e.ttl))}throw new W(`LedgerKey: unknown type ${e.type}`)}static is(t){return t instanceof e}},Av=class extends kv{type=`account`;account;constructor(e){super(),this.account=e}get value(){return this.account}toXdrObject(){return{type:0,account:this.account.toXdrObject()}}},jv=class extends kv{type=`trustline`;trustLine;constructor(e){super(),this.trustLine=e}get value(){return this.trustLine}toXdrObject(){return{type:1,trustLine:this.trustLine.toXdrObject()}}},Mv=class extends kv{type=`offer`;offer;constructor(e){super(),this.offer=e}get value(){return this.offer}toXdrObject(){return{type:2,offer:this.offer.toXdrObject()}}},Nv=class extends kv{type=`data`;data;constructor(e){super(),this.data=e}get value(){return this.data}toXdrObject(){return{type:3,data:this.data.toXdrObject()}}},Pv=class extends kv{type=`claimableBalance`;claimableBalance;constructor(e){super(),this.claimableBalance=e}get value(){return this.claimableBalance}toXdrObject(){return{type:4,claimableBalance:this.claimableBalance.toXdrObject()}}},Fv=class extends kv{type=`liquidityPool`;liquidityPool;constructor(e){super(),this.liquidityPool=e}get value(){return this.liquidityPool}toXdrObject(){return{type:5,liquidityPool:this.liquidityPool.toXdrObject()}}},Iv=class extends kv{type=`contractData`;contractData;constructor(e){super(),this.contractData=e}get value(){return this.contractData}toXdrObject(){return{type:6,contractData:this.contractData.toXdrObject()}}},Lv=class extends kv{type=`contractCode`;contractCode;constructor(e){super(),this.contractCode=e}get value(){return this.contractCode}toXdrObject(){return{type:7,contractCode:this.contractCode.toXdrObject()}}},Rv=class extends kv{type=`configSetting`;configSetting;constructor(e){super(),this.configSetting=e}get value(){return this.configSetting}toXdrObject(){return{type:8,configSetting:this.configSetting.toXdrObject()}}},zv=class extends kv{type=`ttl`;ttl;constructor(e){super(),this.ttl=e}get value(){return this.ttl}toXdrObject(){return{type:9,ttl:this.ttl.toXdrObject()}}},Bv=kv,Vv=class e extends Y{accountId;signerKey;static schema=G(`RevokeSponsorshipOpSigner`,{accountId:dh.schema,signerKey:yh.schema});constructor(e){super(),this.accountId=e.accountId,this.signerKey=e.signerKey}toXdrObject(){return{accountId:this.accountId.toXdrObject(),signerKey:this.signerKey.toXdrObject()}}static fromXdrObject(t){return new e({accountId:dh.fromXdrObject(t.accountId),signerKey:yh.fromXdrObject(t.signerKey)})}},Hv=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.RevokeSponsorshipOp(...) is not supported: XDR unions are built from per-variant factories. Call xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(...) (or another arm factory) instead.`)}static schema=Of(`RevokeSponsorshipOp`,{switchOn:Yg.schema,cases:[q(`revokeSponsorshipLedgerEntry`,0,K(`ledgerKey`,Bv.schema)),q(`revokeSponsorshipSigner`,1,K(`signer`,Vv.schema))]});static revokeSponsorshipLedgerEntry(e){return new Uv(e)}static revokeSponsorshipSigner(e){return new Wv(e)}static fromXdrObject(e){switch(e.type){case 0:return new Uv(Bv.fromXdrObject(e.ledgerKey));case 1:return new Wv(Vv.fromXdrObject(e.signer))}throw new W(`RevokeSponsorshipOp: unknown type ${e.type}`)}static is(t){return t instanceof e}},Uv=class extends Hv{type=`revokeSponsorshipLedgerEntry`;ledgerKey;constructor(e){super(),this.ledgerKey=e}get value(){return this.ledgerKey}toXdrObject(){return{type:0,ledgerKey:this.ledgerKey.toXdrObject()}}},Wv=class extends Hv{type=`revokeSponsorshipSigner`;signer;constructor(e){super(),this.signer=e}get value(){return this.signer}toXdrObject(){return{type:1,signer:this.signer.toXdrObject()}}},Gv=Hv,Kv=class e extends Y{asset;from;amount;static schema=G(`ClawbackOp`,{asset:Rh.schema,from:ng.schema,amount:ff()});constructor(e){super(),this.asset=e.asset,this.from=e.from,this.amount=e.amount}toXdrObject(){return{asset:this.asset.toXdrObject(),from:this.from.toXdrObject(),amount:this.amount}}static fromXdrObject(t){return new e({asset:Rh.fromXdrObject(t.asset),from:ng.fromXdrObject(t.from),amount:t.amount})}},qv=class e extends Y{balanceId;static schema=G(`ClawbackClaimableBalanceOp`,{balanceId:Kg.schema});constructor(e){super(),this.balanceId=e.balanceId}toXdrObject(){return{balanceId:this.balanceId.toXdrObject()}}static fromXdrObject(t){return new e({balanceId:Kg.fromXdrObject(t.balanceId)})}},Jv=class e extends Y{trustor;asset;clearFlags;setFlags;static schema=G(`SetTrustLineFlagsOp`,{trustor:dh.schema,asset:Rh.schema,clearFlags:Cf(),setFlags:Cf()});constructor(e){super(),this.trustor=e.trustor,this.asset=e.asset,this.clearFlags=e.clearFlags,this.setFlags=e.setFlags}toXdrObject(){return{trustor:this.trustor.toXdrObject(),asset:this.asset.toXdrObject(),clearFlags:this.clearFlags,setFlags:this.setFlags}}static fromXdrObject(t){return new e({trustor:dh.fromXdrObject(t.trustor),asset:Rh.fromXdrObject(t.asset),clearFlags:t.clearFlags,setFlags:t.setFlags})}},Yv=class e extends Y{liquidityPoolId;maxAmountA;maxAmountB;minPrice;maxPrice;static schema=G(`LiquidityPoolDepositOp`,{liquidityPoolId:Qg.schema,maxAmountA:ff(),maxAmountB:ff(),minPrice:sg.schema,maxPrice:sg.schema});constructor(e){super(),this.liquidityPoolId=e.liquidityPoolId,this.maxAmountA=e.maxAmountA,this.maxAmountB=e.maxAmountB,this.minPrice=e.minPrice,this.maxPrice=e.maxPrice}toXdrObject(){return{liquidityPoolId:this.liquidityPoolId.toXdrObject(),maxAmountA:this.maxAmountA,maxAmountB:this.maxAmountB,minPrice:this.minPrice.toXdrObject(),maxPrice:this.maxPrice.toXdrObject()}}static fromXdrObject(t){return new e({liquidityPoolId:Qg.fromXdrObject(t.liquidityPoolId),maxAmountA:t.maxAmountA,maxAmountB:t.maxAmountB,minPrice:sg.fromXdrObject(t.minPrice),maxPrice:sg.fromXdrObject(t.maxPrice)})}},Xv=class e extends Y{liquidityPoolId;amount;minAmountA;minAmountB;static schema=G(`LiquidityPoolWithdrawOp`,{liquidityPoolId:Qg.schema,amount:ff(),minAmountA:ff(),minAmountB:ff()});constructor(e){super(),this.liquidityPoolId=e.liquidityPoolId,this.amount=e.amount,this.minAmountA=e.minAmountA,this.minAmountB=e.minAmountB}toXdrObject(){return{liquidityPoolId:this.liquidityPoolId.toXdrObject(),amount:this.amount,minAmountA:this.minAmountA,minAmountB:this.minAmountB}}static fromXdrObject(t){return new e({liquidityPoolId:Qg.fromXdrObject(t.liquidityPoolId),amount:t.amount,minAmountA:t.minAmountA,minAmountB:t.minAmountB})}},Zv=class e extends rh{static hostFunctionTypeInvokeContract=new e(`hostFunctionTypeInvokeContract`,0);static hostFunctionTypeCreateContract=new e(`hostFunctionTypeCreateContract`,1);static hostFunctionTypeUploadContractWasm=new e(`hostFunctionTypeUploadContractWasm`,2);static hostFunctionTypeCreateContractV2=new e(`hostFunctionTypeCreateContractV2`,3);static schema=ih(cf(`HostFunctionType`,{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2,hostFunctionTypeCreateContractV2:3}),`hostFunctionType`);static fromValue(t){return ah(`HostFunctionType`,e.schema,e,t)}static fromName(t){return oh(`HostFunctionType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},Qv=class e extends Y{contractAddress;functionName;args;static schema=G(`InvokeContractArgs`,{contractAddress:x_.schema,functionName:Op(32),args:ef(Sv.schema,Zd)});constructor(e){super(),this.contractAddress=e.contractAddress,this.functionName=e.functionName instanceof Tp?e.functionName:new Tp(e.functionName),this.args=e.args}toXdrObject(){return{contractAddress:this.contractAddress.toXdrObject(),functionName:this.functionName,args:this.args.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({contractAddress:x_.fromXdrObject(t.contractAddress),functionName:t.functionName,args:t.args.map(e=>Sv.fromXdrObject(e))})}},$v=class e extends rh{static contractIdPreimageFromAddress=new e(`contractIdPreimageFromAddress`,0);static contractIdPreimageFromAsset=new e(`contractIdPreimageFromAsset`,1);static schema=ih(cf(`ContractIdPreimageType`,{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),`contractIdPreimageFrom`);static fromValue(t){return ah(`ContractIdPreimageType`,e.schema,e,t)}static fromName(t){return oh(`ContractIdPreimageType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},ey=class e extends Y{address;salt;static schema=G(`ContractIdPreimageFromAddress`,{address:x_.schema,salt:ch.schema});constructor(e){super(),this.address=e.address,this.salt=e.salt instanceof ch?e.salt:new ch(e.salt)}toXdrObject(){return{address:this.address.toXdrObject(),salt:this.salt.toXdrObject()}}static fromXdrObject(t){return new e({address:x_.fromXdrObject(t.address),salt:ch.fromXdrObject(t.salt)})}},ty=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.ContractIdPreimage(...) is not supported: XDR unions are built from per-variant factories. Call xdr.ContractIdPreimage.contractIdPreimageFromAddress(...) (or another arm factory) instead.`)}static schema=Of(`ContractIdPreimage`,{switchOn:$v.schema,cases:[q(`contractIdPreimageFromAddress`,0,K(`fromAddress`,ey.schema)),q(`contractIdPreimageFromAsset`,1,K(`fromAsset`,Rh.schema))]});static contractIdPreimageFromAddress(e){return new ny(e)}static contractIdPreimageFromAsset(e){return new ry(e)}static fromXdrObject(e){switch(e.type){case 0:return new ny(ey.fromXdrObject(e.fromAddress));case 1:return new ry(Rh.fromXdrObject(e.fromAsset))}throw new W(`ContractIdPreimage: unknown type ${e.type}`)}static is(t){return t instanceof e}},ny=class extends ty{type=`contractIdPreimageFromAddress`;fromAddress;constructor(e){super(),this.fromAddress=e}get value(){return this.fromAddress}toXdrObject(){return{type:0,fromAddress:this.fromAddress.toXdrObject()}}},ry=class extends ty{type=`contractIdPreimageFromAsset`;fromAsset;constructor(e){super(),this.fromAsset=e}get value(){return this.fromAsset}toXdrObject(){return{type:1,fromAsset:this.fromAsset.toXdrObject()}}},iy=ty,ay=class e extends Y{contractIdPreimage;executable;static schema=G(`CreateContractArgs`,{contractIdPreimage:iy.schema,executable:O_.schema});constructor(e){super(),this.contractIdPreimage=e.contractIdPreimage,this.executable=e.executable}toXdrObject(){return{contractIdPreimage:this.contractIdPreimage.toXdrObject(),executable:this.executable.toXdrObject()}}static fromXdrObject(t){return new e({contractIdPreimage:iy.fromXdrObject(t.contractIdPreimage),executable:O_.fromXdrObject(t.executable)})}},oy=class e extends Y{contractIdPreimage;executable;constructorArgs;static schema=G(`CreateContractArgsV2`,{contractIdPreimage:iy.schema,executable:O_.schema,constructorArgs:ef(Sv.schema,Zd)});constructor(e){super(),this.contractIdPreimage=e.contractIdPreimage,this.executable=e.executable,this.constructorArgs=e.constructorArgs}toXdrObject(){return{contractIdPreimage:this.contractIdPreimage.toXdrObject(),executable:this.executable.toXdrObject(),constructorArgs:this.constructorArgs.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({contractIdPreimage:iy.fromXdrObject(t.contractIdPreimage),executable:O_.fromXdrObject(t.executable),constructorArgs:t.constructorArgs.map(e=>Sv.fromXdrObject(e))})}},sy=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.HostFunction(...) is not supported: XDR unions are built from per-variant factories. Call xdr.HostFunction.hostFunctionTypeInvokeContract(...) (or another arm factory) instead.`)}static schema=Of(`HostFunction`,{switchOn:Zv.schema,cases:[q(`hostFunctionTypeInvokeContract`,0,K(`invokeContract`,Qv.schema)),q(`hostFunctionTypeCreateContract`,1,K(`createContract`,ay.schema)),q(`hostFunctionTypeUploadContractWasm`,2,K(`wasm`,Pf(Zd))),q(`hostFunctionTypeCreateContractV2`,3,K(`createContractV2`,oy.schema))]});static hostFunctionTypeInvokeContract(e){return new cy(e)}static hostFunctionTypeCreateContract(e){return new ly(e)}static hostFunctionTypeUploadContractWasm(e){return new uy(e)}static hostFunctionTypeCreateContractV2(e){return new dy(e)}static fromXdrObject(e){switch(e.type){case 0:return new cy(Qv.fromXdrObject(e.invokeContract));case 1:return new ly(ay.fromXdrObject(e.createContract));case 2:return new uy(e.wasm);case 3:return new dy(oy.fromXdrObject(e.createContractV2))}throw new W(`HostFunction: unknown type ${e.type}`)}static is(t){return t instanceof e}},cy=class extends sy{type=`hostFunctionTypeInvokeContract`;invokeContract;constructor(e){super(),this.invokeContract=e}get value(){return this.invokeContract}toXdrObject(){return{type:0,invokeContract:this.invokeContract.toXdrObject()}}},ly=class extends sy{type=`hostFunctionTypeCreateContract`;createContract;constructor(e){super(),this.createContract=e}get value(){return this.createContract}toXdrObject(){return{type:1,createContract:this.createContract.toXdrObject()}}},uy=class extends sy{type=`hostFunctionTypeUploadContractWasm`;wasm;constructor(e){super(),this.wasm=e}get value(){return this.wasm}toXdrObject(){return{type:2,wasm:this.wasm}}},dy=class extends sy{type=`hostFunctionTypeCreateContractV2`;createContractV2;constructor(e){super(),this.createContractV2=e}get value(){return this.createContractV2}toXdrObject(){return{type:3,createContractV2:this.createContractV2.toXdrObject()}}},fy=sy,py=class e extends rh{static sorobanCredentialsSourceAccount=new e(`sorobanCredentialsSourceAccount`,0);static sorobanCredentialsAddress=new e(`sorobanCredentialsAddress`,1);static sorobanCredentialsAddressV2=new e(`sorobanCredentialsAddressV2`,2);static sorobanCredentialsAddressWithDelegates=new e(`sorobanCredentialsAddressWithDelegates`,3);static schema=ih(cf(`SorobanCredentialsType`,{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1,sorobanCredentialsAddressV2:2,sorobanCredentialsAddressWithDelegates:3}),`sorobanCredentials`);static fromValue(t){return ah(`SorobanCredentialsType`,e.schema,e,t)}static fromName(t){return oh(`SorobanCredentialsType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},my=class e extends Y{address;nonce;signatureExpirationLedger;signature;static schema=G(`SorobanAddressCredentials`,{address:x_.schema,nonce:ff(),signatureExpirationLedger:Cf(),signature:Sv.schema});constructor(e){super(),this.address=e.address,this.nonce=e.nonce,this.signatureExpirationLedger=e.signatureExpirationLedger,this.signature=e.signature}toXdrObject(){return{address:this.address.toXdrObject(),nonce:this.nonce,signatureExpirationLedger:this.signatureExpirationLedger,signature:this.signature.toXdrObject()}}static fromXdrObject(t){return new e({address:x_.fromXdrObject(t.address),nonce:t.nonce,signatureExpirationLedger:t.signatureExpirationLedger,signature:Sv.fromXdrObject(t.signature)})}},hy=class e extends Y{address;signature;nestedDelegates;static schema=G(`SorobanDelegateSignature`,{address:x_.schema,signature:Sv.schema,nestedDelegates:ef(mf(()=>e.schema),Zd)});constructor(e){super(),this.address=e.address,this.signature=e.signature,this.nestedDelegates=e.nestedDelegates}toXdrObject(){return{address:this.address.toXdrObject(),signature:this.signature.toXdrObject(),nestedDelegates:this.nestedDelegates.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({address:x_.fromXdrObject(t.address),signature:Sv.fromXdrObject(t.signature),nestedDelegates:t.nestedDelegates.map(t=>e.fromXdrObject(t))})}},gy=class e extends Y{addressCredentials;delegates;static schema=G(`SorobanAddressCredentialsWithDelegates`,{addressCredentials:my.schema,delegates:ef(hy.schema,Zd)});constructor(e){super(),this.addressCredentials=e.addressCredentials,this.delegates=e.delegates}toXdrObject(){return{addressCredentials:this.addressCredentials.toXdrObject(),delegates:this.delegates.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({addressCredentials:my.fromXdrObject(t.addressCredentials),delegates:t.delegates.map(e=>hy.fromXdrObject(e))})}},_y=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.SorobanCredentials(...) is not supported: XDR unions are built from per-variant factories. Call xdr.SorobanCredentials.sorobanCredentialsSourceAccount() (or another arm factory) instead.`)}static schema=Of(`SorobanCredentials`,{switchOn:py.schema,cases:[q(`sorobanCredentialsSourceAccount`,0,If()),q(`sorobanCredentialsAddress`,1,K(`address`,my.schema)),q(`sorobanCredentialsAddressV2`,2,K(`addressV2`,my.schema)),q(`sorobanCredentialsAddressWithDelegates`,3,K(`addressWithDelegates`,gy.schema))]});static sorobanCredentialsSourceAccount(){return new vy}static sorobanCredentialsAddress(e){return new yy(e)}static sorobanCredentialsAddressV2(e){return new by(e)}static sorobanCredentialsAddressWithDelegates(e){return new xy(e)}static fromXdrObject(e){switch(e.type){case 0:return new vy;case 1:return new yy(my.fromXdrObject(e.address));case 2:return new by(my.fromXdrObject(e.addressV2));case 3:return new xy(gy.fromXdrObject(e.addressWithDelegates))}throw new W(`SorobanCredentials: unknown type ${e.type}`)}static is(t){return t instanceof e}},vy=class extends _y{type=`sorobanCredentialsSourceAccount`;get value(){return null}toXdrObject(){return{type:0}}},yy=class extends _y{type=`sorobanCredentialsAddress`;address;constructor(e){super(),this.address=e}get value(){return this.address}toXdrObject(){return{type:1,address:this.address.toXdrObject()}}},by=class extends _y{type=`sorobanCredentialsAddressV2`;addressV2;constructor(e){super(),this.addressV2=e}get value(){return this.addressV2}toXdrObject(){return{type:2,addressV2:this.addressV2.toXdrObject()}}},xy=class extends _y{type=`sorobanCredentialsAddressWithDelegates`;addressWithDelegates;constructor(e){super(),this.addressWithDelegates=e}get value(){return this.addressWithDelegates}toXdrObject(){return{type:3,addressWithDelegates:this.addressWithDelegates.toXdrObject()}}},Sy=_y,Cy=class e extends rh{static sorobanAuthorizedFunctionTypeContractFn=new e(`sorobanAuthorizedFunctionTypeContractFn`,0);static sorobanAuthorizedFunctionTypeCreateContractHostFn=new e(`sorobanAuthorizedFunctionTypeCreateContractHostFn`,1);static sorobanAuthorizedFunctionTypeCreateContractV2HostFn=new e(`sorobanAuthorizedFunctionTypeCreateContractV2HostFn`,2);static schema=ih(cf(`SorobanAuthorizedFunctionType`,{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1,sorobanAuthorizedFunctionTypeCreateContractV2HostFn:2}),`sorobanAuthorizedFunctionType`);static fromValue(t){return ah(`SorobanAuthorizedFunctionType`,e.schema,e,t)}static fromName(t){return oh(`SorobanAuthorizedFunctionType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},wy=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.SorobanAuthorizedFunction(...) is not supported: XDR unions are built from per-variant factories. Call xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn(...) (or another arm factory) instead.`)}static schema=Of(`SorobanAuthorizedFunction`,{switchOn:Cy.schema,cases:[q(`sorobanAuthorizedFunctionTypeContractFn`,0,K(`contractFn`,Qv.schema)),q(`sorobanAuthorizedFunctionTypeCreateContractHostFn`,1,K(`createContractHostFn`,ay.schema)),q(`sorobanAuthorizedFunctionTypeCreateContractV2HostFn`,2,K(`createContractV2HostFn`,oy.schema))]});static sorobanAuthorizedFunctionTypeContractFn(e){return new Ty(e)}static sorobanAuthorizedFunctionTypeCreateContractHostFn(e){return new Ey(e)}static sorobanAuthorizedFunctionTypeCreateContractV2HostFn(e){return new Dy(e)}static fromXdrObject(e){switch(e.type){case 0:return new Ty(Qv.fromXdrObject(e.contractFn));case 1:return new Ey(ay.fromXdrObject(e.createContractHostFn));case 2:return new Dy(oy.fromXdrObject(e.createContractV2HostFn))}throw new W(`SorobanAuthorizedFunction: unknown type ${e.type}`)}static is(t){return t instanceof e}},Ty=class extends wy{type=`sorobanAuthorizedFunctionTypeContractFn`;contractFn;constructor(e){super(),this.contractFn=e}get value(){return this.contractFn}toXdrObject(){return{type:0,contractFn:this.contractFn.toXdrObject()}}},Ey=class extends wy{type=`sorobanAuthorizedFunctionTypeCreateContractHostFn`;createContractHostFn;constructor(e){super(),this.createContractHostFn=e}get value(){return this.createContractHostFn}toXdrObject(){return{type:1,createContractHostFn:this.createContractHostFn.toXdrObject()}}},Dy=class extends wy{type=`sorobanAuthorizedFunctionTypeCreateContractV2HostFn`;createContractV2HostFn;constructor(e){super(),this.createContractV2HostFn=e}get value(){return this.createContractV2HostFn}toXdrObject(){return{type:2,createContractV2HostFn:this.createContractV2HostFn.toXdrObject()}}},Oy=wy,ky=class e extends Y{function;subInvocations;static schema=G(`SorobanAuthorizedInvocation`,{function:Oy.schema,subInvocations:ef(mf(()=>e.schema),Zd)});constructor(e){super(),this.function=e.function,this.subInvocations=e.subInvocations}toXdrObject(){return{function:this.function.toXdrObject(),subInvocations:this.subInvocations.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({function:Oy.fromXdrObject(t.function),subInvocations:t.subInvocations.map(t=>e.fromXdrObject(t))})}},Ay=class e extends Y{credentials;rootInvocation;static schema=G(`SorobanAuthorizationEntry`,{credentials:Sy.schema,rootInvocation:ky.schema});constructor(e){super(),this.credentials=e.credentials,this.rootInvocation=e.rootInvocation}toXdrObject(){return{credentials:this.credentials.toXdrObject(),rootInvocation:this.rootInvocation.toXdrObject()}}static fromXdrObject(t){return new e({credentials:Sy.fromXdrObject(t.credentials),rootInvocation:ky.fromXdrObject(t.rootInvocation)})}},jy=class e extends Y{hostFunction;auth;static schema=G(`InvokeHostFunctionOp`,{hostFunction:fy.schema,auth:ef(Ay.schema,Zd)});constructor(e){super(),this.hostFunction=e.hostFunction,this.auth=e.auth}toXdrObject(){return{hostFunction:this.hostFunction.toXdrObject(),auth:this.auth.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({hostFunction:fy.fromXdrObject(t.hostFunction),auth:t.auth.map(e=>Ay.fromXdrObject(e))})}},My=class e extends Y{ext;extendTo;static schema=G(`ExtendFootprintTtlOp`,{ext:Ch.schema,extendTo:Cf()});constructor(e){super(),this.ext=e.ext,this.extendTo=e.extendTo}toXdrObject(){return{ext:this.ext.toXdrObject(),extendTo:this.extendTo}}static fromXdrObject(t){return new e({ext:Ch.fromXdrObject(t.ext),extendTo:t.extendTo})}},Ny=class e extends Y{ext;static schema=G(`RestoreFootprintOp`,{ext:Ch.schema});constructor(e){super(),this.ext=e.ext}toXdrObject(){return{ext:this.ext.toXdrObject()}}static fromXdrObject(t){return new e({ext:Ch.fromXdrObject(t.ext)})}},Py=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.OperationBody(...) is not supported: XDR unions are built from per-variant factories. Call xdr.OperationBody.createAccount(...) (or another arm factory) instead.`)}static schema=Of(`OperationBody`,{switchOn:rg.schema,cases:[q(`createAccount`,0,K(`createAccountOp`,ig.schema)),q(`payment`,1,K(`paymentOp`,ag.schema)),q(`pathPaymentStrictReceive`,2,K(`pathPaymentStrictReceiveOp`,og.schema)),q(`manageSellOffer`,3,K(`manageSellOfferOp`,cg.schema)),q(`createPassiveSellOffer`,4,K(`createPassiveSellOfferOp`,lg.schema)),q(`setOptions`,5,K(`setOptionsOp`,ug.schema)),q(`changeTrust`,6,K(`changeTrustOp`,Sg.schema)),q(`allowTrust`,7,K(`allowTrustOp`,jh.schema)),q(`accountMerge`,8,K(`destination`,ng.schema)),q(`inflation`,9,If()),q(`manageData`,10,K(`manageDataOp`,wg.schema)),q(`bumpSequence`,11,K(`bumpSequenceOp`,Tg.schema)),q(`manageBuyOffer`,12,K(`manageBuyOfferOp`,Eg.schema)),q(`pathPaymentStrictSend`,13,K(`pathPaymentStrictSendOp`,Dg.schema)),q(`createClaimableBalance`,14,K(`createClaimableBalanceOp`,Hg.schema)),q(`claimClaimableBalance`,15,K(`claimClaimableBalanceOp`,qg.schema)),q(`beginSponsoringFutureReserves`,16,K(`beginSponsoringFutureReservesOp`,Jg.schema)),q(`endSponsoringFutureReserves`,17,If()),q(`revokeSponsorship`,18,K(`revokeSponsorshipOp`,Gv.schema)),q(`clawback`,19,K(`clawbackOp`,Kv.schema)),q(`clawbackClaimableBalance`,20,K(`clawbackClaimableBalanceOp`,qv.schema)),q(`setTrustLineFlags`,21,K(`setTrustLineFlagsOp`,Jv.schema)),q(`liquidityPoolDeposit`,22,K(`liquidityPoolDepositOp`,Yv.schema)),q(`liquidityPoolWithdraw`,23,K(`liquidityPoolWithdrawOp`,Xv.schema)),q(`invokeHostFunction`,24,K(`invokeHostFunctionOp`,jy.schema)),q(`extendFootprintTtl`,25,K(`extendFootprintTtlOp`,My.schema)),q(`restoreFootprint`,26,K(`restoreFootprintOp`,Ny.schema))]});static createAccount(e){return new Fy(e)}static payment(e){return new Iy(e)}static pathPaymentStrictReceive(e){return new Ly(e)}static manageSellOffer(e){return new Ry(e)}static createPassiveSellOffer(e){return new zy(e)}static setOptions(e){return new By(e)}static changeTrust(e){return new Vy(e)}static allowTrust(e){return new Hy(e)}static accountMerge(e){return new Uy(e)}static inflation(){return new Wy}static manageData(e){return new Gy(e)}static bumpSequence(e){return new Ky(e)}static manageBuyOffer(e){return new qy(e)}static pathPaymentStrictSend(e){return new Jy(e)}static createClaimableBalance(e){return new Yy(e)}static claimClaimableBalance(e){return new Xy(e)}static beginSponsoringFutureReserves(e){return new Zy(e)}static endSponsoringFutureReserves(){return new Qy}static revokeSponsorship(e){return new $y(e)}static clawback(e){return new eb(e)}static clawbackClaimableBalance(e){return new tb(e)}static setTrustLineFlags(e){return new nb(e)}static liquidityPoolDeposit(e){return new rb(e)}static liquidityPoolWithdraw(e){return new ib(e)}static invokeHostFunction(e){return new ab(e)}static extendFootprintTtl(e){return new ob(e)}static restoreFootprint(e){return new sb(e)}static fromXdrObject(e){switch(e.type){case 0:return new Fy(ig.fromXdrObject(e.createAccountOp));case 1:return new Iy(ag.fromXdrObject(e.paymentOp));case 2:return new Ly(og.fromXdrObject(e.pathPaymentStrictReceiveOp));case 3:return new Ry(cg.fromXdrObject(e.manageSellOfferOp));case 4:return new zy(lg.fromXdrObject(e.createPassiveSellOfferOp));case 5:return new By(ug.fromXdrObject(e.setOptionsOp));case 6:return new Vy(Sg.fromXdrObject(e.changeTrustOp));case 7:return new Hy(jh.fromXdrObject(e.allowTrustOp));case 8:return new Uy(ng.fromXdrObject(e.destination));case 9:return new Wy;case 10:return new Gy(wg.fromXdrObject(e.manageDataOp));case 11:return new Ky(Tg.fromXdrObject(e.bumpSequenceOp));case 12:return new qy(Eg.fromXdrObject(e.manageBuyOfferOp));case 13:return new Jy(Dg.fromXdrObject(e.pathPaymentStrictSendOp));case 14:return new Yy(Hg.fromXdrObject(e.createClaimableBalanceOp));case 15:return new Xy(qg.fromXdrObject(e.claimClaimableBalanceOp));case 16:return new Zy(Jg.fromXdrObject(e.beginSponsoringFutureReservesOp));case 17:return new Qy;case 18:return new $y(Gv.fromXdrObject(e.revokeSponsorshipOp));case 19:return new eb(Kv.fromXdrObject(e.clawbackOp));case 20:return new tb(qv.fromXdrObject(e.clawbackClaimableBalanceOp));case 21:return new nb(Jv.fromXdrObject(e.setTrustLineFlagsOp));case 22:return new rb(Yv.fromXdrObject(e.liquidityPoolDepositOp));case 23:return new ib(Xv.fromXdrObject(e.liquidityPoolWithdrawOp));case 24:return new ab(jy.fromXdrObject(e.invokeHostFunctionOp));case 25:return new ob(My.fromXdrObject(e.extendFootprintTtlOp));case 26:return new sb(Ny.fromXdrObject(e.restoreFootprintOp))}throw new W(`OperationBody: unknown type ${e.type}`)}static is(t){return t instanceof e}},Fy=class extends Py{type=`createAccount`;createAccountOp;constructor(e){super(),this.createAccountOp=e}get value(){return this.createAccountOp}toXdrObject(){return{type:0,createAccountOp:this.createAccountOp.toXdrObject()}}},Iy=class extends Py{type=`payment`;paymentOp;constructor(e){super(),this.paymentOp=e}get value(){return this.paymentOp}toXdrObject(){return{type:1,paymentOp:this.paymentOp.toXdrObject()}}},Ly=class extends Py{type=`pathPaymentStrictReceive`;pathPaymentStrictReceiveOp;constructor(e){super(),this.pathPaymentStrictReceiveOp=e}get value(){return this.pathPaymentStrictReceiveOp}toXdrObject(){return{type:2,pathPaymentStrictReceiveOp:this.pathPaymentStrictReceiveOp.toXdrObject()}}},Ry=class extends Py{type=`manageSellOffer`;manageSellOfferOp;constructor(e){super(),this.manageSellOfferOp=e}get value(){return this.manageSellOfferOp}toXdrObject(){return{type:3,manageSellOfferOp:this.manageSellOfferOp.toXdrObject()}}},zy=class extends Py{type=`createPassiveSellOffer`;createPassiveSellOfferOp;constructor(e){super(),this.createPassiveSellOfferOp=e}get value(){return this.createPassiveSellOfferOp}toXdrObject(){return{type:4,createPassiveSellOfferOp:this.createPassiveSellOfferOp.toXdrObject()}}},By=class extends Py{type=`setOptions`;setOptionsOp;constructor(e){super(),this.setOptionsOp=e}get value(){return this.setOptionsOp}toXdrObject(){return{type:5,setOptionsOp:this.setOptionsOp.toXdrObject()}}},Vy=class extends Py{type=`changeTrust`;changeTrustOp;constructor(e){super(),this.changeTrustOp=e}get value(){return this.changeTrustOp}toXdrObject(){return{type:6,changeTrustOp:this.changeTrustOp.toXdrObject()}}},Hy=class extends Py{type=`allowTrust`;allowTrustOp;constructor(e){super(),this.allowTrustOp=e}get value(){return this.allowTrustOp}toXdrObject(){return{type:7,allowTrustOp:this.allowTrustOp.toXdrObject()}}},Uy=class extends Py{type=`accountMerge`;destination;constructor(e){super(),this.destination=e}get value(){return this.destination}toXdrObject(){return{type:8,destination:this.destination.toXdrObject()}}},Wy=class extends Py{type=`inflation`;get value(){return null}toXdrObject(){return{type:9}}},Gy=class extends Py{type=`manageData`;manageDataOp;constructor(e){super(),this.manageDataOp=e}get value(){return this.manageDataOp}toXdrObject(){return{type:10,manageDataOp:this.manageDataOp.toXdrObject()}}},Ky=class extends Py{type=`bumpSequence`;bumpSequenceOp;constructor(e){super(),this.bumpSequenceOp=e}get value(){return this.bumpSequenceOp}toXdrObject(){return{type:11,bumpSequenceOp:this.bumpSequenceOp.toXdrObject()}}},qy=class extends Py{type=`manageBuyOffer`;manageBuyOfferOp;constructor(e){super(),this.manageBuyOfferOp=e}get value(){return this.manageBuyOfferOp}toXdrObject(){return{type:12,manageBuyOfferOp:this.manageBuyOfferOp.toXdrObject()}}},Jy=class extends Py{type=`pathPaymentStrictSend`;pathPaymentStrictSendOp;constructor(e){super(),this.pathPaymentStrictSendOp=e}get value(){return this.pathPaymentStrictSendOp}toXdrObject(){return{type:13,pathPaymentStrictSendOp:this.pathPaymentStrictSendOp.toXdrObject()}}},Yy=class extends Py{type=`createClaimableBalance`;createClaimableBalanceOp;constructor(e){super(),this.createClaimableBalanceOp=e}get value(){return this.createClaimableBalanceOp}toXdrObject(){return{type:14,createClaimableBalanceOp:this.createClaimableBalanceOp.toXdrObject()}}},Xy=class extends Py{type=`claimClaimableBalance`;claimClaimableBalanceOp;constructor(e){super(),this.claimClaimableBalanceOp=e}get value(){return this.claimClaimableBalanceOp}toXdrObject(){return{type:15,claimClaimableBalanceOp:this.claimClaimableBalanceOp.toXdrObject()}}},Zy=class extends Py{type=`beginSponsoringFutureReserves`;beginSponsoringFutureReservesOp;constructor(e){super(),this.beginSponsoringFutureReservesOp=e}get value(){return this.beginSponsoringFutureReservesOp}toXdrObject(){return{type:16,beginSponsoringFutureReservesOp:this.beginSponsoringFutureReservesOp.toXdrObject()}}},Qy=class extends Py{type=`endSponsoringFutureReserves`;get value(){return null}toXdrObject(){return{type:17}}},$y=class extends Py{type=`revokeSponsorship`;revokeSponsorshipOp;constructor(e){super(),this.revokeSponsorshipOp=e}get value(){return this.revokeSponsorshipOp}toXdrObject(){return{type:18,revokeSponsorshipOp:this.revokeSponsorshipOp.toXdrObject()}}},eb=class extends Py{type=`clawback`;clawbackOp;constructor(e){super(),this.clawbackOp=e}get value(){return this.clawbackOp}toXdrObject(){return{type:19,clawbackOp:this.clawbackOp.toXdrObject()}}},tb=class extends Py{type=`clawbackClaimableBalance`;clawbackClaimableBalanceOp;constructor(e){super(),this.clawbackClaimableBalanceOp=e}get value(){return this.clawbackClaimableBalanceOp}toXdrObject(){return{type:20,clawbackClaimableBalanceOp:this.clawbackClaimableBalanceOp.toXdrObject()}}},nb=class extends Py{type=`setTrustLineFlags`;setTrustLineFlagsOp;constructor(e){super(),this.setTrustLineFlagsOp=e}get value(){return this.setTrustLineFlagsOp}toXdrObject(){return{type:21,setTrustLineFlagsOp:this.setTrustLineFlagsOp.toXdrObject()}}},rb=class extends Py{type=`liquidityPoolDeposit`;liquidityPoolDepositOp;constructor(e){super(),this.liquidityPoolDepositOp=e}get value(){return this.liquidityPoolDepositOp}toXdrObject(){return{type:22,liquidityPoolDepositOp:this.liquidityPoolDepositOp.toXdrObject()}}},ib=class extends Py{type=`liquidityPoolWithdraw`;liquidityPoolWithdrawOp;constructor(e){super(),this.liquidityPoolWithdrawOp=e}get value(){return this.liquidityPoolWithdrawOp}toXdrObject(){return{type:23,liquidityPoolWithdrawOp:this.liquidityPoolWithdrawOp.toXdrObject()}}},ab=class extends Py{type=`invokeHostFunction`;invokeHostFunctionOp;constructor(e){super(),this.invokeHostFunctionOp=e}get value(){return this.invokeHostFunctionOp}toXdrObject(){return{type:24,invokeHostFunctionOp:this.invokeHostFunctionOp.toXdrObject()}}},ob=class extends Py{type=`extendFootprintTtl`;extendFootprintTtlOp;constructor(e){super(),this.extendFootprintTtlOp=e}get value(){return this.extendFootprintTtlOp}toXdrObject(){return{type:25,extendFootprintTtlOp:this.extendFootprintTtlOp.toXdrObject()}}},sb=class extends Py{type=`restoreFootprint`;restoreFootprintOp;constructor(e){super(),this.restoreFootprintOp=e}get value(){return this.restoreFootprintOp}toXdrObject(){return{type:26,restoreFootprintOp:this.restoreFootprintOp.toXdrObject()}}},cb=Py,lb=class e extends Y{sourceAccount;body;static schema=G(`Operation`,{sourceAccount:vf(ng.schema),body:cb.schema});constructor(e){super(),this.sourceAccount=e.sourceAccount,this.body=e.body}toXdrObject(){return{sourceAccount:this.sourceAccount===null?null:this.sourceAccount.toXdrObject(),body:this.body.toXdrObject()}}static fromXdrObject(t){return new e({sourceAccount:t.sourceAccount===null?null:ng.fromXdrObject(t.sourceAccount),body:cb.fromXdrObject(t.body)})}},ub=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.TransactionV0Ext(...) is not supported: XDR unions are built from per-variant factories. Call xdr.TransactionV0Ext.v0() (or another arm factory) instead.`)}static schema=Of(`TransactionV0Ext`,{switchOn:uf(),cases:[q(`v0`,0,If())],switchKey:`v`});static v0(){return new db}static fromXdrObject(e){if(e.v===0)return new db;throw new W(`TransactionV0Ext: unknown v ${e.v}`)}static is(t){return t instanceof e}},db=class extends ub{type=`v0`;get value(){return null}toXdrObject(){return{v:0}}},fb=ub,pb=class e extends Y{sourceAccountEd25519;fee;seqNum;timeBounds;memo;operations;ext;static schema=G(`TransactionV0`,{sourceAccountEd25519:ch.schema,fee:Cf(),seqNum:ff(),timeBounds:vf(Hh.schema),memo:Xh.schema,operations:ef(lb.schema,100),ext:fb.schema});constructor(e){super(),this.sourceAccountEd25519=e.sourceAccountEd25519 instanceof ch?e.sourceAccountEd25519:new ch(e.sourceAccountEd25519),this.fee=e.fee,this.seqNum=e.seqNum,this.timeBounds=e.timeBounds,this.memo=e.memo,this.operations=e.operations,this.ext=e.ext}toXdrObject(){return{sourceAccountEd25519:this.sourceAccountEd25519.toXdrObject(),fee:this.fee,seqNum:this.seqNum,timeBounds:this.timeBounds===null?null:this.timeBounds.toXdrObject(),memo:this.memo.toXdrObject(),operations:this.operations.map(e=>e.toXdrObject()),ext:this.ext.toXdrObject()}}static fromXdrObject(t){return new e({sourceAccountEd25519:ch.fromXdrObject(t.sourceAccountEd25519),fee:t.fee,seqNum:t.seqNum,timeBounds:t.timeBounds===null?null:Hh.fromXdrObject(t.timeBounds),memo:Xh.fromXdrObject(t.memo),operations:t.operations.map(e=>lb.fromXdrObject(e)),ext:fb.fromXdrObject(t.ext)})}},mb=class e extends nh{static byteLength=4;static encoding=`hex`;static schema=gf(4,`SignatureHint`);static fromXdrObject(t){return new e(t)}},hb=class e extends Y{hint;signature;static schema=G(`DecoratedSignature`,{hint:mb.schema,signature:zh.schema});constructor(e){super(),this.hint=e.hint instanceof mb?e.hint:new mb(e.hint),this.signature=e.signature instanceof zh?e.signature:new zh(e.signature)}toXdrObject(){return{hint:this.hint.toXdrObject(),signature:this.signature.toXdrObject()}}static fromXdrObject(t){return new e({hint:mb.fromXdrObject(t.hint),signature:zh.fromXdrObject(t.signature)})}},gb=class e extends Y{tx;signatures;static schema=G(`TransactionV0Envelope`,{tx:pb.schema,signatures:ef(hb.schema,20)});constructor(e){super(),this.tx=e.tx,this.signatures=e.signatures}toXdrObject(){return{tx:this.tx.toXdrObject(),signatures:this.signatures.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({tx:pb.fromXdrObject(t.tx),signatures:t.signatures.map(e=>hb.fromXdrObject(e))})}},_b=class e extends rh{static precondNone=new e(`precondNone`,0);static precondTime=new e(`precondTime`,1);static precondV2=new e(`precondV2`,2);static schema=ih(cf(`PreconditionType`,{precondNone:0,precondTime:1,precondV2:2}),`precond`);static fromValue(t){return ah(`PreconditionType`,e.schema,e,t)}static fromName(t){return oh(`PreconditionType`,e,t)}static fromXdrObject(t){return e.fromValue(t)}},vb=class e extends Y{minLedger;maxLedger;static schema=G(`LedgerBounds`,{minLedger:Cf(),maxLedger:Cf()});constructor(e){super(),this.minLedger=e.minLedger,this.maxLedger=e.maxLedger}toXdrObject(){return{minLedger:this.minLedger,maxLedger:this.maxLedger}}static fromXdrObject(t){return new e({minLedger:t.minLedger,maxLedger:t.maxLedger})}},yb=class e extends Y{timeBounds;ledgerBounds;minSeqNum;minSeqAge;minSeqLedgerGap;extraSigners;static schema=G(`PreconditionsV2`,{timeBounds:vf(Hh.schema),ledgerBounds:vf(vb.schema),minSeqNum:vf(ff()),minSeqAge:Tf(),minSeqLedgerGap:Cf(),extraSigners:ef(yh.schema,2)});constructor(e){super(),this.timeBounds=e.timeBounds,this.ledgerBounds=e.ledgerBounds,this.minSeqNum=e.minSeqNum,this.minSeqAge=e.minSeqAge,this.minSeqLedgerGap=e.minSeqLedgerGap,this.extraSigners=e.extraSigners}toXdrObject(){return{timeBounds:this.timeBounds===null?null:this.timeBounds.toXdrObject(),ledgerBounds:this.ledgerBounds===null?null:this.ledgerBounds.toXdrObject(),minSeqNum:this.minSeqNum,minSeqAge:this.minSeqAge,minSeqLedgerGap:this.minSeqLedgerGap,extraSigners:this.extraSigners.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({timeBounds:t.timeBounds===null?null:Hh.fromXdrObject(t.timeBounds),ledgerBounds:t.ledgerBounds===null?null:vb.fromXdrObject(t.ledgerBounds),minSeqNum:t.minSeqNum,minSeqAge:t.minSeqAge,minSeqLedgerGap:t.minSeqLedgerGap,extraSigners:t.extraSigners.map(e=>yh.fromXdrObject(e))})}},bb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.Preconditions(...) is not supported: XDR unions are built from per-variant factories. Call xdr.Preconditions.precondNone() (or another arm factory) instead.`)}static schema=Of(`Preconditions`,{switchOn:_b.schema,cases:[q(`precondNone`,0,If()),q(`precondTime`,1,K(`timeBounds`,Hh.schema)),q(`precondV2`,2,K(`v2`,yb.schema))]});static precondNone(){return new xb}static precondTime(e){return new Sb(e)}static precondV2(e){return new Cb(e)}static fromXdrObject(e){switch(e.type){case 0:return new xb;case 1:return new Sb(Hh.fromXdrObject(e.timeBounds));case 2:return new Cb(yb.fromXdrObject(e.v2))}throw new W(`Preconditions: unknown type ${e.type}`)}static is(t){return t instanceof e}},xb=class extends bb{type=`precondNone`;get value(){return null}toXdrObject(){return{type:0}}},Sb=class extends bb{type=`precondTime`;timeBounds;constructor(e){super(),this.timeBounds=e}get value(){return this.timeBounds}toXdrObject(){return{type:1,timeBounds:this.timeBounds.toXdrObject()}}},Cb=class extends bb{type=`precondV2`;v2;constructor(e){super(),this.v2=e}get value(){return this.v2}toXdrObject(){return{type:2,v2:this.v2.toXdrObject()}}},wb=bb,Tb=class e extends Y{archivedSorobanEntries;static schema=G(`SorobanResourcesExtV0`,{archivedSorobanEntries:ef(Cf(),Zd)});constructor(e){super(),this.archivedSorobanEntries=e.archivedSorobanEntries}toXdrObject(){return{archivedSorobanEntries:this.archivedSorobanEntries}}static fromXdrObject(t){return new e({archivedSorobanEntries:t.archivedSorobanEntries})}},Eb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.SorobanTransactionDataExt(...) is not supported: XDR unions are built from per-variant factories. Call xdr.SorobanTransactionDataExt.v0() (or another arm factory) instead.`)}static schema=Of(`SorobanTransactionDataExt`,{switchOn:uf(),cases:[q(`v0`,0,If()),q(`resourceExt`,1,K(`resourceExt`,Tb.schema))],switchKey:`v`});static v0(){return new Db}static resourceExt(e){return new Ob(e)}static fromXdrObject(e){switch(e.v){case 0:return new Db;case 1:return new Ob(Tb.fromXdrObject(e.resourceExt))}throw new W(`SorobanTransactionDataExt: unknown v ${e.v}`)}static is(t){return t instanceof e}},Db=class extends Eb{type=`v0`;get value(){return null}toXdrObject(){return{v:0}}},Ob=class extends Eb{type=`resourceExt`;resourceExt;constructor(e){super(),this.resourceExt=e}get value(){return this.resourceExt}toXdrObject(){return{v:1,resourceExt:this.resourceExt.toXdrObject()}}},kb=Eb,Ab=class e extends Y{readOnly;readWrite;static schema=G(`LedgerFootprint`,{readOnly:ef(Bv.schema,Zd),readWrite:ef(Bv.schema,Zd)});constructor(e){super(),this.readOnly=e.readOnly,this.readWrite=e.readWrite}toXdrObject(){return{readOnly:this.readOnly.map(e=>e.toXdrObject()),readWrite:this.readWrite.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({readOnly:t.readOnly.map(e=>Bv.fromXdrObject(e)),readWrite:t.readWrite.map(e=>Bv.fromXdrObject(e))})}},jb=class e extends Y{footprint;instructions;diskReadBytes;writeBytes;static schema=G(`SorobanResources`,{footprint:Ab.schema,instructions:Cf(),diskReadBytes:Cf(),writeBytes:Cf()});constructor(e){super(),this.footprint=e.footprint,this.instructions=e.instructions,this.diskReadBytes=e.diskReadBytes,this.writeBytes=e.writeBytes}toXdrObject(){return{footprint:this.footprint.toXdrObject(),instructions:this.instructions,diskReadBytes:this.diskReadBytes,writeBytes:this.writeBytes}}static fromXdrObject(t){return new e({footprint:Ab.fromXdrObject(t.footprint),instructions:t.instructions,diskReadBytes:t.diskReadBytes,writeBytes:t.writeBytes})}},Mb=class e extends Y{ext;resources;resourceFee;static schema=G(`SorobanTransactionData`,{ext:kb.schema,resources:jb.schema,resourceFee:ff()});constructor(e){super(),this.ext=e.ext,this.resources=e.resources,this.resourceFee=e.resourceFee}toXdrObject(){return{ext:this.ext.toXdrObject(),resources:this.resources.toXdrObject(),resourceFee:this.resourceFee}}static fromXdrObject(t){return new e({ext:kb.fromXdrObject(t.ext),resources:jb.fromXdrObject(t.resources),resourceFee:t.resourceFee})}},Nb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.TransactionExt(...) is not supported: XDR unions are built from per-variant factories. Call xdr.TransactionExt.v0() (or another arm factory) instead.`)}static schema=Of(`TransactionExt`,{switchOn:uf(),cases:[q(`v0`,0,If()),q(`sorobanData`,1,K(`sorobanData`,Mb.schema))],switchKey:`v`});static v0(){return new Pb}static sorobanData(e){return new Fb(e)}static fromXdrObject(e){switch(e.v){case 0:return new Pb;case 1:return new Fb(Mb.fromXdrObject(e.sorobanData))}throw new W(`TransactionExt: unknown v ${e.v}`)}static is(t){return t instanceof e}},Pb=class extends Nb{type=`v0`;get value(){return null}toXdrObject(){return{v:0}}},Fb=class extends Nb{type=`sorobanData`;sorobanData;constructor(e){super(),this.sorobanData=e}get value(){return this.sorobanData}toXdrObject(){return{v:1,sorobanData:this.sorobanData.toXdrObject()}}},Ib=Nb,Lb=class e extends Y{sourceAccount;fee;seqNum;cond;memo;operations;ext;static schema=G(`Transaction`,{sourceAccount:ng.schema,fee:Cf(),seqNum:ff(),cond:wb.schema,memo:Xh.schema,operations:ef(lb.schema,100),ext:Ib.schema});constructor(e){super(),this.sourceAccount=e.sourceAccount,this.fee=e.fee,this.seqNum=e.seqNum,this.cond=e.cond,this.memo=e.memo,this.operations=e.operations,this.ext=e.ext}toXdrObject(){return{sourceAccount:this.sourceAccount.toXdrObject(),fee:this.fee,seqNum:this.seqNum,cond:this.cond.toXdrObject(),memo:this.memo.toXdrObject(),operations:this.operations.map(e=>e.toXdrObject()),ext:this.ext.toXdrObject()}}static fromXdrObject(t){return new e({sourceAccount:ng.fromXdrObject(t.sourceAccount),fee:t.fee,seqNum:t.seqNum,cond:wb.fromXdrObject(t.cond),memo:Xh.fromXdrObject(t.memo),operations:t.operations.map(e=>lb.fromXdrObject(e)),ext:Ib.fromXdrObject(t.ext)})}},Rb=class e extends Y{tx;signatures;static schema=G(`TransactionV1Envelope`,{tx:Lb.schema,signatures:ef(hb.schema,20)});constructor(e){super(),this.tx=e.tx,this.signatures=e.signatures}toXdrObject(){return{tx:this.tx.toXdrObject(),signatures:this.signatures.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({tx:Lb.fromXdrObject(t.tx),signatures:t.signatures.map(e=>hb.fromXdrObject(e))})}},zb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.FeeBumpTransactionInnerTx(...) is not supported: XDR unions are built from per-variant factories. Call xdr.FeeBumpTransactionInnerTx.envelopeTypeTx(...) (or another arm factory) instead.`)}static schema=Of(`FeeBumpTransactionInnerTx`,{switchOn:Vh.schema,cases:[q(`envelopeTypeTx`,2,K(`v1`,Rb.schema))]});static envelopeTypeTx(e){return new Bb(e)}static fromXdrObject(e){if(e.type===2)return new Bb(Rb.fromXdrObject(e.v1));throw new W(`FeeBumpTransactionInnerTx: unknown type ${e.type}`)}static is(t){return t instanceof e}},Bb=class extends zb{type=`envelopeTypeTx`;v1;constructor(e){super(),this.v1=e}get value(){return this.v1}toXdrObject(){return{type:2,v1:this.v1.toXdrObject()}}},Vb=zb,Hb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.FeeBumpTransactionExt(...) is not supported: XDR unions are built from per-variant factories. Call xdr.FeeBumpTransactionExt.v0() (or another arm factory) instead.`)}static schema=Of(`FeeBumpTransactionExt`,{switchOn:uf(),cases:[q(`v0`,0,If())],switchKey:`v`});static v0(){return new Ub}static fromXdrObject(e){if(e.v===0)return new Ub;throw new W(`FeeBumpTransactionExt: unknown v ${e.v}`)}static is(t){return t instanceof e}},Ub=class extends Hb{type=`v0`;get value(){return null}toXdrObject(){return{v:0}}},Wb=Hb,Gb=class e extends Y{feeSource;fee;innerTx;ext;static schema=G(`FeeBumpTransaction`,{feeSource:ng.schema,fee:ff(),innerTx:Vb.schema,ext:Wb.schema});constructor(e){super(),this.feeSource=e.feeSource,this.fee=e.fee,this.innerTx=e.innerTx,this.ext=e.ext}toXdrObject(){return{feeSource:this.feeSource.toXdrObject(),fee:this.fee,innerTx:this.innerTx.toXdrObject(),ext:this.ext.toXdrObject()}}static fromXdrObject(t){return new e({feeSource:ng.fromXdrObject(t.feeSource),fee:t.fee,innerTx:Vb.fromXdrObject(t.innerTx),ext:Wb.fromXdrObject(t.ext)})}},Kb=class e extends Y{tx;signatures;static schema=G(`FeeBumpTransactionEnvelope`,{tx:Gb.schema,signatures:ef(hb.schema,20)});constructor(e){super(),this.tx=e.tx,this.signatures=e.signatures}toXdrObject(){return{tx:this.tx.toXdrObject(),signatures:this.signatures.map(e=>e.toXdrObject())}}static fromXdrObject(t){return new e({tx:Gb.fromXdrObject(t.tx),signatures:t.signatures.map(e=>hb.fromXdrObject(e))})}},qb=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.TransactionEnvelope(...) is not supported: XDR unions are built from per-variant factories. Call xdr.TransactionEnvelope.envelopeTypeTxV0(...) (or another arm factory) instead.`)}static schema=Of(`TransactionEnvelope`,{switchOn:Vh.schema,cases:[q(`envelopeTypeTxV0`,0,K(`v0`,gb.schema)),q(`envelopeTypeTx`,2,K(`v1`,Rb.schema)),q(`envelopeTypeTxFeeBump`,5,K(`feeBump`,Kb.schema))]});static envelopeTypeTxV0(e){return new Jb(e)}static envelopeTypeTx(e){return new Yb(e)}static envelopeTypeTxFeeBump(e){return new Xb(e)}static fromXdrObject(e){switch(e.type){case 0:return new Jb(gb.fromXdrObject(e.v0));case 2:return new Yb(Rb.fromXdrObject(e.v1));case 5:return new Xb(Kb.fromXdrObject(e.feeBump))}throw new W(`TransactionEnvelope: unknown type ${e.type}`)}static is(t){return t instanceof e}},Jb=class extends qb{type=`envelopeTypeTxV0`;v0;constructor(e){super(),this.v0=e}get value(){return this.v0}toXdrObject(){return{type:0,v0:this.v0.toXdrObject()}}},Yb=class extends qb{type=`envelopeTypeTx`;v1;constructor(e){super(),this.v1=e}get value(){return this.v1}toXdrObject(){return{type:2,v1:this.v1.toXdrObject()}}},Xb=class extends qb{type=`envelopeTypeTxFeeBump`;feeBump;constructor(e){super(),this.feeBump=e}get value(){return this.feeBump}toXdrObject(){return{type:5,feeBump:this.feeBump.toXdrObject()}}},Zb=qb,Qb=class e extends Y{sourceAccount;seqNum;opNum;static schema=G(`HashIdPreimageOperationId`,{sourceAccount:dh.schema,seqNum:ff(),opNum:Cf()});constructor(e){super(),this.sourceAccount=e.sourceAccount,this.seqNum=e.seqNum,this.opNum=e.opNum}toXdrObject(){return{sourceAccount:this.sourceAccount.toXdrObject(),seqNum:this.seqNum,opNum:this.opNum}}static fromXdrObject(t){return new e({sourceAccount:dh.fromXdrObject(t.sourceAccount),seqNum:t.seqNum,opNum:t.opNum})}},$b=class e extends Y{sourceAccount;seqNum;opNum;liquidityPoolId;asset;static schema=G(`HashIdPreimageRevokeId`,{sourceAccount:dh.schema,seqNum:ff(),opNum:Cf(),liquidityPoolId:Qg.schema,asset:Rh.schema});constructor(e){super(),this.sourceAccount=e.sourceAccount,this.seqNum=e.seqNum,this.opNum=e.opNum,this.liquidityPoolId=e.liquidityPoolId,this.asset=e.asset}toXdrObject(){return{sourceAccount:this.sourceAccount.toXdrObject(),seqNum:this.seqNum,opNum:this.opNum,liquidityPoolId:this.liquidityPoolId.toXdrObject(),asset:this.asset.toXdrObject()}}static fromXdrObject(t){return new e({sourceAccount:dh.fromXdrObject(t.sourceAccount),seqNum:t.seqNum,opNum:t.opNum,liquidityPoolId:Qg.fromXdrObject(t.liquidityPoolId),asset:Rh.fromXdrObject(t.asset)})}},ex=class e extends Y{networkId;contractIdPreimage;static schema=G(`HashIdPreimageContractId`,{networkId:Bh.schema,contractIdPreimage:iy.schema});constructor(e){super(),this.networkId=e.networkId instanceof Bh?e.networkId:new Bh(e.networkId),this.contractIdPreimage=e.contractIdPreimage}toXdrObject(){return{networkId:this.networkId.toXdrObject(),contractIdPreimage:this.contractIdPreimage.toXdrObject()}}static fromXdrObject(t){return new e({networkId:Bh.fromXdrObject(t.networkId),contractIdPreimage:iy.fromXdrObject(t.contractIdPreimage)})}},tx=class e extends Y{networkId;nonce;signatureExpirationLedger;invocation;static schema=G(`HashIdPreimageSorobanAuthorization`,{networkId:Bh.schema,nonce:ff(),signatureExpirationLedger:Cf(),invocation:ky.schema});constructor(e){super(),this.networkId=e.networkId instanceof Bh?e.networkId:new Bh(e.networkId),this.nonce=e.nonce,this.signatureExpirationLedger=e.signatureExpirationLedger,this.invocation=e.invocation}toXdrObject(){return{networkId:this.networkId.toXdrObject(),nonce:this.nonce,signatureExpirationLedger:this.signatureExpirationLedger,invocation:this.invocation.toXdrObject()}}static fromXdrObject(t){return new e({networkId:Bh.fromXdrObject(t.networkId),nonce:t.nonce,signatureExpirationLedger:t.signatureExpirationLedger,invocation:ky.fromXdrObject(t.invocation)})}},nx=class e extends Y{networkId;nonce;signatureExpirationLedger;address;invocation;static schema=G(`HashIdPreimageSorobanAuthorizationWithAddress`,{networkId:Bh.schema,nonce:ff(),signatureExpirationLedger:Cf(),address:x_.schema,invocation:ky.schema});constructor(e){super(),this.networkId=e.networkId instanceof Bh?e.networkId:new Bh(e.networkId),this.nonce=e.nonce,this.signatureExpirationLedger=e.signatureExpirationLedger,this.address=e.address,this.invocation=e.invocation}toXdrObject(){return{networkId:this.networkId.toXdrObject(),nonce:this.nonce,signatureExpirationLedger:this.signatureExpirationLedger,address:this.address.toXdrObject(),invocation:this.invocation.toXdrObject()}}static fromXdrObject(t){return new e({networkId:Bh.fromXdrObject(t.networkId),nonce:t.nonce,signatureExpirationLedger:t.signatureExpirationLedger,address:x_.fromXdrObject(t.address),invocation:ky.fromXdrObject(t.invocation)})}},rx=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.HashIdPreimage(...) is not supported: XDR unions are built from per-variant factories. Call xdr.HashIdPreimage.envelopeTypeOpId(...) (or another arm factory) instead.`)}static schema=Of(`HashIdPreimage`,{switchOn:Vh.schema,cases:[q(`envelopeTypeOpId`,6,K(`operationId`,Qb.schema)),q(`envelopeTypePoolRevokeOpId`,7,K(`revokeId`,$b.schema)),q(`envelopeTypeContractId`,8,K(`contractId`,ex.schema)),q(`envelopeTypeSorobanAuthorization`,9,K(`sorobanAuthorization`,tx.schema)),q(`envelopeTypeSorobanAuthorizationWithAddress`,10,K(`sorobanAuthorizationWithAddress`,nx.schema))]});static envelopeTypeOpId(e){return new ix(e)}static envelopeTypePoolRevokeOpId(e){return new ax(e)}static envelopeTypeContractId(e){return new ox(e)}static envelopeTypeSorobanAuthorization(e){return new sx(e)}static envelopeTypeSorobanAuthorizationWithAddress(e){return new cx(e)}static fromXdrObject(e){switch(e.type){case 6:return new ix(Qb.fromXdrObject(e.operationId));case 7:return new ax($b.fromXdrObject(e.revokeId));case 8:return new ox(ex.fromXdrObject(e.contractId));case 9:return new sx(tx.fromXdrObject(e.sorobanAuthorization));case 10:return new cx(nx.fromXdrObject(e.sorobanAuthorizationWithAddress))}throw new W(`HashIdPreimage: unknown type ${e.type}`)}static is(t){return t instanceof e}},ix=class extends rx{type=`envelopeTypeOpId`;operationId;constructor(e){super(),this.operationId=e}get value(){return this.operationId}toXdrObject(){return{type:6,operationId:this.operationId.toXdrObject()}}},ax=class extends rx{type=`envelopeTypePoolRevokeOpId`;revokeId;constructor(e){super(),this.revokeId=e}get value(){return this.revokeId}toXdrObject(){return{type:7,revokeId:this.revokeId.toXdrObject()}}},ox=class extends rx{type=`envelopeTypeContractId`;contractId;constructor(e){super(),this.contractId=e}get value(){return this.contractId}toXdrObject(){return{type:8,contractId:this.contractId.toXdrObject()}}},sx=class extends rx{type=`envelopeTypeSorobanAuthorization`;sorobanAuthorization;constructor(e){super(),this.sorobanAuthorization=e}get value(){return this.sorobanAuthorization}toXdrObject(){return{type:9,sorobanAuthorization:this.sorobanAuthorization.toXdrObject()}}},cx=class extends rx{type=`envelopeTypeSorobanAuthorizationWithAddress`;sorobanAuthorizationWithAddress;constructor(e){super(),this.sorobanAuthorizationWithAddress=e}get value(){return this.sorobanAuthorizationWithAddress}toXdrObject(){return{type:10,sorobanAuthorizationWithAddress:this.sorobanAuthorizationWithAddress.toXdrObject()}}},lx=rx,ux=class e extends Y{constructor(){if(super(),new.target===e)throw TypeError(`new xdr.TransactionSignaturePayloadTaggedTransaction(...) is not supported: XDR unions are built from per-variant factories. Call xdr.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(...) (or another arm factory) instead.`)}static schema=Of(`TransactionSignaturePayloadTaggedTransaction`,{switchOn:Vh.schema,cases:[q(`envelopeTypeTx`,2,K(`tx`,Lb.schema)),q(`envelopeTypeTxFeeBump`,5,K(`feeBump`,Gb.schema))]});static envelopeTypeTx(e){return new dx(e)}static envelopeTypeTxFeeBump(e){return new fx(e)}static fromXdrObject(e){switch(e.type){case 2:return new dx(Lb.fromXdrObject(e.tx));case 5:return new fx(Gb.fromXdrObject(e.feeBump))}throw new W(`TransactionSignaturePayloadTaggedTransaction: unknown type ${e.type}`)}static is(t){return t instanceof e}},dx=class extends ux{type=`envelopeTypeTx`;tx;constructor(e){super(),this.tx=e}get value(){return this.tx}toXdrObject(){return{type:2,tx:this.tx.toXdrObject()}}},fx=class extends ux{type=`envelopeTypeTxFeeBump`;feeBump;constructor(e){super(),this.feeBump=e}get value(){return this.feeBump}toXdrObject(){return{type:5,feeBump:this.feeBump.toXdrObject()}}},px=ux,mx=class e extends Y{networkId;taggedTransaction;static schema=G(`TransactionSignaturePayload`,{networkId:Bh.schema,taggedTransaction:px.schema});constructor(e){super(),this.networkId=e.networkId instanceof Bh?e.networkId:new Bh(e.networkId),this.taggedTransaction=e.taggedTransaction}toXdrObject(){return{networkId:this.networkId.toXdrObject(),taggedTransaction:this.taggedTransaction.toXdrObject()}}static fromXdrObject(t){return new e({networkId:Bh.fromXdrObject(t.networkId),taggedTransaction:px.fromXdrObject(t.taggedTransaction)})}},hx=class e extends rh{static authorizedFlag=new e(`authorizedFlag`,1);static authorizedToMaintainLiabilitiesFlag=new e(`authorizedToMaintainLiabilitiesFlag`,2);static trustlineClawbackEnabledFlag=new e(`trustlineClawbackEnabledFlag`,4);static schema=cf(`TrustLineFlags`,{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4});static fromValue(t){return ah(`TrustLineFlags`,e.schema,e,t)}static fromName(t){return oh(`TrustLineFlags`,e,t)}static fromXdrObject(t){return e.fromValue(t)}};function gx(e,t){return e.type===t}var _x=yx(!0,64),vx=yx(!1,64);bx(!0,32),bx(!1,32);function yx(e,t){let[n,r]=Hf(e,t),i=e?`Int${t}`:`Uint${t}`;function a(n){let r;if(Array.isArray(n)&&n.length===2){let t=BigInt.asUintN(32,BigInt(n[0])),i=BigInt(n[1])<<32n|t;r=e?BigInt.asIntN(64,i):BigInt.asUintN(64,i)}else r=typeof n==`bigint`?n:BigInt(n);return Uf(r,e,t,i),r}return a.fromXdr=(n,r=`raw`)=>{let a=$m(n,r);if(a.length!==8)throw new W(`${i}.fromXdr: expected exactly 8 bytes, got ${a.length}`);let o=0n;for(let e of a)o=(o<<8n)+BigInt(e);return e?BigInt.asIntN(t,o):BigInt.asUintN(t,o)},a.fromString=n=>{let r=BigInt(n);return Uf(r,e,t,i),r},a.MAX_VALUE=r,a.MIN_VALUE=n,Object.defineProperty(a,"name",{value:i}),new Proxy(a,{construct(e,t){throw a(t[0]),TypeError(`new xdr.${i}(...) is not supported: XDR ${i.toLowerCase()} values are native bigints. Call xdr.${i}(value) (no \`new\`) or pass a bigint literal instead.`)}})}function bx(e,t){let n=e?2**(t-1)-1:2**t-1,r=e?-2147483648:0,i=e?`Int${t}`:`Uint${t}`;function a(n){let r=typeof n==`number`?n:Number(n);return qf(r,e,t,i),r}return a.fromXdr=(t,n=`raw`)=>{let r=$m(t,n);if(r.length!==4)throw new W(`${i}.fromXdr: expected exactly 4 bytes, got ${r.length}`);let a=r[0]<<24|r[1]<<16|r[2]<<8|r[3];return e?a:a>>>0},a.fromString=n=>{let r=Number(n);return qf(r,e,t,i),r},a.MAX_VALUE=n,a.MIN_VALUE=r,Object.defineProperty(a,"name",{value:i}),new Proxy(a,{construct(e,t){throw a(t[0]),TypeError(`new xdr.${i}(...) is not supported: XDR ${i.toLowerCase()} values are native numbers. Call xdr.${i}(value) (no \`new\`) or pass a number literal instead.`)}})}var xx=BigInt(2**32-1),Sx=BigInt(32);function Cx(e,t=!1){return t?{h:Number(e&xx),l:Number(e>>Sx&xx)}:{h:Number(e>>Sx&xx)|0,l:Number(e&xx)|0}}function wx(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Cx(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var Tx=e=>e/2**32|0,Ex=e=>e>>>0;function Dx(e,t,n,r){let i=Tx(n),a=Ex(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}var Ox=(e,t,n)=>e>>>n,kx=(e,t,n)=>e<<32-n|t>>>n,Ax=(e,t,n)=>e>>>n|t<<32-n,jx=(e,t,n)=>e<<32-n|t>>>n,Mx=(e,t,n)=>e<<64-n|t>>>n-32,Nx=(e,t,n)=>e>>>n-32|t<<64-n;function Px(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Fx=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Ix=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Lx=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Rx=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,zx=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Bx=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function Vx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}var Hx=e=>e?`"${e}" `:``;function Ux(e,t=``){if(typeof e!=`number`)throw TypeError(Hx(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(Hx(t)+`expected integer >= 0, got `+e);return e}function Wx(e,t,n=``){if(Vx(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Ux(t,`length`);let r=Vx(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=Hx(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}var Gx=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},Kx=(e,t)=>{Gx(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function qx(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function Jx(e,t){Wx(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function Yx(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Xx(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Zx(e,t){return e<<32-t|e>>>t}function Qx(e,t,n=`opts`){return Kx(e,`defaults`),t!==void 0&&Kx(t,n),Object.assign(Object.create(null),e,t)}function $x(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=Qx({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}var eS=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function tS(e,t,n){return e&t^~e&n}function nS(e,t,n){return e&t^e&n^t&n}var rS=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Xx(this.buffer)}update(e){qx(this),Wx(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=Xx(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0}else n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){qx(this),Jx(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),Dx(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:Xx(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}},iS=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),aS=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),oS=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]),sS=new Uint32Array(64),cS=class extends rS{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)sS[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=sS[e-15],n=sS[e-2],r=Zx(t,7)^Zx(t,18)^t>>>3,i=Zx(n,17)^Zx(n,19)^n>>>10;sS[e]=i+sS[e-7]+r+sS[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Zx(o,6)^Zx(o,11)^Zx(o,25),u=l+t+tS(o,s,c)+oS[e]+sS[e]|0,d=(Zx(n,2)^Zx(n,13)^Zx(n,22))+nS(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Yx(sS)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Yx(this.buffer)}},lS=class extends cS{constructor(){super(32,iS)}},uS=wx(`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`.split(`.`).map(e=>BigInt(e))),dS=uS[0],fS=uS[1],pS=new Uint32Array(80),mS=new Uint32Array(80),hS=class extends rS{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,t){super(128,e,16,!1),this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)pS[n]=e.getUint32(t),mS[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=pS[e-15]|0,n=mS[e-15]|0,r=Ax(t,n,1)^Ax(t,n,8)^Ox(t,n,7),i=jx(t,n,1)^jx(t,n,8)^kx(t,n,7),a=pS[e-2]|0,o=mS[e-2]|0,s=Ax(a,o,19)^Mx(a,o,61)^Ox(a,o,6),c=Lx(i,jx(a,o,19)^Nx(a,o,61)^kx(a,o,6),mS[e-7],mS[e-16]),l=Rx(c,r,s,pS[e-7],pS[e-16]);pS[e]=l|0,mS[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Ax(u,d,14)^Ax(u,d,18)^Mx(u,d,41),v=jx(u,d,14)^jx(u,d,18)^Nx(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=zx(_,v,b,fS[e],mS[e]),S=Bx(x,g,t,y,dS[e],pS[e]),C=x|0,w=Ax(n,r,28)^Mx(n,r,34)^Mx(n,r,39),T=jx(n,r,28)^Nx(n,r,34)^Nx(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Px(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=Fx(C,T,D);n=Ix(O,S,w,E),r=O|0}({h:n,l:r}=Px(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Px(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Px(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Px(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Px(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Px(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Px(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Px(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){Yx(pS,mS)}destroy(){this.destroyed=!0,Yx(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},gS=class extends hS{constructor(){super(64,aS)}},_S=$x(()=>new lS,eS(1)),vS=$x(()=>new gS,eS(3)),yS=Object.freeze,bS=57896044618658097711785492504343953926634992332820282019728792003956564819949n,xS=7237005577332262213973186563042994240857116359379907606001950938285454250989n,SS=37095705934669439343138083508754565189542113879843219016388785533085940283555n,CS=15112221349535400772501151409588531511454012693041857206046113283949847762202n,wS=46316835694926478169428394003475163141307993866256225615783033603165251855960n,TS=bS-1n,ES=yS({p:bS,n:xS,h:8n,a:TS,d:SS,Gx:CS,Gy:wS}),DS=32,OS=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&e.BYTES_PER_ELEMENT===1,kS=(e,t,n=``)=>{if(OS(e)&&(t===void 0||e.length===t))return e;let r=OS(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=(n?`"${n}" `:``)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)},AS=(e,t=``,n)=>Uint8Array.from(kS(e,n,t)),jS=(e,t)=>e.toString(16).padStart(t,`0`),MS=e=>{let t=``;for(let n of kS(e))t+=jS(n,2);return t},NS=e=>{let t=`hex invalid`;if(typeof e!=`string`)throw TypeError(t);if(e.length%2||!/^[\da-f]*$/i.test(e))throw RangeError(t);let n=new Uint8Array(e.length/2);for(let t=0,r=0;t<n.length;t++,r+=2){let i=e.charCodeAt(r),a=e.charCodeAt(r+1);n[t]=((i&15)+(i>>6)*9)*16+(a&15)+(a>>6)*9}return n},PS=(...e)=>{let t=0;for(let n of e)t+=kS(n).length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n},FS=(e=DS)=>{let t=globalThis?.crypto;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined, consider polyfill`);return t.getRandomValues(new Uint8Array(e))},IS=(e,t,n,r=`bad number: out of range`)=>{if(typeof e!=`bigint`)throw TypeError(r);if(t<=e&&e<n)return e;throw RangeError(r)},LS=(e,t=bS)=>(e%=t)>=0n?e:t+e,RS=(1n<<255n)-1n,X=e=>{if(e<0n)throw RangeError(`negative coordinate`);let t=(e>>255n)*19n+(e&RS);return t=(t>>255n)*19n+(t&RS),t%bS},zS=e=>LS(e,xS),BS=(e,t)=>{if(e===0n)throw Error(`invert: expected non-zero number`);if(t<=1n)throw Error(`invert: expected modulus > 1, got `+t);let n=LS(e,t),r=t,i=0n,a=1n;for(;n!==0n;){let e=r/n,t=r-n*e,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==1n)throw Error(`invert: does not exist`);return LS(i,t)},VS=e=>{let t=fC[e];if(typeof t!=`function`)throw Error(`hashes.`+e+` not set`);return t},HS=(e,...t)=>kS(VS(e)(PS(...t)),64,`digest`),US=async(e,...t)=>kS(await VS(e)(PS(...t)),64,`digest`),WS=e=>{if(e instanceof KS)return e;throw TypeError(`Point expected`)},GS=2n**256n,KS=class e{static BASE;static ZERO;X;Y;Z;T;constructor(e,t,n,r){let i=GS;this.X=IS(e,0n,i),this.Y=IS(t,0n,i),this.Z=IS(n,1n,i),this.T=IS(r,0n,i),yS(this)}static CURVE(){return ES}static fromAffine(t){return new e(t.x,t.y,1n,X(t.x*t.y))}static fromBytes(t,n=!1){let r=AS(t,`point`,DS),i=r[31];r[31]=i&-129;let a=XS(r);n||IS(a,0n,bS);let o=X(a*a),{isValid:s,value:c}=eC(LS(o-1n),X(SS*o+1n));if(!s)throw Error(`bad point: y not sqrt`);let l=!!(i&128);if(!n&&c===0n&&l)throw Error(`bad point: x==0, isLastByteOdd`);return l!==!!(c&1n)&&(c=LS(-c)),new e(c,a,1n,X(c*a))}static fromHex(t,n){return e.fromBytes(NS(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=TS,t=SS,n=this;if(n.is0())throw Error(`bad point: ZERO`);let{X:r,Y:i,Z:a,T:o}=n,s=X(r*r),c=X(i*i),l=X(a*a),u=X(l*l);if(X(l*(X(s*e)+c))!==LS(u+X(t*X(s*c))))throw Error(`bad point: equation left != right (1)`);if(X(r*i)!==X(a*o))throw Error(`bad point: equation left != right (2)`);return this}equals(e){let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=WS(e);return X(t*o)===X(i*r)&&X(n*o)===X(a*r)}is0(){return this.equals(JS)}negate(){return new e(LS(-this.X),this.Y,this.Z,LS(-this.T))}double(){let{X:t,Y:n,Z:r}=this,i=TS,a=X(t*t),o=X(n*n),s=X(2n*r*r),c=X(i*a),l=LS(t+n),u=LS(X(l*l)-a-o),d=LS(c+o),f=LS(d-s),p=LS(c-o),m=X(u*f),h=X(d*p),g=X(u*p),_=X(f*d);return new e(m,h,_,g)}add(t){let{X:n,Y:r,Z:i,T:a}=this,{X:o,Y:s,Z:c,T:l}=WS(t),u=TS,d=SS,f=X(n*o),p=X(r*s),m=X(X(a*d)*l),h=X(i*c),g=LS(X(LS(n+r)*LS(o+s))-f-p),_=LS(h-m),v=LS(h+m),y=LS(p-X(u*f)),b=X(g*_),x=X(v*y),S=X(g*y),C=X(_*v);return new e(b,x,C,S)}subtract(e){return this.add(WS(e).negate())}multiply(e,t=!0){if(!t&&e===0n||(IS(e,1n,xS),!t&&this.is0()))return JS;if(e===1n)return this;if(this.equals(qS))return _C(e).p;let n=JS,r=qS,i=this;for(let a=0;t?a<256:e>0n;a++)e&1n?n=n.add(i):t&&(r=r.add(i)),i=i.double(),e>>=1n;return n}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:t,Z:n}=this;if(this.equals(JS))return{x:0n,y:1n};let r=BS(n,bS);if(X(n*r)!==1n)throw Error(`invalid inverse`);return{x:X(e*r),y:X(t*r)}}toBytes(){let{x:e,y:t}=this.toAffine(),n=YS(t);return n[31]|=e&1n?128:0,n}toHex(){return MS(this.toBytes())}clearCofactor(){return this.multiply(8n,!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return this.multiply(xS/2n,!1).double().add(this).is0()}},qS=new KS(CS,wS,1n,LS(CS*wS)),JS=new KS(0n,1n,1n,0n);KS.BASE=qS,KS.ZERO=JS;var YS=e=>NS(jS(IS(e,0n,GS),64)).reverse(),XS=e=>BigInt(`0x`+MS(Uint8Array.from(kS(e)).reverse())),ZS=(e,t)=>{let n=e;for(;t-->0;)n=X(n*n);return n},QS=e=>{let t=X(X(e*e)*e),n=X(ZS(X(ZS(t,2)*t),1)*e),r=X(ZS(n,5)*n),i=X(ZS(r,10)*r),a=X(ZS(i,20)*i),o=X(ZS(a,40)*a);return X(ZS(X(ZS(X(ZS(X(ZS(o,80)*o),80)*o),10)*r),2)*e)},$S=19681161376707505956807079304988542015446066515923890162744021073123829784752n,eC=(e,t)=>{let n=X(t*X(t*t)),r=X(e*X(n*QS(X(e*X(X(n*n)*t))))),i=X(t*X(r*r)),a=r,o=X(r*$S),s=i===e,c=i===LS(-e),l=i===LS(-e*$S);return s&&(r=a),(c||l)&&(r=o),(LS(r)&1n)==1n&&(r=LS(-r)),{isValid:s||c,value:r}},tC=e=>zS(XS(e)),nC=e=>{let t=AS(e),n=t.slice(0,32);n[0]&=248,n[31]&=127,n[31]|=64;let r=t.slice(32),i=tC(n),a=qS.multiply(i);return{head:n,prefix:r,scalar:i,point:a,pointBytes:a.toBytes()}},rC=e=>US(`sha512Async`,kS(e,DS,`secretKey`)).then(nC),iC=e=>nC(HS(`sha512`,kS(e,DS,`secretKey`))),aC=e=>iC(e).pointBytes,oC=e=>e[1](HS(`sha512`,e[0])),sC=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,a=tC(t),o=qS.multiply(a).toBytes();return[PS(o,r,n),e=>{let t=zS(a+tC(e)*i);return kS(PS(o,YS(t)),64)}]},cC=(e,t)=>{let n=AS(e,`message`),r=iC(t);return oC(sC(r,HS(`sha512`,r.prefix,n),n))},lC=e=>{if(typeof e!=`object`||!e)throw TypeError(`expected valid options object`);return e.zip215??!0},uC=(e,t,n,r)=>{e=kS(e,64,`signature`),t=kS(t,void 0,`message`),n=kS(n,DS,`publicKey`);let i=lC(r),a=e.subarray(0,DS),o=XS(e.subarray(DS,64)),s,c,l,u=Uint8Array.of(),d=!1;try{s=KS.fromBytes(n,i),c=KS.fromBytes(a,i),l=qS.multiply(o,!1),u=PS(a,n,t),d=!0}catch{}return[u,e=>{if(!d||!i&&s.isSmallOrder())return!1;let t=tC(e);return c.add(s.multiply(t,!1)).subtract(l).clearCofactor().is0()}]},dC=(e,t,n,r={})=>oC(uC(e,t,n,r)),fC={sha512Async:async e=>{let t=globalThis?.crypto?.subtle;if(!t)throw Error(`crypto.subtle must be defined, consider polyfill`);return new Uint8Array(await t.digest(`SHA-512`,PS(e)))},sha512:void 0},pC=yS({getExtendedPublicKeyAsync:rC,getExtendedPublicKey:iC,randomSecretKey:e=>kS(e===void 0?FS():e,DS,`seed`)}),mC=()=>{let e=[],t=qS,n;for(let r=0;r<33;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e},hC=void 0,gC=(e,t)=>{let n=t.negate();return e?n:t},_C=e=>{let t=hC||=mC(),n=JS,r=qS;for(let i=0;i<33;i++){let a=Number(e&255n);e>>=8n,a>128&&(a-=256,e+=1n);let o=i*128,s=o+Math.abs(a)-1,c=i%2!=0,l=a<0;a===0?r=r.add(gC(c,t[o])):n=n.add(gC(l,t[s]))}if(e!==0n)throw Error(`invalid wnaf`);return{p:n,f:r}};fC.sha512=vS;function vC(e){return aC(e)}function yC(e,t){return cC(e,t)}function bC(e,t,n){return dC(t,e,n,{zip215:!1})}function xC(e){return _S(typeof e==`string`?gp(e):e)}var SC=BigInt(`18446744073709551615`);function CC(e){return wC(e).toString()}function wC(e){if(typeof e!=`string`)throw Error(`id should be a string representing a number (uint64)`);if(e.length>22)throw Error(`id must have at most 22 digits`);if(!/^\d+$/.test(e))throw Error(`id is not a valid uint64 string: ${e}`);let t=BigInt(e);if(t>SC)throw Error(`id value out of range for uint64 [0, ${SC}]: ${e}`);return t}function TC(e){return J.isValidMed25519PublicKey(e)?OC(e):ng.keyTypeEd25519(J.decodeEd25519PublicKey(e))}function EC(e){return e.type===`keyTypeMuxedEd25519`?kC(e):J.encodeEd25519PublicKey(e.value.toBytes())}function DC(e){if(J.isValidEd25519PublicKey(e)||J.isValidContract(e))return e;if(J.isValidMuxedContract(e))return J.encodeContract(J.decodeMuxedContract(e).subarray(0,32));if(!J.isValidMed25519PublicKey(e))throw TypeError(`expected an account or contract address (G..., M..., C... or W...), got ${e}`);let t=TC(e);if(t.type!==`keyTypeMuxedEd25519`)throw TypeError(`expected muxed account (M...), got ${e}`);return J.encodeEd25519PublicKey(t.value.ed25519.toBytes())}function OC(e){let t=J.decodeMed25519PublicKey(e);return ng.keyTypeMuxedEd25519(new Qh({id:vx.fromXdr(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}function kC(e){if(e.type===`keyTypeEd25519`)return EC(e);let t=e.value;return J.encodeMed25519PublicKey(lp([t.ed25519.toBytes(),Qh.schema.encode(t.toXdrObject()).subarray(0,8)]))}fC.sha512=vS;var AC=gp(`Stellar Signed Message:
4
+ `);function jC(e){return e instanceof zh?!0:typeof e!=`object`||!e||e.constructor?.schema?.name!==zh.schema.name?!1:typeof e.toBytes==`function`}function MC(e){return typeof e==`string`?gp(e):Uint8Array.from(e)}var NC=class{type;_publicKey;_secretSeed;_secretKey;constructor(e){if(e.type!==`ed25519`)throw Error(`Invalid keys type`);if(this.type=e.type,`secretKey`in e){let t=MC(e.secretKey);if(t.length!==32)throw Error(`secretKey length is invalid`);if(this._secretSeed=t,this._publicKey=vC(t),this._secretKey=t,e.publicKey&&!up(this._publicKey,MC(e.publicKey)))throw Error(`secretKey does not match publicKey`)}else if(`publicKey`in e){if(this._publicKey=MC(e.publicKey),this._publicKey.length!==32)throw Error(`publicKey length is invalid`)}else throw Error(`At least one of publicKey or secretKey must be provided`)}static fromSecret(e){let t=J.decodeEd25519SecretSeed(e);return this.fromRawEd25519Seed(t)}static fromRawEd25519Seed(e){return new this({type:`ed25519`,secretKey:e})}static master(e){if(!e)throw Error("No network selected. Please pass a network argument, e.g. `Keypair.master(Networks.PUBLIC)`.");return this.fromRawEd25519Seed(xC(e))}static fromPublicKey(e){let t=J.decodeEd25519PublicKey(e);if(t.length!==32)throw Error(`Invalid Stellar public key`);return new this({type:`ed25519`,publicKey:t})}static random(){let e=pC.randomSecretKey();return this.fromRawEd25519Seed(e)}xdrAccountId(){return dh.publicKeyTypeEd25519(this._publicKey)}xdrPublicKey(){return dh.publicKeyTypeEd25519(this._publicKey)}xdrMuxedAccount(e){if(e!==void 0){if(typeof e!=`string`)throw TypeError(`expected string for ID, got ${typeof e}`);return ng.keyTypeMuxedEd25519(new Qh({id:vx.fromString(CC(e)),ed25519:this._publicKey}))}return ng.keyTypeEd25519(this._publicKey)}rawPublicKey(){return this._publicKey}signatureHint(){let e=this.xdrAccountId().toXdr();return e.slice(e.length-4)}publicKey(){return J.encodeEd25519PublicKey(this._publicKey)}secret(){if(!this._secretSeed)throw Error(`no secret key available`);if(this.type===`ed25519`)return J.encodeEd25519SecretSeed(this._secretSeed);throw Error(`Invalid Keypair type`)}rawSecretKey(){if(!this._secretSeed)throw Error(`no secret seed available`);return this._secretSeed}canSign(){return!!this._secretKey}sign(e){if(!this._secretKey)throw Error(`cannot sign: no secret key available`);return yC(e,this._secretKey)}verify(e,t){if(!ip(e))throw TypeError(`expected Uint8Array for data, got ${typeof e}`);let n=jC(t)?t.toBytes():t;if(!ip(n))throw TypeError(`expected Uint8Array or xdr.Signature for signature, got ${typeof t}`);try{return bC(e,n,this._publicKey)}catch{return!1}}signMessage(e){return this.sign(this._hashMessage(e))}verifyMessage(e,t){return this.verify(this._hashMessage(e),t)}_hashMessage(e){if(typeof e!=`string`&&!ip(e))throw TypeError(`expected string or Uint8Array for message, got ${typeof e}`);return xC(lp([AC,typeof e==`string`?gp(e):e]))}signDecorated(e){let t=this.sign(e);return new hb({hint:this.signatureHint(),signature:t})}signPayloadDecorated(e){let t=this.sign(e),n=this.signatureHint(),r=new Uint8Array(4);r.set(e.slice(-4),0);for(let e=0;e<r.length;e++)r[e]=r[e]^n[e];return new hb({hint:r,signature:t})}},PC=GC(),FC=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,IC=Math.ceil,LC=Math.floor,RC=`[BigNumber Error] `,zC=0x5af3107a4000,BC=14,VC=9007199254740991,HC=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],UC=1e7,WC=1e9;function GC(e){var t,n,r=/^(-?)0([xbo])(?=[^.])/i,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?!-)|^\s+|\s+$/g,o=b.prototype={constructor:b,toString:null,valueOf:null},s=new b(1),c=20,l=4,u=-7,d=21,f=-1e7,p=1e7,m=!1,h=!0,g=1,_=0,v={prefix:``,negativeSign:`-`,positiveSign:``,groupSeparator:`,`,groupSize:3,secondaryGroupSize:0,decimalSeparator:`.`,fractionGroupSeparator:``,fractionGroupSize:0,suffix:``},y=`0123456789abcdefghijklmnopqrstuvwxyz`;function b(e,t){var n,o,s,c,l=this;if(!(l instanceof b))return new b(e,t);if(c=typeof e,t==null){if(w(e)){l.s=e.s,!e.c||e.e>p?l.c=l.e=null:e.e<f?l.c=[l.e=0]:(l.e=e.e,l.c=e.c.slice());return}if(c==`number`){if(e*0!=0){l.s=isNaN(e)?null:e<0?-1:1,l.c=l.e=null;return}if(l.s=1/e<0?(e=-e,-1):1,e===~~e){for(n=0,o=e;o>=10;o/=10,n++);n>p?l.c=l.e=null:(l.e=n,l.c=[e]);return}return x(l,String(e))}if(c==`bigint`)return l.s=e<0?(e=-e,-1):1,x(l,String(e));if(c==`string`)s=e;else{if(h)throw Error(RC+`BigNumber, string, number, or BigInt expected: `+e);s=String(e)}if(FC.test(s))return l.s=s.charCodeAt(0)==45?(s=s.slice(1),-1):1,x(l,s);if(s=s.replace(a,``),i.test(s)){l.s=isNaN(s)?null:s<0?-1:1,l.c=l.e=null;return}if(s=s.replace(r,function(e,n,r){return t=(r=r.toLowerCase())==`x`?16:r==`b`?2:8,n}),t)return S(l,s,t,e);if(s=s.replace(/(\d)_(?=\d)/g,`$1`),FC.test(s))return l.s=s.charCodeAt(0)==45?(s=s.slice(1),-1):1,x(l,s);if(h)throw Error(RC+`Not a number: `+e);l.s=l.c=l.e=null}else{if(c!=`string`){if(h)throw Error(RC+`String expected: `+e);e=String(e)}YC(t,2,y.length,`Base`),S(l,e.replace(a,``),t,e)}}b.clone=GC,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(e){var t,n;if(e!=null){if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(c=YC(e[t],0,WC,t)),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(l=YC(e[t],0,8,t)),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],XC(n)?(YC(n[0],-WC,0,t),YC(n[1],0,WC,t),u=n[0],d=n[1]):u=-(d=YC(n,-WC,WC,t)<0?-n:n)),e.hasOwnProperty(t=`RANGE`)){if(n=e[t],n)XC(n)?(YC(n[0],-WC,-1,t),YC(n[1],1,WC,t),f=n[0],p=n[1]):f=-(p=YC(n,-WC,WC,t)<0?-n:n);else throw Error(RC+t+` cannot be zero: `+n)}if(e.hasOwnProperty(t=`CRYPTO`)){if(n=e[t],n===!!n){if(n){if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=n;else throw m=!n,Error(RC+`crypto unavailable`)}else m=n}else throw Error(RC+t+` not true or false: `+n)}if(e.hasOwnProperty(t=`STRICT`)){if(n=e[t],n===!!n)h=n;else throw Error(RC+t+` not true or false: `+n)}if(e.hasOwnProperty(t=`MODULO_MODE`)&&(g=YC(e[t],0,9,t)),e.hasOwnProperty(t=`POW_PRECISION`)&&(_=YC(e[t],0,WC,t)),e.hasOwnProperty(t=`FORMAT`)){if(n=e[t],typeof n==`object`)for(t in n)n.hasOwnProperty(t)&&v.hasOwnProperty(t)&&(v[t]=n[t]);else throw Error(RC+t+` not an object: `+n)}if(e.hasOwnProperty(t=`ALPHABET`)){if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))y=n;else throw Error(RC+t+` invalid: `+n)}}else throw Error(RC+`Object expected: `+e)}return{DECIMAL_PLACES:c,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,d],RANGE:[f,p],CRYPTO:m,STRICT:h,MODULO_MODE:g,POW_PRECISION:_,FORMAT:v,ALPHABET:y}},b.fromFormat=function(e,t){if(typeof e!=`string`)throw Error(RC+`Not a string: `+e);if(t==null)t=v;else if(typeof t!=`object`)throw Error(RC+`Argument not an object: `+t);else t=D(t);var n,r,i,a,o=t.negativeSign||`-`,s=t.positiveSign||``,c=t.prefix||``,l=t.suffix||``,u=t.groupSeparator||``,d=t.decimalSeparator||`.`,f=t.fractionGroupSeparator||``;if(c&&e.indexOf(c)===0&&(e=e.slice(c.length)),l&&e.lastIndexOf(l)===e.length-l.length&&(e=e.slice(0,-l.length)),o&&e.indexOf(o)===0?(e=e.slice(o.length),r=!0):s&&e.indexOf(s)===0&&(e=e.slice(s.length)),n=e.indexOf(d),n<0){if(u)for(;e.indexOf(u)>-1;)e=e.replace(u,``)}else{if(i=e.slice(0,n),a=e.slice(n+d.length),u)for(;i.indexOf(u)>-1;)i=i.replace(u,``);if(f)for(;a.indexOf(f)>-1;)a=a.replace(f,``);e=i+`.`+a}return new b(r?`-`+e:e)},b.isBigNumber=function(e){if(!w(e))return!1;var t,n,r=e.c,i=e.e,a=e.s;if(!XC(r))return r===null&&i===null&&(a===null||a===1||a===-1);if(a!==1&&a!==-1||i<-WC||i>WC||i!==LC(i))return!1;if(r[0]===0)return i===0&&r.length===1;if(t=(i+1)%BC,t<1&&(t+=BC),String(r[0]).length!==t)return!1;for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=zC||n!==LC(n))return!1;return n!==0},b.maximum=b.max=function(){return T(arguments,-1)},b.minimum=b.min=function(){return T(arguments,1)},b.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return LC(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,i,a,o,l=0,u=[],d=new b(s);if(e=e==null?c:YC(e,0,WC),a=IC(e/BC),m){if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)o=n[l]*131072+(n[l+1]>>>11),o>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[l]=r[0],n[l+1]=r[1]):(u.push(o%0x5af3107a4000),l+=2);l=a/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(a*=7);l<a;)o=(n[l]&31)*281474976710656+n[l+1]*1099511627776+n[l+2]*4294967296+n[l+3]*16777216+(n[l+4]<<16)+(n[l+5]<<8)+n[l+6],o>=9e15?crypto.randomBytes(7).copy(n,l):(u.push(o%0x5af3107a4000),l+=7);l=a/7}else throw m=!1,Error(RC+`crypto unavailable`)}if(!m)for(;l<a;)o=t(),o<9e15&&(u[l++]=o%0x5af3107a4000);for(a=u[--l],e%=BC,a&&e&&(o=HC[BC-e],u[l]=LC(a/o)*o);u[l]===0;u.pop(),l--);if(l<0)u=[i=0];else{for(i=-1;u[0]===0;u.splice(0,1),i-=BC);for(l=1,o=u[0];o>=10;o/=10,l++);l<BC&&(i-=BC-l)}return d.e=i,d.c=u,d}})(),b.sum=function(){for(var e=0,t=new b(0);e<arguments.length;)t=t.plus(arguments[e++]);return t};function x(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(--i)===48;);if(t=t.slice(r,++i)){if(i-=r,n=n-r-1,n>p)e.c=e.e=null;else if(n<f)e.c=[e.e=0];else{if(e.e=n,e.c=[],r=(n+1)%BC,n<0&&(r+=BC),r<i){for(r&&e.c.push(+t.slice(0,r)),i-=BC;r<i;)e.c.push(+t.slice(r,r+=BC));r=BC-(t=t.slice(r)).length}else r-=i;for(;r--;t+=`0`);e.c.push(+t)}}else e.c=[e.e=0]}function S(e,t,r,i){var a,o,s=y.slice(0,r),c=0,l=``,u=!1,d=!1,f=!1;for(e.s=t.charCodeAt(0)===45?(t=t.slice(1),-1):1,o=t.length;c<o;c++)if(a=t.charAt(c),s.indexOf(a)>=0)l+=a,d=!0;else{if(a==`_`){if(d&&c+1<o){d=!1;continue}}else if(a==`.`){if(c==0||!u&&d){if(c+1==o)break;c==0&&(l=`0`),l+=a,u=!0,d=!1;continue}}else if(!f&&(t==t.toUpperCase()&&s==s.toLowerCase()&&(t=t.toLowerCase())||t==t.toLowerCase()&&s==s.toUpperCase()&&(t=t.toUpperCase()))){c=-1,l=``,f=!0,u=d=!1;continue}if(h)throw Error(RC+`Not a base `+r+` number: `+i);e.s=e.c=e.e=null;return}x(e,n(l,r,10,e.s))}n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var u,d,f,p,m,h,g,v,x=r.indexOf(`.`),S=c,C=l;for(x>=0&&(p=_,_=0,r=r.replace(`.`,``),v=new b(i),h=v.pow(r.length-x),_=p,v.c=n($C(qC(h.c),h.e,`0`),10,a,e),v.e=v.c.length),g=n(r,i,a,s?(u=y,e):(u=e,y)),f=p=g.length;g[--p]==0;g.pop());if(!g[0])return u.charAt(0);if(x<0?--f:(h.c=g,h.e=f,h.s=o,h=t(h,v,S,C,a),g=h.c,m=h.r,f=h.e),d=f+S+1,x=g[d],p=a/2,m=m||d<0||g[d+1]!=null,m=C<4?(x!=null||m)&&(C==0||C==(h.s<0?3:2)):x>p||x==p&&(C==4||m||C==6&&g[d-1]&1||C==(h.s<0?8:7)),d<1||!g[0])r=m?$C(u.charAt(1),-S,u.charAt(0)):u.charAt(0);else{if(d<g.length&&(g.length=d),m)for(--a;++g[--d]>a;)g[d]=0,d||(++f,g=[1].concat(g));for(p=g.length;!g[--p];);for(x=0,r=``;x<=p;r+=u.charAt(g[x++]));r=$C(r,f,u.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%UC,u=t/UC|0;for(e=e.slice();c--;)a=e[c]%UC,o=e[c]/UC|0,r=u*a+o*l,i=l*a+r%UC*UC+s,s=(i/n|0)+(r/UC|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,g,_,v,y,x,S,C,w,T,E=r.s==i.s?1:-1,D=r.c,k=i.c;if(!D||!D[0]||!k||!k[0])return new b(!r.s||!i.s||(D?k&&D[0]==k[0]:!k)?NaN:D&&D[0]==0||!k?E*0:E/0);for(h=new b(E),g=h.c=[],l=r.e-i.e,E=a+l+1,s||(s=zC,l=KC(r.e/BC)-KC(i.e/BC),E=E/BC|0),u=0;k[u]==(D[u]||0);u++);if(k[u]>(D[u]||0)&&l--,E<0)g.push(1),d=!0;else{for(S=D.length,w=k.length,u=0,E+=2,f=LC(s/(k[0]+1)),f>1&&(k=e(k,f,s),D=e(D,f,s),w=k.length,S=D.length),x=w,_=D.slice(0,w),v=_.length;v<w;_[v++]=0);T=k.slice(),T=[0].concat(T),C=k[0],k[1]>=s/2&&C++;do{if(f=0,c=t(k,_,w,v),c<0){if(y=_[0],w!=v&&(y=y*s+(_[1]||0)),f=LC(y/C),f>1)for(f>=s&&(f=s-1),p=e(k,f,s),m=p.length,v=_.length;t(p,_,m,v)==1;)f--,n(p,w<m?T:k,m,s),m=p.length,c=1;else f==0&&(c=f=1),p=k.slice(),m=p.length;if(m<v&&(p=[0].concat(p)),n(_,p,v,s),v=_.length,c==-1)for(;t(k,_,w,v)<1;)f++,n(_,w<v?T:k,v,s),v=_.length}else c===0&&(f++,_=[0]);g[u++]=f,_[0]?_[v++]=D[x]||0:(_=[D[x]],v=1)}while((x++<S||_[0]!=null)&&E--);d=_[0]!=null,g[0]||g.splice(0,1)}if(s==zC){for(u=1,E=g[0];E>=10;E/=10,u++);O(h,a+(h.e=u+l*BC-1)+1,o,d)}else h.e=l,h.r=+d;return h}})();function C(e,t,n,r){var i,a,o,s,c;if(n=n==null?l:YC(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=qC(e.c),c=r==1||r==2&&(o<=u||o>=d)?QC(c,o):$C(c,o,`0`);else if(e=O(new b(e),t,n),a=e.e,c=qC(e.c),s=c.length,r==1||r==2&&(t<=a||a<=u)){for(;s<t;c+=`0`,s++);c=QC(c,a)}else if(t-=o+(r===2&&a>o),c=$C(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function w(e){return e instanceof b||!!e&&e._isBigNumber===!0}function T(e,t){for(var n,r,i=1,a=new b(e[0]);i<e.length;i++)r=new b(e[i]),(!r.s||(n=JC(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function E(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*BC-1)>p?e.c=e.e=null:n<f?e.c=[e.e=0]:(e.e=n,e.c=t),e}function D(e){var t,n={};for(t in v)v.hasOwnProperty(t)&&(n[t]=e.hasOwnProperty(t)?e[t]:v[t]);return n}function O(e,t,n,r){var i,a,o,s,c,l,u,d=e.c,m=HC;if(d){out:{for(i=1,s=d[0];s>=10;s/=10,i++);if(a=t-i,a<0)a+=BC,o=t,c=d[l=0],u=LC(c/m[i-o-1]%10);else if(l=IC((a+1)/BC),l>=d.length){if(r){for(;d.length<=l;d.push(0));c=u=0,i=1,a%=BC,o=a-BC+1}else break out}else{for(c=s=d[l],i=1;s>=10;s/=10,i++);a%=BC,o=a-BC+i,u=o<0?0:LC(c/m[i-o-1]%10)}if(r=r||t<0||d[l+1]!=null||(o<0?c:c%m[i-o-1]),r=n<4?(u||r)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||r||n==6&&(a>0?o>0?c/m[i-o]:0:d[l-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=m[(BC-t%BC)%BC],e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=l,s=1,l--):(d.length=l+1,s=m[BC-a],d[l]=o>0?LC(c/m[i-o]%m[o])*s:0),r)for(;;)if(l==0){for(a=1,o=d[0];o>=10;o/=10,a++);for(o=d[0]+=s,s=1;o>=10;o/=10,s++);a!=s&&(e.e++,d[0]==zC&&(d[0]=1));break}else{if(d[l]+=s,d[l]!=zC)break;d[l--]=0,s=1}for(a=d.length;d[--a]===0;d.pop());}e.e>p?e.c=e.e=null:e.e<f&&(e.c=[e.e=0])}return e}function k(e){var t,n=e.e;return n===null?e.toString():(t=qC(e.c),t=n<=u||n>=d?QC(t,n):$C(t,n,`0`),e.s<0?`-`+t:t)}return o.absoluteValue=o.abs=function(){var e=new b(this);return e.s<0&&(e.s=1),e},o.comparedTo=function(e,t){return JC(this,new b(e,t))},o.decimalPlaces=o.dp=function(e,t){var n,r,i,a=this;if(e!=null)return O(new b(a),YC(e,-WC,WC)+a.e+1,t==null?l:YC(t,0,8));if(!(n=a.c))return null;if(r=((i=n.length-1)-KC(this.e/BC))*BC,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},o.dividedBy=o.div=function(e,n){return t(this,new b(e,n),c,l)},o.dividedToIntegerBy=o.idiv=function(e,n){return t(this,new b(e,n),0,1)},o.exponentiatedBy=o.pow=function(e,t){var n,r,i,a,o,c,u,d,f,p=this;if(e=new b(e),e.c&&!e.isInteger())throw Error(RC+`Exponent not an integer: `+k(e));if(t!=null&&(t=new b(t)),c=e.e>14,!p.c||!p.c[0]||p.c[0]==1&&!p.e&&p.c.length==1||!e.c||!e.c[0])return f=new b((+k(p))**(c?e.s*(2-ZC(e)):+k(e))),t?f.mod(t):f;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new b(NaN);r=!u&&p.isInteger()&&t.isInteger(),r&&(p=p.mod(t))}else if(e.e>9&&(p.e>0||p.e<-1||(p.e==0?p.c[0]>1||c&&p.c[1]>=24e7:p.c[0]<8e13||c&&p.c[0]<=9999975e7)))return a=p.s<0&&ZC(e)?-0:0,p.e>-1&&(a=1/a),new b(u?1/a:a);else _&&(a=IC(_/BC+2));for(c?(n=new b(.5),u&&(e.s=1),d=ZC(e)):(i=Math.abs(+k(e)),d=i%2),f=new b(s);;){if(d){if(f=f.times(p),!f.c)break;a?f.c.length>a&&(f.c.length=a):r&&(f=f.mod(t))}if(i){if(i=LC(i/2),i===0)break;d=i%2}else if(e=e.times(n),O(e,e.e+1,1),e.e>14)d=ZC(e);else{if(i=+k(e),i===0)break;d=i%2}p=p.times(p),a?p.c&&p.c.length>a&&(p.c.length=a):r&&(p=p.mod(t))}return r?f:(u&&(f=s.div(f)),t?f.mod(t):a?O(f,_,l,o):f)},o.integerValue=function(e){var t=new b(this);return O(t,t.e+1,e==null?l:YC(e,0,8))},o.isEqualTo=o.eq=function(e,t){return JC(this,new b(e,t))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(e,t){return JC(this,new b(e,t))>0},o.isGreaterThanOrEqualTo=o.gte=function(e,t){return(t=JC(this,new b(e,t)))===1||t===0},o.isInteger=function(){return!!this.c&&KC(this.e/BC)>this.c.length-2},o.isLessThan=o.lt=function(e,t){return JC(this,new b(e,t))<0},o.isLessThanOrEqualTo=o.lte=function(e,t){return(t=JC(this,new b(e,t)))===-1||t===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new b(e,t),t=e.s,!s||!t)return new b(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/BC,u=e.e/BC,d=o.c,f=e.c;if(!c||!u){if(!d||!f)return d?(e.s=-t,e):new b(f?o:NaN);if(!d[0]||!f[0])return f[0]?(e.s=-t,e):new b(d[0]?o:l==3?-0:0)}if(c=KC(c),u=KC(u),d=d.slice(),s=c-u){for((a=s<0)?(s=-s,i=d):(u=c,i=f),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=d.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(d[t]!=f[t]){a=d[t]<f[t];break}if(a&&(i=d,d=f,f=i,e.s=-e.s),t=(r=f.length)-(n=d.length),t>0)for(;t--;d[n++]=0);for(t=zC-1;r>s;){if(d[--r]<f[r]){for(n=r;n&&!d[--n];d[n]=t);--d[n],d[r]+=zC}d[r]-=f[r]}for(;d[0]==0;d.splice(0,1),--u);return d[0]?E(e,d,u):(e.s=l==3?-1:1,e.c=[e.e=0],e)},o.modulo=o.mod=function(e,n){var r,i,a=this;return e=new b(e,n),!a.c||!e.s||e.c&&!e.c[0]?new b(NaN):!e.c||a.c&&!a.c[0]?new b(a):(g==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,g),e=a.minus(r.times(e)),!e.c[0]&&g==1&&(e.s=a.s),e)},o.multipliedBy=o.times=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=this,v=_.c,y=(e=new b(e,t)).c;if(!v||!y||!v[0]||!y[0])return!_.s||!e.s||v&&!v[0]&&!y||y&&!y[0]&&!v?e.c=e.e=e.s=null:(e.s*=_.s,!v||!y?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=KC(_.e/BC)+KC(e.e/BC),e.s*=_.s,c=v.length,d=y.length,c<d&&(m=v,v=y,y=m,i=c,c=d,d=i),i=c+d,m=[];i--;m.push(0));for(h=zC,g=UC,i=d;--i>=0;){for(n=0,f=y[i]%g,p=y[i]/g|0,o=c,a=i+o;a>i;)l=v[--o]%g,u=v[o]/g|0,s=p*l+u*f,l=f*l+s%g*g+m[a]+n,n=(l/h|0)+(s/g|0)+p*u,m[a--]=l%h;m[a]=n}return n?++r:m.splice(0,1),E(e,m,r)},o.negated=function(){var e=new b(this);return e.s=-e.s||null,e},o.plus=function(e,t){var n,r=this,i=r.s;if(e=new b(e,t),t=e.s,!i||!t)return new b(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/BC,o=e.e/BC,s=r.c,c=e.c;if(!a||!o){if(!s||!c)return new b(i/0);if(!s[0]||!c[0])return c[0]?e:new b(s[0]?r:i*0)}if(a=KC(a),o=KC(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=c.length,i-t<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/zC|0,s[t]=zC===s[t]?0:s[t]%zC;return i&&(s=[i].concat(s),++o),E(e,s,o)},o.precision=o.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return O(new b(a),YC(e,1,WC),t==null?l:YC(t,0,8));if(!(n=a.c))return null;if(i=n.length-1,r=i*BC+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},o.shiftedBy=function(e){return this.times(`1e`+YC(e,-VC,VC))},o.squareRoot=o.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,u=o.s,d=o.e,f=c+4,p=new b(`0.5`);if(u!==1||!s||!s[0])return new b(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);if(u=Math.sqrt(+k(o)),u==0||u==1/0?(n=qC(s),(n.length+d)%2==0&&(n+=`0`),u=Math.sqrt(+n),d=KC((d+1)/2)-(d<0||d%2),u==1/0?n=`5e`+d:(n=u.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+d),r=new b(n)):r=new b(u+``),r.c[0]){for(d=r.e,u=d+f,u<3&&(u=0);;)if(a=r,r=p.times(a.plus(t(o,a,f,1))),qC(a.c).slice(0,u)===(n=qC(r.c)).slice(0,u)){if(r.e<d&&--u,n=n.slice(u-3,u+1),n==`9999`||!i&&n==`4999`){if(!i&&(O(a,a.e+c+2,0),a.times(a).eq(o))){r=a;break}f+=4,u+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(O(r,r.e+c+2,1),e=!r.times(r).eq(o));break}}}return O(r,r.e+c+1,l,e)},typeof BigInt==`function`&&(o.toBigInt=function(e){var t=this;return t.c?BigInt(C(t,t.e+1,e)):null}),o.toExponential=function(e,t){return C(this,e==null?e:YC(e,0,WC)+1,t,1)},o.toFixed=function(e,t){return C(this,e==null?e:YC(e,-WC,WC)+this.e+1,t)},o.toFormat=function(e,t,n){var r,i,a,o,s=this;if(n==null)n=v,e!=null&&(t==null?typeof e==`object`&&!XC(e)&&(n=D(e),e=t=null):typeof t==`object`&&(n=D(t),t=null));else if(typeof n!=`object`)throw Error(RC+`Argument not an object: `+n);else n=D(n);if(e!=null){if(XC(e)&&e.length<=2){if(i=e[0],a=e[1],e=s.dp(),a!=null&&e>YC(a,0,WC)&&(e=a),i!=null&&YC(i,0,WC)!==0){if(a!=null&&i>a)throw Error(RC+`Minimum must not exceed maximum`);e<i&&(e=i)}}else YC(e,-WC,WC)}if(o=s.toFixed(e,t),r=o.charCodeAt(0)===45,r&&(o=o.slice(1)),s.c){var c,l=o.split(`.`),u=+n.groupSize,d=+n.secondaryGroupSize,f=n.groupSeparator||``,p=l[0],m=l[1],h=p.length;if(d&&(c=u,u=d,d=c,h-=c),u>0&&h>0){for(c=h%u||u,o=p.substr(0,c);c<h;c+=u)o+=f+p.substr(c,u);d>0&&(o+=f+p.slice(c))}else o=p;m&&(c=+n.fractionGroupSize,c&&(m=m.replace(RegExp(`\\d{`+c+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``))),o+=(n.decimalSeparator||``)+m)}return(n.prefix||``)+(r?n.negativeSign||``:s.s>0&&n.positiveSign||``)+o+(n.suffix||``)},o.toFraction=function(e){var n,r,i,a,o,c,l,u,d,f,m,h,g,_,v=this,y=v.c;if(e!=null&&(l=new b(e),!l.isInteger()&&(l.c||l.s!==1)||l.lt(s)))throw Error(RC+`Argument `+(l.isInteger()?`out of range: `:`not an integer: `)+k(l));if(!y)return[new b(v.s||0),new b(0)];for(n=new b(s),d=r=new b(s),i=u=new b(s),h=qC(y),o=n.e=h.length-v.e-1,n.c[0]=HC[(c=o%BC)<0?BC+c:c],e=!e||l.comparedTo(n)>0?o>0?n:d:l,c=p,p=1/0,l=new b(h),_=l,g=n,u.c[0]=0;f=t(l,n,0,1),a=r.plus(f.times(i)),a.comparedTo(e)!=1;)r=i,i=a,d=u.plus(f.times(a=d)),u=a,n=l.minus(f.times(a=n)),l=a;return a=t(e.minus(r),i,0,1),u=u.plus(a.times(d)),r=r.plus(a.times(i)),m=d.times(g).minus(_.times(i)).abs().times(r).comparedTo(u.times(g).minus(_.times(r)).abs().times(i))<1?[d,i]:[u,r],m[0].s=v.s,p=c,m},o.toNumber=function(){return+k(this)},o.toObject=function(){var e=this;return{c:e.c?e.c.slice():null,e:e.e,s:e.s}},o.toPrecision=function(e,t){return C(this,e==null?e:YC(e,1,WC),t,2)},o.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=u||a>=d?QC(qC(r.c),a):$C(qC(r.c),a,`0`):(YC(e,2,y.length,`Base`),t=n($C(qC(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},o.valueOf=o.toJSON=function(){return k(this)},o._isBigNumber=!0,e!=null&&b.set(e),b}function KC(e){var t=e|0;return e>0||e===t?t:t-1}function qC(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=BC-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function JC(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function YC(e,t,n,r){if(e<t||e>n||e!==LC(e))throw Error(RC+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e));return e}function XC(e){return{}.toString.call(e)==`[object Array]`}function ZC(e){var t=e.c.length-1;return KC(e.e/BC)==t&&e.c[t]%2!=0}function QC(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function $C(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}var ew=PC.clone({STRICT:!0}),tw=(1<<31>>>0)-1,nw=new ew(tw);function rw(e){let t=new ew(e),n,r,i=[[new ew(0),new ew(1)],[new ew(1),new ew(0)]],a=2;for(;!t.gt(tw);){n=t.integerValue(ew.ROUND_FLOOR),r=t.minus(n);let e=i[a-1],o=i[a-2];if(!e||!o)throw Error(`Continued fraction approximation failed: missing fraction elements at indices ${a-1} and/or ${a-2}`);let s=n.times(e[0]).plus(o[0]),c=n.times(e[1]).plus(o[1]);if(s.gt(tw)||c.gt(tw)||(i.push([s,c]),r.eq(0)))break;t=new ew(1).div(r),a+=1}let o=i[i.length-1];if(!o)throw Error(`Missing last fraction element in continued fraction approximation`);let[s,c]=o;if(s.isZero()||c.isZero()){if(new ew(e).isZero())throw Error(`Couldn't find approximation`);let t=i[i.length-1],n=i[i.length-2];if(t&&n){let e=nw;if(t[0].gt(0)&&(e=ew.min(e,nw.minus(n[0]).div(t[0]).integerValue(ew.ROUND_FLOOR))),t[1].gt(0)&&(e=ew.min(e,nw.minus(n[1]).div(t[1]).integerValue(ew.ROUND_FLOOR))),e.gte(1)){let r=e.times(t[0]).plus(n[0]),i=e.times(t[1]).plus(n[1]);if(!r.isZero()&&!i.isZero())return[r.toNumber(),i.toNumber()]}}throw Error(`Couldn't find approximation`)}return[s.toNumber(),c.toNumber()]}var iw=(e,t)=>{let n=typeof e==`number`,r=String(e);for(;r.endsWith(t);)r=r.slice(0,-1);return n?Number(r):r},aw={native:`native`,credit4:`credit_alphanum4`,credit12:`credit_alphanum12`,liquidityPoolShares:`liquidity_pool_shares`};function ow(e,t){return dp(gp(e),gp(t))}var sw=class e{code;issuer;#e;constructor(t,n){if(!/^[a-zA-Z0-9]{1,12}$/.test(t))throw Error(`Asset code is invalid (maximum alphanumeric, 12 characters at max)`);if(String(t).toLowerCase()!==`xlm`&&!n)throw Error(`Issuer cannot be null`);if(n&&!J.isValidEd25519PublicKey(n))throw Error(`Issuer is invalid`);this.code=!n&&String(t).toLowerCase()===`xlm`?`XLM`:t,this.issuer=n,this.#e=e.#t(this.code,n)}static#t(e,t){return t?e.length<=4?wh.assetTypeCreditAlphanum4:wh.assetTypeCreditAlphanum12:wh.assetTypeNative}static native(){return new e(`XLM`)}static fromOperation(e){let t,n,r;switch(e.type){case`assetTypeNative`:return this.native();case`assetTypeCreditAlphanum4`:return t=e.alphaNum4,r=J.encodeEd25519PublicKey(t.issuer.ed25519.toBytes()),n=iw(pp(t.assetCode.toBytes()),`\0`),new this(n,r);case`assetTypeCreditAlphanum12`:{t=e.alphaNum12,r=J.encodeEd25519PublicKey(t.issuer.ed25519.toBytes()),n=iw(pp(t.assetCode.toBytes()),`\0`);let i=new this(n,r);return i.#e=wh.assetTypeCreditAlphanum12,i}default:throw Error(`Invalid asset type received: `+e.type)}}toXdrObject(){return this._toXdrObject(Rh)}toChangeTrustXdrObject(){return this._toXdrObject(xg)}toTrustLineXdrObject(){return this._toXdrObject(i_)}toXDRObject(){return this.toXdrObject()}toChangeTrustXDRObject(){return this.toChangeTrustXdrObject()}toTrustLineXDRObject(){return this.toTrustLineXdrObject()}contractId(e){let t=xC(gp(e)),n=lx.envelopeTypeContractId(new ex({networkId:t,contractIdPreimage:iy.contractIdPreimageFromAsset(this.toXdrObject())}));return J.encodeContract(xC(n.toXdr()))}_toXdrObject(e){if(this.isNative())return e.assetTypeNative();if(!this.issuer)throw Error(`Issuer cannot be null for non-native asset`);if(this.getRawAssetType().value===wh.assetTypeCreditAlphanum4.value){let t=new Nh({assetCode:gp(this.code.padEnd(4,`\0`)),issuer:NC.fromPublicKey(this.issuer).xdrAccountId()});return e.assetTypeCreditAlphanum4(t)}let t=new Mh({assetCode:gp(this.code.padEnd(12,`\0`)),issuer:NC.fromPublicKey(this.issuer).xdrAccountId()});return e.assetTypeCreditAlphanum12(t)}getCode(){return String(this.code)}getIssuer(){if(this.issuer!==void 0)return String(this.issuer)}getAssetType(){switch(this.getRawAssetType().value){case wh.assetTypeNative.value:return aw.native;case wh.assetTypeCreditAlphanum4.value:return aw.credit4;case wh.assetTypeCreditAlphanum12.value:return aw.credit12;default:throw Error(`Supported asset types are: native, credit_alphanum4, credit_alphanum12. received: `+this.getRawAssetType().name)}}getRawAssetType(){let{code:t,issuer:n}=this;return#e in this?this.#e:e.#t(t,n)}isNative(){return!this.issuer}equals(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()&&this.getRawAssetType().value===e.getRawAssetType().value}toString(){return this.isNative()?`native`:`${this.getCode()}:${this.getIssuer()}`}static compare(t,n){if(!t||!(t instanceof e))throw Error(`assetA is invalid`);if(!n||!(n instanceof e))throw Error(`assetB is invalid`);if(t.equals(n))return 0;let r=t.getRawAssetType().value,i=n.getRawAssetType().value;if(r!==i)return r<i?-1:1;let a=ow(t.getCode(),n.getCode());if(a!==0)return a;let o=t.getIssuer(),s=n.getIssuer();if(o===void 0||s===void 0)throw Error(`Issuer is undefined for non-native asset`);return dp(J.decodeEd25519PublicKey(o),J.decodeEd25519PublicKey(s))}};function cw(e,t){if(e!==`constant_product`)throw Error(`liquidityPoolType is invalid`);let{assetA:n,assetB:r,fee:i}=t??{};if(!n||!(n instanceof sw))throw Error(`assetA is invalid`);if(!r||!(r instanceof sw))throw Error(`assetB is invalid`);if(!i||i!==30)throw Error(`fee is invalid`);if(sw.compare(n,r)!==-1)throw Error(`Assets are not in lexicographic order`);return xC(hg.liquidityPoolConstantProduct(new fg({assetA:n.toXdrObject(),assetB:r.toXdrObject(),fee:i})).toXdr())}var lw=class{assetA;assetB;fee;constructor(e,t,n){if(!e||!(e instanceof sw))throw Error(`assetA is invalid`);if(!t||!(t instanceof sw))throw Error(`assetB is invalid`);if(sw.compare(e,t)!==-1)throw Error(`Assets are not in lexicographic order`);if(!n||n!==30)throw Error(`fee is invalid`);this.assetA=e,this.assetB=t,this.fee=n}static fromOperation(e){let t=e.type;if(t===`assetTypePoolShare`){let t=e.value.value;return new this(sw.fromOperation(t.assetA),sw.fromOperation(t.assetB),t.fee)}throw Error(`Invalid asset type: ${t}`)}toXdrObject(){let e=new fg({assetA:this.assetA.toXdrObject(),assetB:this.assetB.toXdrObject(),fee:this.fee}),t=hg.liquidityPoolConstantProduct(e);return xg.assetTypePoolShare(t)}toXDRObject(){return this.toXdrObject()}getLiquidityPoolParameters(){return{...this,assetA:this.assetA,assetB:this.assetB,fee:this.fee}}getAssetType(){return`liquidity_pool_shares`}equals(e){return this.assetA.equals(e.assetA)&&this.assetB.equals(e.assetB)&&this.fee===e.fee}toString(){return`liquidity_pool:${vp(cw(`constant_product`,this.getLiquidityPoolParameters()))}`}},uw=class e{_destination;_predicate;constructor(e,t){if(!J.isValidEd25519PublicKey(e))throw Error(`Destination is invalid`);if(this._destination=e,!t)this._predicate=Lg.claimPredicateUnconditional();else if(t instanceof Lg)this._predicate=t;else throw Error(`Predicate should be an xdr.ClaimPredicate`)}static predicateUnconditional(){return Lg.claimPredicateUnconditional()}static predicateAnd(e,t){if(!(e instanceof Lg))throw Error(`left Predicate should be an xdr.ClaimPredicate`);if(!(t instanceof Lg))throw Error(`right Predicate should be an xdr.ClaimPredicate`);return Lg.claimPredicateAnd([e,t])}static predicateOr(e,t){if(!(e instanceof Lg))throw Error(`left Predicate should be an xdr.ClaimPredicate`);if(!(t instanceof Lg))throw Error(`right Predicate should be an xdr.ClaimPredicate`);return Lg.claimPredicateOr([e,t])}static predicateNot(e){if(!(e instanceof Lg))throw Error(`Predicate should be an xdr.ClaimPredicate`);return Lg.claimPredicateNot(e)}static predicateBeforeAbsoluteTime(e){return Lg.claimPredicateBeforeAbsoluteTime(_x.fromString(e))}static predicateBeforeRelativeTime(e){return Lg.claimPredicateBeforeRelativeTime(_x.fromString(e))}static fromXdr(e){let t;switch(e.type){case`claimantTypeV0`:return t=e.value,new this(J.encodeEd25519PublicKey(t.destination.value.toBytes()),t.predicate);default:throw Error(`Invalid claimant type: ${e.type}`)}}static fromXDR(t){return e.fromXdr(t)}toXdrObject(){let e=new Rg({destination:NC.fromPublicKey(this._destination).xdrAccountId(),predicate:this._predicate});return Vg.claimantTypeV0(e)}toXDRObject(){return this.toXdrObject()}get destination(){return this._destination}set destination(e){throw Error(`Claimant is immutable`)}get predicate(){return this._predicate}set predicate(e){throw Error(`Claimant is immutable`)}},dw=class e{liquidityPoolId;constructor(e){if(!e)throw Error(`liquidityPoolId cannot be empty`);if(!/^[a-f0-9]{64}$/.test(e))throw Error(`Liquidity pool ID is not a valid hash`);this.liquidityPoolId=e}static fromOperation(t){let n=t.type;if(n===`assetTypePoolShare`){let n=vp(t.value.value);return new e(n)}throw Error(`Invalid asset type: ${n}`)}toXdrObject(){let e=new Qg(this.liquidityPoolId);return i_.assetTypePoolShare(e)}toXDRObject(){return this.toXdrObject()}getLiquidityPoolId(){return String(this.liquidityPoolId)}getAssetType(){return`liquidity_pool_shares`}equals(e){return this.liquidityPoolId===e.getLiquidityPoolId()}toString(){return`liquidity_pool:${this.liquidityPoolId}`}},fw=1e7,pw=`9223372036854775807`;function mw(e,t){if(t.source)try{e.sourceAccount=TC(t.source)}catch{throw Error(`Source address is invalid`)}}function hw(e,t,n=null){if(t===void 0)return;let r=typeof t==`string`?t.trim()===``?NaN:Number(t):t;if(typeof r!=`number`||!Number.isFinite(r)||r%1!=0)throw Error(`${e} value is invalid`);if(r<0)throw Error(`${e} value must be unsigned`);if(!n||n(r,e))return r;throw Error(`${e} value is invalid`)}function gw(e){let t=new ew(e).times(fw);return _x.fromString(t.toString())}function _w(e){if(e===void 0)return _x.fromString(`0`);let t;if(typeof e==`number`){if(!Number.isSafeInteger(e)||e<0)throw Error(`offerId must be a non-negative safe integer; pass a larger ID as a bigint or a decimal string`);t=BigInt(e)}else if(typeof e==`bigint`){if(e<0n)throw Error(`offerId must not be negative`);t=e}else if(typeof e==`string`){if(e.length>22)throw Error(`offerId must have at most 22 digits`);if(!/^\d+$/.test(e))throw Error(`offerId must be a string of decimal digits`);t=BigInt(e)}else throw Error(`offerId must be a number, a bigint, or a string of decimal digits`);if(t>_x.MAX_VALUE)throw Error(`offerId must not exceed ${_x.MAX_VALUE}`);return _x.fromString(t.toString())}function vw(e){return new ew(e.toString()).div(fw).toFixed(7)}function yw(e){return new ew(e.n).div(new ew(e.d)).toString()}function bw(e){let t;if(typeof e==`object`&&`n`in e&&`d`in e)t=new sg(e);else{let n=new ew(e);if(!n.gt(0)||!n.isFinite())throw Error(`price must be positive`);let r=rw(e);t=new sg({n:parseInt(String(r[0]),10),d:parseInt(String(r[1]),10)})}if(t.n<=0||t.d<=0)throw Error(`price must be positive`);return t}function xw(e,t=!1){if(typeof e!=`string`)return!1;let n;try{n=new ew(e)}catch{return!1}return!(!t&&n.isZero()||n.isNegative()||n.times(1e7).gt(new ew(pw).toString())||(n.decimalPlaces()??0)>7||n.isNaN()||!n.isFinite())}function Sw(e){return`${e} argument must be of type String, represent a positive number and have at most 7 digits after the decimal`}function Cw(e){let t=e.selling.toXdrObject(),n=e.buying.toXdrObject();if(!xw(e.amount,!0))throw TypeError(Sw(`amount`));let r=gw(e.amount);if(e.price===void 0)throw TypeError(`price argument is required`);let i=new cg({selling:t,buying:n,amount:r,price:bw(e.price),offerId:_w(e.offerId)}),a={sourceAccount:null,body:cb.manageSellOffer(i)};return mw(a,e),new lb(a)}function ww(e){let t=e.selling.toXdrObject(),n=e.buying.toXdrObject();if(!xw(e.amount))throw TypeError(Sw(`amount`));let r=gw(e.amount);if(e.price===void 0)throw TypeError(`price argument is required`);let i=new lg({selling:t,buying:n,amount:r,price:bw(e.price)}),a={sourceAccount:null,body:cb.createPassiveSellOffer(i)};return mw(a,e),new lb(a)}function Tw(e){let t;try{t=cb.accountMerge(TC(e.destination))}catch{throw Error(`destination is invalid`)}let n={sourceAccount:null,body:t};return mw(n,e),new lb(n)}function Ew(e){if(!J.isValidEd25519PublicKey(e.trustor))throw Error(`trustor is invalid`);let t=NC.fromPublicKey(e.trustor).xdrAccountId(),n;if(e.assetCode.length<=4){let t=gp(e.assetCode.padEnd(4,`\0`));n=Ah.assetTypeCreditAlphanum4(new Th(t))}else if(e.assetCode.length<=12){let t=gp(e.assetCode.padEnd(12,`\0`));n=Ah.assetTypeCreditAlphanum12(new Eh(t))}else throw Error(`Asset code must be 12 characters at max.`);let r;if(typeof e.authorize==`boolean`)r=e.authorize?hx.authorizedFlag.value:0;else if(e.authorize==null)throw Error(`authorize is required`);else r=e.authorize;let i=new jh({trustor:t,asset:n,authorize:r}),a={sourceAccount:null,body:cb.allowTrust(i)};return mw(a,e),new lb(a)}function Dw(e){if(typeof e.bumpTo!=`string`)throw Error(`bumpTo must be a string`);try{new ew(e.bumpTo)}catch{throw Error(`bumpTo must be a stringified number`)}let t=new Tg({bumpTo:_x.fromString(e.bumpTo)}),n={sourceAccount:null,body:cb.bumpSequence(t)};return mw(n,e),new lb(n)}var Ow=`9223372036854775807`;function kw(e){let t=e.asset??e.line,n;if(t instanceof sw)n=t.toChangeTrustXdrObject();else if(t instanceof lw)n=t.toXdrObject();else throw TypeError(`asset must be Asset or LiquidityPoolAsset`);if(e.limit!==void 0&&!xw(e.limit,!0))throw TypeError(Sw(`limit`));let r=e.limit?gw(e.limit):_x.fromString(Ow),i=new Sg({line:n,limit:r}),a={sourceAccount:null,body:cb.changeTrust(i)};return mw(a,e),new lb(a)}function Aw(e){if(!J.isValidEd25519PublicKey(e.destination))throw Error(`destination is invalid`);if(!xw(e.startingBalance,!0))throw TypeError(Sw(`startingBalance`));let t=new ig({destination:NC.fromPublicKey(e.destination).xdrAccountId(),startingBalance:gw(e.startingBalance)}),n={sourceAccount:null,body:cb.createAccount(t)};return mw(n,e),new lb(n)}function jw(e){if(!(e.asset instanceof sw))throw Error(`must provide an asset for create claimable balance operation`);if(!xw(e.amount))throw TypeError(Sw(`amount`));if(!Array.isArray(e.claimants)||e.claimants.length===0)throw Error(`must provide at least one claimant`);let t=new Hg({asset:e.asset.toXdrObject(),amount:gw(e.amount),claimants:e.claimants.map(e=>e.toXdrObject())}),n={sourceAccount:null,body:cb.createClaimableBalance(t)};return mw(n,e),new lb(n)}function Mw(e={}){Nw(e.balanceId);let t=new qg({balanceId:Kg.fromXdr(e.balanceId,`hex`)}),n={sourceAccount:null,body:cb.claimClaimableBalance(t)};return mw(n,e),new lb(n)}function Nw(e){if(typeof e!=`string`||e.length!==72)throw Error(`must provide a valid claimable balance id`)}function Pw(e={}){Nw(e.balanceId);let t=Kg.fromXdr(e.balanceId,`hex`),n={sourceAccount:null,body:cb.clawbackClaimableBalance(new qv({balanceId:t}))};return mw(n,e),new lb(n)}function Fw(e={}){let t={sourceAccount:null,body:cb.inflation()};return mw(t,e),new lb(t)}function Iw(e){if(!(typeof e.name==`string`&&e.name.length<=64))throw Error(`name must be a string, up to 64 characters`);if(typeof e.value!=`string`&&!(e.value instanceof Uint8Array)&&e.value!==null&&e.value!==void 0)throw Error(`value must be a string, Uint8Array or null`);let t;if(t=typeof e.value==`string`?gp(e.value):e.value??null,t!==null&&t.length>64)throw Error(`value cannot be longer that 64 bytes`);let n=new wg({dataName:e.name,dataValue:t===null?null:new Cg(Uint8Array.from(t))}),r={sourceAccount:null,body:cb.manageData(n)};return mw(r,e),new lb(r)}function Lw(e){let t=e.selling.toXdrObject(),n=e.buying.toXdrObject();if(!xw(e.buyAmount,!0))throw TypeError(Sw(`buyAmount`));let r=gw(e.buyAmount);if(e.price===void 0)throw TypeError(`price argument is required`);let i=new Eg({selling:t,buying:n,buyAmount:r,price:bw(e.price),offerId:_w(e.offerId)}),a={sourceAccount:null,body:cb.manageBuyOffer(i)};return mw(a,e),new lb(a)}function Rw(e){if(!e.sendAsset)throw Error(`Must specify a send asset`);if(!xw(e.sendMax))throw TypeError(Sw(`sendMax`));if(!e.destAsset)throw Error(`Must provide a destAsset for a payment operation`);if(!xw(e.destAmount))throw TypeError(Sw(`destAmount`));let t;try{t=TC(e.destination)}catch{throw Error(`destination is invalid`)}let n=e.path?e.path:[],r=new og({sendAsset:e.sendAsset.toXdrObject(),sendMax:gw(e.sendMax),destination:t,destAsset:e.destAsset.toXdrObject(),destAmount:gw(e.destAmount),path:n.map(e=>e.toXdrObject())}),i={sourceAccount:null,body:cb.pathPaymentStrictReceive(r)};return mw(i,e),new lb(i)}function zw(e){if(!e.sendAsset)throw Error(`Must specify a send asset`);if(!xw(e.sendAmount))throw TypeError(Sw(`sendAmount`));if(!e.destAsset)throw Error(`Must provide a destAsset for a payment operation`);if(!xw(e.destMin))throw TypeError(Sw(`destMin`));let t=e.sendAsset.toXdrObject(),n=gw(e.sendAmount),r;try{r=TC(e.destination)}catch{throw Error(`destination is invalid`)}let i=e.destAsset.toXdrObject(),a=gw(e.destMin),o=(e.path??[]).map(e=>e.toXdrObject()),s=new Dg({sendAsset:t,sendAmount:n,destination:r,destAsset:i,destMin:a,path:o}),c={sourceAccount:null,body:cb.pathPaymentStrictSend(s)};return mw(c,e),new lb(c)}function Bw(e){if(!e.asset)throw Error(`Must provide an asset for a payment operation`);if(!xw(e.amount))throw TypeError(Sw(`amount`));let t;try{t=TC(e.destination)}catch{throw Error(`destination is invalid`)}let n=new ag({destination:t,asset:e.asset.toXdrObject(),amount:gw(e.amount)}),r={sourceAccount:null,body:cb.payment(n)};return mw(r,e),new lb(r)}function Vw(e,t){if(e>=0&&e<=255)return!0;throw Error(`${t} value must be between 0 and 255`)}function Hw(e){let t=null;if(e.inflationDest){if(!J.isValidEd25519PublicKey(e.inflationDest))throw Error(`inflationDest is invalid`);t=NC.fromPublicKey(e.inflationDest).xdrAccountId()}let n=hw(`clearFlags`,e.clearFlags)??null,r=hw(`setFlags`,e.setFlags)??null,i=hw(`masterWeight`,e.masterWeight,Vw)??null,a=hw(`lowThreshold`,e.lowThreshold,Vw)??null,o=hw(`medThreshold`,e.medThreshold,Vw)??null,s=hw(`highThreshold`,e.highThreshold,Vw)??null;if(e.homeDomain!==void 0&&typeof e.homeDomain!=`string`)throw TypeError(`homeDomain argument must be of type String`);let c=e.homeDomain,l=null;if(e.signer){let t=hw(`signer.weight`,e.signer.weight,Vw),n,r=0;if(e.signer.ed25519PublicKey){if(!J.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw Error(`signer.ed25519PublicKey is invalid.`);let t=J.decodeEd25519PublicKey(e.signer.ed25519PublicKey);n=yh.signerKeyTypeEd25519(t),r+=1}if(e.signer.preAuthTx){let t;if(t=typeof e.signer.preAuthTx==`string`?bp(e.signer.preAuthTx):e.signer.preAuthTx,!(t instanceof Uint8Array&&t.length===32))throw Error(`signer.preAuthTx must be 32 bytes Uint8Array.`);n=yh.signerKeyTypePreAuthTx(t),r+=1}if(e.signer.sha256Hash){let t;if(t=typeof e.signer.sha256Hash==`string`?bp(e.signer.sha256Hash):e.signer.sha256Hash,!(t instanceof Uint8Array&&t.length===32))throw Error(`signer.sha256Hash must be 32 bytes Uint8Array.`);n=yh.signerKeyTypeHashX(t),r+=1}if(e.signer.ed25519SignedPayload){if(!J.isValidSignedPayload(e.signer.ed25519SignedPayload))throw Error(`signer.ed25519SignedPayload is invalid.`);let t=J.decodeSignedPayload(e.signer.ed25519SignedPayload),i=ph.fromXdr(t);n=yh.signerKeyTypeEd25519SignedPayload(i),r+=1}if(r!==1)throw Error(`Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx, or signer.ed25519SignedPayload.`);if(t===void 0)throw Error(`signer weight is required.`);if(n===void 0)throw Error(`signer key is required.`);l=new bh({key:n,weight:t})}let u=new ug({inflationDest:t,clearFlags:n,setFlags:r,masterWeight:i,lowThreshold:a,medThreshold:o,highThreshold:s,homeDomain:c??null,signer:l}),d={sourceAccount:null,body:cb.setOptions(u)};return mw(d,e),new lb(d)}function Uw(e){if(!J.isValidEd25519PublicKey(e.sponsoredId))throw Error(`sponsoredId is invalid`);let t=new Jg({sponsoredId:NC.fromPublicKey(e.sponsoredId).xdrAccountId()}),n={sourceAccount:null,body:cb.beginSponsoringFutureReserves(t)};return mw(n,e),new lb(n)}function Ww(e={}){let t={sourceAccount:null,body:cb.endSponsoringFutureReserves()};return mw(t,e),new lb(t)}function Gw(e={}){if(!J.isValidEd25519PublicKey(e.account))throw Error(`account is invalid`);let t=Bv.account(new Zg({accountId:NC.fromPublicKey(e.account).xdrAccountId()})),n=Gv.revokeSponsorshipLedgerEntry(t),r={sourceAccount:null,body:cb.revokeSponsorship(n)};return mw(r,e),new lb(r)}function Kw(e={}){if(!J.isValidEd25519PublicKey(e.account))throw Error(`account is invalid`);let t;if(e.asset instanceof sw)t=e.asset.toTrustLineXdrObject();else if(e.asset instanceof dw)t=e.asset.toXdrObject();else throw TypeError(`asset must be an Asset or LiquidityPoolId`);let n=Bv.trustline(new a_({accountId:NC.fromPublicKey(e.account).xdrAccountId(),asset:t})),r=Gv.revokeSponsorshipLedgerEntry(n),i={sourceAccount:null,body:cb.revokeSponsorship(r)};return mw(i,e),new lb(i)}function qw(e={}){if(!J.isValidEd25519PublicKey(e.seller))throw Error(`seller is invalid`);if(e.offerId===void 0)throw Error(`offerId is invalid`);let t=Bv.offer(new o_({sellerId:NC.fromPublicKey(e.seller).xdrAccountId(),offerId:_w(e.offerId)})),n=Gv.revokeSponsorshipLedgerEntry(t),r={sourceAccount:null,body:cb.revokeSponsorship(n)};return mw(r,e),new lb(r)}function Jw(e={}){if(!J.isValidEd25519PublicKey(e.account))throw Error(`account is invalid`);if(typeof e.name!=`string`||e.name.length>64)throw Error(`name must be a string, up to 64 characters`);let t=Bv.data(new s_({accountId:NC.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),n=Gv.revokeSponsorshipLedgerEntry(t),r={sourceAccount:null,body:cb.revokeSponsorship(n)};return mw(r,e),new lb(r)}function Yw(e={}){if(typeof e.balanceId!=`string`)throw Error(`balanceId is invalid`);let t=Bv.claimableBalance(new c_({balanceId:Kg.fromXdr(e.balanceId,`hex`)})),n=Gv.revokeSponsorshipLedgerEntry(t),r={sourceAccount:null,body:cb.revokeSponsorship(n)};return mw(r,e),new lb(r)}function Xw(e={}){if(typeof e.liquidityPoolId!=`string`)throw Error(`liquidityPoolId is invalid`);let t=Bv.liquidityPool(new l_({liquidityPoolId:new Qg(bp(e.liquidityPoolId))})),n=Gv.revokeSponsorshipLedgerEntry(t),r={sourceAccount:null,body:cb.revokeSponsorship(n)};return mw(r,e),new lb(r)}function Zw(e={}){if(!J.isValidEd25519PublicKey(e.account))throw Error(`account is invalid`);let t;if(e.signer.ed25519PublicKey){if(!J.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw Error(`signer.ed25519PublicKey is invalid.`);let n=J.decodeEd25519PublicKey(e.signer.ed25519PublicKey);t=yh.signerKeyTypeEd25519(n)}else if(e.signer.preAuthTx){let n;if(n=typeof e.signer.preAuthTx==`string`?bp(e.signer.preAuthTx):e.signer.preAuthTx,!(n instanceof Uint8Array&&n.length===32))throw Error(`signer.preAuthTx must be 32 bytes Uint8Array.`);t=yh.signerKeyTypePreAuthTx(n)}else if(e.signer.sha256Hash){let n;if(n=typeof e.signer.sha256Hash==`string`?bp(e.signer.sha256Hash):e.signer.sha256Hash,!(n instanceof Uint8Array&&n.length===32))throw Error(`signer.sha256Hash must be 32 bytes Uint8Array.`);t=yh.signerKeyTypeHashX(n)}else if(e.signer.ed25519SignedPayload){if(!J.isValidSignedPayload(e.signer.ed25519SignedPayload))throw Error(`signer.ed25519SignedPayload is invalid.`);let n=J.decodeSignedPayload(e.signer.ed25519SignedPayload),r=ph.fromXdr(n);t=yh.signerKeyTypeEd25519SignedPayload(r)}else throw Error(`signer is invalid`);let n=new Vv({accountId:NC.fromPublicKey(e.account).xdrAccountId(),signerKey:t}),r=Gv.revokeSponsorshipSigner(n),i={sourceAccount:null,body:cb.revokeSponsorship(r)};return mw(i,e),new lb(i)}function Qw(e){if(!xw(e.amount))throw TypeError(Sw(`amount`));let t;try{t=TC(e.from)}catch{throw Error(`from address is invalid`)}let n=new Kv({amount:gw(e.amount),asset:e.asset.toXdrObject(),from:t}),r={sourceAccount:null,body:cb.clawback(n)};return mw(r,e),new lb(r)}function $w(e){if(typeof e.flags!=`object`||Object.keys(e.flags).length===0)throw Error(`opts.flags must be a map of boolean flags to modify`);let t={authorized:hx.authorizedFlag,authorizedToMaintainLiabilities:hx.authorizedToMaintainLiabilitiesFlag,clawbackEnabled:hx.trustlineClawbackEnabledFlag},n=0,r=0;Object.keys(e.flags).forEach(i=>{if(!Object.prototype.hasOwnProperty.call(t,i))throw Error(`unsupported flag name specified: ${i}`);let a=e.flags[i],o=t[i];if(!o)throw Error(`Invalid flag name: ${i}`);if(typeof a!=`boolean`&&a!==void 0)throw TypeError(`opts.flags.${i} must be a boolean (got ${typeof a})`);a===!0?r|=o.value:a===!1&&(n|=o.value)});let i=NC.fromPublicKey(e.trustor).xdrAccountId(),a=e.asset.toXdrObject(),o={sourceAccount:null,body:cb.setTrustLineFlags(new Jv({trustor:i,asset:a,clearFlags:n,setFlags:r}))};return mw(o,e),new lb(o)}function eT(e={}){let{liquidityPoolId:t,maxAmountA:n,maxAmountB:r,minPrice:i,maxPrice:a}=e;if(!t)throw TypeError(`liquidityPoolId argument is required`);let o=new Qg(bp(t));if(!xw(n,!0))throw TypeError(Sw(`maxAmountA`));let s=gw(n);if(!xw(r,!0))throw TypeError(Sw(`maxAmountB`));let c=gw(r);if(i===void 0)throw TypeError(`minPrice argument is required`);let l=bw(i);if(a===void 0)throw TypeError(`maxPrice argument is required`);let u=new Yv({liquidityPoolId:o,maxAmountA:s,maxAmountB:c,minPrice:l,maxPrice:bw(a)}),d={sourceAccount:null,body:cb.liquidityPoolDeposit(u)};return mw(d,e),new lb(d)}function tT(e={}){if(!e.liquidityPoolId)throw TypeError(`liquidityPoolId argument is required`);let t=new Qg(bp(e.liquidityPoolId));if(!xw(e.amount))throw TypeError(Sw(`amount`));let n=gw(e.amount);if(!xw(e.minAmountA,!0))throw TypeError(Sw(`minAmountA`));let r=gw(e.minAmountA);if(!xw(e.minAmountB,!0))throw TypeError(Sw(`minAmountB`));let i=new Xv({liquidityPoolId:t,amount:n,minAmountA:r,minAmountB:gw(e.minAmountB)}),a={sourceAccount:null,body:cb.liquidityPoolWithdraw(i)};return mw(a,e),new lb(a)}var nT=class e{_type;_key;constructor(e){if(J.isValidEd25519PublicKey(e))this._type=`account`,this._key=J.decodeEd25519PublicKey(e);else if(J.isValidContract(e))this._type=`contract`,this._key=J.decodeContract(e);else if(J.isValidMed25519PublicKey(e))this._type=`muxedAccount`,this._key=J.decodeMed25519PublicKey(e);else if(J.isValidMuxedContract(e))this._type=`muxedContract`,this._key=J.decodeMuxedContract(e);else if(J.isValidClaimableBalance(e))this._type=`claimableBalance`,this._key=J.decodeClaimableBalance(e);else if(J.isValidLiquidityPool(e))this._type=`liquidityPool`,this._key=J.decodeLiquidityPool(e);else throw Error(`Unsupported address type: ${e}`)}static fromString(t){return new e(t)}static account(t){return new e(J.encodeEd25519PublicKey(t))}static contract(t){return new e(J.encodeContract(t))}static claimableBalance(t){return new e(J.encodeClaimableBalance(t))}static liquidityPool(t){return new e(J.encodeLiquidityPool(t))}static muxedAccount(t){return new e(J.encodeMed25519PublicKey(t))}static muxedContract(t){return new e(J.encodeMuxedContract(t))}static fromScVal(t){if(t.type!==`scvAddress`)throw Error(`Unsupported ScVal type: ${t.type}`);return e.fromScAddress(t.address)}static fromScAddress(t){switch(t.type){case`scAddressTypeAccount`:return e.account(t.accountId.ed25519.toBytes());case`scAddressTypeContract`:return e.contract(t.contractId.value);case`scAddressTypeMuxedAccount`:{let n=t.value,r=lp([n.ed25519.toBytes(),f_.schema.encode(n.toXdrObject()).subarray(0,8)]);return e.muxedAccount(r)}case`scAddressTypeClaimableBalance`:{let n=t.value;return e.claimableBalance(lp([Uint8Array.of(Ug.claimableBalanceIdTypeV0.value),n.v0.value]))}case`scAddressTypeLiquidityPool`:return e.liquidityPool(t.value.toBytes());case`scAddressTypeMuxedContract`:{let n=t.value;return e.muxedContract(km(n.contractId.value,n.id))}default:throw Error(`Unsupported address type`)}}toString(){switch(this._type){case`account`:return J.encodeEd25519PublicKey(this._key);case`contract`:return J.encodeContract(this._key);case`claimableBalance`:return J.encodeClaimableBalance(this._key);case`liquidityPool`:return J.encodeLiquidityPool(this._key);case`muxedAccount`:return J.encodeMed25519PublicKey(this._key);case`muxedContract`:return J.encodeMuxedContract(this._key);default:throw Error(`Unsupported address type`)}}toScVal(){return Sv.scvAddress(this.toScAddress())}toScAddress(){switch(this._type){case`account`:return x_.scAddressTypeAccount(dh.publicKeyTypeEd25519(this._key));case`contract`:return x_.scAddressTypeContract(new d_(this._key));case`liquidityPool`:return x_.scAddressTypeLiquidityPool(new Qg(this._key));case`claimableBalance`:return x_.scAddressTypeClaimableBalance(new Gg(new Bh(this._key.subarray(1))));case`muxedAccount`:return x_.scAddressTypeMuxedAccount(new f_({ed25519:this._key.subarray(0,32),id:vx.fromXdr(this._key.subarray(32,40),`raw`)}));case`muxedContract`:{let{contractId:e,id:t}=Am(this._key);return x_.scAddressTypeMuxedContract(new p_({id:t,contractId:new d_(e)}))}default:throw Error(`Unsupported address type`)}}toBuffer(){return this._key}get type(){return this._type}};function rT(e){if(!e.func)throw TypeError(`host function invocation ('func') required (got ${JSON.stringify(e)})`);e.func.type===`hostFunctionTypeInvokeContract`&&e.func.value.args.forEach(e=>{let t;try{t=nT.fromScVal(e)}catch{return}switch(t.type){case`claimableBalance`:case`liquidityPool`:throw TypeError(`claimable balances and liquidity pools cannot be arguments to invokeHostFunction`)}});let t=new jy({hostFunction:e.func,auth:e.auth||[]}),n={sourceAccount:null,body:cb.invokeHostFunction(t)};return mw(n,e),new lb(n)}function iT(e){let t=new nT(e.contract);if(t.type!==`contract`)throw TypeError(`expected contract strkey instance, got ${t.toString()}`);return rT({func:fy.hostFunctionTypeInvokeContract(new Qv({contractAddress:t.toScAddress(),functionName:e.function,args:e.args})),...e.source!==void 0&&{source:e.source},...e.auth!==void 0&&{auth:e.auth}})}function aT(e){let t=Uint8Array.from(e.salt||cT()),n;if(e.externalRef!==void 0){if(e.wasmHash!==void 0)throw TypeError(`Must provide only one of: 'opts.wasmHash' or 'opts.externalRef'`);let t=e.externalRef;if(t instanceof C_||(t=new C_({executableOwner:(t.owner instanceof nT?t.owner:new nT(t.owner)).toScAddress(),tag:t.tag})),t.executableOwner.type!==`scAddressTypeContract`)throw TypeError(`expected contract address in 'opts.externalRef.owner', got `+nT.fromScAddress(t.executableOwner).toString());n=O_.contractExecutableExternalRef(t)}else{if(!e.wasmHash||e.wasmHash.length!==32)throw TypeError(`expected hash(contract WASM) in 'opts.wasmHash', got ${String(e.wasmHash)}`);n=O_.contractExecutableWasm(new Bh(Uint8Array.from(e.wasmHash)))}if(t.length!==32)throw TypeError(`expected 32-byte salt in 'opts.salt', got ${String(e.salt)}`);return rT({func:fy.hostFunctionTypeCreateContractV2(new oy({executable:n,contractIdPreimage:iy.contractIdPreimageFromAddress(new ey({address:e.address.toScAddress(),salt:t})),constructorArgs:e.constructorArgs??[]})),...e.source!==void 0&&{source:e.source},...e.auth!==void 0&&{auth:e.auth}})}function oT(e){let t=e.asset;if(typeof t==`string`){let n=t.split(`:`),r=n[0];if(r===void 0)throw TypeError(`expected Asset in 'opts.asset', got ${String(e.asset)}`);t=new sw(r,n[1])}if(!(t instanceof sw))throw TypeError(`expected Asset in 'opts.asset', got ${String(e.asset)}`);return rT({func:fy.hostFunctionTypeCreateContract(new ay({executable:O_.contractExecutableStellarAsset(),contractIdPreimage:iy.contractIdPreimageFromAsset(t.toXdrObject())})),auth:e.auth||[],...e.source!==void 0&&{source:e.source}})}function sT(e){return rT({func:fy.hostFunctionTypeUploadContractWasm(Uint8Array.from(e.wasm)),auth:e.auth||[],...e.source!==void 0&&{source:e.source}})}function cT(){return NC.random().xdrPublicKey().value.toBytes()}function lT(e){if((e.extendTo??-1)<=0)throw RangeError(`extendTo has to be positive`);let t=new My({ext:Ch.v0(),extendTo:e.extendTo}),n={sourceAccount:null,body:cb.extendFootprintTtl(t)};return mw(n,e),new lb(n)}function uT(e={}){let t=new Ny({ext:Ch.v0()}),n={sourceAccount:null,body:cb.restoreFootprint(t)};return mw(n,e),new lb(n)}var dT=class e{static fromXDRObject(t){return e.fromXdrObject(t)}static fromXdrObject(e){let t={},n=e.sourceAccount;n&&(t.source=EC(n));let r=`value`in e.body?e.body.value:void 0,i=e.body.type;switch(i){case`createAccount`:t.type=`createAccount`,t.destination=mT(r.destination),t.startingBalance=vw(r.startingBalance);break;case`payment`:t.type=`payment`,t.destination=EC(r.destination),t.asset=sw.fromOperation(r.asset),t.amount=vw(r.amount);break;case`pathPaymentStrictReceive`:t.type=`pathPaymentStrictReceive`,t.sendAsset=sw.fromOperation(r.sendAsset),t.sendMax=vw(r.sendMax),t.destination=EC(r.destination),t.destAsset=sw.fromOperation(r.destAsset),t.destAmount=vw(r.destAmount),t.path=r.path.map(e=>sw.fromOperation(e));break;case`pathPaymentStrictSend`:t.type=`pathPaymentStrictSend`,t.sendAsset=sw.fromOperation(r.sendAsset),t.sendAmount=vw(r.sendAmount),t.destination=EC(r.destination),t.destAsset=sw.fromOperation(r.destAsset),t.destMin=vw(r.destMin),t.path=r.path.map(e=>sw.fromOperation(e));break;case`changeTrust`:switch(t.type=`changeTrust`,r.line.type){case`assetTypePoolShare`:t.line=lw.fromOperation(r.line);break;default:t.line=sw.fromOperation(r.line)}t.limit=vw(r.limit);break;case`allowTrust`:t.type=`allowTrust`,t.trustor=mT(r.trustor),t.assetCode=iw(pp(r.asset.value.value),`\0`),t.authorize=r.authorize;break;case`setOptions`:if(t.type=`setOptions`,r.inflationDest&&(t.inflationDest=mT(r.inflationDest)),t.clearFlags=r.clearFlags??void 0,t.setFlags=r.setFlags??void 0,t.masterWeight=r.masterWeight??void 0,t.lowThreshold=r.lowThreshold??void 0,t.medThreshold=r.medThreshold??void 0,t.highThreshold=r.highThreshold??void 0,t.homeDomain=r.homeDomain===null?void 0:r.homeDomain.toString(),r.signer){let e={},n=r.signer.key;switch(n.type){case`signerKeyTypeEd25519`:e.ed25519PublicKey=J.encodeEd25519PublicKey(n.ed25519.toBytes());break;case`signerKeyTypePreAuthTx`:e.preAuthTx=n.preAuthTx.toBytes().slice();break;case`signerKeyTypeHashX`:e.sha256Hash=n.hashX.toBytes().slice();break;case`signerKeyTypeEd25519SignedPayload`:e.ed25519SignedPayload=J.encodeSignedPayload(n.ed25519SignedPayload.toXdr())}e.weight=r.signer.weight,t.signer=e}break;case`manageOffer`:case`manageSellOffer`:t.type=`manageSellOffer`,t.selling=sw.fromOperation(r.selling),t.buying=sw.fromOperation(r.buying),t.amount=vw(r.amount),t.price=yw(r.price),t.offerId=r.offerId.toString();break;case`manageBuyOffer`:t.type=`manageBuyOffer`,t.selling=sw.fromOperation(r.selling),t.buying=sw.fromOperation(r.buying),t.buyAmount=vw(r.buyAmount),t.price=yw(r.price),t.offerId=r.offerId.toString();break;case`createPassiveOffer`:case`createPassiveSellOffer`:t.type=`createPassiveSellOffer`,t.selling=sw.fromOperation(r.selling),t.buying=sw.fromOperation(r.buying),t.amount=vw(r.amount),t.price=yw(r.price);break;case`accountMerge`:t.type=`accountMerge`,t.destination=EC(r);break;case`manageData`:t.type=`manageData`,t.name=r.dataName.toString(),t.value=r.dataValue===null?void 0:r.dataValue.value.slice();break;case`inflation`:t.type=`inflation`;break;case`bumpSequence`:t.type=`bumpSequence`,t.bumpTo=r.bumpTo.toString();break;case`createClaimableBalance`:t.type=`createClaimableBalance`,t.asset=sw.fromOperation(r.asset),t.amount=vw(r.amount),t.claimants=[],r.claimants.forEach(e=>{t.claimants.push(uw.fromXdr(e))});break;case`claimClaimableBalance`:t.type=`claimClaimableBalance`,t.balanceId=r.toXdr(`hex`);break;case`beginSponsoringFutureReserves`:t.type=`beginSponsoringFutureReserves`,t.sponsoredId=mT(r.sponsoredId);break;case`endSponsoringFutureReserves`:t.type=`endSponsoringFutureReserves`;break;case`revokeSponsorship`:fT(r,t);break;case`clawback`:t.type=`clawback`,t.amount=vw(r.amount),t.from=EC(r.from),t.asset=sw.fromOperation(r.asset);break;case`clawbackClaimableBalance`:t.type=`clawbackClaimableBalance`,t.balanceId=r.toXdr(`hex`);break;case`setTrustLineFlags`:{t.type=`setTrustLineFlags`,t.asset=sw.fromOperation(r.asset),t.trustor=mT(r.trustor);let e=r.clearFlags,n=r.setFlags,i={authorized:hx.authorizedFlag,authorizedToMaintainLiabilities:hx.authorizedToMaintainLiabilitiesFlag,clawbackEnabled:hx.trustlineClawbackEnabledFlag},a=t=>{let r=i[t]?.value??0;if(n&r)return!0;if(e&r)return!1},o={};Object.keys(i).forEach(e=>{o[e]=a(e)}),t.flags=o;break}case`liquidityPoolDeposit`:t.type=`liquidityPoolDeposit`,t.liquidityPoolId=vp(r.liquidityPoolId.value),t.maxAmountA=vw(r.maxAmountA),t.maxAmountB=vw(r.maxAmountB),t.minPrice=yw(r.minPrice),t.maxPrice=yw(r.maxPrice);break;case`liquidityPoolWithdraw`:t.type=`liquidityPoolWithdraw`,t.liquidityPoolId=vp(r.liquidityPoolId.value),t.amount=vw(r.amount),t.minAmountA=vw(r.minAmountA),t.minAmountB=vw(r.minAmountB);break;case`invokeHostFunction`:t.type=`invokeHostFunction`,t.func=r.hostFunction,t.auth=r.auth??[];break;case`extendFootprintTtl`:t.type=`extendFootprintTtl`,t.extendTo=r.extendTo;break;case`restoreFootprint`:t.type=`restoreFootprint`;break;default:throw Error(`Unknown operation: ${i}`)}return t}static accountMerge=Tw;static allowTrust=Ew;static bumpSequence=Dw;static changeTrust=kw;static createAccount=Aw;static createClaimableBalance=jw;static claimClaimableBalance=Mw;static clawbackClaimableBalance=Pw;static createPassiveSellOffer=ww;static inflation=Fw;static manageData=Iw;static manageSellOffer=Cw;static manageBuyOffer=Lw;static pathPaymentStrictReceive=Rw;static pathPaymentStrictSend=zw;static payment=Bw;static setOptions=Hw;static beginSponsoringFutureReserves=Uw;static endSponsoringFutureReserves=Ww;static revokeAccountSponsorship=Gw;static revokeTrustlineSponsorship=Kw;static revokeOfferSponsorship=qw;static revokeDataSponsorship=Jw;static revokeClaimableBalanceSponsorship=Yw;static revokeLiquidityPoolSponsorship=Xw;static revokeSignerSponsorship=Zw;static clawback=Qw;static setTrustLineFlags=$w;static liquidityPoolDeposit=eT;static liquidityPoolWithdraw=tT;static invokeHostFunction=rT;static extendFootprintTtl=lT;static restoreFootprint=uT;static createStellarAssetContract=oT;static invokeContractFunction=iT;static createCustomContract=aT;static uploadContractWasm=sT};function fT(e,t){switch(e.type){case`revokeSponsorshipLedgerEntry`:{let n=e.ledgerKey;switch(n.type){case`account`:t.type=`revokeAccountSponsorship`,t.account=mT(n.account.accountId);break;case`trustline`:{t.type=`revokeTrustlineSponsorship`,t.account=mT(n.trustLine.accountId);let e=n.trustLine.asset;switch(e.type){case`assetTypePoolShare`:t.asset=dw.fromOperation(e);break;default:t.asset=sw.fromOperation(e)}break}case`offer`:t.type=`revokeOfferSponsorship`,t.seller=mT(n.offer.sellerId),t.offerId=n.offer.offerId.toString();break;case`data`:t.type=`revokeDataSponsorship`,t.account=mT(n.data.accountId),t.name=n.data.dataName.toString();break;case`claimableBalance`:t.type=`revokeClaimableBalanceSponsorship`,t.balanceId=n.claimableBalance.balanceId.toXdr(`hex`);break;case`liquidityPool`:t.type=`revokeLiquidityPoolSponsorship`,t.liquidityPoolId=vp(n.liquidityPool.liquidityPoolId.value);break;default:throw Error(`Unknown ledgerKey: ${n.type}`)}break}case`revokeSponsorshipSigner`:{let n=e.signer;t.type=`revokeSignerSponsorship`,t.account=mT(n.accountId),t.signer=pT(n.signerKey);break}default:throw Error(`Unknown revokeSponsorship: ${e.type}`)}}function pT(e){let t={};switch(e.type){case`signerKeyTypeEd25519`:t.ed25519PublicKey=J.encodeEd25519PublicKey(e.value.toBytes());break;case`signerKeyTypePreAuthTx`:t.preAuthTx=vp(e.value.toBytes());break;case`signerKeyTypeHashX`:t.sha256Hash=vp(e.value.toBytes());break;case`signerKeyTypeEd25519SignedPayload`:{let n=e.value;t.ed25519SignedPayload=J.encodeSignedPayload(n.toXdr());break}default:throw Error(`Unknown signerKey type: `+e.type)}return t}function mT(e){return J.encodeEd25519PublicKey(e.value.toBytes())}var hT=`none`,gT=`text`,_T=`hash`,vT=`return`,yT=class e{_type;_value;constructor(t,n=null){switch(this._type=t,this._value=n,this._type){case hT:break;case`id`:e._validateIdValue(n);break;case gT:e._validateTextValue(n);break;case _T:case vT:e._validateHashValue(n),typeof n==`string`&&(this._value=bp(n));break;default:throw Error(`Invalid memo type`)}}get type(){return this._type}set type(e){throw Error(`Memo is immutable`)}get value(){switch(this._type){case hT:return null;case`id`:case gT:return this._value;case _T:case vT:return Uint8Array.from(this._value);default:throw Error(`Invalid memo type`)}}set value(e){throw Error(`Memo is immutable`)}static _validateIdValue(e){let t=Error(`Expects a uint64 as a string. Got ${e}`);if(typeof e!=`string`||!/^[0-9]+$/.test(e))throw t;let n;try{n=new ew(e)}catch{throw t}if(!n.isFinite()||n.isNaN()||n.isNegative()||!n.isInteger()||n.isGreaterThan(`18446744073709551615`))throw t}static _validateTextValue(e){if(typeof e==`string`){if(gp(e).length>28)throw Error(`Expects string or Uint8Array, max 28 bytes`)}else if(e instanceof Uint8Array){if(e.length>28)throw Error(`Expects string or Uint8Array, max 28 bytes`)}else throw Error(`Expects string or Uint8Array, max 28 bytes`)}static _validateHashValue(e){let t=Error(`Expects a 32 byte hash value or hex encoded string. Got ${String(e)}`);if(e==null)throw t;let n;if(typeof e==`string`){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw t;n=bp(e)}else if(e instanceof Uint8Array)n=e;else throw t;if(!n.length||n.length!==32)throw t}static none(){return new e(hT)}static text(t){return new e(gT,t)}static id(t){return new e(`id`,t)}static hash(t){return new e(_T,t)}static return(t){return new e(vT,t)}toXdrObject(){switch(this._type){case hT:return Xh.memoNone();case`id`:return Xh.memoId(vx.fromString(this._value));case gT:return Xh.memoText(this._value);case _T:return Xh.memoHash(new Bh(this._value));case vT:return Xh.memoReturn(new Bh(this._value));default:throw Error(`Invalid memo type`)}}static fromXdrObject(t){switch(t.type){case`memoId`:return e.id(t.value.toString());case`memoText`:return e.text(Uint8Array.from(t.text.bytes));case`memoHash`:return e.hash(t.value.toBytes());case`memoReturn`:return e.return(t.value.toBytes());case`memoNone`:return e.none()}throw Error(`Unknown type`)}toXDRObject(){return this.toXdrObject()}static fromXDRObject(t){return e.fromXdrObject(t)}},bT=new WeakSet;function xT(e,t,n){let r=typeof e==`string`,i=r?Zb.fromXdr(xp(e)):e;if(!t(i))throw Error(`Invalid TransactionEnvelope: expected an ${n} but received an ${i.type}.`);if(r||bT.has(i))return i;let a;try{a=Zb.fromXdr(i.toXdr())}catch(e){throw Error(`Invalid TransactionEnvelope: ${e instanceof Error?e.message:String(e)}`)}if(!t(a))throw Error(`TransactionEnvelope changed type in the copy: ${i.type} became ${a.type}.`);return a}var ST=class{_tx;_signatures;_fee;_networkPassphrase;constructor(e,t,n,r){if(typeof r!=`string`)throw Error(`Invalid passphrase provided to Transaction: expected a string but got a ${typeof r}`);this._networkPassphrase=r,this._tx=e,this._signatures=t,this._fee=n}get signatures(){return this._signatures}set signatures(e){throw Error(`Transaction is immutable`)}get tx(){let e=this._tx.toXdr();if(this._tx instanceof Lb)return Lb.fromXdr(e);if(this._tx instanceof pb)return pb.fromXdr(e);if(this._tx instanceof Gb)return Gb.fromXdr(e);throw Error(`Unknown transaction type`)}set tx(e){throw Error(`Transaction is immutable`)}get fee(){return this._fee}set fee(e){throw Error(`Transaction is immutable`)}get networkPassphrase(){return this._networkPassphrase}set networkPassphrase(e){throw Error(`Transaction is immutable`)}sign(...e){let t=this.hash();e.forEach(e=>{let n=e.signDecorated(t);this.signatures.push(n)})}getKeypairSignature(e){return Cp(e.sign(this.hash()))}addSignature(e=``,t=``){if(!t||typeof t!=`string`)throw Error(`Invalid signature`);if(!e||typeof e!=`string`)throw Error(`Invalid publicKey`);let n,r,i=xp(t);try{n=NC.fromPublicKey(e),r=n.signatureHint()}catch{throw Error(`Invalid publicKey`)}if(!n.verify(this.hash(),i))throw Error(`Invalid signature`);this.signatures.push(new hb({hint:r,signature:i}))}addDecoratedSignature(e){this.signatures.push(e)}signHashX(e){if(typeof e==`string`&&(e=bp(e)),e.length>64)throw Error(`preimage cannot be longer than 64 bytes`);let t=e,n=xC(e),r=n.subarray(n.length-4);this.signatures.push(new hb({hint:r,signature:t}))}hash(){return xC(this.signatureBase())}signatureBase(){throw Error(`Implement in subclass`)}toEnvelope(){throw Error(`Implement in subclass`)}toXdr(){return this.toEnvelope().toXdr(`base64`)}toXDR(){return this.toXdr()}},CT=class extends ST{_envelopeType;_source=``;_memo;_sequence;_operations;_timeBounds;_ledgerBounds;_minAccountSequence;_minAccountSequenceAge;_minAccountSequenceLedgerGap;_extraSigners;constructor(e,t){let n=xT(e,e=>gx(e,`envelopeTypeTxV0`)||gx(e,`envelopeTypeTx`),`envelopeTypeTxV0 or envelopeTypeTx`),r=n.type,i=n.value,a=i.tx,o=a.fee.toString(),s=(i.signatures||[]).slice();switch(super(a,s,o,t),this._envelopeType=r,this._memo=a.memo,this._sequence=a.seqNum.toString(),this._envelopeType){case`envelopeTypeTxV0`:this._source=J.encodeEd25519PublicKey(a.sourceAccountEd25519.toBytes());break;default:this._source=EC(a.sourceAccount)}let c=null,l=null;switch(this._envelopeType){case`envelopeTypeTxV0`:l=a.timeBounds;break;case`envelopeTypeTx`:{let e=a.cond;switch(e.type){case`precondTime`:l=e.value;break;case`precondV2`:c=e.value,l=c.timeBounds}break}}if(l&&(this._timeBounds={minTime:l.minTime.toString(),maxTime:l.maxTime.toString()}),c){let e=c.ledgerBounds;e&&(this._ledgerBounds={minLedger:e.minLedger,maxLedger:e.maxLedger});let t=c.minSeqNum;t&&(this._minAccountSequence=t.toString()),this._minAccountSequenceAge=c.minSeqAge,this._minAccountSequenceLedgerGap=c.minSeqLedgerGap,this._extraSigners=c.extraSigners}let u=a.operations||[];this._operations=u.map(e=>dT.fromXdrObject(e))}get timeBounds(){return this._timeBounds}set timeBounds(e){throw Error(`Transaction is immutable`)}get ledgerBounds(){return this._ledgerBounds}set ledgerBounds(e){throw Error(`Transaction is immutable`)}get minAccountSequence(){return this._minAccountSequence}set minAccountSequence(e){throw Error(`Transaction is immutable`)}get minAccountSequenceAge(){return this._minAccountSequenceAge}set minAccountSequenceAge(e){throw Error(`Transaction is immutable`)}get minAccountSequenceLedgerGap(){return this._minAccountSequenceLedgerGap}set minAccountSequenceLedgerGap(e){throw Error(`Transaction is immutable`)}get extraSigners(){return this._extraSigners}set extraSigners(e){throw Error(`Transaction is immutable`)}get sequence(){return this._sequence}set sequence(e){throw Error(`Transaction is immutable`)}get source(){return this._source}set source(e){throw Error(`Transaction is immutable`)}get operations(){return this._operations}set operations(e){throw Error(`Transaction is immutable`)}get memo(){return yT.fromXdrObject(this._memo)}set memo(e){throw Error(`Transaction is immutable`)}signatureBase(){let e=this.tx;this._envelopeType===`envelopeTypeTxV0`&&(e=Lb.fromXdr(lp([new Uint8Array(4),e.toXdr()])));let t=px.envelopeTypeTx(e);return new mx({networkId:Bh.fromXdr(xC(this.networkPassphrase)),taggedTransaction:t}).toXdr()}toEnvelope(){let e=this.tx.toXdr(),t=this.signatures.slice(),n;switch(this._envelopeType){case`envelopeTypeTxV0`:n=Zb.envelopeTypeTxV0(new gb({tx:pb.fromXdr(e),signatures:t}));break;case`envelopeTypeTx`:n=Zb.envelopeTypeTx(new Rb({tx:Lb.fromXdr(e),signatures:t}));break;default:throw Error(`Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ${this._envelopeType}.`)}return n}getClaimableBalanceId(e){if(!Number.isInteger(e)||e<0||e>=this.operations.length)throw RangeError(`invalid operation index`);let t=this.operations[e];if(t===void 0)throw RangeError(`invalid operation index`);try{dT.createClaimableBalance(t)}catch(e){throw TypeError(`expected createClaimableBalance, got ${t.type}: ${String(e)}`)}let n=J.decodeEd25519PublicKey(DC(this.source)),r=xC(lx.envelopeTypeOpId(new Qb({sourceAccount:dh.publicKeyTypeEd25519(n),seqNum:_x.fromString(this.sequence),opNum:e})).toXdr(`raw`));return Kg.claimableBalanceIdTypeV0(new Bh(r)).toXdr(`hex`)}},wT=globalThis.localStorage,TT=globalThis.document;Is(()=>{if(TT)for(let[e,t]of Object.entries(nc.value))TT.documentElement.style.setProperty(`--swk-${e}`,t)}),Is(()=>{if(wT&&lc.value)try{let e=wT.getItem(Ua.usedWalletsIds),t=e?new Set(JSON.parse(e)):new Set;t.has(lc.value.productId)&&t.delete(lc.value.productId),wT.setItem(Ua.usedWalletsIds,JSON.stringify([lc.value.productId,...t]))}catch(e){console.error(e)}}),Is(()=>{wT&&(ac.value?wT.setItem(Ua.activeAddress,ac.value):wT.removeItem(Ua.activeAddress),oc.value?wT.setItem(Ua.selectedModuleId,oc.value):wT.removeItem(Ua.selectedModuleId),dc.value!==void 0&&wT.setItem(Ua.hardwareWalletPaths,JSON.stringify(dc.value)),mc.value!==void 0&&wT.setItem(Ua.wcSessionPaths,JSON.stringify(mc.value)))});var ET=pu,DT=Ld,OT=`LEDGER`,kT=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HW_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:OT}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Ledger`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://www.ledger.com/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/ledger.png`}),Object.defineProperty(this,"_transport",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async transport(){if(!await DT.isSupported())throw Error(`Ledger can not be used with this device.`);if(this._transport||=await DT.create(),!this._transport)throw Error(`Ledger Transport was not created.`);return this._transport}async disconnect(){this._transport?.close(),this._transport=void 0}async isAvailable(){return DT.isSupported()}async runChecks(){if(!await this.isAvailable())throw Error(`Ledger wallets can not be used`)}async getAddress(e){await this.runChecks();try{let t=new ET(await this.transport()),n=e?.path||fc.value;n||=fc.value;let r=await t.getPublicKey(n);return{address:J.encodeEd25519PublicKey(r.rawPublicKey)}}catch(e){throw H(e)}}async getAddresses(e=0){let t=new ET(await this.transport()),n=e*10,r=[];for(let e=0;e<10;e++){let i=await t.getPublicKey(`44'/148'/${e+n}'`);r.push({publicKey:J.encodeEd25519PublicKey(i.rawPublicKey),index:e+n})}return dc.value=r,r}async signTransaction(e,t){await this.runChecks();let n=await this.transport();if(!n)throw Error(`Transport not possible to load.`);let r=new ET(n),i,a;if(t?.path){i=t.path;let e=await r.getPublicKey(i);a=J.encodeEd25519PublicKey(e.rawPublicKey)}else if(t?.address){let e=dc.value.find(e=>e.publicKey===t.address);if(!e)throw Error(`This address has not been loaded from this ledger`);i=`44'/148'/${e.index}'`,a=e.publicKey}else{if(i=fc.value,!i)throw Error("There is no path available, please call the `getAddress` method first.");let e=await r.getPublicKey(i);a=J.encodeEd25519PublicKey(e.rawPublicKey)}let o=t?.networkPassphrase||tc.value;if(!o)throw Error(`You need to provide or set a network passphrase`);let s=new CT(e,o),c=t?.nonBlindTx?await r.signTransaction(i,s.signatureBase()):await r.signHash(i,s.hash());return s.addSignature(a,Qc(c.signature)),{signedTxXdr:s.toXdr(),signerAddress:a}}async signAuthEntry(){throw{code:-3,message:`Ledger Wallets do not support the "signAuthEntry" function`}}async signMessage(){throw{code:-3,message:`Ledger Wallets do not support the "signMessage" function`}}async getNetwork(){throw{code:-3,message:`Ledger Wallets do not support the "getNetwork" function`}}},AT=4294967295,jT=Math.floor(Math.random()*AT),MT=()=>(jT=(jT+1)%AT,jT),NT=()=>typeof chrome<`u`&&!!chrome.runtime&&typeof chrome.runtime.connect==`function`;async function PT(e,t={}){let{maxRetries:n=10,retryDelay:r=200,timeoutErrorClass:i}=t;for(let t=0;t<=n;t++)try{return await e()}catch(e){if(t>=n)throw e;if(i&&typeof i==`function`&&e instanceof i)continue;await new Promise(e=>setTimeout(e,r))}throw Error(`Max retries exceeded`)}function FT(e,t,n){return t===-1?e:new Promise((r,i)=>{let a=setTimeout(()=>{i(n?n():Error(`Timeout after ${t}ms`))},t);e.then(e=>{clearTimeout(a),r(e)}).catch(e=>{clearTimeout(a),i(e)})})}var IT=class extends Error{constructor(e){super(e.message),this.name=this.constructor.name,this.cause=e,Object.setPrototypeOf(this,this.constructor.prototype)}},LT=class extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.cause=t,Object.setPrototypeOf(this,this.constructor.prototype)}},RT=class extends LT{constructor(e=`Transport request timed out`,t){super(e,t)}};function zT({transport:e}){let t,n;async function r(){e.isConnected()||(n||=e.connect(),await n)}async function i(){return t||=(async()=>{await r(),await PT(()=>e.request({method:`wallet_getSession`},{timeout:e.warmupTimeout??1e3}))})(),await t}return r(),{createSession:async t=>(await i(),await BT({transport:e,method:`wallet_createSession`,params:t})),getSession:async()=>(await i(),await BT({transport:e,method:`wallet_getSession`})),revokeSession:async r=>{await i(),t=void 0,n=void 0,await BT({transport:e,method:`wallet_revokeSession`,params:r}),await e.disconnect()},invokeMethod:async t=>(await i(),await BT({transport:e,method:`wallet_invokeMethod`,params:t})),extendsRpcApi:()=>zT({transport:e}),onNotification:t=>e.onNotification(t)}}async function BT({transport:e,method:t,params:n,timeout:r}){let i=await e.request({method:t,params:n},{timeout:r});if(i?.error)throw new IT(i.error);return i.result}var VT=`caip-348`,HT=`metamask-contentscript`,UT=`metamask-multichain-provider`,WT=`metamask-provider`;async function GT(){return new Promise((e,t)=>{let n=t=>{if(qT(t)){let i=t?.data?.data?.data;if(i?.method===`METAMASK_EXTENSION_CONNECT_CAN_RETRY`)KT();else if(i?.result?.extensionId){let t=i?.result?.extensionId;e(t),window.removeEventListener(`message`,n),clearTimeout(r)}}},r=setTimeout(()=>{window.removeEventListener(`message`,n),t(Error(`MetaMask extension not found`))},1e4);window.addEventListener(`message`,n),KT()})}function KT(){window.postMessage({target:HT,data:{name:WT,data:{method:`metamask_getProviderState`}}},location.origin)}function qT(e){let{target:t,data:n}=e.data;return t===`metamask-inpage`&&n?.name===`metamask-provider`&&e.origin===location.origin}async function JT({timeout:e=2e3}={}){return new Promise(t=>{let n=e=>{e.detail.info.rdns.includes(`io.metamask`)&&(window.removeEventListener(`eip6963:announceProvider`,n),clearTimeout(r),t(!0))},r=setTimeout(()=>{window.removeEventListener(`eip6963:announceProvider`,n),t(!1)},e);window.addEventListener(`eip6963:announceProvider`,n),window.dispatchEvent(new Event(`eip6963:requestProvider`))})}function YT(e={}){let{extensionId:t}=e,{defaultTimeout:n=-1,warmupTimeout:r=200}=e,i,a=MT(),o=new Map,s=new Set;function c(e){let{data:t}=e;if(t?.id===null||t?.id===void 0)l(t);else if(o.has(t.id)){let e=o.get(t.id);o.delete(t.id),e?.(t)}}function l(e){for(let t of s)try{t(e)}catch(e){console.log(`[ChromeTransport] notifyCallbacks error:`,e)}}function u(){s.clear()}return{warmupTimeout:r,connect:async()=>{try{t||=await GT();let e=chrome.runtime.connect(t),n=!0;if(e.onDisconnect.addListener(()=>{console.log(`[ChromeTransport] chromePort disconnected`),i=void 0,n=!1}),await new Promise(e=>setTimeout(e,10)),!n)throw Error(`No extension found with id: ${t}`);e.onMessage.addListener(c),i=e}catch(e){throw new LT(`Failed to connect to MetaMask`,e)}},disconnect:async()=>{if(i)try{i.disconnect(),i=void 0,u(),o.clear()}catch(e){console.log(`[ChromeTransport] disconnect error:`,e)}},isConnected:()=>i!==void 0,request:async(e,t={})=>{let{timeout:r=n}=t,s=i;if(!s)throw new LT(`Chrome port not connected`);let c=a++,l={id:c,jsonrpc:`2.0`,...e};try{return await FT(new Promise(e=>{o.set(c,e),s.postMessage({type:VT,data:l})}),r,()=>new RT)}catch(e){throw o.has(c)&&o.delete(c),e}},onNotification:e=>(s.add(e),()=>{s.delete(e)})}}function XT(e={}){let{defaultTimeout:t=-1,warmupTimeout:n=200}=e,r=null,i=new Map,a=new Set;function o(e){for(let t of a)try{t(e)}catch(e){console.log(`[WindowPostMessageTransport] notifyCallbacks error:`,e)}}function s(e){if(e?.id===null||e?.id===void 0)o(e);else if(i.has(e.id)){let t=i.get(e.id);i.delete(e.id),t?.(e)}}function c(e){window.postMessage({target:HT,data:{name:UT,data:e}},location.origin)}async function l(){r&&=(window.removeEventListener(`message`,r),null),i.clear(),a.clear()}let u=()=>!!r;return{warmupTimeout:n,connect:async()=>{u()&&await l(),r=e=>{let{target:t,data:n}=e.data;t===`metamask-inpage`&&n?.name===`metamask-multichain-provider`&&e.origin===location.origin&&s(n.data)},window.addEventListener(`message`,r)},disconnect:l,isConnected:u,request:(e,n={})=>{let{timeout:r=t}=n;if(!u())throw new LT(`Transport not connected`);let a=MT(),o={jsonrpc:`2.0`,id:a,...e};return FT(new Promise(e=>{i.set(a,t=>e(t)),c(o)}),r,()=>new RT).catch(e=>{throw i.has(a)&&i.delete(a),e})},onNotification:e=>(a.add(e),()=>{a.delete(e)})}}function ZT({extensionId:e,defaultTimeout:t,warmupTimeout:n}={}){return NT()?YT({extensionId:e,defaultTimeout:t,warmupTimeout:n}):XT({defaultTimeout:t,warmupTimeout:n})}var QT=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIzIiBoZWlnaHQ9IjIzIiB4PSIzLjUiIHk9IjMuNSIgdmlld0JveD0iMCAwIDE0MS41MSAxMzYuNDIiPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im0xMzIuMjQgMTMxLjc1LTMwLjQ4LTkuMDctMjIuOTkgMTMuNzQtMTYuMDMtLjAxLTIzLTEzLjc0LTMwLjQ3IDkuMDhMMCAxMDAuNDdsOS4yNy0zNC43M0wwIDM2LjQgOS4yNyAwbDQ3LjYgMjguNDRoMjcuNzZMMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2IDkuMjcgMzQuNzItOS4yNyAzMS4zWiIvPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im05LjI3IDAgNDcuNjEgMjguNDZMNTQuOTggNDggOS4yOSAwWm0zMC40NyAxMDAuNDggMjAuOTUgMTUuOTUtMjAuOTUgNi4yNHYtMjIuMlpNNTkuMDEgNzQuMSA1NSA0OCAyOS4yMiA2NS43NWgtLjAybC4wOCAxOC4yNyAxMC40NS05LjkyaDE5LjI5Wk0xMzIuMjUgMGwtNDcuNiAyOC40Nkw4Ni41MSA0OGw0NS43Mi00OFptLTMwLjQ3IDEwMC40OC0yMC45NCAxNS45NSAyMC45NCA2LjI0di0yMi4yWm0xMC41My0zNC43M0w4Ni41MyA0OCA4Mi41IDc0LjFoMTkuMjdsMTAuNDYgOS45LjA3LTE4LjI2WiIvPjxwYXRoIGZpbGw9IiNFMzQ4MDciIGQ9Im0zOS43MyAxMjIuNjctMzAuNDYgOS4wOEwwIDEwMC40OGgzOS43M3YyMi4yWk01OS4wMiA3NC4xbDUuODIgMzcuNzEtOC4wNy0yMC45Ny0yNy40OS02LjgyIDEwLjQ2LTkuOTJINTlabTQyLjc2IDQ4LjU5IDMwLjQ3IDkuMDcgOS4yNy0zMS4yN2gtMzkuNzR6TTgyLjUgNzQuMDlsLTUuODIgMzcuNzEgOC4wNi0yMC45NyAyNy41LTYuODItMTAuNDctOS45MnoiLz48cGF0aCBmaWxsPSIjRkY4RDVEIiBkPSJtMCAxMDAuNDcgOS4yNy0zNC43M0gyOS4ybC4wNyAxOC4yNyAyNy41IDYuODIgOC4wNiAyMC45Ny00LjE1IDQuNjItMjAuOTQtMTUuOTZIMFptMTQxLjUgMC05LjI2LTM0LjczaC0xOS45M2wtLjA3IDE4LjI3LTI3LjUgNi44Mi04LjA2IDIwLjk3IDQuMTUgNC42MiAyMC45NC0xNS45NmgzOS43NFpNODQuNjQgMjguNDRINTYuODhsLTEuODkgMTkuNTQgOS44NCA2My44aDExLjg1bDkuODUtNjMuOC0xLjktMTkuNTRaIi8+PHBhdGggZmlsbD0iIzY2MTgwMCIgZD0iTTkuMjcgMCAwIDM2LjM4bDkuMjcgMjkuMzZIMjkuMkw1NC45OCA0OHptNDMuOTggODEuNjdoLTkuMDNsLTQuOTIgNC44MSAxNy40NyA0LjMzLTMuNTItOS4xNVpNMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2aC0xOS45M0w4Ni41MyA0OHpNODguMjcgODEuNjdoOS4wNGw0LjkyIDQuODItMTcuNDkgNC4zNCAzLjUzLTkuMTdabS05LjUgNDIuMyAyLjA2LTcuNTQtNC4xNS00LjYySDY0LjgybC00LjE0IDQuNjIgMi4wNSA3LjU0Ii8+PHBhdGggZmlsbD0iI0MwQzRDRCIgZD0iTTc4Ljc3IDEyMy45N3YxMi40NUg2Mi43NHYtMTIuNDVoMTYuMDJaIi8+PHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0IDEyMi42NiAyMyAxMy43NnYtMTIuNDZsLTIuMDUtNy41NHptNjIuMDMgMC0yMyAxMy43NnYtMTIuNDZsMi4wNi03LjU0eiIvPjwvc3ZnPjwvc3ZnPg==`,$T;(function(e){e.PUBNET=`stellar:pubnet`})($T||={});var eE=[`signMessage`,`signTransaction`,`signAuthEntry`],tE={[$T.PUBNET]:`Public Global Stellar Network ; September 2015`},nE={[$T.PUBNET]:`PUBLIC`},rE={GENERIC:-1,NOT_CONNECTED:-3,UNSUPPORTED_NETWORK:-4};function iE(e){let[,,t]=e.split(`:`);if(!t)throw Error(`Invalid CAIP account ID: ${e}`);return t}function aE(e){let t=Object.entries(tE).find(([,t])=>t===e);if(!t)throw Error(`Unknown network passphrase: ${e}`);return t[0]}function oE(e){let{method:t,params:n}=e??{};return t===`wallet_sessionChanged`&&typeof n==`object`&&!!n}var sE=class{constructor(){this.name=`MetaMask`,this.url=`https://metamask.io`,this.icon=QT,this._address=null,this._connected=!1,this._listeners=new Map,this._transport=ZT(),this._client=zT({transport:this._transport}).extendsRpcApi(),this.startSessionListener(),this._restorePromise=this.tryRestoringSession().then(()=>{this._address&&(this._connected=!0,this.emit(`connect`,this._address))}).catch(e=>{console.warn(`Failed to auto-restore Stellar MetaMask session:`,e)})}async requestAccess(){try{return await this._restorePromise,this._address||await this.createSession($T.PUBNET),this._address?(this._connected=!0,this.startSessionListener(),this.emit(`connect`,this._address),{address:this._address}):{address:``,error:{code:rE.GENERIC,message:`No address selected`}}}catch(e){return{address:``,error:cE(e)}}}async disconnect(e={}){let{revokeSession:t=!0}=e;try{let e=this._connected||!!this._address;return this._address=null,this._scope=void 0,this._connected=!1,e&&this.emit(`disconnect`,void 0),t&&(this._removeSessionChangedListener?.(),this._removeSessionChangedListener=void 0,await this._client.revokeSession({scopes:[$T.PUBNET]})),{}}catch(e){return{error:cE(e)}}}async getAddress(){return this._address?{address:this._address}:{address:``,error:{code:rE.NOT_CONNECTED,message:`Not connected. Call requestAccess() first.`}}}async getNetwork(){return this._scope?{network:nE[this._scope],networkPassphrase:tE[this._scope]}:{network:``,networkPassphrase:``,error:{code:rE.NOT_CONNECTED,message:`Not connected. Call requestAccess() first.`}}}async isAllowed(){try{let e=await this._client.getSession();return{isAllowed:!!(e&&Object.keys(e.sessionScopes).some(e=>e.startsWith(`stellar:`)))}}catch(e){return{isAllowed:!1,error:cE(e)}}}async isConnected(){return{isConnected:this._connected&&!!this._address}}async signTransaction(e,t){try{if(t?.submit!==void 0)throw Error(`The "submit" option is not supported. Submit the transaction yourself after signing.`);if(t?.submitUrl!==void 0)throw Error(`The "submitUrl" option is not supported. Submit the transaction yourself after signing.`);let n=this.resolveScopeForCall(t?.networkPassphrase);await this.ensureScopeInSession(n);let r=await this._client.invokeMethod({scope:n,request:{method:`signTransaction`,params:{xdr:e,opts:this.getSep43SignOptions(n,t)}}});return{signedTxXdr:r.signedTxXdr,signerAddress:r.signerAddress}}catch(e){return{signedTxXdr:``,signerAddress:``,error:cE(e)}}}async signAuthEntry(e,t){try{let n=this.resolveScopeForCall(t?.networkPassphrase);await this.ensureScopeInSession(n);let r=await this._client.invokeMethod({scope:n,request:{method:`signAuthEntry`,params:{authEntry:e,opts:this.getSep43SignOptions(n,t)}}});return{signedAuthEntry:r.signedAuthEntry,signerAddress:r.signerAddress}}catch(e){return{signedAuthEntry:null,signerAddress:``,error:cE(e)}}}async signMessage(e,t){try{let n=this.resolveScopeForCall(t?.networkPassphrase);await this.ensureScopeInSession(n);let r=await this._client.invokeMethod({scope:n,request:{method:`signMessage`,params:{message:e,opts:this.getSep43SignOptions(n,t)}}});return{signedMessage:r.signedMessage,signerAddress:r.signerAddress}}catch(e){return{signedMessage:``,signerAddress:``,error:cE(e)}}}async connect(){await this.requestAccess()}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}emit(e,t){for(let n of this._listeners.get(e)??[])n(t)}static async isMetaMaskAvailable(){return JT()}startSessionListener(){this._removeSessionChangedListener||=this._client.onNotification(this.handleSessionChangedEvent.bind(this))}resolveScopeForCall(e){if(e)return aE(e);if(!this._scope)throw{code:rE.NOT_CONNECTED,message:`Not connected. Call requestAccess() first.`};return this._scope}async ensureScopeInSession(e){let t=(await this._client.getSession())?.sessionScopes[e],n=this._address&&t?.accounts?.some(e=>e.includes(this._address)),r=eE.every(e=>t?.methods?.includes(e));(!n||!r)&&await this.createSession(e,this._address?[this._address]:void 0)}getSep43SignOptions(e,t){let n=t?.address??this._address??void 0;return{networkPassphrase:t?.networkPassphrase??tE[e],...n?{address:n}:{}}}async tryRestoringSession(){try{let e=await this._client.getSession();if(!e)return;this.updateSession(e)}catch(e){console.warn(`Failed to restore Stellar MetaMask session:`,e)}}async createSession(e,t){let n=await this._client.createSession({optionalScopes:{[e]:{accounts:t?t.map(t=>`${e}:${t}`):[],methods:[...eE],notifications:[]}}});this.updateSession(n)}updateSession(e){let t=this.selectScopeWithPriority(e);if(!t){this.clearSession();return}let n=e?.sessionScopes[t]?.accounts?.[0];n?(this.setAddress(iE(n)),this.setScope(t)):this.clearSession()}clearSession(){this.setAddress(null),this.setScope(void 0)}selectScopeWithPriority(e){return new Set(Object.keys(e?.sessionScopes??{})).has($T.PUBNET)?$T.PUBNET:void 0}setAddress(e){this._address!==e&&(this._connected=!!e,this._address=e,e&&this.emit(`accountsChanged`,e))}setScope(e){this._scope!==e&&(this._scope=e,e&&this.emit(`networkChanged`,{network:nE[e],networkPassphrase:tE[e]}))}async handleSessionChangedEvent(e){oE(e)&&(this.selectScopeWithPriority(e.params)?this.updateSession(e.params):await this.disconnect({revokeSession:!1}))}};function cE(e){if(e instanceof Error)return e.message.startsWith(`Unknown network passphrase`)?{code:rE.UNSUPPORTED_NETWORK,message:e.message}:{code:rE.GENERIC,message:e.message};if(typeof e==`object`&&e&&`message`in e){let t=e;return{code:typeof t.code==`number`?t.code:rE.GENERIC,message:String(t.message)}}return{code:rE.GENERIC,message:String(e)}}var lE=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];o===3?r[0]=s:o===4?r[1]=Object.assign(r[1]||{},s):o===5?(r[1]=r[1]||{})[t[++a]]=s:o===6?r[1][t[++a]]+=s+``:o?(i=e.apply(s,lE(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},uE=new Map;function dE(e){var t=uE.get(this);return t||(t=new Map,uE.set(this,t)),(t=lE(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i=``,a=``,o=[0],s=function(e){r===1&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,``)))?o.push(0,e,i):r===3&&(e||i)?(o.push(3,e,i),r=2):r===2&&i===`...`&&e?o.push(4,e,0):r===2&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&r===5)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=``},c=0;c<e.length;c++){c&&(r===1&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],r===1?t===`<`?(s(),o=[o],r=3):i+=t:r===4?i===`--`&&t===`>`?(r=1,i=``):i=t+i[0]:a?t===a?a=``:i+=t:t===`"`||t===`'`?a=t:t===`>`?(s(),r=1):r&&(t===`=`?(r=5,n=i,i=``):t===`/`&&(r<5||e[c][l+1]===`>`)?(s(),r===3&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):t===` `||t===` `||t===`
5
+ `||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}var fE=dE.bind(ho),pE;function mE(e){return[...e.v,(e.i?`!`:``)+e.n].join(`:`)}function hE(e,t=`,`){return e.map(mE).join(t)}var gE=typeof CSS<`u`&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,`\\$&`).replace(/^\d/,`\\3$& `));function _E(e){for(var t=9,n=e.length;n--;)t=Math.imul(t^e.charCodeAt(n),1597334677);return`#`+((t^t>>>9)>>>0).toString(36)}function vE(e,t=`@media `){return t+yE(e).map(e=>(typeof e==`string`&&(e={min:e}),e.raw||Object.keys(e).map(t=>`(${t}-width:${e[t]})`).join(` and `))).join(`,`)}function yE(e=[]){return Array.isArray(e)?e:e==null?[]:[e]}function bE(e){return e}function xE(){}var SE={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function CE(e){return e.match(/[-=:;]/g)?.length||0}function wE(e){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(e)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(CE(e),15)<<18}var TE=[`rst-c`,`st-ch`,`h-chi`,`y-lin`,`nk`,`sited`,`ecked`,`pty`,`ad-on`,`cus-w`,`ver`,`cus`,`cus-v`,`tive`,`sable`,`tiona`,`quire`];function EE({n:e,i:t,v:n=[]},r,i,a){e&&=mE({n:e,i:t,v:n}),a=[...yE(a)];for(let e of n){let t=r.theme(`screens`,e);for(let n of yE(t&&vE(t)||r.v(e))){var o;a.push(n),i|=t?67108864|wE(n):e==`dark`?1073741824:n[0]==`@`?wE(n):(o=n,1<<~(/:([a-z-]+)/.test(o)&&~TE.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:e,p:i,r:a,i:t}}var DE=new Map;function OE(e){if(e.d){let t=[],n=kE(e.r.reduce((e,n)=>n[0]==`@`?(t.push(n),e):n?kE(e,e=>kE(n,t=>{let n=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(t);if(n){let r=e.indexOf(n[1]);return~r?e.slice(0,r)+n[0]+e.slice(r+n[1].length):AE(e,t)}return AE(t,e)})):e,`&`),t=>AE(t,e.n?`.`+gE(e.n):``));return n&&t.push(n.replace(/:merge\((.+?)\)/g,`$1`)),t.reduceRight((e,t)=>t+`{`+e+`}`,e.d)}}function kE(e,t){return e.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(e,n,r)=>t(n)+r)}function AE(e,t){return e.replace(/&/g,t)}var jE=new Intl.Collator(`en`,{numeric:!0});function ME(e,t){for(var n=0,r=e.length;n<r;){let i=r+n>>1;0>=NE(e[i],t)?n=i+1:r=i}return r}function NE(e,t){let n=e.p&SE.o;return n==(t.p&SE.o)&&(n==SE.b||n==SE.o)?0:e.p-t.p||e.o-t.o||jE.compare(PE(e.n),PE(t.n))||jE.compare(FE(e.n),FE(t.n))}function PE(e){return(e||``).split(/:/).pop().split(`/`).pop()||`\0`}function FE(e){return(e||``).replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+`\0`}function IE(e,t){return Math.round(parseInt(e,16)*t)}function LE(e,t={}){if(typeof e==`function`)return e(t);let{opacityValue:n=`1`,opacityVariable:r}=t,i=r?`var(${r})`:n;if(e.includes(`<alpha-value>`))return e.replace(`<alpha-value>`,i);if(e[0]==`#`&&(e.length==4||e.length==7)){let t=(e.length-1)/3,n=[17,1,.062272][t-1];return`rgba(${[IE(e.substr(1,t),n),IE(e.substr(1+t,t),n),IE(e.substr(1+2*t,t),n),i]})`}return i==`1`?e:i==`0`?`#0000`:e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function RE(e,t,n,r,i=[]){return function e(t,{n,p:r,r:i=[],i:a},o){let s=[],c=``,l=0,u=0;for(let p in t||{}){var d,f;let m=t[p];if(p[0]==`@`){if(!m)continue;if(p[1]==`a`){s.push(...HE(n,r,qE(``+m),o,r,i,a,!0));continue}if(p[1]==`l`){for(let t of yE(m))s.push(...e(t,{n,p:(d=SE[p[7]],r&~SE.o|d),r:p[7]==`d`?[]:i,i:a},o));continue}if(p[1]==`i`){s.push(...yE(m).map(e=>({p:-1,o:0,r:[],d:p+` `+e})));continue}if(p[1]==`k`){s.push({p:SE.d,o:0,r:[p],d:e(m,{p:SE.d},o).map(OE).join(``)});continue}if(p[1]==`f`){s.push(...yE(m).map(t=>({p:SE.d,o:0,r:[p],d:e(t,{p:SE.d},o).map(OE).join(``)})));continue}}if(typeof m!=`object`||Array.isArray(m))p==`label`&&m?n=m+_E(JSON.stringify([r,a,t])):(m||m===0)&&(p=p.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),u+=1,l=Math.max(l,(f=p)[0]==`-`?0:CE(f)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(f)?+!!RegExp.$1||-!!RegExp.$2:0)+1),c+=(c?`;`:``)+yE(m).map(e=>o.s(p,zE(``+e,o.theme)+(a?` !important`:``))).join(`;`));else if(p[0]==`@`||p.includes(`&`)){let t=r;p[0]==`@`&&(p=p.replace(/\bscreen\(([^)]+)\)/g,(e,n)=>{let r=o.theme(`screens`,n);return r?(t|=67108864,vE(r,``)):e}),t|=wE(p)),s.push(...e(m,{n,p:t,r:[...i,p],i:a},o))}else s.push(...e(m,{p:r,r:[...i,p]},o))}return s.unshift({n,p:r,o:Math.max(0,15-u)+1.5*Math.min(l||15,15),r:i,d:c}),s.sort(NE)}(e,EE(t,n,r,i),n)}function zE(e,t){return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(e,n,r,i,a=``)=>{let o=t(r,a);return typeof o==`function`&&/color|fill|stroke/i.test(r)?LE(o):``+yE(o).filter(e=>Object(e)!==e)})}function BE(e,t){let n,r=[];for(let i of e)i.d&&i.n?n?.p==i.p&&``+n.r==``+i.r?(n.c=[n.c,i.c].filter(Boolean).join(` `),n.d=n.d+`;`+i.d):r.push(n={...i,n:i.n&&t}):r.push({...i,n:i.n&&t});return r}function VE(e,t,n=SE.u,r,i){let a=[];for(let o of e)for(let e of function(e,t,n,r,i){e={...e,i:e.i||i};let a=function(e,t){let n=DE.get(e.n);return n?n(e,t):t.r(e.n,e.v[0]==`dark`)}(e,t);return a?typeof a==`string`?({r,p:n}=EE(e,t,n,r),BE(VE(qE(a),t,n,r,e.i),e.n)):Array.isArray(a)?a.map(e=>{var t,i;return{o:0,...e,r:[...yE(r),...yE(e.r)],p:(t=n,i=e.p??n,t&~SE.o|i)}}):RE(a,e,t,n,r):[{c:mE(e),p:0,o:0,r:[]}]}(o,t,n,r,i))a.splice(ME(a,e),0,e);return a}function HE(e,t,n,r,i,a,o,s){return BE((s?n.flatMap(e=>VE([e],r,i,a,o)):VE(n,r,i,a,o)).map(e=>e.p&SE.o&&(e.n||t==SE.b)?{...e,p:e.p&~SE.o|t,o:0}:e),e)}function UE(e,t,n,r){return DE.set(e,(e,i)=>{let{n:a,p:o,r:s,i:c}=EE(e,i,t);return n&&HE(a,t,n,i,o,s,c,r)}),e}function WE(e,t,n){if(e[e.length-1]!=`(`){let n=[],r=!1,i=!1,a=``;for(let t of e)if(!(t==`(`||/[~@]$/.test(t))){if(t[0]==`!`&&(t=t.slice(1),r=!r),t.endsWith(`:`)){n[t==`dark:`?`unshift`:`push`](t.slice(0,-1));continue}t[0]==`-`&&(t=t.slice(1),i=!i),t.endsWith(`-`)&&(t=t.slice(0,-1)),t&&t!=`&`&&(a+=(a&&`-`)+t)}a&&(i&&(a=`-`+a),t[0].push({n:a,v:n.filter(GE),i:r}))}}function GE(e,t,n){return n.indexOf(e)==t}var KE=new Map;function qE(e){let t=KE.get(e);if(!t){let n=[],r=[[]],i=0,a=0,o=null,s=0,c=(t,a=0)=>{i!=s&&(n.push(e.slice(i,s+a)),t&&WE(n,r)),i=s+1};for(;s<e.length;s++){let t=e[s];if(a)e[s-1]!=`\\`&&(a+=+(t==`[`)||-(t==`]`));else if(t==`[`)a+=1;else if(o)e[s-1]!=`\\`&&o.test(e.slice(s))&&(o=null,i=s+RegExp.lastMatch.length);else if(t==`/`&&e[s-1]!=`\\`&&(e[s+1]==`*`||e[s+1]==`/`))o=e[s+1]==`*`?/^\*\//:/^[\r\n]/;else if(t==`(`)c(),n.push(t);else if(t==`:`)e[s+1]!=`:`&&c(!1,1);else if(/[\s,)]/.test(t)){c(!0);let e=n.lastIndexOf(`(`);if(t==`)`){let t=n[e-1];if(/[~@]$/.test(t)){let i=r.shift();n.length=e,WE([...n,`#`],r);let{v:a}=r[0].pop();for(let e of i)e.v.splice(+(e.v[0]==`dark`)-(a[0]==`dark`),a.length);WE([...n,UE(t.length>1?t.slice(0,-1)+_E(JSON.stringify([t,i])):t+`(`+hE(i)+`)`,SE.a,i,/@$/.test(t))],r)}e=n.lastIndexOf(`(`,e-1)}n.length=e+1}else/[~@]/.test(t)&&e[s+1]==`(`&&r.unshift([])}c(!0),KE.set(e,t=r[0])}return t}function JE(e,t,n){return t.reduce((t,r,i)=>t+n(r)+e[i+1],e[0])}function YE(e,t){return Array.isArray(e)&&Array.isArray(e.raw)?JE(e,t,e=>XE(e).trim()):t.filter(Boolean).reduce((e,t)=>e+XE(t),e?XE(e):``)}function XE(e){let t,n=``;if(e&&typeof e==`object`){if(Array.isArray(e))(t=YE(e[0],e.slice(1)))&&(n+=` `+t);else for(let t in e)e[t]&&(n+=` `+t)}else e!=null&&typeof e!=`boolean`&&(n+=` `+e);return n}function ZE(e,t){return Array.isArray(e)?$E(JE(e,t,e=>e!=null&&typeof e!=`boolean`?e:``)):typeof e==`string`?$E(e):[e]}var QE=/ *(?:(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}))/g;function $E(e){let t;e=e.replace(/\/\*[^]*?\*\/|\s\s+|\n/gm,` `);let n=[{}],r=[n[0]],i=[];for(;t=QE.exec(e);)t[4]&&(n.shift(),i.shift()),t[3]?(i.unshift(t[3]),n.unshift({}),r.push(i.reduce((e,t)=>({[t]:e}),n[0]))):t[4]||(n[0][t[1]]&&(n.unshift({}),r.push(i.reduce((e,t)=>({[t]:e}),n[0]))),n[0][t[1]]=t[2]);return r}function eD(e,...t){var n;let r=ZE(e,t),i=(r.find(e=>e.label)?.label||`css`)+_E(JSON.stringify(r));return n=(e,t)=>BE(r.flatMap(n=>RE(n,e,t,SE.o)),i),DE.set(i,n),i}function Z(e,t,n){return[e,tD(t,n)]}function tD(e,t){return typeof e==`function`?e:typeof e==`string`&&/^[\w-]+$/.test(e)?(n,r)=>({[e]:t?t(n,r):nD(n,1)}):t=>e||{[t[1]]:nD(t,2)}}function nD(e,t,n=e.slice(t).find(Boolean)||e.$$||e.input){return e.input[0]==`-`?`calc(${n} * -1)`:n}function Q(e,t,n,r){return[e,rD(t,n,r)]}function rD(e,t,n){let r=typeof t==`string`?(e,r)=>({[t]:n?n(e,r):e._}):t||(({1:e,_:t},n,r)=>({[e||r]:t}));return(t,n)=>{let i=lD(e||t[1]),a=n.theme(i,t.$$)??cD(t.$$,i,n);if(a!=null)return t._=nD(t,0,a),r(t,n,i)}}function iD(e,t={},n){return[e,aD(t,n)]}function aD(e={},t){return(n,r)=>{let{section:i=lD(n[0]).replace(`-`,``)+`Color`}=e,[a,o]=oD(n.$$);if(!a)return;let s=r.theme(i,a)||cD(a,i,r);if(!s||typeof s==`object`)return;let{opacityVariable:c=`--tw-${n[0].replace(/-$/,``)}-opacity`,opacitySection:l=i.replace(`Color`,`Opacity`),property:u=i,selector:d}=e,f=r.theme(l,o||`DEFAULT`)||o&&cD(o,l,r),p=t||(({_:e})=>{let t=sD(u,e);return d?{[d]:t}:t});n._={value:LE(s,{opacityVariable:c||void 0,opacityValue:f||void 0}),color:e=>LE(s,e),opacityVariable:c||void 0,opacityValue:f||void 0};let m=p(n,r);if(!n.dark){let e=r.d(i,a,s);e&&e!==s&&(n._={value:LE(e,{opacityVariable:c||void 0,opacityValue:f||`1`}),color:t=>LE(e,t),opacityVariable:c||void 0,opacityValue:f||void 0},m={"&":m,[r.v(`dark`)]:p(n,r)})}return m}}function oD(e){return(e.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function sD(e,t){let n={};return typeof t==`string`?n[e]=t:(t.opacityVariable&&t.value.includes(t.opacityVariable)&&(n[t.opacityVariable]=t.opacityValue||`1`),n[e]=t.value),n}function cD(e,t,n){if(e[0]==`[`&&e.slice(-1)==`]`){if(e=uD(zE(e.slice(1,-1),n.theme)),!t)return e;if(!(/color|fill|stroke/i.test(t)&&!(/^color:/.test(e)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e))||/image/i.test(t)&&!(/^image:/.test(e)||/^[a-z-]+\(/.test(e))||/weight/i.test(t)&&!(/^(number|any):/.test(e)||/^\d+$/.test(e))||/position/i.test(t)&&/^(length|size):/.test(e)))return e.replace(/^[a-z-]+:/,``)}}function lD(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function uD(e){return e.includes(`url(`)?e.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t=``,n,r=``)=>uD(t)+n+uD(r)):e.replace(/(^|[^\\])_+/g,(e,t)=>t+` `.repeat(e.length-t.length)).replace(/\\_/g,`_`).replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,`$1 $2 `))}function dD(e,...t){return hE(qE(YE(e,t)),` `)}function fD({presets:e=[],...t}){let n={darkMode:void 0,darkColor:void 0,preflight:!1!==t.preflight&&[],theme:{},variants:yE(t.variants),rules:yE(t.rules),ignorelist:yE(t.ignorelist),hash:void 0,stringify:(e,t)=>e+`:`+t,finalize:[]};for(let r of yE([...e,{darkMode:t.darkMode,darkColor:t.darkColor,preflight:!1!==t.preflight&&yE(t.preflight),theme:t.theme,hash:t.hash,stringify:t.stringify,finalize:t.finalize}])){let{preflight:e,darkMode:t=n.darkMode,darkColor:i=n.darkColor,theme:a,variants:o,rules:s,ignorelist:c,hash:l=n.hash,stringify:u=n.stringify,finalize:d}=typeof r==`function`?r(n):r;n={preflight:!1!==n.preflight&&!1!==e&&[...n.preflight,...yE(e)],darkMode:t,darkColor:i,theme:{...n.theme,...a,extend:{...n.theme.extend,...a?.extend}},variants:[...n.variants,...yE(o)],rules:[...n.rules,...yE(s)],ignorelist:[...n.ignorelist,...yE(c)],hash:l,stringify:u,finalize:[...n.finalize,...yE(d)]}}return n}function pD(e,t,n,r,i,a){for(let o of t){let t=n.get(o);t||n.set(o,t=r(o));let s=t(e,i,a);if(s)return s}}function mD(e){var t;return gD(e[0],typeof(t=e[1])==`function`?t:()=>t)}function hD(e){var t,n;return Array.isArray(e)?gD(e[0],tD(e[1],e[2])):gD(e,tD(t,n))}function gD(e,t){return _D(e,(e,n,r,i)=>{let a=n.exec(e);if(a)return a.$$=e.slice(a[0].length),a.dark=i,t(a,r)})}function _D(e,t){let n=yE(e).map(vD);return(e,r,i)=>{for(let a of n){let n=t(e,a,r,i);if(n)return n}}}function vD(e){return typeof e==`string`?RegExp(`^`+e+(e.includes(`$`)||e.slice(-1)==`-`?``:`$`)):e}function yD(e,t){let n=fD(e),r=function({theme:e,darkMode:t,darkColor:n=xE,variants:r,rules:i,hash:a,stringify:o,ignorelist:s,finalize:c}){let l=new Map,u=new Map,d=new Map,f=new Map,p=_D(s,(e,t)=>t.test(e));r.push([`dark`,Array.isArray(t)||t==`class`?`${yE(t)[1]||`.dark`} &`:typeof t==`string`&&t!=`media`?t:`@media (prefers-color-scheme:dark)`]);let m=typeof a==`function`?e=>a(e,_E):a?_E:bE;m!==bE&&c.push(e=>({...e,n:e.n&&m(e.n),d:e.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(e,t)=>`--`+m(t).replace(`#`,``))}));let h={theme:function({extend:e={},...t}){let n={},r={get colors(){return i(`colors`)},theme:i,negative(){return{}},breakpoints(e){let t={};for(let n in e)typeof e[n]==`string`&&(t[`screen-`+n]=e[n]);return t}};return i;function i(r,o,s,c){if(r){if({1:r,2:c}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(r)||[,r],/[.[]/.test(r)){let e=[];r.replace(/\[([^\]]+)\]|([^.[]+)/g,(t,n,r=n)=>e.push(r)),r=e.shift(),s=o,o=e.join(`-`)}let l=n[r]||Object.assign(Object.assign(n[r]={},a(t,r)),a(e,r));if(o==null)return l;o||=`DEFAULT`;let u=l[o]??o.split(`-`).reduce((e,t)=>e?.[t],l)??s;return c?LE(u,{opacityValue:zE(c,i)}):u}let l={};for(let n of[...Object.keys(t),...Object.keys(e)])l[n]=i(n);return l}function a(e,t){let n=e[t];return typeof n==`function`&&(n=n(r)),n&&/color|fill|stroke/i.test(t)?function e(t,n=[]){let r={};for(let i in t){let a=t[i],o=[...n,i];r[o.join(`-`)]=a,i==`DEFAULT`&&(o=n,r[n.join(`-`)]=a),typeof a==`object`&&Object.assign(r,e(a,o))}return r}(n):n}}(e),e:gE,h:m,s(e,t){return o(e,t,h)},d(e,t,r){return n(e,t,h,r)},v(e){return l.has(e)||l.set(e,pD(e,r,u,mD,h)||`&:`+e),l.get(e)},r(e,t){let n=JSON.stringify([e,t]);return d.has(n)||d.set(n,!p(e,h)&&pD(e,i,f,hD,h,t)),d.get(n)},f(e){return c.reduce((e,t)=>t(e,h),e)}};return h}(n),i=new Map,a=[],o=new Set;t.resume(e=>i.set(e,e),(e,n)=>{t.insert(e,a.length,n),a.push(n),o.add(e)});function s(e){let n=r.f(e),i=OE(n);if(i&&!o.has(i)){o.add(i);let n=ME(a,e);t.insert(i,n,e),a.splice(n,0,e)}return n.n}return Object.defineProperties(function(e){if(!i.size)for(let e of yE(n.preflight))typeof e==`function`&&(e=e(r)),e&&(typeof e==`string`?HE(``,SE.b,qE(e),r,SE.b,[],!1,!0):RE(e,{},r,SE.b)).forEach(s);e=``+e;let t=i.get(e);if(!t){let n=new Set;for(let t of VE(qE(e),r))n.add(t.c).add(s(t));t=[...n].filter(Boolean).join(` `),i.set(e,t).set(t,t)}return t},Object.getOwnPropertyDescriptors({get target(){return t.target},theme:r.theme,config:n,snapshot(){let e=t.snapshot(),n=new Set(o),r=new Map(i),s=[...a];return()=>{e(),o=n,i=r,a=s}},clear(){t.clear(),o=new Set,i=new Map,a=[]},destroy(){this.clear(),t.destroy()}}))}function bD(e){let t=document.querySelector(e||`style[data-twind=""]`);return(!t||t.tagName!=`STYLE`)&&(t=document.createElement(`style`),document.head.prepend(t)),t.dataset.twind=`claimed`,t}function xD(e){let t=e?.cssRules?e:(e&&typeof e!=`string`?e:bD(e)).sheet;return{target:t,snapshot(){let e=Array.from(t.cssRules,e=>e.cssText);return()=>{this.clear(),e.forEach(this.insert)}},clear(){for(let e=t.cssRules.length;e--;)t.deleteRule(e)},destroy(){t.ownerNode?.remove()},insert(e,n){try{t.insertRule(e,n)}catch{t.insertRule(`:root{}`,n)}},resume:xE}}function SD(e){let t=[];return{target:t,snapshot(){let e=[...t];return()=>{t.splice(0,t.length,...e)}},clear(){t.length=0},destroy(){this.clear()},insert(n,r,i){t.splice(r,0,e?`/*!${i.p.toString(36)},${(2*i.o).toString(36)}${i.n?`,`+i.n:``}*/${n}`:n)},resume:xE}}var CD=new Proxy(xE,{apply(e,t,n){return pE(n[0])},get(e,t){let n=pE[t];return typeof n==`function`?function(){return n.apply(pE,arguments)}:n}}),wD=function(e,...t){(typeof this==`function`?this:CD)(eD({"@layer base":ZE(e,t)}))},TD=function e(t){return new Proxy(function(e,...n){return ED(t,``,e,n)},{get(n,r){return r===`bind`?e:r in n?n[r]:function(e,...n){return ED(t,r,e,n)}}})}();function ED(e,t,n,r){return{toString(){let i=ZE(n,r),a=gE(t+_E(JSON.stringify([t,i])));return(typeof e==`function`?e:CD)(eD({[`@keyframes ${a}`]:ZE(n,r)})),a}}}var DD=function(e,...t){return(typeof this==`function`?this:CD)(YE(e,t))},OD=new Map([[`align-self`,`-ms-grid-row-align`],[`color-adjust`,`-webkit-print-color-adjust`],[`column-gap`,`grid-column-gap`],[`forced-color-adjust`,`-ms-high-contrast-adjust`],[`gap`,`grid-gap`],[`grid-template-columns`,`-ms-grid-columns`],[`grid-template-rows`,`-ms-grid-rows`],[`justify-self`,`-ms-grid-column-align`],[`margin-inline-end`,`-webkit-margin-end`],[`margin-inline-start`,`-webkit-margin-start`],[`mask-border`,`-webkit-mask-box-image`],[`mask-border-outset`,`-webkit-mask-box-image-outset`],[`mask-border-slice`,`-webkit-mask-box-image-slice`],[`mask-border-source`,`-webkit-mask-box-image-source`],[`mask-border-repeat`,`-webkit-mask-box-image-repeat`],[`mask-border-width`,`-webkit-mask-box-image-width`],[`overflow-wrap`,`word-wrap`],[`padding-inline-end`,`-webkit-padding-end`],[`padding-inline-start`,`-webkit-padding-start`],[`print-color-adjust`,`color-adjust`],[`row-gap`,`grid-row-gap`],[`scroll-margin-bottom`,`scroll-snap-margin-bottom`],[`scroll-margin-left`,`scroll-snap-margin-left`],[`scroll-margin-right`,`scroll-snap-margin-right`],[`scroll-margin-top`,`scroll-snap-margin-top`],[`scroll-margin`,`scroll-snap-margin`],[`text-combine-upright`,`-ms-text-combine-horizontal`]]);function kD(e){return OD.get(e)}function AD(e){var t=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(e);return t?t[1]?1:t[2]?2:t[3]?3:5:0}function jD(e,t){var n=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(e);return n?n[1]?+!!/^sti/i.test(t):n[2]?+!!/^pat/i.test(t):n[3]?+!!/^image-/i.test(t):n[4]?t[3]===`-`?2:0:/^(?:inline-)?grid$/i.test(t)?4:0:0}var MD=[[`-webkit-`,1],[`-moz-`,2],[`-ms-`,4]];function ND(){return({stringify:e})=>({stringify(t,n,r){let i=``,a=kD(t);a&&(i+=e(a,n,r)+`;`);let o=AD(t),s=jD(t,n);for(let a of MD)o&a[1]&&(i+=e(a[0]+t,n,r)+`;`),s&a[1]&&(i+=e(t,a[0]+n,r)+`;`);return i+e(t,n,r)}})}var PD={screens:{sm:`640px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`},columns:{auto:`auto`,"3xs":`16rem`,"2xs":`18rem`,xs:`20rem`,sm:`24rem`,md:`28rem`,lg:`32rem`,xl:`36rem`,"2xl":`42rem`,"3xl":`48rem`,"4xl":`56rem`,"5xl":`64rem`,"6xl":`72rem`,"7xl":`80rem`},spacing:{px:`1px`,0:`0px`,...LD(4,`rem`,4,.5,.5),...LD(12,`rem`,4,5),14:`3.5rem`,...LD(64,`rem`,4,16,4),72:`18rem`,80:`20rem`,96:`24rem`},durations:{75:`75ms`,100:`100ms`,150:`150ms`,200:`200ms`,300:`300ms`,500:`500ms`,700:`700ms`,1e3:`1000ms`},animation:{none:`none`,spin:`spin 1s linear infinite`,ping:`ping 1s cubic-bezier(0,0,0.2,1) infinite`,pulse:`pulse 2s cubic-bezier(0.4,0,0.6,1) infinite`,bounce:`bounce 1s infinite`},aspectRatio:{auto:`auto`,square:`1/1`,video:`16/9`},backdropBlur:RD(`blur`),backdropBrightness:RD(`brightness`),backdropContrast:RD(`contrast`),backdropGrayscale:RD(`grayscale`),backdropHueRotate:RD(`hueRotate`),backdropInvert:RD(`invert`),backdropOpacity:RD(`opacity`),backdropSaturate:RD(`saturate`),backdropSepia:RD(`sepia`),backgroundColor:RD(`colors`),backgroundImage:{none:`none`},backgroundOpacity:RD(`opacity`),backgroundSize:{auto:`auto`,cover:`cover`,contain:`contain`},blur:{none:`none`,0:`0`,sm:`4px`,DEFAULT:`8px`,md:`12px`,lg:`16px`,xl:`24px`,"2xl":`40px`,"3xl":`64px`},brightness:{...LD(200,``,100,0,50),...LD(110,``,100,90,5),75:`0.75`,125:`1.25`},borderColor:({theme:e})=>({DEFAULT:e(`colors.gray.200`,`currentColor`),...e(`colors`)}),borderOpacity:RD(`opacity`),borderRadius:{none:`0px`,sm:`0.125rem`,DEFAULT:`0.25rem`,md:`0.375rem`,lg:`0.5rem`,xl:`0.75rem`,"2xl":`1rem`,"3xl":`1.5rem`,"1/2":`50%`,full:`9999px`},borderSpacing:RD(`spacing`),borderWidth:{DEFAULT:`1px`,...ID(8,`px`)},boxShadow:{sm:`0 1px 2px 0 rgba(0,0,0,0.05)`,DEFAULT:`0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)`,md:`0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)`,lg:`0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)`,xl:`0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)`,"2xl":`0 25px 50px -12px rgba(0,0,0,0.25)`,inner:`inset 0 2px 4px 0 rgba(0,0,0,0.05)`,none:`0 0 #0000`},boxShadowColor:RD(`colors`),caretColor:RD(`colors`),accentColor:({theme:e})=>({auto:`auto`,...e(`colors`)}),contrast:{...LD(200,``,100,0,50),75:`0.75`,125:`1.25`},content:{none:`none`},divideColor:RD(`borderColor`),divideOpacity:RD(`borderOpacity`),divideWidth:RD(`borderWidth`),dropShadow:{sm:`0 1px 1px rgba(0,0,0,0.05)`,DEFAULT:[`0 1px 2px rgba(0,0,0,0.1)`,`0 1px 1px rgba(0,0,0,0.06)`],md:[`0 4px 3px rgba(0,0,0,0.07)`,`0 2px 2px rgba(0,0,0,0.06)`],lg:[`0 10px 8px rgba(0,0,0,0.04)`,`0 4px 3px rgba(0,0,0,0.1)`],xl:[`0 20px 13px rgba(0,0,0,0.03)`,`0 8px 5px rgba(0,0,0,0.08)`],"2xl":`0 25px 25px rgba(0,0,0,0.15)`,none:`0 0 #0000`},fill:({theme:e})=>({...e(`colors`),none:`none`}),grayscale:{DEFAULT:`100%`,0:`0`},hueRotate:{0:`0deg`,15:`15deg`,30:`30deg`,60:`60deg`,90:`90deg`,180:`180deg`},invert:{DEFAULT:`100%`,0:`0`},flex:{1:`1 1 0%`,auto:`1 1 auto`,initial:`0 1 auto`,none:`none`},flexBasis:({theme:e})=>({...e(`spacing`),...FD(2,6),...FD(12,12),auto:`auto`,full:`100%`}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:`ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"`.split(`,`),serif:`ui-serif,Georgia,Cambria,"Times New Roman",Times,serif`.split(`,`),mono:`ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace`.split(`,`)},fontSize:{xs:[`0.75rem`,`1rem`],sm:[`0.875rem`,`1.25rem`],base:[`1rem`,`1.5rem`],lg:[`1.125rem`,`1.75rem`],xl:[`1.25rem`,`1.75rem`],"2xl":[`1.5rem`,`2rem`],"3xl":[`1.875rem`,`2.25rem`],"4xl":[`2.25rem`,`2.5rem`],"5xl":[`3rem`,`1`],"6xl":[`3.75rem`,`1`],"7xl":[`4.5rem`,`1`],"8xl":[`6rem`,`1`],"9xl":[`8rem`,`1`]},fontWeight:{thin:`100`,extralight:`200`,light:`300`,normal:`400`,medium:`500`,semibold:`600`,bold:`700`,extrabold:`800`,black:`900`},gap:RD(`spacing`),gradientColorStops:RD(`colors`),gridAutoColumns:{auto:`auto`,min:`min-content`,max:`max-content`,fr:`minmax(0,1fr)`},gridAutoRows:{auto:`auto`,min:`min-content`,max:`max-content`,fr:`minmax(0,1fr)`},gridColumn:{auto:`auto`,"span-full":`1 / -1`},gridRow:{auto:`auto`,"span-full":`1 / -1`},gridTemplateColumns:{none:`none`},gridTemplateRows:{none:`none`},height:({theme:e})=>({...e(`spacing`),...FD(2,6),min:`min-content`,max:`max-content`,fit:`fit-content`,auto:`auto`,full:`100%`,screen:`100vh`}),inset:({theme:e})=>({...e(`spacing`),...FD(2,4),auto:`auto`,full:`100%`}),keyframes:{spin:{from:{transform:`rotate(0deg)`},to:{transform:`rotate(360deg)`}},ping:{"0%":{transform:`scale(1)`,opacity:`1`},"75%,100%":{transform:`scale(2)`,opacity:`0`}},pulse:{"0%,100%":{opacity:`1`},"50%":{opacity:`.5`}},bounce:{"0%, 100%":{transform:`translateY(-25%)`,animationTimingFunction:`cubic-bezier(0.8,0,1,1)`},"50%":{transform:`none`,animationTimingFunction:`cubic-bezier(0,0,0.2,1)`}}},letterSpacing:{tighter:`-0.05em`,tight:`-0.025em`,normal:`0em`,wide:`0.025em`,wider:`0.05em`,widest:`0.1em`},lineHeight:{...LD(10,`rem`,4,3),none:`1`,tight:`1.25`,snug:`1.375`,normal:`1.5`,relaxed:`1.625`,loose:`2`},margin:({theme:e})=>({auto:`auto`,...e(`spacing`)}),maxHeight:({theme:e})=>({full:`100%`,min:`min-content`,max:`max-content`,fit:`fit-content`,screen:`100vh`,...e(`spacing`)}),maxWidth:({theme:e,breakpoints:t})=>({...t(e(`screens`)),none:`none`,0:`0rem`,xs:`20rem`,sm:`24rem`,md:`28rem`,lg:`32rem`,xl:`36rem`,"2xl":`42rem`,"3xl":`48rem`,"4xl":`56rem`,"5xl":`64rem`,"6xl":`72rem`,"7xl":`80rem`,full:`100%`,min:`min-content`,max:`max-content`,fit:`fit-content`,prose:`65ch`}),minHeight:{0:`0px`,full:`100%`,min:`min-content`,max:`max-content`,fit:`fit-content`,screen:`100vh`},minWidth:{0:`0px`,full:`100%`,min:`min-content`,max:`max-content`,fit:`fit-content`},opacity:{...LD(100,``,100,0,10),5:`0.05`,25:`0.25`,75:`0.75`,95:`0.95`},order:{first:`-9999`,last:`9999`,none:`0`},padding:RD(`spacing`),placeholderColor:RD(`colors`),placeholderOpacity:RD(`opacity`),outlineColor:RD(`colors`),outlineOffset:ID(8,`px`),outlineWidth:ID(8,`px`),ringColor:({theme:e})=>({...e(`colors`),DEFAULT:`#3b82f6`}),ringOffsetColor:RD(`colors`),ringOffsetWidth:ID(8,`px`),ringOpacity:({theme:e})=>({...e(`opacity`),DEFAULT:`0.5`}),ringWidth:{DEFAULT:`3px`,...ID(8,`px`)},rotate:{...ID(2,`deg`),...ID(12,`deg`,3),...ID(180,`deg`,45)},saturate:LD(200,``,100,0,50),scale:{...LD(150,``,100,0,50),...LD(110,``,100,90,5),75:`0.75`,125:`1.25`},scrollMargin:RD(`spacing`),scrollPadding:RD(`spacing`),sepia:{0:`0`,DEFAULT:`100%`},skew:{...ID(2,`deg`),...ID(12,`deg`,3)},space:RD(`spacing`),stroke:({theme:e})=>({...e(`colors`),none:`none`}),strokeWidth:LD(2),textColor:RD(`colors`),textDecorationColor:RD(`colors`),textDecorationThickness:{"from-font":`from-font`,auto:`auto`,...ID(8,`px`)},textUnderlineOffset:{auto:`auto`,...ID(8,`px`)},textIndent:RD(`spacing`),textOpacity:RD(`opacity`),transitionDuration:({theme:e})=>({...e(`durations`),DEFAULT:`150ms`}),transitionDelay:RD(`durations`),transitionProperty:{none:`none`,all:`all`,DEFAULT:`color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter`,colors:`color,background-color,border-color,text-decoration-color,fill,stroke`,opacity:`opacity`,shadow:`box-shadow`,transform:`transform`},transitionTimingFunction:{DEFAULT:`cubic-bezier(0.4,0,0.2,1)`,linear:`linear`,in:`cubic-bezier(0.4,0,1,1)`,out:`cubic-bezier(0,0,0.2,1)`,"in-out":`cubic-bezier(0.4,0,0.2,1)`},translate:({theme:e})=>({...e(`spacing`),...FD(2,4),full:`100%`}),width:({theme:e})=>({min:`min-content`,max:`max-content`,fit:`fit-content`,screen:`100vw`,...e(`flexBasis`)}),willChange:{scroll:`scroll-position`},zIndex:{...LD(50,``,1,0,10),auto:`auto`}};function FD(e,t){let n={};do for(var r=1;r<e;r++)n[`${r}/${e}`]=Number((r/e*100).toFixed(6))+`%`;while(++e<=t);return n}function ID(e,t,n=0){let r={};for(;n<=e;n=2*n||1)r[n]=n+t;return r}function LD(e,t=``,n=1,r=0,i=1,a={}){for(;r<=e;r+=i)a[r]=r/n+t;return a}function RD(e){return({theme:t})=>t(e)}var zD={"*,::before,::after":{boxSizing:`border-box`,borderWidth:`0`,borderStyle:`solid`,borderColor:`theme(borderColor.DEFAULT, currentColor)`},"::before,::after":{"--tw-content":`''`},html:{lineHeight:1.5,WebkitTextSizeAdjust:`100%`,MozTabSize:`4`,tabSize:4,fontFamily:`theme(fontFamily.sans, ${PD.fontFamily.sans})`,fontFeatureSettings:`theme(fontFamily.sans[1].fontFeatureSettings, normal)`},body:{margin:`0`,lineHeight:`inherit`},hr:{height:`0`,color:`inherit`,borderTopWidth:`1px`},"abbr:where([title])":{textDecoration:`underline dotted`},"h1,h2,h3,h4,h5,h6":{fontSize:`inherit`,fontWeight:`inherit`},a:{color:`inherit`,textDecoration:`inherit`},"b,strong":{fontWeight:`bolder`},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${PD.fontFamily.mono})`,fontFeatureSettings:`theme(fontFamily.mono[1].fontFeatureSettings, normal)`,fontSize:`1em`},small:{fontSize:`80%`},"sub,sup":{fontSize:`75%`,lineHeight:0,position:`relative`,verticalAlign:`baseline`},sub:{bottom:`-0.25em`},sup:{top:`-0.5em`},table:{textIndent:`0`,borderColor:`inherit`,borderCollapse:`collapse`},"button,input,optgroup,select,textarea":{fontFamily:`inherit`,fontSize:`100%`,lineHeight:`inherit`,color:`inherit`,margin:`0`,padding:`0`},"button,select":{textTransform:`none`},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:`button`,backgroundColor:`transparent`,backgroundImage:`none`},":-moz-focusring":{outline:`auto`},":-moz-ui-invalid":{boxShadow:`none`},progress:{verticalAlign:`baseline`},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:`auto`},"[type='search']":{WebkitAppearance:`textfield`,outlineOffset:`-2px`},"::-webkit-search-decoration":{WebkitAppearance:`none`},"::-webkit-file-upload-button":{WebkitAppearance:`button`,font:`inherit`},summary:{display:`list-item`},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:`0`},fieldset:{margin:`0`,padding:`0`},legend:{padding:`0`},"ol,ul,menu":{listStyle:`none`,margin:`0`,padding:`0`},textarea:{resize:`vertical`},"input::placeholder,textarea::placeholder":{opacity:1,color:`theme(colors.gray.400, #9ca3af)`},'button,[role="button"]':{cursor:`pointer`},":disabled":{cursor:`default`},"img,svg,video,canvas,audio,iframe,embed,object":{display:`block`,verticalAlign:`middle`},"img,video":{maxWidth:`100%`,height:`auto`},"[hidden]":{display:`none`}},BD=[Z(`\\[([-\\w]+):(.+)]`,({1:e,2:t},n)=>({"@layer overrides":{"&":{[e]:cD(`[${t}]`,``,n)}}})),Z(`(group|peer)([~/][^-[]+)?`,({input:e},{h:t})=>[{c:t(e)}]),Q(`aspect-`,`aspectRatio`),Z(`container`,(e,{theme:t})=>{let{screens:n=t(`screens`),center:r,padding:i}=t(`container`),a={width:`100%`,marginRight:r&&`auto`,marginLeft:r&&`auto`,...o(`xs`)};for(let e in n){let t=n[e];typeof t==`string`&&(a[vE(t)]={"&":{maxWidth:t,...o(e)}})}return a;function o(e){let t=i&&(typeof i==`string`?i:i[e]||i.DEFAULT);if(t)return{paddingRight:t,paddingLeft:t}}}),Q(`content-`,`content`,({_:e})=>({"--tw-content":e,content:`var(--tw-content)`})),Z(`(?:box-)?decoration-(slice|clone)`,`boxDecorationBreak`),Z(`box-(border|content)`,`boxSizing`,({1:e})=>e+`-box`),Z(`hidden`,{display:`none`}),Z(`table-(auto|fixed)`,`tableLayout`),Z([`(block|flex|table|grid|inline|contents|flow-root|list-item)`,`(inline-(block|flex|table|grid))`,`(table-(caption|cell|column|row|(column|row|footer|header)-group))`],`display`),`(float)-(left|right|none)`,`(clear)-(left|right|none|both)`,`(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)`,`(isolation)-(auto)`,Z(`isolate`,`isolation`),Z(`object-(contain|cover|fill|none|scale-down)`,`objectFit`),Q(`object-`,`objectPosition`),Z(`object-(top|bottom|center|(left|right)(-(top|bottom))?)`,`objectPosition`,VD),Z(`overscroll(-[xy])?-(auto|contain|none)`,({1:e=``,2:t})=>({[`overscroll-behavior`+e]:t})),Z(`(static|fixed|absolute|relative|sticky)`,`position`),Q(`-?inset(-[xy])?(?:$|-)`,`inset`,({1:e,_:t})=>({top:e!=`-x`&&t,right:e!=`-y`&&t,bottom:e!=`-x`&&t,left:e!=`-y`&&t})),Q(`-?(top|bottom|left|right)(?:$|-)`,`inset`),Z(`(visible|collapse)`,`visibility`),Z(`invisible`,{visibility:`hidden`}),Q(`-?z-`,`zIndex`),Z(`flex-((row|col)(-reverse)?)`,`flexDirection`,HD),Z(`flex-(wrap|wrap-reverse|nowrap)`,`flexWrap`),Q(`(flex-(?:grow|shrink))(?:$|-)`),Q(`(flex)-`),Q(`grow(?:$|-)`,`flexGrow`),Q(`shrink(?:$|-)`,`flexShrink`),Q(`basis-`,`flexBasis`),Q(`-?(order)-`),`-?(order)-(\\d+)`,Q(`grid-cols-`,`gridTemplateColumns`),Z(`grid-cols-(\\d+)`,`gridTemplateColumns`,QD),Q(`col-`,`gridColumn`),Z(`col-(span)-(\\d+)`,`gridColumn`,ZD),Q(`col-start-`,`gridColumnStart`),Z(`col-start-(auto|\\d+)`,`gridColumnStart`),Q(`col-end-`,`gridColumnEnd`),Z(`col-end-(auto|\\d+)`,`gridColumnEnd`),Q(`grid-rows-`,`gridTemplateRows`),Z(`grid-rows-(\\d+)`,`gridTemplateRows`,QD),Q(`row-`,`gridRow`),Z(`row-(span)-(\\d+)`,`gridRow`,ZD),Q(`row-start-`,`gridRowStart`),Z(`row-start-(auto|\\d+)`,`gridRowStart`),Q(`row-end-`,`gridRowEnd`),Z(`row-end-(auto|\\d+)`,`gridRowEnd`),Z(`grid-flow-((row|col)(-dense)?)`,`gridAutoFlow`,e=>VD(HD(e))),Z(`grid-flow-(dense)`,`gridAutoFlow`),Q(`auto-cols-`,`gridAutoColumns`),Q(`auto-rows-`,`gridAutoRows`),Q(`gap-x(?:$|-)`,`gap`,`columnGap`),Q(`gap-y(?:$|-)`,`gap`,`rowGap`),Q(`gap(?:$|-)`,`gap`),`(justify-(?:items|self))-`,Z(`justify-`,`justifyContent`,GD),Z(`(content|items|self)-`,e=>({[`align-`+e[1]]:GD(e)})),Z(`(place-(content|items|self))-`,({1:e,$$:t})=>({[e]:(`wun`.includes(t[3])?`space-`:``)+t})),Q(`p([xytrbl])?(?:$|-)`,`padding`,KD(`padding`)),Q(`-?m([xytrbl])?(?:$|-)`,`margin`,KD(`margin`)),Q(`-?space-(x|y)(?:$|-)`,`space`,({1:e,_:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:`0`,[`margin-`+{y:`top`,x:`left`}[e]]:`calc(${t} * calc(1 - var(--tw-space-${e}-reverse)))`,[`margin-`+{y:`bottom`,x:`right`}[e]]:`calc(${t} * var(--tw-space-${e}-reverse))`}})),Z(`space-(x|y)-reverse`,({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:`1`}})),Q(`w-`,`width`),Q(`min-w-`,`minWidth`),Q(`max-w-`,`maxWidth`),Q(`h-`,`height`),Q(`min-h-`,`minHeight`),Q(`max-h-`,`maxHeight`),Q(`font-`,`fontWeight`),Q(`font-`,`fontFamily`,({_:e})=>typeof(e=yE(e))[1]==`string`?{fontFamily:WD(e)}:{fontFamily:WD(e[0]),...e[1]}),Z(`antialiased`,{WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`}),Z(`subpixel-antialiased`,{WebkitFontSmoothing:`auto`,MozOsxFontSmoothing:`auto`}),Z(`italic`,`fontStyle`),Z(`not-italic`,{fontStyle:`normal`}),Z(`(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)`,({1:e,2:t=``,3:n})=>t==`normal`?{fontVariantNumeric:`normal`}:{[`--tw-`+(n?`numeric-fraction`:`pt`.includes(t[0])?`numeric-spacing`:t?`numeric-figure`:e)]:e,fontVariantNumeric:`var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)`,...$D({"--tw-ordinal":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-slashed-zero":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-numeric-figure":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-numeric-spacing":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-numeric-fraction":`var(--tw-empty,/*!*/ /*!*/)`})}),Q(`tracking-`,`letterSpacing`),Q(`leading-`,`lineHeight`),Z(`list-(inside|outside)`,`listStylePosition`),Q(`list-`,`listStyleType`),Z(`list-`,`listStyleType`),Q(`placeholder-opacity-`,`placeholderOpacity`,({_:e})=>({"&::placeholder":{"--tw-placeholder-opacity":e}})),iD(`placeholder-`,{property:`color`,selector:`&::placeholder`}),Z(`text-(left|center|right|justify|start|end)`,`textAlign`),Z(`text-(ellipsis|clip)`,`textOverflow`),Q(`text-opacity-`,`textOpacity`,`--tw-text-opacity`),iD(`text-`,{property:`color`}),Q(`text-`,`fontSize`,({_:e})=>typeof e==`string`?{fontSize:e}:{fontSize:e[0],...typeof e[1]==`string`?{lineHeight:e[1]}:e[1]}),Q(`indent-`,`textIndent`),Z(`(overline|underline|line-through)`,`textDecorationLine`),Z(`no-underline`,{textDecorationLine:`none`}),Q(`underline-offset-`,`textUnderlineOffset`),iD(`decoration-`,{section:`textDecorationColor`,opacityVariable:!1,opacitySection:`opacity`}),Q(`decoration-`,`textDecorationThickness`),Z(`decoration-`,`textDecorationStyle`),Z(`(uppercase|lowercase|capitalize)`,`textTransform`),Z(`normal-case`,{textTransform:`none`}),Z(`truncate`,{overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`}),Z(`align-`,`verticalAlign`),Z(`whitespace-`,`whiteSpace`),Z(`break-normal`,{wordBreak:`normal`,overflowWrap:`normal`}),Z(`break-words`,{overflowWrap:`break-word`}),Z(`break-all`,{wordBreak:`break-all`}),Z(`break-keep`,{wordBreak:`keep-all`}),iD(`caret-`,{opacityVariable:!1,opacitySection:`opacity`}),iD(`accent-`,{opacityVariable:!1,opacitySection:`opacity`}),Z(`bg-gradient-to-([trbl]|[tb][rl])`,`backgroundImage`,({1:e})=>`linear-gradient(to ${UD(e,` `)},var(--tw-gradient-stops))`),iD(`from-`,{section:`gradientColorStops`,opacityVariable:!1,opacitySection:`opacity`},({_:e})=>({"--tw-gradient-from":e.value,"--tw-gradient-to":e.color({opacityValue:`0`}),"--tw-gradient-stops":`var(--tw-gradient-from),var(--tw-gradient-to)`})),iD(`via-`,{section:`gradientColorStops`,opacityVariable:!1,opacitySection:`opacity`},({_:e})=>({"--tw-gradient-to":e.color({opacityValue:`0`}),"--tw-gradient-stops":`var(--tw-gradient-from),${e.value},var(--tw-gradient-to)`})),iD(`to-`,{section:`gradientColorStops`,property:`--tw-gradient-to`,opacityVariable:!1,opacitySection:`opacity`}),Z(`bg-(fixed|local|scroll)`,`backgroundAttachment`),Z(`bg-origin-(border|padding|content)`,`backgroundOrigin`,({1:e})=>e+`-box`),Z([`bg-(no-repeat|repeat(-[xy])?)`,`bg-repeat-(round|space)`],`backgroundRepeat`),Z(`bg-blend-`,`backgroundBlendMode`),Z(`bg-clip-(border|padding|content|text)`,`backgroundClip`,({1:e})=>e+(e==`text`?``:`-box`)),Q(`bg-opacity-`,`backgroundOpacity`,`--tw-bg-opacity`),iD(`bg-`,{section:`backgroundColor`}),Q(`bg-`,`backgroundImage`),Q(`bg-`,`backgroundPosition`),Z(`bg-(top|bottom|center|(left|right)(-(top|bottom))?)`,`backgroundPosition`,VD),Q(`bg-`,`backgroundSize`),Q(`rounded(?:$|-)`,`borderRadius`),Q(`rounded-([trbl]|[tb][rl])(?:$|-)`,`borderRadius`,({1:e,_:t})=>{let n={t:[`tl`,`tr`],r:[`tr`,`br`],b:[`bl`,`br`],l:[`bl`,`tl`]}[e]||[e,e];return{[`border-${UD(n[0])}-radius`]:t,[`border-${UD(n[1])}-radius`]:t}}),Z(`border-(collapse|separate)`,`borderCollapse`),Q(`border-opacity(?:$|-)`,`borderOpacity`,`--tw-border-opacity`),Z(`border-(solid|dashed|dotted|double|none)`,`borderStyle`),Q(`border-spacing(-[xy])?(?:$|-)`,`borderSpacing`,({1:e,_:t})=>({...$D({"--tw-border-spacing-x":`0`,"--tw-border-spacing-y":`0`}),[`--tw-border-spacing`+(e||`-x`)]:t,[`--tw-border-spacing`+(e||`-y`)]:t,"border-spacing":`var(--tw-border-spacing-x) var(--tw-border-spacing-y)`})),iD(`border-([xytrbl])-`,{section:`borderColor`},KD(`border`,`Color`)),iD(`border-`),Q(`border-([xytrbl])(?:$|-)`,`borderWidth`,KD(`border`,`Width`)),Q(`border(?:$|-)`,`borderWidth`),Q(`divide-opacity(?:$|-)`,`divideOpacity`,({_:e})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":e}})),Z(`divide-(solid|dashed|dotted|double|none)`,({1:e})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:e}})),Z(`divide-([xy]-reverse)`,({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-divide-`+e]:`1`}})),Q(`divide-([xy])(?:$|-)`,`divideWidth`,({1:e,_:t})=>{let n={x:`lr`,y:`tb`}[e];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${e}-reverse`]:`0`,[`border-${UD(n[0])}Width`]:`calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,[`border-${UD(n[1])}Width`]:`calc(${t} * var(--tw-divide-${e}-reverse))`}}}),iD(`divide-`,{property:`borderColor`,selector:`&>:not([hidden])~:not([hidden])`}),Q(`ring-opacity(?:$|-)`,`ringOpacity`,`--tw-ring-opacity`),iD(`ring-offset-`,{property:`--tw-ring-offset-color`,opacityVariable:!1}),Q(`ring-offset(?:$|-)`,`ringOffsetWidth`,`--tw-ring-offset-width`),Z(`ring-inset`,{"--tw-ring-inset":`inset`}),iD(`ring-`,{property:`--tw-ring-color`}),Q(`ring(?:$|-)`,`ringWidth`,({_:e},{theme:t})=>({...$D({"--tw-ring-offset-shadow":`0 0 #0000`,"--tw-ring-shadow":`0 0 #0000`,"--tw-shadow":`0 0 #0000`,"--tw-shadow-colored":`0 0 #0000`,"&":{"--tw-ring-inset":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-ring-offset-width":t(`ringOffsetWidth`,``,`0px`),"--tw-ring-offset-color":LE(t(`ringOffsetColor`,``,`#fff`)),"--tw-ring-color":LE(t(`ringColor`,``,`#93c5fd`),{opacityVariable:`--tw-ring-opacity`}),"--tw-ring-opacity":t(`ringOpacity`,``,`0.5`)}}),"--tw-ring-offset-shadow":`var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`,"--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:`var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)`})),iD(`shadow-`,{section:`boxShadowColor`,opacityVariable:!1,opacitySection:`opacity`},({_:e})=>({"--tw-shadow-color":e.value,"--tw-shadow":`var(--tw-shadow-colored)`})),Q(`shadow(?:$|-)`,`boxShadow`,({_:e})=>({...$D({"--tw-ring-offset-shadow":`0 0 #0000`,"--tw-ring-shadow":`0 0 #0000`,"--tw-shadow":`0 0 #0000`,"--tw-shadow-colored":`0 0 #0000`}),"--tw-shadow":WD(e),"--tw-shadow-colored":WD(e).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,`$1var(--tw-shadow-color)$2`),boxShadow:`var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)`})),Q(`(opacity)-`),Z(`mix-blend-`,`mixBlendMode`),...qD(),...qD(`backdrop-`),Q(`transition(?:$|-)`,`transitionProperty`,(e,{theme:t})=>({transitionProperty:WD(e),transitionTimingFunction:e._==`none`?void 0:WD(t(`transitionTimingFunction`,``)),transitionDuration:e._==`none`?void 0:WD(t(`transitionDuration`,``))})),Q(`duration(?:$|-)`,`transitionDuration`,`transitionDuration`,WD),Q(`ease(?:$|-)`,`transitionTimingFunction`,`transitionTimingFunction`,WD),Q(`delay(?:$|-)`,`transitionDelay`,`transitionDelay`,WD),Q(`animate(?:$|-)`,`animation`,(e,{theme:t,h:n,e:r})=>{let i=WD(e),a=i.split(` `),o=t(`keyframes`,a[0]);return o?{[`@keyframes `+(a[0]=r(n(a[0])))]:o,animation:a.join(` `)}:{animation:i}}),`(transform)-(none)`,Z(`transform`,YD),Z(`transform-(cpu|gpu)`,({1:e})=>({"--tw-transform":XD(e==`gpu`)})),Q(`scale(-[xy])?-`,`scale`,({1:e,_:t})=>({[`--tw-scale`+(e||`-x`)]:t,[`--tw-scale`+(e||`-y`)]:t,...YD()})),Q(`-?(rotate)-`,`rotate`,JD),Q(`-?(translate-[xy])-`,`translate`,JD),Q(`-?(skew-[xy])-`,`skew`,JD),Z(`origin-(center|((top|bottom)(-(left|right))?)|left|right)`,`transformOrigin`,VD),`(appearance)-`,Q(`(columns)-`),`(columns)-(\\d+)`,`(break-(?:before|after|inside))-`,Q(`(cursor)-`),`(cursor)-`,Z(`snap-(none)`,`scroll-snap-type`),Z(`snap-(x|y|both)`,({1:e})=>({...$D({"--tw-scroll-snap-strictness":`proximity`}),"scroll-snap-type":e+` var(--tw-scroll-snap-strictness)`})),Z(`snap-(mandatory|proximity)`,`--tw-scroll-snap-strictness`),Z(`snap-(?:(start|end|center)|align-(none))`,`scroll-snap-align`),Z(`snap-(normal|always)`,`scroll-snap-stop`),Z(`scroll-(auto|smooth)`,`scroll-behavior`),Q(`scroll-p([xytrbl])?(?:$|-)`,`padding`,KD(`scroll-padding`)),Q(`-?scroll-m([xytrbl])?(?:$|-)`,`scroll-margin`,KD(`scroll-margin`)),Z(`touch-(auto|none|manipulation)`,`touch-action`),Z(`touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))`,({1:e,2:t,3:n})=>({...$D({"--tw-pan-x":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-pan-y":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-pinch-zoom":`var(--tw-empty,/*!*/ /*!*/)`,"--tw-touch-action":`var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)`}),[`--tw-${t?`pan-x`:n?`pan-y`:e}`]:e,"touch-action":`var(--tw-touch-action)`})),Z(`outline-none`,{outline:`2px solid transparent`,"outline-offset":`2px`}),Z(`outline`,{outlineStyle:`solid`}),Z(`outline-(dashed|dotted|double)`,`outlineStyle`),Q(`-?(outline-offset)-`),iD(`outline-`,{opacityVariable:!1,opacitySection:`opacity`}),Q(`outline-`,`outlineWidth`),`(pointer-events)-`,Q(`(will-change)-`),`(will-change)-`,[`resize(?:-(none|x|y))?`,`resize`,({1:e})=>({x:`horizontal`,y:`vertical`})[e]||e||`both`],Z(`select-(none|text|all|auto)`,`userSelect`),iD(`fill-`,{section:`fill`,opacityVariable:!1,opacitySection:`opacity`}),iD(`stroke-`,{section:`stroke`,opacityVariable:!1,opacitySection:`opacity`}),Q(`stroke-`,`strokeWidth`),Z(`sr-only`,{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,whiteSpace:`nowrap`,clip:`rect(0,0,0,0)`,borderWidth:`0`}),Z(`not-sr-only`,{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,whiteSpace:`normal`,clip:`auto`})];function VD(e){return(typeof e==`string`?e:e[1]).replace(/-/g,` `).trim()}function HD(e){return(typeof e==`string`?e:e[1]).replace(`col`,`column`)}function UD(e,t=`-`){let n=[];for(let t of e)n.push({t:`top`,r:`right`,b:`bottom`,l:`left`}[t]);return n.join(t)}function WD(e){return e&&``+(e._||e)}function GD({$$:e}){return({r:`flex-`,"":`flex-`,w:`space-`,u:`space-`,n:`space-`}[e[3]||``]||``)+e}function KD(e,t=``){return({1:n,_:r})=>{let i={x:`lr`,y:`tb`}[n]||n+n;return i?{...sD(e+`-`+UD(i[0])+t,r),...sD(e+`-`+UD(i[1])+t,r)}:sD(e+t,r)}}function qD(e=``){let t=[`blur`,`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,e&&`opacity`,`saturate`,`sepia`,!e&&`drop-shadow`].filter(Boolean),n={};for(let r of t)n[`--tw-${e}${r}`]=`var(--tw-empty,/*!*/ /*!*/)`;return n={...$D(n),[`${e}filter`]:t.map(t=>`var(--tw-${e}${t})`).join(` `)},[`(${e}filter)-(none)`,Z(`${e}filter`,n),...t.map(t=>Q(`${t[0]==`h`?`-?`:``}(${e}${t})(?:$|-)`,t,({1:e,_:r})=>({[`--tw-${e}`]:yE(r).map(e=>`${t}(${e})`).join(` `),...n})))]}function JD({1:e,_:t}){return{[`--tw-`+e]:t,...YD()}}function YD(){return{...$D({"--tw-translate-x":`0`,"--tw-translate-y":`0`,"--tw-rotate":`0`,"--tw-skew-x":`0`,"--tw-skew-y":`0`,"--tw-scale-x":`1`,"--tw-scale-y":`1`,"--tw-transform":XD()}),transform:`var(--tw-transform)`}}function XD(e){return[e?`translate3d(var(--tw-translate-x),var(--tw-translate-y),0)`:`translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))`,`rotate(var(--tw-rotate))`,`skewX(var(--tw-skew-x))`,`skewY(var(--tw-skew-y))`,`scaleX(var(--tw-scale-x))`,`scaleY(var(--tw-scale-y))`].join(` `)}function ZD({1:e,2:t}){return`${e} ${t} / ${e} ${t}`}function QD({1:e}){return`repeat(${e},minmax(0,1fr))`}function $D(e){return{"@layer defaults":{"*,::before,::after":e,"::backdrop":e}}}var eO=[[`sticky`,`@supports ((position: -webkit-sticky) or (position:sticky))`],[`motion-reduce`,`@media (prefers-reduced-motion:reduce)`],[`motion-safe`,`@media (prefers-reduced-motion:no-preference)`],[`print`,`@media print`],[`(portrait|landscape)`,({1:e})=>`@media (orientation:${e})`],[`contrast-(more|less)`,({1:e})=>`@media (prefers-contrast:${e})`],[`(first-(letter|line)|placeholder|backdrop|before|after)`,({1:e})=>`&::${e}`],[`(marker|selection)`,({1:e})=>`& *::${e},&::${e}`],[`file`,`&::file-selector-button`],[`(first|last|only)`,({1:e})=>`&:${e}-child`],[`even`,`&:nth-child(2n)`],[`odd`,`&:nth-child(odd)`],[`open`,`&[open]`],[`(aria|data)-`,({1:e,$$:t},n)=>t&&`&[${e}-${n.theme(e,t)||cD(t,``,n)||`${t}="true"`}]`],[`((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?`,({2:e,3:t=``,4:n,5:r=``,6:i=t},{e:a,h:o,v:s})=>{let c=uD(r)||(n[0]==`[`?n:s(n.slice(1)));return`${(c.includes(`&`)?c:`&`+c).replace(/&/g,`:merge(.${a(o(e+i))})`)}${e[0]==`p`?`~`:` `}&`}],[`(ltr|rtl)`,({1:e})=>`[dir="${e}"] &`],[`supports-`,({$$:e},t)=>{if(e&&=t.theme(`supports`,e)||cD(e,``,t),e)return e.includes(`:`)||(e+=`:var(--tw)`),/^\w*\s*\(/.test(e)||(e=`(${e})`),`@supports ${e.replace(/\b(and|or|not)\b/g,` $1 `).trim()}`}],[`max-`,({$$:e},t)=>{if(e&&=t.theme(`screens`,e)||cD(e,``,t),typeof e==`string`)return`@media not all and (min-width:${e})`}],[`min-`,({$$:e},t)=>(e&&=cD(e,``,t),e&&`@media (min-width:${e})`)],[/^\[(.+)]$/,({1:e})=>/[&@]/.test(e)&&uD(e).replace(/[}]+$/,``).split(`{`)]];function tO({colors:e,disablePreflight:t}={}){return{preflight:t?void 0:zD,theme:{...PD,colors:{inherit:`inherit`,current:`currentColor`,transparent:`transparent`,black:`#000`,white:`#fff`,...e}},variants:eO,rules:BD,finalize(e){return e.n&&e.d&&e.r.some(e=>/^&::(before|after)$/.test(e))&&!/(^|;)content:/.test(e.d)?{...e,d:`content:var(--tw-content);`+e.d}:e}}}var nO=yD(fD({preflight:!1,hash:!0,darkMode:`class`,theme:{extend:{colors:{background:`var(--swk-background)`,"background-secondary":`var(--swk-background-secondary)`,"foreground-strong":`var(--swk-foreground-strong)`,foreground:`var(--swk-foreground)`,"foreground-secondary":`var(--swk-foreground-secondary)`,primary:`var(--swk-primary)`,"primary-foreground":`var(--swk-primary-foreground)`,transparent:`var(--swk-transparent)`,lighter:`var(--swk-lighter)`,light:`var(--swk-light)`,"light-gray":`var(--swk-light-gray)`,gray:`var(--swk-gray)`,danger:`var(--swk-danger)`,border:`var(--swk-border)`},boxShadow:{default:`0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)`},borderRadius:{default:`var(--swk-border-radius)`},fontFamily:{default:`var(--swk-font-family)`}}},presets:[ND(),tO({disablePreflight:!0})]}),typeof document>`u`?SD():xD(`style[data-library]`)),$=e=>nO(`!(${e})`);DD.bind(nO),wD.bind(nO),TD.bind(nO);var rO=eD`
6
+ .stellar-wallets-kit *,
7
+ .stellar-wallets-kit ::after,
8
+ .stellar-wallets-kit ::before,
9
+ .stellar-wallets-kit ::backdrop,
10
+ .stellar-wallets-kit ::file-selector-button {
11
+ box-sizing: border-box;
12
+ margin: 0;
13
+ padding: 0;
14
+ border: 0 solid;
15
+ }
16
+ .stellar-wallets-kit :host {
17
+ line-height: 1.5;
18
+ -webkit-text-size-adjust: 100%;
19
+ tab-size: 4;
20
+ font-family:
21
+ ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
22
+ "Noto Color Emoji";
23
+ font-feature-settings: normal;
24
+ font-variation-settings: normal;
25
+ -webkit-tap-highlight-color: transparent;
26
+ }
27
+ .stellar-wallets-kit hr {
28
+ height: 0;
29
+ color: inherit;
30
+ border-top-width: 1px;
31
+ }
32
+ .stellar-wallets-kit abbr:where([title]) {
33
+ -webkit-text-decoration: underline dotted;
34
+ text-decoration: underline dotted;
35
+ }
36
+ .stellar-wallets-kit h1,
37
+ .stellar-wallets-kit h2,
38
+ .stellar-wallets-kit h3,
39
+ .stellar-wallets-kit h4,
40
+ .stellar-wallets-kit h5,
41
+ .stellar-wallets-kit h6 {
42
+ font-size: inherit;
43
+ font-weight: inherit;
44
+ }
45
+ .stellar-wallets-kit a {
46
+ color: inherit;
47
+ -webkit-text-decoration: inherit;
48
+ text-decoration: inherit;
49
+ }
50
+ .stellar-wallets-kit b,
51
+ .stellar-wallets-kit strong {
52
+ font-weight: bolder;
53
+ }
54
+ .stellar-wallets-kit code,
55
+ .stellar-wallets-kit kbd,
56
+ .stellar-wallets-kit samp,
57
+ .stellar-wallets-kit pre {
58
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
59
+ font-feature-settings: normal;
60
+ font-variation-settings: normal;
61
+ font-size: 1em;
62
+ }
63
+ .stellar-wallets-kit small {
64
+ font-size: 80%;
65
+ }
66
+ .stellar-wallets-kit sub,
67
+ .stellar-wallets-kit sup {
68
+ font-size: 75%;
69
+ line-height: 0;
70
+ position: relative;
71
+ vertical-align: baseline;
72
+ }
73
+ .stellar-wallets-kit sub {
74
+ bottom: -0.25em;
75
+ }
76
+ .stellar-wallets-kit sup {
77
+ top: -0.5em;
78
+ }
79
+ .stellar-wallets-kit table {
80
+ text-indent: 0;
81
+ border-color: inherit;
82
+ border-collapse: collapse;
83
+ }
84
+ .stellar-wallets-kit :-moz-focusring {
85
+ outline: auto;
86
+ }
87
+ .stellar-wallets-kit progress {
88
+ vertical-align: baseline;
89
+ }
90
+ .stellar-wallets-kit summary {
91
+ display: list-item;
92
+ }
93
+ .stellar-wallets-kit ol,
94
+ .stellar-wallets-kit ul,
95
+ .stellar-wallets-kit menu {
96
+ list-style: none;
97
+ }
98
+ .stellar-wallets-kit img,
99
+ .stellar-wallets-kit svg,
100
+ .stellar-wallets-kit video,
101
+ .stellar-wallets-kit canvas,
102
+ .stellar-wallets-kit audio,
103
+ .stellar-wallets-kit iframe,
104
+ .stellar-wallets-kit embed,
105
+ .stellar-wallets-kit object {
106
+ display: block;
107
+ vertical-align: middle;
108
+ }
109
+ .stellar-wallets-kit img,
110
+ .stellar-wallets-kit video {
111
+ max-width: 100%;
112
+ height: auto;
113
+ }
114
+ .stellar-wallets-kit button,
115
+ .stellar-wallets-kit input,
116
+ .stellar-wallets-kit select,
117
+ .stellar-wallets-kit optgroup,
118
+ .stellar-wallets-kit textarea,
119
+ .stellar-wallets-kit ::file-selector-button {
120
+ font: inherit;
121
+ font-feature-settings: inherit;
122
+ font-variation-settings: inherit;
123
+ letter-spacing: inherit;
124
+ color: inherit;
125
+ border-radius: 0;
126
+ background-color: transparent;
127
+ opacity: 1;
128
+ }
129
+ .stellar-wallets-kit :where(select:is([multiple], [size])) optgroup {
130
+ font-weight: bolder;
131
+ }
132
+ .stellar-wallets-kit :where(select:is([multiple], [size])) optgroup option {
133
+ padding-inline-start: 20px;
134
+ }
135
+ .stellar-wallets-kit ::file-selector-button {
136
+ margin-inline-end: 4px;
137
+ }
138
+ .stellar-wallets-kit ::placeholder {
139
+ opacity: 1;
140
+ }
141
+ .stellar-wallets-kit textarea {
142
+ resize: vertical;
143
+ }
144
+ .stellar-wallets-kit ::-webkit-search-decoration {
145
+ -webkit-appearance: none;
146
+ }
147
+ .stellar-wallets-kit ::-webkit-date-and-time-value {
148
+ min-height: 1lh;
149
+ text-align: inherit;
150
+ }
151
+ .stellar-wallets-kit ::-webkit-datetime-edit {
152
+ display: inline-flex;
153
+ }
154
+ .stellar-wallets-kit ::-webkit-datetime-edit-fields-wrapper {
155
+ padding: 0;
156
+ }
157
+ .stellar-wallets-kit ::-webkit-datetime-edit,
158
+ .stellar-wallets-kit ::-webkit-datetime-edit-year-field,
159
+ .stellar-wallets-kit ::-webkit-datetime-edit-month-field,
160
+ .stellar-wallets-kit ::-webkit-datetime-edit-day-field,
161
+ .stellar-wallets-kit ::-webkit-datetime-edit-hour-field,
162
+ .stellar-wallets-kit ::-webkit-datetime-edit-minute-field,
163
+ .stellar-wallets-kit ::-webkit-datetime-edit-second-field,
164
+ .stellar-wallets-kit ::-webkit-datetime-edit-millisecond-field,
165
+ .stellar-wallets-kit ::-webkit-datetime-edit-meridiem-field {
166
+ padding-block: 0;
167
+ }
168
+ .stellar-wallets-kit ::-webkit-calendar-picker-indicator {
169
+ line-height: 1;
170
+ }
171
+ .stellar-wallets-kit :-moz-ui-invalid {
172
+ box-shadow: none;
173
+ }
174
+ .stellar-wallets-kit button,
175
+ .stellar-wallets-kit input:where([type="button"], [type="reset"], [type="submit"]),
176
+ .stellar-wallets-kit ::file-selector-button {
177
+ appearance: button;
178
+ }
179
+ .stellar-wallets-kit ::-webkit-inner-spin-button,
180
+ .stellar-wallets-kit ::-webkit-outer-spin-button {
181
+ height: auto;
182
+ }
183
+ .stellar-wallets-kit [hidden]:where(:not([hidden="until-found"])) {
184
+ display: none !important;
185
+ }
186
+ `,iO;(function(e){e.xs=`xs`,e.sm=`sm`,e.md=`md`,e.lg=`lg`,e.xl=`xl`})(iO||={});var aO;(function(e){e.primary=`primary`,e.secondary=`secondary`,e.ghost=`ghost`,e.free=`free`})(aO||={});var oO;(function(e){e.regular=`regular`,e.icon=`icon`})(oO||={});var sO=`flex items-center justify-center font-semibold easy-in-out transition leading-none`;function cO({size:e=iO.md,mode:t=aO.primary,shape:n=oO.regular,classes:r,styles:i,children:a,onClick:o}){let s=dD({"border-none bg-primary text-primary-foreground shadow-default hover:opacity-70 focus:opacity-90":t===aO.primary,"border-none bg-background text-foreground shadow-default hover:opacity-70 focus:opacity-90":t===aO.secondary,"bg-transparent text-foreground border-transparent border-1 hover:border-light-gray":t===aO.ghost}),c=dD({"rounded-default":n===oO.regular,"rounded-full":n===oO.icon}),l=dD({"text-xs":e===iO.xs,"text-sm":e!==iO.xs}),u=dD({"px-2 py-1":n===oO.regular&&(e===iO.xs||e===iO.sm),"px-2.5 py-1.5":n===oO.regular&&e===iO.md,"px-3 py-2":n===oO.regular&&e===iO.lg,"px-3.5 py-2.5":n===oO.regular&&e===iO.xl,"p-1":n===oO.icon&&e===iO.xs,"p-1.5":n===oO.icon&&e===iO.sm,"p-2":n===oO.icon&&e===iO.md,"p-2.5":n===oO.icon&&e===iO.lg,"p-3":n===oO.icon&&e===iO.xl});return fE`
187
+ <button onClick="${()=>o()}" type="button" style="${i}" class="${t===aO.free?``:$(dD(`cursor-pointer`,sO,s,c,l,u))} ${r}">
188
+ ${a}
189
+ </button>
190
+ `}function lO(){ic.value=[]}function uO(e){rc.value=e,ic.value=[...ic.value,e]}function dO(){let e=ic.value;e.pop(),ic.value=e.slice(),rc.value=e[e.length-1]}function fO({children:e,isActive:t,duration:n=300}){let[r,i]=es(t),[a,o]=es(t);return ns(()=>{if(t)o(!0),globalThis.requestAnimationFrame(()=>i(!0));else{i(!1);let e=globalThis.setTimeout(()=>o(!1),n);return()=>globalThis.clearTimeout(e)}},[t,n]),a?fE`<div style=${{position:r?`relative`:`absolute`,inset:0,transition:`opacity ${n}ms ease, transform ${n}ms ease, position ${n}ms ease`,opacity:+!!r,scrollbarWidth:`none`}}>${e}</div>`:null}function pO({currentRoute:e,pages:t,duration:n=300}){return fE`
191
+ <div style=${{position:`relative`,width:`100%`,height:`100%`}}>${Object.entries(t).map(([t,r])=>fE`
192
+ <${fO} id=${t} key=${t} isActive=${e===t} duration=${n}>
193
+ <${r} />
194
+ <//>
195
+ `)}</div>
196
+ `}function mO(){uO(Ba.HELP_PAGE)}function hO(){dO()}var gO=js(()=>rc.value===Ba.AUTH_OPTIONS?fE`
197
+ <${cO} onClick=${()=>mO()}
198
+ size="${iO.md}"
199
+ mode="${aO.ghost}"
200
+ shape="${oO.icon}">
201
+ <svg class="${$(`w-4 h-4`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"></path></svg>
202
+ <//>
203
+ `:ic.value.length<2?fE``:fE`
204
+ <${cO} onClick=${()=>hO()}
205
+ size="${iO.md}"
206
+ mode="${aO.ghost}"
207
+ shape="${oO.icon}">
208
+
209
+ <svg class="${$(`w-4 h-4`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z"></path></svg>
210
+ <//>
211
+ `);function _O(){return fE`
212
+ <header class="${$(`flex items-center px-3 py-2`)}">
213
+ <div class="${$(`w-3/12 flex justify-start`)}">
214
+ ${gO.value}
215
+ </div>
216
+
217
+ <div class="${$(`w-6/12 text-center`)}">
218
+ <h1 class="${$(`text-foreground-strong font-semibold`)}">
219
+ ${Zs.value}
220
+ </h1>
221
+ </div>
222
+
223
+ <div class="${$(`w-3/12 flex justify-end`)}">
224
+ <${cO} onClick=${()=>yc.next()}
225
+ size="${iO.md}"
226
+ mode="${aO.ghost}"
227
+ shape="${oO.icon}">
228
+
229
+ <svg class="${$(`w-4 h-4`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path></svg>
230
+ <//>
231
+ </div>
232
+ </header>
233
+ `}function vO(){return fE`
234
+ <footer class="${$(`w-full text-center p-2 border-t-1 border-t-border`)}">
235
+ <p class="${$(`text-xs text-foreground`)}">
236
+ Powered by
237
+ <a target="_blank" href="https://stellarwalletskit.dev/" class="${$(`font-semibold underline ml-1`)}">
238
+ Stellar Wallets Kit
239
+ </a>
240
+ </p>
241
+ </footer>
242
+ `}var yO;(function(e){e.xs=`w-6 h-6`,e.sm=`w-8 h-8`,e.md=`w-10 h-10`,e.lg=`w-12 h-12`,e.xl=`w-14 h-14`})(yO||={});var bO=`inline-block rounded-full outline -outline-offset-1 outline-black/5 dark:outline-white/10`;function xO(e){return fE`
243
+ <img alt="${e.alt}" src="${e.image}" class="${$(dD(bO,e.size))}" />
244
+ `}var SO=js(()=>{let e=sc.value.reduce((e,t)=>({available:t.isAvailable?[...e.available,t]:e.available,unavailable:t.isAvailable?e.unavailable:[...e.unavailable,t]}),{available:[],unavailable:[]}),t;try{let e=globalThis?.localStorage.getItem(Ua.usedWalletsIds);t=e?JSON.parse(e):[]}catch(e){console.error(e),t=[]}let n=[],r=[];for(let i of e.available)t.find(e=>e===i.id)?n.push(i):r.push(i);return[...n.sort((e,n)=>t.indexOf(e.id)-t.indexOf(n.id)),...r,...e.unavailable]});async function CO(e){if(!e.isAvailable)globalThis.open(e.url,`_blank`);else if(oc.value=e.id,_c.next(e),e.type===Ga.HW_WALLET)uO(Ba.HW_ACCOUNTS_FETCHER);else try{let{address:e}=await lc.value.getAddress();ac.value=e,vc.next(e)}catch(e){vc.next(e)}}function wO(){Zs.value=`Connect Wallet`;let e=SO.value.find(e=>e.isPlatformWrapper);if(e)return CO(e).then(),fE`
245
+ <div class="${$(`w-full text-center px-4 py-8`)}">
246
+ <div class="${$(`w-full mb-4`)}">
247
+ <${xO} alt="${e.name} icon" image="${e.icon}" size="${yO.md}" />
248
+ </div>
249
+
250
+ <p class="${$(`text-foreground text-lg w-full`)}">
251
+ Connecting to your wallet using <b>${e.name}</b>
252
+ </p>
253
+ </div>
254
+ `;let t=fE`
255
+ <div class="${$(`w-full text-center text-foreground font-semibold p-4`)}">Loading wallets...</div>
256
+ `,n=SO.value.map(e=>fE`
257
+ <li
258
+ onClick="${()=>CO(e)}"
259
+ class="${$(`px-2 py-2 cursor-pointer flex justify-between items-center bg-background hover:border-light-gray border-1 border-transparent rounded-default duration-150 ease active:bg-background active:border-gray`)}"
260
+ >
261
+ <div class="${$(`flex items-center gap-2`)}">
262
+ <${xO} class="${$(`mr-2`)}" alt="${e.name} icon" image="${e.icon}" size="${yO.sm}" />
263
+ <p class="${$(`text-foreground font-semibold`)}">${e.name}</p>
264
+ </div>
265
+
266
+ ${Qs.value&&!e.isAvailable?fE`
267
+ <div class="${$(`ml-4 flex items-center`)}">
268
+ <small
269
+ class="${$(`inline-flex items-center border-1 border-border px-2 py-1 rounded-default text-foreground-secondary text-xs bg-background-secondary`)}"
270
+ >
271
+ ${ec.value}
272
+
273
+ <svg class="${$(`w-4 h-4`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
274
+ <path d="M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"></path>
275
+ </svg>
276
+ </small>
277
+ </div>
278
+ `:``}
279
+ </li>
280
+ `);return fE`
281
+ <ul class="${$(`w-full grid gap-2 px-2 py-4`)}">
282
+ ${SO.value.length===0?t:n}
283
+ </ul>
284
+ `}function TO(){return fE`
285
+ <section class="${$(`w-full p-4 pb-8 rounded-tl-default`)}">
286
+ <div class="${$(`w-full mb-6`)}">
287
+ <h3 class="${$(`text-foreground-strong font-semibold text-lg mb-2`)}">What is a wallet?</h3>
288
+ <p class="${$(`text-foreground text-sm`)}">
289
+ Wallets are used to send, receive, and store the keys you use to sign blockchain transactions.
290
+ </p>
291
+ </div>
292
+
293
+ <div class="w-full">
294
+ <h3 class="${$(`text-foreground-strong font-semibold text-lg mb-2`)}">What is Stellar?</h3>
295
+ <p class="${$(`text-foreground text-sm`)}">
296
+ Stellar is a decentralized, public blockchain that gives developers the tools to create experiences that are more
297
+ like cash than crypto.
298
+ </p>
299
+ </div>
300
+ </section>
301
+ `}var EO=Es(!1);function DO(){if(!ac.value)throw Error(`Text to copy to the clipboard can't be undefined`);navigator.clipboard.writeText(ac.value).then(()=>{EO.value=!0,setTimeout(()=>{EO.value=!1},2500)}).catch(e=>console.error(e))}function OO(){return Zs.value=``,fE`
302
+ <section class="${$(`w-full flex flex-col pb-8`)}">
303
+ <div class="${$(`w-full flex justify-center mb-4`)}">
304
+ <${xO} alt="${lc.value?.productName} icon" image="${lc.value?.productIcon}" size="${yO.xl}" />
305
+ </div>
306
+
307
+ <div class="${$(`w-full flex items-center justify-center mb-2`)}">
308
+ <h1 class="${$(`text-lg font-semibold text-foreground`)}">
309
+ ${ac.value&&`${ac.value.slice(0,6)}....${ac.value.slice(-6)}`}
310
+ </h1>
311
+ </div>
312
+
313
+ <div class="${$(`w-full flex flex-col items-center justify-center gap-2`)}">
314
+ <${cO} mode="${aO.ghost}" onClick="${DO}" size="${iO.sm}">
315
+ ${EO.value?`Address copied!`:fE`Copy address`} <svg class="${$(`w-4 h-4 ml-2`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"></path></svg>
316
+ <//>
317
+
318
+ <${cO} mode="${aO.ghost}" onClick="${xc}" size="${iO.sm}">
319
+ Disconnect <svg class="${$(`w-4 h-4 ml-2`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11H13V13H5V16L0 12L5 8V11ZM3.99927 18H6.70835C8.11862 19.2447 9.97111 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.97111 4 8.11862 4.75527 6.70835 6H3.99927C5.82368 3.57111 8.72836 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C8.72836 22 5.82368 20.4289 3.99927 18Z"></path></svg>
320
+ <//>
321
+ </div>
322
+ </section>
323
+ `}var kO={error:null,loading:!0,accounts:[]},AO=class extends vo{constructor(){super(...arguments),Object.defineProperty(this,"stateSignal",{enumerable:!0,configurable:!0,writable:!0,value:Es(kO)})}componentWillMount(){Zs.value=`Wallet Accounts`,this.fetchAccounts()}async fetchAccounts(){let e=lc.value;this.stateSignal.value=kO,e.disconnect&&(await e.disconnect(),await new Promise(e=>setTimeout(e,500)));try{let t=await e.getAddresses();this.stateSignal.value={...this.stateSignal.value,loading:!1,accounts:t}}catch(e){this.stateSignal.value={...this.stateSignal.value,error:e.message}}}async selectAccount(e){ac.value=e.publicKey,vc.next(e.publicKey)}render(){let e=fE`
324
+ <div class="${$(`py-8 w-full flex justify-center items-center text-foreground`)}">
325
+ <svg class="${$(`w-8 h-8 text-gray-200 animate-spin`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
326
+ <path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>
327
+ </svg>
328
+ </div>
329
+ `,t=fE`
330
+ <ul class="${$(`w-full grid gap-2 px-2 py-4 text-foreground`)}">
331
+ ${dc.value.map(({publicKey:e,index:t})=>fE`
332
+ <li onClick=${()=>this.selectAccount({publicKey:e,index:t})}
333
+ class="${$(`px-2 py-2 cursor-pointer flex justify-between items-center bg-background hover:border-light-gray border-1 border-transparent rounded-default duration-150 ease active:bg-background active:border-gray`)}">
334
+ ${e.slice(0,6)}....${e.slice(-6)}
335
+
336
+ <span class="dialog-text">(44'/148'/${t}')</span>
337
+ </li>
338
+ `)}
339
+ </ul>
340
+ `,n=fE`
341
+ <div class="${$(`w-full text-center text-foreground py-4`)}">
342
+ <div class="${$(`text-danger`)}">
343
+ <svg class="${$(`inline-block mx-auto w-8 h-8 mb-2`)}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
344
+ <path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM4.20568 19.0002H19.7941L11.9999 5.50017L4.20568 19.0002ZM10.9999 16.0002H12.9999V18.0002H10.9999V16.0002ZM10.9999 9.00017H12.9999V14.0002H10.9999V9.00017Z"></path>
345
+ </svg>
346
+ </div>
347
+
348
+ <h3 class="${$(`text-sm font-semibold`)}">
349
+ Error while fetching accounts with reason:
350
+ </h3>
351
+
352
+ <p class="${$(`mb-4 text-sm`)}">
353
+ ${this.stateSignal.value.error}
354
+ </p>
355
+
356
+ <div class="${$(`w-full flex justify-center items-center`)}">
357
+ <${cO} onClick=${()=>this.fetchAccounts()} size="${iO.md}">
358
+ Retry
359
+ <//>
360
+ </div>
361
+ </div>
362
+ `;return this.stateSignal.value.error?n:this.stateSignal.value.loading?e:t}},jO={[Ba.AUTH_OPTIONS]:wO,[Ba.HELP_PAGE]:TO,[Ba.PROFILE_PAGE]:OO,[Ba.HW_ACCOUNTS_FETCHER]:AO},MO=eD`
363
+ .glass {
364
+ backdrop-filter: blur(10px);
365
+ background-color: color-mix(in srgb, var(--swk-background) 25%, transparent);
366
+ }
367
+ `;function NO(){return fE`
368
+ <section class="stellar-wallets-kit ${$(dD([Xs.value===Va.FIXED?`fixed flex left-0 top-0 z-[999] w-full h-full`:`inline-flex`,`font-default justify-center items-center`]))} ${$(rO)} ${$(MO)}">
369
+ ${Xs.value===Va.FIXED?fE`
370
+ <div class="${$(`absolute left-0 top-0 z-0 w-full h-full bg-[rgba(0,0,0,0.5)]`)}" onClick="${()=>yc.next()}"></div>
371
+ `:``}
372
+
373
+ <section
374
+ class="${$(`w-full h-fit relative max-w-[22rem] max-h-[39.4375rem] grid grid-cols-1 grid-rows-[auto_1fr_auto] bg-background rounded-default shadow-default transition-all duration-[0.5s] ease-in-out overflow-hidden max-h-[400px] overflow-y-scroll`)}"
375
+ >
376
+ <div class="${$(`col-span-1 top-0 sticky z-50`)} glass">
377
+ <${_O} />
378
+ </div>
379
+
380
+ <div class="${$(`col-span-1 relative z-10`)}">
381
+ <${pO}
382
+ currentRoute="${rc.value}"
383
+ pages="${jO}"
384
+ duration="${400}"
385
+ />
386
+ </div>
387
+
388
+ <div class="${$(`col-span-1 bottom-0 sticky z-50`)} glass">
389
+ <${vO} />
390
+ </div>
391
+ </section>
392
+ </section>
393
+ `}async function PO(e){if(e&&e(),cc.value===void 0)throw Error(`The kit hasn't been initiated.`);!lc.value||!ac.value?await IO.authModal():await IO.profileModal()}function FO(e){let t=ac.value?`${ac.value.slice(0,4)}....${ac.value.slice(-6)}`:`Connect Wallet`;return fE`
394
+ <div class="${$(rO)} ${$(`inline-block`)}">
395
+ <${cO} styles=${e.styles}
396
+ classes=${e.classes}
397
+ mode=${e.mode||aO.primary}
398
+ shape=${e.shape||oO.regular}
399
+ size=${e.size}
400
+ onClick=${()=>PO(e.onClick)}>
401
+ ${e.children?e.children:t}
402
+ <//>
403
+ </div>
404
+ `}var IO=class e{static init(t){cc.value=t.modules,t.selectedWalletId&&e.setWallet(t.selectedWalletId),t.network&&e.setNetwork(t.network),t.theme&&e.setTheme(t.theme),t.authModal&&(t.authModal.showInstallLabel!==void 0&&(Qs.value=t.authModal.showInstallLabel),t.authModal.hideUnsupportedWallets!==void 0&&($s.value=t.authModal.hideUnsupportedWallets))}static get selectedModule(){if(!lc.value)throw{code:-3,message:`Please set the wallet first`};return lc.value}static setWallet(e){let t=cc.value.find(t=>t.productId===e);if(!t)throw Error(`Wallet id "${e}" is not and existing module`);oc.value=t.productId}static setNetwork(e){tc.value=e}static setTheme(e=Ha){nc.value=e}static async getAddress(){if(!ac.value)throw{code:-1,message:`No wallet has been connected.`};return{address:ac.value}}static async fetchAddress(){let{address:t}=await e.selectedModule.getAddress();return ac.value=t,vc.next(t),{address:t}}static signTransaction(t,n){return e.selectedModule.signTransaction(t,{...n,networkPassphrase:n?.networkPassphrase||tc.value})}static signAuthEntry(t,n){return e.selectedModule.signAuthEntry(t,{...n,networkPassphrase:n?.networkPassphrase||tc.value})}static signMessage(t,n){return e.selectedModule.signMessage(t,{...n,networkPassphrase:n?.networkPassphrase||tc.value})}static signAndSubmitTransaction(t,n){let r=e.selectedModule;if(!r.signAndSubmitTransaction)throw{code:-3,message:`The selected module "${r.productName}" does not support the "signAndSubmitTransaction" method.`};return r.signAndSubmitTransaction(t,{...n,networkPassphrase:n?.networkPassphrase||tc.value})}static getNetwork(){return e.selectedModule.getNetwork()}static async disconnect(){xc()}static on(e,t){switch(e){case Ka.STATE_UPDATED:{let e,n;return Is(()=>{(ac.value!==e||tc.value!==n)&&(e=ac.value,n=tc.value,t({eventType:Ka.STATE_UPDATED,payload:{address:ac.value,networkPassphrase:tc.value}}))})}case Ka.WALLET_SELECTED:{let e;return Is(()=>{oc.value!==e&&(e=oc.value,t({eventType:Ka.WALLET_SELECTED,payload:{id:oc.value}}))})}case Ka.DISCONNECT:return bc.subscribe(()=>{t({eventType:Ka.DISCONNECT,payload:{}})});default:throw Error(`${e} event type is not supported`)}}static async refreshSupportedWallets(){let e=await Promise.all(cc.value.map(async e=>{let t=new Promise(e=>setTimeout(()=>e(!1),1e3));return{id:e.productId,name:e.productName,type:e.moduleType,icon:e.productIcon,isAvailable:await Promise.race([t,e.isAvailable()]).catch(()=>!1),isPlatformWrapper:await Promise.race([t,e.isPlatformWrapper?e.isPlatformWrapper():Promise.resolve(!1)]).catch(()=>!1),url:e.productUrl}}));return sc.value=e,e}static async createButton(e,t={}){zo(fE`
405
+ <${FO}
406
+ styles="${t.styles}"
407
+ classes="${t.classes}"
408
+ mode="${t.mode}"
409
+ shape="${t.shape}"
410
+ size="${t.size}"
411
+ onClick="${()=>t.onClick&&t.onClick()}"
412
+ children="${t.children}"
413
+ />
414
+ `,e)}static async authModal(t){lO(),uO(Ba.AUTH_OPTIONS),Xs.value=t?.container?Va.BLOCK:Va.FIXED;let n=document.createElement(`div`);(t?.container||document.body).appendChild(n),zo(fE`
415
+ <${NO} />
416
+ `,n),await e.refreshSupportedWallets();let r=[],i=()=>{for(let e of r)e();zo(null,n),n.parentNode?.removeChild(n)};return new Promise((e,t)=>{let n=vc.subscribe(n=>{typeof n==`string`?e({address:n}):t(H(n))}),i=yc.subscribe(()=>{t({code:-1,message:`The user closed the modal.`})});r.push(n),r.push(i)}).then(e=>(i(),e)).catch(e=>{throw i(),e})}static async profileModal(e){if(!ac.value)throw{code:-1,message:`There is no active address, the user needs to authenticate first.`};lO(),uO(Ba.PROFILE_PAGE),Xs.value=e?.container?Va.BLOCK:Va.FIXED;let t=document.createElement(`div`);(e?.container||document.body).appendChild(t),zo(fE`
417
+ <${NO} />
418
+ `,t);let n=yc.subscribe(()=>{n(),zo(null,t),t.parentNode?.removeChild(t)})}},LO=`metamask`,RO=class{constructor(){this.moduleType=Ga.HOT_WALLET,this.productId=LO,this.productName=`MetaMask`,this.productUrl=`https://metamask.io`,this.productIcon=QT,this.adapter=new sE}async isAvailable(){return sE.isMetaMaskAvailable()}async getAddress(e){if(e?.skipRequestAccess===!0){let e=await this.adapter.getAddress();if(e.error)throw e.error;return{address:e.address}}let t=await this.adapter.requestAccess();if(t.error)throw t.error;return{address:t.address}}async signTransaction(e,t){let n=await this.adapter.signTransaction(e,t);if(n.error)throw n.error;return{signedTxXdr:n.signedTxXdr,signerAddress:n.signerAddress}}async signAuthEntry(e,t){let n=await this.adapter.signAuthEntry(e,t);if(n.error)throw n.error;if(!n.signedAuthEntry)throw{code:rE.NOT_CONNECTED,message:`MetaMask did not return a signed auth entry.`};return{signedAuthEntry:n.signedAuthEntry,signerAddress:n.signerAddress}}async signMessage(e,t){let n=await this.adapter.signMessage(e,t);if(n.error)throw n.error;return{signedMessage:n.signedMessage,signerAddress:n.signerAddress}}async getNetwork(){let e=await this.adapter.getNetwork();if(e.error)throw e.error;return{network:e.network,networkPassphrase:e.networkPassphrase}}async disconnect(){let e=await this.adapter.disconnect();if(e.error)throw e.error}onChange(e){this.adapter.on(`accountsChanged`,t=>{let n=t;this.adapter.getNetwork().then(({network:t,networkPassphrase:r})=>e({address:n,network:t,networkPassphrase:r})).catch(t=>e({address:``,network:``,networkPassphrase:``,error:{code:rE.GENERIC,message:t.message}}))})}},zO=`onekey`,BO=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:zO}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`OneKey Wallet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://onekey.so/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://uni.onekey-asset.com/static/logo/onekey.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`OneKey Wallet is not installed`)}async isAvailable(){return typeof window<`u`&&!!window.$onekey?.stellar}async getAddress(){try{return await this.runChecks(),{address:await window.$onekey.stellar.getPublicKey()}}catch(e){throw H(e)}}async signTransaction(e,t){try{return await this.runChecks(),await window.$onekey.stellar.signTransaction(e,t)}catch(e){throw H(e)}}async signAuthEntry(e,t){try{return await this.runChecks(),await window.$onekey.stellar.signAuthEntry(e,t)}catch(e){throw H(e)}}async signMessage(e,t){try{return await this.runChecks(),await window.$onekey.stellar.signMessage(e,t)}catch(e){throw H(e)}}async getNetwork(){throw{code:-3,message:`OneKey does not support the "getNetwork" function`}}},VO=`rabet`,HO=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:VO}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Rabet`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://rabet.io/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/rabet.png`})}async runChecks(){if(!await this.isAvailable())throw Error(`Rabet is not installed`)}isAvailable(){return new Promise(e=>{setTimeout(()=>{e(typeof window<`u`&&!!window.rabet)},100)})}async getAddress(){try{await this.runChecks();let{publicKey:e}=await window.rabet.connect();return{address:e}}catch(e){throw H(e)}}async signTransaction(e,t){if(t?.networkPassphrase&&t.networkPassphrase!==Wa.PUBLIC&&t.networkPassphrase!==Wa.TESTNET)throw Error(`Rabet doesn't support the network: ${t.networkPassphrase}`);t?.address&&console.warn(`Rabet doesn't allow specifying the network that should be used, we skip the value`);try{return await this.runChecks(),{signedTxXdr:(await window.rabet.sign(e,t?.networkPassphrase===Wa.PUBLIC?UO.PUBLIC:UO.TESTNET))?.xdr}}catch(e){throw H(e)}}signAuthEntry(){return Promise.reject({code:-3,message:`Rabet does not support the "signAuthEntry" function`})}signMessage(){return Promise.reject({code:-3,message:`Rabet does not support the "signMessage" function`})}getNetwork(){return Promise.reject({code:-3,message:`Rabet does not support the "getNetwork" function`})}},UO;(function(e){e.PUBLIC=`mainnet`,e.TESTNET=`testnet`})(UO||={});var WO=`scopuly`,GO=800,KO=class{constructor(){Object.defineProperty(this,"removeChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"providerInitializedListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:WO}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`Scopuly`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://extension.scopuly.com/`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://scopuly.com/img/logo/icon.png`})}async runChecks(){if(!await this.isAvailable())throw{code:-3,message:`Scopuly provider is not available. Install the Scopuly browser extension or open the dApp inside the Scopuly app.`}}async isAvailable(){return typeof window>`u`?!1:this.isProviderReady()?!0:await new Promise(e=>{let t=!1,n=n=>{t||(t=!0,clearTimeout(i),window.removeEventListener(`scopuly#initialized`,r),e(n))},r=()=>n(this.isProviderReady()),i=setTimeout(()=>n(this.isProviderReady()),GO);window.addEventListener(`scopuly#initialized`,r,{once:!0}),this.isProviderReady()&&n(!0)})}async isPlatformWrapper(){return this.isProviderReady()&&window.scopuly?.platform===`mobile`}onChange(e){if(this.removeChangeListener?.(),this.removeChangeListener=void 0,typeof window>`u`)return;this.providerInitializedListener&&=(window.removeEventListener(`scopuly#initialized`,this.providerInitializedListener),void 0);let t=()=>{this.isProviderReady()&&(this.removeChangeListener=this.getProvider().onChange(t=>{e({address:t.address,network:t.network,networkPassphrase:t.networkPassphrase})}))};this.isProviderReady()?t():(this.providerInitializedListener=()=>{this.providerInitializedListener=void 0,t()},window.addEventListener(`scopuly#initialized`,this.providerInitializedListener,{once:!0}))}async getAddress(e){try{if(await this.runChecks(),e?.skipRequestAccess!==!0){let e=await this.getProvider().requestAccess();if(e.error)throw e.error;if(e.address)return{address:e.address}}let t=await this.getProvider().getAddress();if(t.error)throw t.error;if(t.address)return{address:t.address};let n=await this.getProvider().getPublicKey();if(!n)throw{code:-3,message:`Scopuly returned an empty address.`};return{address:n}}catch(e){throw H(e)}}async signTransaction(e,t){try{await this.runChecks();let{signedTxXdr:n,signedXDR:r,signerAddress:i,error:a}=await this.getProvider().signTransaction(e,t);if(a)throw a;let o=n||r;if(!o)throw{code:-3,message:`Scopuly returned an empty signed transaction.`};return{signedTxXdr:o,signerAddress:i}}catch(e){throw H(e)}}async signAndSubmitTransaction(e,t){try{await this.runChecks();let n=await this.getProvider().signAndSubmitTransaction(e,t);if(n.error)throw n.error;return{status:n.status}}catch(e){throw H(e)}}async signAuthEntry(e,t){try{await this.runChecks();let n=await this.getProvider().signAuthEntry(e,t);if(n.error)throw n.error;if(!n.signedAuthEntry)throw{code:-3,message:`Scopuly returned an empty signed auth entry.`};return{signedAuthEntry:n.signedAuthEntry,signerAddress:n.signerAddress}}catch(e){throw H(e)}}async signMessage(e,t){try{await this.runChecks();let n=await this.getProvider().signMessage(e,t);if(n.error)throw n.error;if(!n.signedMessage)throw{code:-3,message:`Scopuly returned an empty signed message.`};return{signedMessage:n.signedMessage,signerAddress:n.signerAddress}}catch(e){throw H(e)}}async getNetwork(){try{await this.runChecks();let{network:e,networkPassphrase:t,error:n}=await this.getProvider().getNetwork();if(n)throw n;return{network:e,networkPassphrase:t}}catch(e){throw H(e)}}async disconnect(){await this.getProvider().disconnect()}getProvider(){if(typeof window>`u`||!window.scopuly)throw{code:-3,message:`Scopuly provider is not available. Install the Scopuly browser extension or open the dApp inside the Scopuly app.`};return window.scopuly}isProviderReady(){return typeof window>`u`||window.scopuly?.isScopuly!==!0?!1:window.scopuly.platform===`mobile`||window.scopuly.platform===`extension`}},qO=o(((e,t)=>{t.exports={}})),JO=o(((e,t)=>{(function(e){var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw Error(`no PRNG`)},r=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var a=t(),o=t([1]),s=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,ee=_,te=v,N=y,P,ne=0;ne<20;ne+=2)P=b+M|0,w^=P<<7|P>>>25,P=w+b|0,O^=P<<9|P>>>23,P=O+w|0,M^=P<<13|P>>>19,P=M+O|0,b^=P<<18|P>>>14,P=T+x|0,k^=P<<7|P>>>25,P=k+T|0,ee^=P<<9|P>>>23,P=ee+k|0,x^=P<<13|P>>>19,P=x+ee|0,T^=P<<18|P>>>14,P=A+E|0,te^=P<<7|P>>>25,P=te+A|0,S^=P<<9|P>>>23,P=S+te|0,E^=P<<13|P>>>19,P=E+S|0,A^=P<<18|P>>>14,P=N+j|0,C^=P<<7|P>>>25,P=C+N|0,D^=P<<9|P>>>23,P=D+C|0,j^=P<<13|P>>>19,P=j+D|0,N^=P<<18|P>>>14,P=b+C|0,x^=P<<7|P>>>25,P=x+b|0,S^=P<<9|P>>>23,P=S+x|0,C^=P<<13|P>>>19,P=C+S|0,b^=P<<18|P>>>14,P=T+w|0,E^=P<<7|P>>>25,P=E+T|0,D^=P<<9|P>>>23,P=D+E|0,w^=P<<13|P>>>19,P=w+D|0,T^=P<<18|P>>>14,P=A+k|0,j^=P<<7|P>>>25,P=j+A|0,O^=P<<9|P>>>23,P=O+j|0,k^=P<<13|P>>>19,P=k+O|0,A^=P<<18|P>>>14,P=N+te|0,M^=P<<7|P>>>25,P=M+N|0,ee^=P<<9|P>>>23,P=ee+M|0,te^=P<<13|P>>>19,P=te+ee|0,N^=P<<18|P>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,ee=ee+_|0,te=te+v|0,N=N+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=ee>>>0&255,e[53]=ee>>>8&255,e[54]=ee>>>16&255,e[55]=ee>>>24&255,e[56]=te>>>0&255,e[57]=te>>>8&255,e[58]=te>>>16&255,e[59]=te>>>24&255,e[60]=N>>>0&255,e[61]=N>>>8&255,e[62]=N>>>16&255,e[63]=N>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,ee=_,te=v,N=y,P,ne=0;ne<20;ne+=2)P=b+M|0,w^=P<<7|P>>>25,P=w+b|0,O^=P<<9|P>>>23,P=O+w|0,M^=P<<13|P>>>19,P=M+O|0,b^=P<<18|P>>>14,P=T+x|0,k^=P<<7|P>>>25,P=k+T|0,ee^=P<<9|P>>>23,P=ee+k|0,x^=P<<13|P>>>19,P=x+ee|0,T^=P<<18|P>>>14,P=A+E|0,te^=P<<7|P>>>25,P=te+A|0,S^=P<<9|P>>>23,P=S+te|0,E^=P<<13|P>>>19,P=E+S|0,A^=P<<18|P>>>14,P=N+j|0,C^=P<<7|P>>>25,P=C+N|0,D^=P<<9|P>>>23,P=D+C|0,j^=P<<13|P>>>19,P=j+D|0,N^=P<<18|P>>>14,P=b+C|0,x^=P<<7|P>>>25,P=x+b|0,S^=P<<9|P>>>23,P=S+x|0,C^=P<<13|P>>>19,P=C+S|0,b^=P<<18|P>>>14,P=T+w|0,E^=P<<7|P>>>25,P=E+T|0,D^=P<<9|P>>>23,P=D+E|0,w^=P<<13|P>>>19,P=w+D|0,T^=P<<18|P>>>14,P=A+k|0,j^=P<<7|P>>>25,P=j+A|0,O^=P<<9|P>>>23,P=O+j|0,k^=P<<13|P>>>19,P=k+O|0,A^=P<<18|P>>>14,P=N+te|0,M^=P<<7|P>>>25,P=M+N|0,ee^=P<<9|P>>>23,P=ee+M|0,te^=P<<13|P>>>19,P=te+ee|0,N^=P<<18|P>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=N>>>0&255,e[13]=N>>>8&255,e[14]=N>>>16&255,e[15]=N>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){for(var s=new Uint8Array(16),c=new Uint8Array(64),l,u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){for(var a=new Uint8Array(16),o=new Uint8Array(64),s,c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],ee=this.r[0],te=this.r[1],N=this.r[2],P=this.r[3],ne=this.r[4],re=this.r[5],F=this.r[6],I=this.r[7],L=this.r[8],ie=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*ee,p+=5*ie*w,p+=5*L*T,p+=5*I*E,p+=5*F*D,f=p>>>13,p&=8191,p+=5*re*O,p+=5*ne*k,p+=5*P*A,p+=5*N*j,p+=5*te*M,f+=p>>>13,p&=8191,m=f,m+=C*te,m+=w*ee,m+=5*ie*T,m+=5*L*E,m+=5*I*D,f=m>>>13,m&=8191,m+=5*F*O,m+=5*re*k,m+=5*ne*A,m+=5*P*j,m+=5*N*M,f+=m>>>13,m&=8191,h=f,h+=C*N,h+=w*te,h+=T*ee,h+=5*ie*E,h+=5*L*D,f=h>>>13,h&=8191,h+=5*I*O,h+=5*F*k,h+=5*re*A,h+=5*ne*j,h+=5*P*M,f+=h>>>13,h&=8191,g=f,g+=C*P,g+=w*N,g+=T*te,g+=E*ee,g+=5*ie*D,f=g>>>13,g&=8191,g+=5*L*O,g+=5*I*k,g+=5*F*A,g+=5*re*j,g+=5*ne*M,f+=g>>>13,g&=8191,_=f,_+=C*ne,_+=w*P,_+=T*N,_+=E*te,_+=D*ee,f=_>>>13,_&=8191,_+=5*ie*O,_+=5*L*k,_+=5*I*A,_+=5*F*j,_+=5*re*M,f+=_>>>13,_&=8191,v=f,v+=C*re,v+=w*ne,v+=T*P,v+=E*N,v+=D*te,f=v>>>13,v&=8191,v+=O*ee,v+=5*ie*k,v+=5*L*A,v+=5*I*j,v+=5*F*M,f+=v>>>13,v&=8191,y=f,y+=C*F,y+=w*re,y+=T*ne,y+=E*P,y+=D*N,f=y>>>13,y&=8191,y+=O*te,y+=k*ee,y+=5*ie*A,y+=5*L*j,y+=5*I*M,f+=y>>>13,y&=8191,b=f,b+=C*I,b+=w*F,b+=T*re,b+=E*ne,b+=D*P,f=b>>>13,b&=8191,b+=O*N,b+=k*te,b+=A*ee,b+=5*ie*j,b+=5*L*M,f+=b>>>13,b&=8191,x=f,x+=C*L,x+=w*I,x+=T*F,x+=E*re,x+=D*ne,f=x>>>13,x&=8191,x+=O*P,x+=k*N,x+=A*te,x+=j*ee,x+=5*ie*M,f+=x>>>13,x&=8191,S=f,S+=C*ie,S+=w*L,S+=T*I,S+=E*F,S+=D*re,f=S>>>13,S&=8191,S+=O*ne,S+=k*P,S+=A*N,S+=j*te,S+=M*ee,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){for(var n=0;n<16;n++)e[n]=t[n]|0}function ee(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function te(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function N(e,n){var r,i,a,o=t(),s=t();for(r=0;r<16;r++)s[r]=n[r];for(ee(s),ee(s),ee(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,te(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function P(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return N(n,e),N(r,t),_(n,0,r,0)}function ne(e){var t=new Uint8Array(32);return N(t,e),t[0]&1}function re(e,t){for(var n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function F(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function I(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function L(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,ee=0,te=0,N=0,P=n[0],ne=n[1],re=n[2],F=n[3],I=n[4],L=n[5],ie=n[6],ae=n[7],oe=n[8],se=n[9],ce=n[10],le=n[11],ue=n[12],de=n[13],fe=n[14],pe=n[15];r=t[0],a+=r*P,o+=r*ne,s+=r*re,c+=r*F,l+=r*I,u+=r*L,d+=r*ie,f+=r*ae,p+=r*oe,m+=r*se,h+=r*ce,g+=r*le,_+=r*ue,v+=r*de,y+=r*fe,b+=r*pe,r=t[1],o+=r*P,s+=r*ne,c+=r*re,l+=r*F,u+=r*I,d+=r*L,f+=r*ie,p+=r*ae,m+=r*oe,h+=r*se,g+=r*ce,_+=r*le,v+=r*ue,y+=r*de,b+=r*fe,x+=r*pe,r=t[2],s+=r*P,c+=r*ne,l+=r*re,u+=r*F,d+=r*I,f+=r*L,p+=r*ie,m+=r*ae,h+=r*oe,g+=r*se,_+=r*ce,v+=r*le,y+=r*ue,b+=r*de,x+=r*fe,S+=r*pe,r=t[3],c+=r*P,l+=r*ne,u+=r*re,d+=r*F,f+=r*I,p+=r*L,m+=r*ie,h+=r*ae,g+=r*oe,_+=r*se,v+=r*ce,y+=r*le,b+=r*ue,x+=r*de,S+=r*fe,C+=r*pe,r=t[4],l+=r*P,u+=r*ne,d+=r*re,f+=r*F,p+=r*I,m+=r*L,h+=r*ie,g+=r*ae,_+=r*oe,v+=r*se,y+=r*ce,b+=r*le,x+=r*ue,S+=r*de,C+=r*fe,w+=r*pe,r=t[5],u+=r*P,d+=r*ne,f+=r*re,p+=r*F,m+=r*I,h+=r*L,g+=r*ie,_+=r*ae,v+=r*oe,y+=r*se,b+=r*ce,x+=r*le,S+=r*ue,C+=r*de,w+=r*fe,T+=r*pe,r=t[6],d+=r*P,f+=r*ne,p+=r*re,m+=r*F,h+=r*I,g+=r*L,_+=r*ie,v+=r*ae,y+=r*oe,b+=r*se,x+=r*ce,S+=r*le,C+=r*ue,w+=r*de,T+=r*fe,E+=r*pe,r=t[7],f+=r*P,p+=r*ne,m+=r*re,h+=r*F,g+=r*I,_+=r*L,v+=r*ie,y+=r*ae,b+=r*oe,x+=r*se,S+=r*ce,C+=r*le,w+=r*ue,T+=r*de,E+=r*fe,D+=r*pe,r=t[8],p+=r*P,m+=r*ne,h+=r*re,g+=r*F,_+=r*I,v+=r*L,y+=r*ie,b+=r*ae,x+=r*oe,S+=r*se,C+=r*ce,w+=r*le,T+=r*ue,E+=r*de,D+=r*fe,O+=r*pe,r=t[9],m+=r*P,h+=r*ne,g+=r*re,_+=r*F,v+=r*I,y+=r*L,b+=r*ie,x+=r*ae,S+=r*oe,C+=r*se,w+=r*ce,T+=r*le,E+=r*ue,D+=r*de,O+=r*fe,k+=r*pe,r=t[10],h+=r*P,g+=r*ne,_+=r*re,v+=r*F,y+=r*I,b+=r*L,x+=r*ie,S+=r*ae,C+=r*oe,w+=r*se,T+=r*ce,E+=r*le,D+=r*ue,O+=r*de,k+=r*fe,A+=r*pe,r=t[11],g+=r*P,_+=r*ne,v+=r*re,y+=r*F,b+=r*I,x+=r*L,S+=r*ie,C+=r*ae,w+=r*oe,T+=r*se,E+=r*ce,D+=r*le,O+=r*ue,k+=r*de,A+=r*fe,j+=r*pe,r=t[12],_+=r*P,v+=r*ne,y+=r*re,b+=r*F,x+=r*I,S+=r*L,C+=r*ie,w+=r*ae,T+=r*oe,E+=r*se,D+=r*ce,O+=r*le,k+=r*ue,A+=r*de,j+=r*fe,M+=r*pe,r=t[13],v+=r*P,y+=r*ne,b+=r*re,x+=r*F,S+=r*I,C+=r*L,w+=r*ie,T+=r*ae,E+=r*oe,D+=r*se,O+=r*ce,k+=r*le,A+=r*ue,j+=r*de,M+=r*fe,ee+=r*pe,r=t[14],y+=r*P,b+=r*ne,x+=r*re,S+=r*F,C+=r*I,w+=r*L,T+=r*ie,E+=r*ae,D+=r*oe,O+=r*se,k+=r*ce,A+=r*le,j+=r*ue,M+=r*de,ee+=r*fe,te+=r*pe,r=t[15],b+=r*P,x+=r*ne,S+=r*re,C+=r*F,w+=r*I,T+=r*L,E+=r*ie,D+=r*ae,O+=r*oe,k+=r*se,A+=r*ce,j+=r*le,M+=r*ue,ee+=r*de,te+=r*fe,N+=r*pe,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*ee,v+=38*te,y+=38*N,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function ie(e,t){L(e,t,t)}function ae(e,n){for(var r=t(),i=0;i<16;i++)r[i]=n[i];for(i=253;i>=0;i--)ie(r,r),i!==2&&i!==4&&L(r,r,n);for(i=0;i<16;i++)e[i]=r[i]}function oe(e,n){for(var r=t(),i=0;i<16;i++)r[i]=n[i];for(i=250;i>=0;i--)ie(r,r),i!==1&&L(r,r,n);for(i=0;i<16;i++)e[i]=r[i]}function se(e,n,r){var i=new Uint8Array(32),a=new Float64Array(80),o,c,l=t(),u=t(),d=t(),f=t(),p=t(),m=t();for(c=0;c<31;c++)i[c]=n[c];for(i[31]=n[31]&127|64,i[0]&=248,re(a,r),c=0;c<16;c++)u[c]=a[c],f[c]=l[c]=d[c]=0;for(l[0]=f[0]=1,c=254;c>=0;--c)o=i[c>>>3]>>>(c&7)&1,te(l,u,o),te(d,f,o),F(p,l,d),I(l,l,d),F(d,u,f),I(u,u,f),ie(f,p),ie(m,l),L(l,d,l),L(d,u,p),F(p,l,d),I(l,l,d),ie(u,l),I(d,f,m),L(l,d,s),F(l,l,f),L(d,d,l),L(l,f,m),L(f,u,a),ie(u,p),te(l,u,o),te(d,f,o);for(c=0;c<16;c++)a[c+16]=l[c],a[c+32]=d[c],a[c+48]=u[c],a[c+64]=f[c];var h=a.subarray(32),g=a.subarray(16);return ae(h,h),L(g,g,h),N(e,g),0}function ce(e,t){return se(e,t,i)}function le(e,t){return n(t,32),ce(e,t)}function ue(e,t,n){var i=new Uint8Array(32);return se(i,n,t),x(e,r,i,S)}var de=A,fe=j;function pe(e,t,n,r,i,a){var o=new Uint8Array(32);return ue(o,i,a),de(e,t,n,r,o)}function me(e,t,n,r,i,a){var o=new Uint8Array(32);return ue(o,i,a),fe(e,t,n,r,o)}var he=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ge(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],ee=e[1],te=e[2],N=e[3],P=e[4],ne=e[5],re=e[6],F=e[7],I=t[0],L=t[1],ie=t[2],ae=t[3],oe=t[4],se=t[5],ce=t[6],le=t[7],ue=0;r>=128;){for(w=0;w<16;w++)T=8*w+ue,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=ee,c=te,l=N,u=P,d=ne,f=re,p=F,m=I,h=L,g=ie,_=ae,v=oe,y=se,b=ce,x=le,E=F,D=le,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(P>>>14|oe<<18)^(P>>>18|oe<<14)^(oe>>>9|P<<23),D=(oe>>>14|P<<18)^(oe>>>18|P<<14)^(P>>>9|oe<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=P&ne^~P&re,D=oe&se^~oe&ce,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=he[w*2],D=he[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|I<<4)^(I>>>2|M<<30)^(I>>>7|M<<25),D=(I>>>28|M<<4)^(M>>>2|I<<30)^(M>>>7|I<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&ee^M&te^ee&te,D=I&L^I&ie^L&ie,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,ee=o,te=s,N=c,P=l,ne=u,re=d,F=f,M=p,L=m,ie=h,ae=g,oe=_,se=v,ce=y,le=b,I=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=I,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=I=O&65535|k<<16,E=ee,D=L,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=ee=A&65535|j<<16,t[1]=L=O&65535|k<<16,E=te,D=ie,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=te=A&65535|j<<16,t[2]=ie=O&65535|k<<16,E=N,D=ae,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=N=A&65535|j<<16,t[3]=ae=O&65535|k<<16,E=P,D=oe,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=P=A&65535|j<<16,t[4]=oe=O&65535|k<<16,E=ne,D=se,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=ne=A&65535|j<<16,t[5]=se=O&65535|k<<16,E=re,D=ce,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=re=A&65535|j<<16,t[6]=ce=O&65535|k<<16,E=F,D=le,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=F=A&65535|j<<16,t[7]=le=O&65535|k<<16,ue+=128,r-=128}return r}function _e(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,ge(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),ge(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function ve(e,n){var r=t(),i=t(),a=t(),o=t(),s=t(),c=t(),l=t(),d=t(),f=t();I(r,e[1],e[0]),I(f,n[1],n[0]),L(r,r,f),F(i,e[0],e[1]),F(f,n[0],n[1]),L(i,i,f),L(a,e[3],n[3]),L(a,a,u),L(o,e[2],n[2]),F(o,o,o),I(s,i,r),I(c,o,a),F(l,o,a),F(d,i,r),L(e[0],s,c),L(e[1],d,l),L(e[2],l,c),L(e[3],s,d)}function ye(e,t,n){for(var r=0;r<4;r++)te(e[r],t[r],n)}function be(e,n){var r=t(),i=t(),a=t();ae(a,n[2]),L(r,n[0],a),L(i,n[1],a),N(e,i),e[31]^=ne(r)<<7}function xe(e,t,n){var r,i;for(M(e[0],a),M(e[1],o),M(e[2],o),M(e[3],a),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ye(e,t,r),ve(t,e),ve(e,e),ye(e,t,r)}function Se(e,n){var r=[t(),t(),t(),t()];M(r[0],d),M(r[1],f),M(r[2],o),L(r[3],d,f),xe(e,r,n)}function Ce(e,r,i){var a=new Uint8Array(64),o=[t(),t(),t(),t()],s;for(i||n(r,32),_e(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,Se(o,a),be(e,o),s=0;s<32;s++)r[s+32]=e[s];return 0}var we=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Te(e,t){for(var n,r=63,i,a;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*we[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*we[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*we[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function R(e){for(var t=new Float64Array(64),n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;Te(e,t)}function Ee(e,n,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[t(),t(),t(),t()];_e(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=n[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(_e(s,e.subarray(32),r+32),R(s),Se(d,s),be(e,d),c=32;c<64;c++)e[c]=i[c];for(_e(o,e,r+64),R(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return Te(e.subarray(32),u),f}function De(e,n){var r=t(),i=t(),s=t(),l=t(),u=t(),d=t(),f=t();return M(e[2],o),re(e[1],n),ie(s,e[1]),L(l,s,c),I(s,s,e[2]),F(l,e[2],l),ie(u,l),ie(d,u),L(f,d,u),L(r,f,s),L(r,r,l),oe(r,r),L(r,r,s),L(r,r,l),L(r,r,l),L(e[0],r,l),ie(i,e[0]),L(i,i,l),P(i,s)&&L(e[0],e[0],p),ie(i,e[0]),L(i,i,l),P(i,s)?-1:(ne(e[0])===n[31]>>7&&I(e[0],a,e[0]),L(e[3],e[0],e[1]),0)}function Oe(e,n,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[t(),t(),t(),t()],l=[t(),t(),t(),t()];if(r<64||De(l,i))return-1;for(a=0;a<r;a++)e[a]=n[a];for(a=0;a<32;a++)e[a+32]=i[a];if(_e(s,e,r),R(s),xe(c,l,s),Se(l,n.subarray(32)),ve(c,l),be(o,c),r-=64,_(n,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=n[a+64];return r}var ke=32,Ae=24,je=32,Me=16,Ne=32,Pe=32,Fe=32,Ie=32,Le=32,Re=Ae,ze=je,Be=Me,Ve=64,He=32,Ue=64,We=32,Ge=64;e.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:se,crypto_scalarmult_base:ce,crypto_box_beforenm:ue,crypto_box_afternm:de,crypto_box:pe,crypto_box_open:me,crypto_box_keypair:le,crypto_hash:_e,crypto_sign:Ee,crypto_sign_keypair:Ce,crypto_sign_open:Oe,crypto_secretbox_KEYBYTES:ke,crypto_secretbox_NONCEBYTES:Ae,crypto_secretbox_ZEROBYTES:je,crypto_secretbox_BOXZEROBYTES:Me,crypto_scalarmult_BYTES:Ne,crypto_scalarmult_SCALARBYTES:Pe,crypto_box_PUBLICKEYBYTES:Fe,crypto_box_SECRETKEYBYTES:Ie,crypto_box_BEFORENMBYTES:Le,crypto_box_NONCEBYTES:Re,crypto_box_ZEROBYTES:ze,crypto_box_BOXZEROBYTES:Be,crypto_sign_BYTES:Ve,crypto_sign_PUBLICKEYBYTES:He,crypto_sign_SECRETKEYBYTES:Ue,crypto_sign_SEEDBYTES:We,crypto_hash_BYTES:Ge,gf:t,D:c,L:we,pack25519:N,unpack25519:re,M:L,A:F,S:ie,Z:I,pow2523:oe,add:ve,set25519:M,modL:Te,scalarmult:xe,scalarbase:Se};function Ke(e,t){if(e.length!==ke)throw Error(`bad key size`);if(t.length!==Ae)throw Error(`bad nonce size`)}function qe(e,t){if(e.length!==Fe)throw Error(`bad public key size`);if(t.length!==Ie)throw Error(`bad secret key size`)}function Je(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Ye(e){for(var t=0;t<e.length;t++)e[t]=0}e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){Je(e,t,n),Ke(n,t);for(var r=new Uint8Array(je+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+je]=e[a];return A(i,r,r.length,t,n),i.subarray(Me)},e.secretbox.open=function(e,t,n){Je(e,t,n),Ke(n,t);for(var r=new Uint8Array(Me+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Me]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(je)},e.secretbox.keyLength=ke,e.secretbox.nonceLength=Ae,e.secretbox.overheadLength=Me,e.scalarMult=function(e,t){if(Je(e,t),e.length!==Pe)throw Error(`bad n size`);if(t.length!==Ne)throw Error(`bad p size`);var n=new Uint8Array(Ne);return se(n,e,t),n},e.scalarMult.base=function(e){if(Je(e),e.length!==Pe)throw Error(`bad n size`);var t=new Uint8Array(Ne);return ce(t,e),t},e.scalarMult.scalarLength=Pe,e.scalarMult.groupElementLength=Ne,e.box=function(t,n,r,i){var a=e.box.before(r,i);return e.secretbox(t,n,a)},e.box.before=function(e,t){Je(e,t),qe(e,t);var n=new Uint8Array(Le);return ue(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,i){var a=e.box.before(r,i);return e.secretbox.open(t,n,a)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(Fe),t=new Uint8Array(Ie);return le(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(Je(e),e.length!==Ie)throw Error(`bad secret key size`);var t=new Uint8Array(Fe);return ce(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=Fe,e.box.secretKeyLength=Ie,e.box.sharedKeyLength=Le,e.box.nonceLength=Re,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(Je(e,t),t.length!==Ue)throw Error(`bad secret key size`);var n=new Uint8Array(Ve+e.length);return Ee(n,e,e.length,t),n},e.sign.open=function(e,t){if(Je(e,t),t.length!==He)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=Oe(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},e.sign.detached=function(t,n){for(var r=e.sign(t,n),i=new Uint8Array(Ve),a=0;a<i.length;a++)i[a]=r[a];return i},e.sign.detached.verify=function(e,t,n){if(Je(e,t,n),t.length!==Ve)throw Error(`bad signature size`);if(n.length!==He)throw Error(`bad public key size`);for(var r=new Uint8Array(Ve+e.length),i=new Uint8Array(Ve+e.length),a=0;a<Ve;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ve]=e[a];return Oe(i,r,r.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(He),t=new Uint8Array(Ue);return Ce(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(Je(e),e.length!==Ue)throw Error(`bad secret key size`);for(var t=new Uint8Array(He),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(Je(e),e.length!==We)throw Error(`bad seed size`);for(var t=new Uint8Array(He),n=new Uint8Array(Ue),r=0;r<32;r++)n[r]=e[r];return Ce(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=He,e.sign.secretKeyLength=Ue,e.sign.seedLength=We,e.sign.signatureLength=Ve,e.hash=function(e){Je(e);var t=new Uint8Array(Ge);return _e(t,e,e.length),t},e.hash.hashLength=Ge,e.verify=function(e,t){return Je(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},e.setPRNG=function(e){n=e},(function(){var t=typeof self<`u`?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){var n=65536;e.setPRNG(function(e,r){var i,a=new Uint8Array(r);for(i=0;i<r;i+=n)t.getRandomValues(a.subarray(i,i+Math.min(r-i,n)));for(i=0;i<r;i++)e[i]=a[i];Ye(a)})}else l!==void 0&&(t=qO(),t&&t.randomBytes&&e.setPRNG(function(e,n){var r,i=t.randomBytes(n);for(r=0;r<n;r++)e[r]=i[r];Ye(i)}))})()})(t!==void 0&&t.exports?t.exports:self.nacl=self.nacl||{})})),YO=o(((e,t,n)=>{(function(e,n){t!==void 0&&t.exports?t.exports=n():(e.nacl||={},e.nacl.util=n())})(n,function(){var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw TypeError(`invalid encoding`)}return e.decodeUTF8=function(e){if(typeof e!=`string`)throw TypeError(`expected string`);var t,n=unescape(encodeURIComponent(e)),r=new Uint8Array(n.length);for(t=0;t<n.length;t++)r[t]=n.charCodeAt(t);return r},e.encodeUTF8=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(n.join(``)))},typeof atob>`u`?Buffer.from===void 0?(e.encodeBase64=function(e){return new Buffer(e).toString(`base64`)},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,`base64`),0))}):(e.encodeBase64=function(e){return Buffer.from(e).toString(`base64`)},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,`base64`),0))}):(e.encodeBase64=function(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(String.fromCharCode(e[t]));return btoa(n.join(``))},e.decodeBase64=function(e){t(e);var n,r=atob(e),i=new Uint8Array(r.length);for(n=0;n<r.length;n++)i[n]=r.charCodeAt(n);return i}),e})})),XO=JO(),ZO=YO(),QO=(e=>(e.XBULL_CONNECT=`XBULL_CONNECT`,e.XBULL_GET_PUBLIC_KEY=`XBULL_GET_PUBLIC_KEY`,e.XBULL_SIGN_XDR=`XBULL_SIGN_XDR`,e.XBULL_GET_NETWORK=`XBULL_GET_NETWORK`,e.XBULL_SIGN_MESSAGE=`XBULL_SIGN_MESSAGE`,e.XBULL_INITIAL_RESPONSE=`XBULL_INITIAL_RESPONSE`,e.XBULL_CONNECT_RESPONSE=`XBULL_CONNECT_RESPONSE`,e.XBULL_SIGN=`XBULL_SIGN`,e.XBULL_SIGN_RESPONSE=`XBULL_SIGN_RESPONSE`,e.XBULL_SIGN_MESSAGE_RESPONSE=`XBULL_SIGN_MESSAGE_RESPONSE`,e))(QO||{});function $O(e){return!!e.error}var ek=function(e,t){return ek=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ek(e,t)};function tk(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);ek(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function nk(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function rk(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function ik(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ak(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ok(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function sk(e){return this instanceof sk?(this.v=e,this):new sk(e)}function ck(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof sk?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function lk(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ik==`function`?ik(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function uk(e){return typeof e==`function`}function dk(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var fk=dk(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
419
+ `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
420
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function pk(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var mk=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=ik(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(uk(c))try{c()}catch(e){i=e instanceof fk?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ik(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{_k(f)}catch(e){i??=[],e instanceof fk?i=ok(ok([],ak(i)),ak(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new fk(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)_k(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&pk(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&pk(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),hk=mk.EMPTY;function gk(e){return e instanceof mk||e&&`closed`in e&&uk(e.remove)&&uk(e.add)&&uk(e.unsubscribe)}function _k(e){uk(e)?e():e.unsubscribe()}var vk={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yk={setTimeout:function(e,t){var n=[...arguments].slice(2),r=yk.delegate;return r?.setTimeout?r.setTimeout.apply(r,ok([e,t],ak(n))):setTimeout.apply(void 0,ok([e,t],ak(n)))},clearTimeout:function(e){return(yk.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function bk(e){yk.setTimeout(function(){var t=vk.onUnhandledError;if(t)t(e);else throw e})}function xk(){}var Sk=(function(){return Tk(`C`,void 0,void 0)})();function Ck(e){return Tk(`E`,void 0,e)}function wk(e){return Tk(`N`,e,void 0)}function Tk(e,t,n){return{kind:e,value:t,error:n}}var Ek=null;function Dk(e){if(vk.useDeprecatedSynchronousErrorHandling){var t=!Ek;if(t&&(Ek={errorThrown:!1,error:null}),e(),t){var n=Ek,r=n.errorThrown,i=n.error;if(Ek=null,r)throw i}}else e()}function Ok(e){vk.useDeprecatedSynchronousErrorHandling&&Ek&&(Ek.errorThrown=!0,Ek.error=e)}var kk=function(e){tk(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,gk(t)&&t.add(n)):n.destination=Lk,n}return t.create=function(e,t,n){return new Nk(e,t,n)},t.prototype.next=function(e){this.isStopped?Ik(wk(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Ik(Ck(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Ik(Sk,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(mk),Ak=Function.prototype.bind;function jk(e,t){return Ak.call(e,t)}var Mk=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Pk(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Pk(e)}else Pk(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Pk(e)}},e}(),Nk=function(e){tk(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(uk(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&vk.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&jk(t.next,o),error:t.error&&jk(t.error,o),complete:t.complete&&jk(t.complete,o)}):a=t}return i.destination=new Mk(a),i}return t}(kk);function Pk(e){vk.useDeprecatedSynchronousErrorHandling?Ok(e):bk(e)}function Fk(e){throw e}function Ik(e,t){var n=vk.onStoppedNotification;n&&yk.setTimeout(function(){return n(e,t)})}var Lk={closed:!0,next:xk,error:Fk,complete:xk},Rk=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function zk(e){return e}function Bk(e){return e.length===0?zk:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Vk=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Wk(e)?e:new Nk(e,t,n);return Dk(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Hk(t),new t(function(t,r){var i=new Nk({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[Rk]=function(){return this},e.prototype.pipe=function(){return Bk([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Hk(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Hk(e){return e??vk.Promise??Promise}function Uk(e){return e&&uk(e.next)&&uk(e.error)&&uk(e.complete)}function Wk(e){return e&&e instanceof kk||Uk(e)&&gk(e)}function Gk(e){return uk(e?.lift)}function Kk(e){return function(t){if(Gk(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function qk(e,t,n,r,i){return new Jk(e,t,n,r,i)}var Jk=function(e){tk(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(kk),Yk=dk(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Xk=function(e){tk(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Zk(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Yk},t.prototype.next=function(e){var t=this;Dk(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=ik(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Dk(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Dk(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?hk:(this.currentObservers=null,a.push(e),new mk(function(){t.currentObservers=null,pk(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Vk;return e.source=this,e},t.create=function(e,t){return new Zk(e,t)},t}(Vk),Zk=function(e){tk(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??hk},t}(Xk),Qk={now:function(){return(Qk.delegate||Date).now()},delegate:void 0},$k=function(e){tk(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(mk),eA={setInterval:function(e,t){var n=[...arguments].slice(2),r=eA.delegate;return r?.setInterval?r.setInterval.apply(r,ok([e,t],ak(n))):setInterval.apply(void 0,ok([e,t],ak(n)))},clearInterval:function(e){return(eA.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},tA=function(e){tk(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),eA.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&eA.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,pk(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}($k),nA=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Qk.now,e}(),rA=new(function(e){tk(t,e);function t(t,n){n===void 0&&(n=nA.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(nA))(tA),iA=new Vk(function(e){return e.complete()});function aA(e){return e&&uk(e.schedule)}function oA(e){return e[e.length-1]}function sA(e){return aA(oA(e))?e.pop():void 0}var cA=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function lA(e){return uk(e?.then)}function uA(e){return uk(e[Rk])}function dA(e){return Symbol.asyncIterator&&uk(e?.[Symbol.asyncIterator])}function fA(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function pA(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var mA=pA();function hA(e){return uk(e?.[mA])}function gA(e){return ck(this,arguments,function(){var t,n,r,i;return rk(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,sk(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,sk(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,sk(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function _A(e){return uk(e?.getReader)}function vA(e){if(e instanceof Vk)return e;if(e!=null){if(uA(e))return yA(e);if(cA(e))return bA(e);if(lA(e))return xA(e);if(dA(e))return CA(e);if(hA(e))return SA(e);if(_A(e))return wA(e)}throw fA(e)}function yA(e){return new Vk(function(t){var n=e[Rk]();if(uk(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function bA(e){return new Vk(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function xA(e){return new Vk(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,bk)})}function SA(e){return new Vk(function(t){var n,r;try{for(var i=ik(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function CA(e){return new Vk(function(t){TA(e,t).catch(function(e){return t.error(e)})})}function wA(e){return CA(gA(e))}function TA(e,t){var n,r,i,a;return nk(this,void 0,void 0,function(){var o,s;return rk(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=lk(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function EA(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function DA(e,t){return t===void 0&&(t=0),Kk(function(n,r){n.subscribe(qk(r,function(n){return EA(r,e,function(){return r.next(n)},t)},function(){return EA(r,e,function(){return r.complete()},t)},function(n){return EA(r,e,function(){return r.error(n)},t)}))})}function OA(e,t){return t===void 0&&(t=0),Kk(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function kA(e,t){return vA(e).pipe(OA(t),DA(t))}function AA(e,t){return vA(e).pipe(OA(t),DA(t))}function jA(e,t){return new Vk(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function MA(e,t){return new Vk(function(n){var r;return EA(n,t,function(){r=e[mA](),EA(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return uk(r?.return)&&r.return()}})}function NA(e,t){if(!e)throw Error(`Iterable cannot be null`);return new Vk(function(n){EA(n,t,function(){var r=e[Symbol.asyncIterator]();EA(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function PA(e,t){return NA(gA(e),t)}function FA(e,t){if(e!=null){if(uA(e))return kA(e,t);if(cA(e))return jA(e,t);if(lA(e))return AA(e,t);if(dA(e))return NA(e,t);if(hA(e))return MA(e,t);if(_A(e))return PA(e,t)}throw fA(e)}function IA(e,t){return t?FA(e,t):vA(e)}function LA(){var e=[...arguments];return IA(e,sA(e))}function RA(e,t){var n=uk(e)?e:function(){return e},r=function(e){return e.error(n())};return new Vk(t?function(e){return t.schedule(r,0,e)}:r)}var zA=dk(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function BA(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new Nk({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new zA)}});e.subscribe(a)})}function VA(e){return e instanceof Date&&!isNaN(e)}function HA(e,t,n){e===void 0&&(e=0),n===void 0&&(n=rA);var r=-1;return t!=null&&(aA(t)?n=t:r=t),new Vk(function(t){var i=VA(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function UA(e){return e<=0?function(){return iA}:Kk(function(t,n){var r=0;t.subscribe(qk(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function WA(e,t){return Kk(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(qk(r,function(n){i?.unsubscribe();var o=0,c=a++;vA(e(n,c)).subscribe(i=qk(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function GA(e){return Kk(function(t,n){vA(e).subscribe(qk(n,function(){return n.complete()},xk)),!n.closed&&t.subscribe(n)})}var KA=class{constructor(){this.isConnected=!1}sendEventToContentScript(e,t,n){return new Promise((r=>{let i=e=>{e.source===window&&e.data&&e.origin===window.origin&&e.data.eventId===n&&(r(e),window.removeEventListener(`message`,i,!1))};window.addEventListener(`message`,i,!1),window.webkit.messageHandlers.cordova_iab.postMessage(JSON.stringify({type:e,eventId:n,detail:t}))}))}async enableConnection(){let e={origin:window.origin,host:window.location.host,permissions:{canRequestPublicKey:!0,canRequestSign:!0}},{detail:t}=(await this.sendEventToContentScript(QO.XBULL_CONNECT,e,crypto.randomUUID())).data;if(!t||t.error)throw{code:t?.code||-1,message:t?.errorMessage||`Unexpected error`};this.isConnected=!0}async getAddress(){try{await this.enableConnection()}catch(e){return{error:{code:e?.code||-1,message:e?.message||`Unexpected error`}}}let e={origin:window.origin,host:window.location.host},{detail:t}=(await this.sendEventToContentScript(QO.XBULL_GET_PUBLIC_KEY,e,crypto.randomUUID())).data;return!t||t.error?{error:{code:t?.code||-1,message:t?.errorMessage||`Unexpected error`}}:{address:t.payload}}async signTransaction(e){if(e.opts?.submit||e.opts?.submitUrl)return{error:{code:-1,message:"Parameters `submit` and `submitUrl` are not supported"}};try{await this.enableConnection()}catch(e){return{error:{code:e?.code||-1,message:e?.message||`Unexpected error`}}}let t={origin:window.origin,host:window.location.host,network:e.opts?.networkPassphrase,publicKey:e.opts?.address,xdr:e.xdr,xdrType:`Transaction`},{detail:n}=(await this.sendEventToContentScript(QO.XBULL_SIGN_XDR,t,crypto.randomUUID())).data;return!n||n.error?{error:{code:n?.code||-1,message:n?.errorMessage||`Unexpected error`}}:{signedTxXdr:n.payload.signedXdr,signerAddress:n.payload.signerAddress}}async signMessage(e,t){if(!e)return{error:{code:-1,message:`The message must be defined.`}};try{await this.enableConnection()}catch(e){return{error:{code:e?.code||-1,message:e?.message||`Unexpected error`}}}let n={origin:window.origin,host:window.location.host,message:e,publicKey:t?.address,network:t?.networkPassphrase},{detail:r}=(await this.sendEventToContentScript(QO.XBULL_SIGN_MESSAGE,n,crypto.randomUUID())).data;return!r||r.error?{error:{code:r?.code||-1,message:r?.errorMessage||`Unexpected error`}}:{signedMessage:r.payload.signedMessage,signerAddress:r.payload.signerAddress}}async getNetwork(){try{await this.enableConnection()}catch(e){return{error:{code:e?.code||-1,message:e?.message||`Unexpected error`}}}let e={origin:window.origin,host:window.location.host},{detail:t}=(await this.sendEventToContentScript(QO.XBULL_GET_NETWORK,e,crypto.randomUUID())).data;return!t||t.error?{error:{code:t?.code||-1,message:t?.errorMessage||`Unexpected error`}}:{network:t.payload.network,networkPassphrase:t.payload.networkPassphrase}}},qA=class{constructor(e){this.closeCurrentPromises$=new Xk,this.closeObservables$=new Xk,this.initialResponse$=new Xk,this.initialResponseCompleted$=new Xk,this.connectResponse$=new Xk,this.connectResult$=new Xk,this.signResponse$=new Xk,this.signResult$=new Xk,this.signMessageResponse$=new Xk,this.signMessageResult$=new Xk,this.closeCurrentPromisesSubscription=HA(1e3,1e3).pipe(GA(this.closeObservables$)).subscribe((()=>{this.target?.closed&&this.closeCurrentPromises$.next()})),this.onInititalResponseSubscription=this.initialResponse$.pipe(GA(this.closeObservables$)).subscribe((e=>{let t=this.decryptFromReceiver({oneTimeCode:e.data.oneTimeCode,payload:e.data.message,senderPublicKey:e.data.publicKey});JSON.parse(t).providedSession===this.session()&&(this.targetPublicKey=e.data.publicKey,this.initialResponseCompleted$.next())})),this.onConnectResponseSubscription=this.connectResponse$.pipe(GA(this.closeObservables$)).subscribe((e=>{if(!this.targetPublicKey)return void this.connectResult$.next({success:!1,message:`Wallet encryption public key is not provided, request rejected.`});if(!e.data.success)return void this.connectResult$.next({success:!1,message:`Request rejected from the wallet`});let t=this.decryptFromReceiver({oneTimeCode:e.data.oneTimeCode,payload:e.data.message,senderPublicKey:this.targetPublicKey}),n=JSON.parse(t);this.connectResult$.next({success:!0,publicKey:n.publicKey})})),this.onSignResponseSubscription=this.signResponse$.pipe(GA(this.closeObservables$)).subscribe((e=>{if(!this.targetPublicKey)return void this.signResult$.next({success:!1,message:`Wallet encryption public key is not provided, request rejected.`});if(!e.data.success)return void this.signResult$.next({success:!1,message:`Request rejected from the wallet`});let t=this.decryptFromReceiver({oneTimeCode:e.data.oneTimeCode,payload:e.data.message,senderPublicKey:this.targetPublicKey}),n=JSON.parse(t);this.signResult$.next({success:!0,xdr:n.xdr})})),this.onSignMessageResponseSubscription=this.signMessageResponse$.pipe(GA(this.closeObservables$)).subscribe((e=>{if(!this.targetPublicKey)return void this.signMessageResult$.next({success:!1,message:`Wallet encryption public key is not provided, request rejected.`});if(!e.data.success)return void this.signMessageResult$.next({success:!1,message:`Request rejected from the wallet`});let t=this.decryptFromReceiver({oneTimeCode:e.data.oneTimeCode,payload:e.data.message,senderPublicKey:this.targetPublicKey}),n=JSON.parse(t);this.signMessageResult$.next({success:!0,...n})})),this.preferredTarget=e?.preferredTarget||`extension`,this.walletUrl=e?.url||`https://wallet.xbull.app/connect`;let t=XO.box.keyPair(),n=(0,ZO.encodeBase64)((0,XO.randomBytes)(24));this.encryptForReceiver=e=>{let n=(0,XO.randomBytes)(24),r=(0,XO.box)((0,ZO.decodeUTF8)(e.data),n,e.receiverPublicKey,t.secretKey);return{message:(0,ZO.encodeBase64)(r),oneTimeCode:(0,ZO.encodeBase64)(n)}},this.decryptFromReceiver=e=>{let n=XO.box.open((0,ZO.decodeBase64)(e.payload),(0,ZO.decodeBase64)(e.oneTimeCode),(0,ZO.decodeBase64)(e.senderPublicKey),t.secretKey);if(!n)throw Error(`Decrypted message is null`);return(0,ZO.encodeUTF8)(n)},this.publicKey=()=>t.publicKey,this.session=()=>n.slice();let r=e=>{switch(e.data.type){case QO.XBULL_INITIAL_RESPONSE:this.initialResponse$.next(e);break;case QO.XBULL_CONNECT_RESPONSE:this.connectResponse$.next(e);break;case QO.XBULL_SIGN_RESPONSE:this.signResponse$.next(e);break;case QO.XBULL_SIGN_MESSAGE_RESPONSE:this.signMessageResponse$.next(e)}};window.addEventListener(`message`,r),this.closeObservables$.asObservable().pipe(UA(1)).subscribe((()=>{window.removeEventListener(`message`,r)}))}openWallet(){return this.target&&!this.target.closed&&(this.target.close(),this.target=null,this.closeCurrentPromises$.next()),this.target=window.open(`${this.walletUrl}?public=${encodeURIComponent((0,ZO.encodeBase64)(this.publicKey()))}&session=${encodeURIComponent(this.session())}`,`xBull_Wallet_app`,`width=380,height=640,left=100,top=100`),BA(this.initialResponseCompleted$.pipe(GA(this.closeCurrentPromises$)).pipe(GA(this.closeObservables$)))}closeWallet(){this.target&&=(this.target?.close(),null)}async connect(e={canRequestPublicKey:!0,canRequestSign:!0}){let t=window?.webkit?.messageHandlers?.cordova_iab?new KA:window.xBullSDK;if(t&&this.preferredTarget===`extension`){let e=await t.getAddress();if($O(e))throw e.error;return e.address}{if(await this.openWallet(),!this.target||!this.targetPublicKey)throw Error(`xBull Wallet is not open, we can't connect with it`);let{message:t,oneTimeCode:n}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,ZO.decodeBase64)(this.targetPublicKey)}),r={type:QO.XBULL_CONNECT,message:t,oneTimeCode:n};return this.target.postMessage(r,`*`),BA(this.connectResult$.asObservable().pipe(WA((e=>e.success?(this.closeWallet(),LA(e.publicKey)):(this.closeWallet(),RA((()=>Error(e.message))))))).pipe(UA(1)).pipe(GA(this.closeCurrentPromises$)).pipe(GA(this.closeObservables$)))}}async sign(e){let t=window?.webkit?.messageHandlers?.cordova_iab?new KA:window.xBullSDK;if(t&&this.preferredTarget===`extension`){let n=await t.signTransaction({xdr:e.xdr,opts:{networkPassphrase:e.network,address:e.publicKey}});if($O(n))throw n.error;return n.signedTxXdr}{if(await this.openWallet(),!this.target||!this.targetPublicKey)throw Error(`xBull Wallet is not open, we can't connect with it`);if(typeof e.xdr!=`string`)throw Error(`XDR provided needs to be a string value`);let{message:t,oneTimeCode:n}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,ZO.decodeBase64)(this.targetPublicKey)}),r={type:QO.XBULL_SIGN,message:t,oneTimeCode:n};return this.target.postMessage(r,`*`),BA(this.signResult$.asObservable().pipe(WA((e=>e.success?(this.closeWallet(),LA(e.xdr)):(this.closeWallet(),RA((()=>Error(e.message))))))).pipe(UA(1)).pipe(GA(this.closeCurrentPromises$)).pipe(GA(this.closeObservables$)))}}async signMessage(e,t){let n=window?.webkit?.messageHandlers?.cordova_iab?new KA:window.xBullSDK;if(n&&this.preferredTarget===`extension`){let r=await n.signMessage(e,t);if($O(r))throw r.error;return r}{if(await this.openWallet(),!this.target||!this.targetPublicKey)throw Error(`xBull Wallet is not open, we can't connect with it`);if(typeof e!=`string`)throw Error(`XDR provided needs to be a string value`);let n=this.encryptForReceiver({data:JSON.stringify({message:e,opts:t}),receiverPublicKey:(0,ZO.decodeBase64)(this.targetPublicKey)}),r={type:QO.XBULL_SIGN_MESSAGE,message:n.message,oneTimeCode:n.oneTimeCode};return this.target.postMessage(r,`*`),BA(this.signMessageResult$.asObservable().pipe(WA((e=>e.success?(this.closeWallet(),LA({signedMessage:e.signedMessage,signerAddress:e.signerAddress})):(this.closeWallet(),RA((()=>Error(e.message))))))).pipe(UA(1)).pipe(GA(this.closeCurrentPromises$)).pipe(GA(this.closeObservables$)))}}closeConnections(){this.closeObservables$.next(),this.closeCurrentPromises$.next(),this.closeObservables$.complete(),this.closeCurrentPromises$.complete()}},JA=`xbull`,YA=class{constructor(){Object.defineProperty(this,"moduleType",{enumerable:!0,configurable:!0,writable:!0,value:Ga.HOT_WALLET}),Object.defineProperty(this,"productId",{enumerable:!0,configurable:!0,writable:!0,value:JA}),Object.defineProperty(this,"productName",{enumerable:!0,configurable:!0,writable:!0,value:`xBull`}),Object.defineProperty(this,"productUrl",{enumerable:!0,configurable:!0,writable:!0,value:`https://xbull.app`}),Object.defineProperty(this,"productIcon",{enumerable:!0,configurable:!0,writable:!0,value:`https://stellar.creit.tech/wallet-icons/xbull.png`})}isAvailable(){return Promise.resolve(!0)}async getAddress(){let e=new qA;try{return{address:await e.connect()}}catch(e){throw H(e)}finally{e.closeConnections()}}async signTransaction(e,t){let n=new qA;try{return{signedTxXdr:await n.sign({xdr:e,publicKey:t?.address,network:t?.networkPassphrase}),signerAddress:t?.address}}catch(e){throw H(e)}finally{n.closeConnections()}}signAuthEntry(){return Promise.reject({code:-3,message:`xBull does not support the "signAuthEntry" function`})}async signMessage(e,t){let n=new qA;try{return await n.signMessage(e,{address:t?.address,networkPassphrase:t?.networkPassphrase})}catch(e){throw H(e)}finally{n.closeConnections()}}getNetwork(){return Promise.reject({code:-3,message:`xBull does not support the "getNetwork" function`})}};function XA(){return[new sl,new YA,new wc,new HO,new El,new RO,new Ol,new BO,new Dc,new Rc,new kc,new Mc,new KO,new dl,new kT]}var ZA={background:`var(--surface)`,"background-secondary":`var(--surface-sunken)`,"foreground-strong":`var(--text)`,foreground:`var(--text)`,"foreground-secondary":`var(--text-secondary)`,primary:`var(--accent-solid)`,"primary-foreground":`var(--on-accent)`,transparent:`rgba(0, 0, 0, 0)`,lighter:`var(--surface)`,light:`var(--surface-sunken)`,"light-gray":`var(--border-strong)`,gray:`var(--text-tertiary)`,danger:`var(--danger)`,border:`var(--border)`,shadow:`var(--shadow-lg)`,"border-radius":`var(--radius-lg)`,"font-family":`var(--font-sans)`},QA=!1;function $A(e){QA||(QA=!0,IO.init({modules:XA(),network:e,theme:ZA,authModal:{showInstallLabel:!0,hideUnsupportedWallets:!1}}))}async function ej(){try{let{address:e}=await IO.authModal();return{address:e,wallet:IO.selectedModule.productName}}catch(e){if(H(e).message===`The user closed the modal.`)return;throw e}}async function tj(){try{return(await IO.getNetwork()).networkPassphrase}catch{return}}async function nj(e,t,n){let{signedTxXdr:r}=await IO.signTransaction(e,{address:t,networkPassphrase:n});return r}function rj(e){let{message:t}=H(e);return/declin|reject|denied|cancel/i.test(t)?{title:`You declined in your wallet`,message:`Nothing was signed. Approve again when you're ready.`}:{title:`Your wallet couldn't do that`,message:t}}var ij=Er(`<section class="frame single svelte-1mjb4es"><!></section>`),aj=Er(`<section class="frame svelte-1mjb4es" aria-labelledby="page-title"><aside class="side svelte-1mjb4es"><p class="eyebrow svelte-1mjb4es">Approve in your wallet</p> <h1 id="page-title" class="svelte-1mjb4es"> </h1> <p class="intro svelte-1mjb4es"> </p> <div class="steps-wrap svelte-1mjb4es"><!></div> <p class="assurance svelte-1mjb4es"><!> <span>Your keys stay in your wallet. This page runs on your computer and talks only to your wallet and your terminal.</span></p></aside> <div class="main svelte-1mjb4es"><!></div></section> <p class="footer svelte-1mjb4es">Served by provider-kit on this computer. Stopping the command in your terminal ends this page.</p>`,1),oj=Er(`<!> <main class="page svelte-1mjb4es"><!></main>`,1);function sj(e,t){Ke(t,!0);let n,r=Bt(void 0),i=Bt(void 0),a=Bt(``),o=Bt(void 0),s=Bt(void 0),c=dt(()=>V(r)!==void 0&&(V(r).state===`done`||V(r).state===`failed`||V(r).state===`cancelled`)),l=dt(()=>V(r)===void 0?[]:[y(V(r)),...V(r).steps]),u=dt(()=>V(r)!==void 0&&!V(c)&&(V(r).state===`working`||V(a)===`sending`||V(a)===`preparing`||V(a)===`cancelling`)),d=dt(()=>V(r)===void 0?{title:``,message:``}:b(V(r),V(a)));pi(()=>{let e=fa();e===void 0?Ht(i,{title:`Open this page from your terminal`,message:`provider-kit prints a link with a one-time key when it needs your approval. Open that link to continue.`},!0):(n=pa(e),f(n))});async function f(e){try{Ht(r,await e.session(),!0),$A(V(r).network.passphrase)}catch(e){m(e)}}async function p(e){if(n===void 0)return;let t=n,i=!1,a=setInterval(()=>{t.session().then(e=>{i||Ht(r,e,!0)},()=>{})},1e3);try{let n=await e(t);i=!0,Ht(r,n,!0)}catch(e){i=!0,m(e)}finally{clearInterval(a)}}function m(e){e instanceof ua?V(c)||Ht(i,{title:`This page isn't connected to your terminal anymore`,message:`The command finished or was stopped. Run it again for a new link.`},!0):Ht(o,{title:`Something went wrong`,message:e instanceof Error?e.message:String(e)},!0)}async function h(){if(V(r)!==void 0){Ht(o,void 0),Ht(s,void 0),Ht(a,`connecting`);try{let e=await ej();if(e===void 0)return;let t=await tj();t!==void 0&&t!==V(r).network.passphrase&&Ht(s,`${e.wallet} is set to another network. Switch it to ${Mi(V(r).network.name)} before you approve.`),await p(t=>t.connect(e.address,e.wallet))}catch(e){Ht(o,rj(e),!0)}finally{Ht(a,``)}}}async function g(){let e=V(r)?.review,t=V(r)?.connected?.address;if(V(r)===void 0||e===void 0||t===void 0)return;Ht(o,void 0),Ht(a,`signing`);let n;try{n=await nj(e.xdr,t,V(r).network.passphrase)}catch(e){Ht(o,rj(e),!0),Ht(a,``);return}Ht(a,`sending`),await p(t=>t.submit(e.stepId,n)),Ht(a,``)}async function _(e){Ht(o,void 0),Ht(a,`preparing`),await p(t=>t.rebuild(e)),Ht(a,``)}async function v(){Ht(o,void 0),Ht(a,`cancelling`),await p(e=>e.cancel()),Ht(a,``)}function y(e){let{connected:t}=e;return t===void 0?{id:`connect`,title:`Connect wallet`,status:e.state===`connect`||e.state===`working`?`active`:`pending`}:{id:`connect`,title:`Connect wallet`,status:`done`,note:`${Ai(t.address)}${t.wallet===void 0?``:` · ${t.wallet}`}`}}function b(e,t){let n=e.network.name;if(t===`cancelling`)return{title:`Cancelling`,message:`Telling your terminal.`};let r=e.state===`working`?e.activity??``:t===`sending`?`Sending to ${n}`:`Preparing the transaction`;return r.startsWith(`Sending`)?{title:r,message:`Waiting for a ledger to include it, usually about 5 seconds. Keep this tab open.`}:r===`Get test XLM`?{title:`Getting test XLM`,message:`Friendbot is funding your new testnet account. This takes a few seconds.`}:r===`Checking the account`?{title:`Checking your account`,message:`Reading it from ${n}.`}:{title:`Preparing the transaction`,message:`Simulating it on ${n} to set its exact resources and fee.`}}var x=oj(),S=an(x);Ri(S,{get view(){return V(r)}});var C=B(S,2),w=z(C),T=e=>{var t=ij();ki(z(t),{get title(){return V(i).title},get message(){return V(i).message}}),R(t),Ar(e,t)},E=e=>{var t=ij();la(z(t),{title:`Connecting to your terminal`,message:`One moment.`}),R(t),Ar(e,t)},D=e=>{var t=aj(),n=an(t),i=z(n),f=B(z(i),2),p=on(f,!0),m=B(f,2),y=on(m,!0),b=B(m,2),x=z(b);{let e=dt(()=>V(r).state===`failed`?`Stopped`:V(r).state===`cancelled`?`Cancelled`:void 0);sa(x,{get steps(){return V(l)},get ended(){return V(e)}})}R(b);var S=B(b,2);_i(z(S),{name:`lock`,size:14}),Ee(2),R(S),R(i);var C=B(i,2),w=z(C),T=e=>{Ki(e,{get view(){return V(r)}})},E=e=>{la(e,{get title(){return V(d).title},get message(){return V(d).message}})},D=e=>{{let t=dt(()=>V(a)===`signing`);ta(e,{get view(){return V(r)},get notice(){return V(o)},get networkWarning(){return V(s)},get signing(){return V(t)},onapprove:g,onrebuild:_,oncancel:v})}},O=e=>{{let t=dt(()=>V(a)===`connecting`);Di(e,{get view(){return V(r)},get notice(){return V(o)},get connecting(){return V(t)},onconnect:h,oncancel:v})}};Vr(w,e=>{V(c)?e(T):V(u)?e(E,1):V(r).state===`review`?e(D,2):e(O,-1)}),R(C),R(n),Ee(2),Cn(()=>{Fr(p,V(r).title),Fr(y,V(r).intro)}),Ar(e,t)};Vr(w,e=>{V(i)===void 0?V(r)===void 0?e(E,1):e(D,-1):e(T)}),R(C),Ar(e,x),qe()}Ir(sj,{target:document.getElementById(`app`)});