@xrpl-wallet-kit/browser 0.1.6 → 0.1.7

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.
@@ -1,4 +1,4 @@
1
- /*! @xrpl-wallet-kit/browser v0.1.6 | MIT | https://github.com/XRPDomains/xrpl-wallet-kit */
1
+ /*! @xrpl-wallet-kit/browser v0.1.7 | MIT | https://github.com/XRPDomains/xrpl-wallet-kit */
2
2
  var ire=Object.defineProperty;var CR=fe=>{throw TypeError(fe)};var sre=(fe,mt,it)=>mt in fe?ire(fe,mt,{enumerable:!0,configurable:!0,writable:!0,value:it}):fe[mt]=it;var Z=(fe,mt,it)=>sre(fe,typeof mt!="symbol"?mt+"":mt,it),ore=(fe,mt,it)=>mt.has(fe)||CR("Cannot "+it);var Zd=(fe,mt,it)=>(ore(fe,mt,"read from private field"),it?it.call(fe):mt.get(fe)),G0=(fe,mt,it)=>mt.has(fe)?CR("Cannot add the same private member more than once"):mt instanceof WeakSet?mt.add(fe):mt.set(fe,it);(function(fe){"use strict";var Ps;function mt(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var it=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function X0(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Y0={},Yc={},Wv;function LR(){if(Wv)return Yc;Wv=1,Yc.byteLength=a,Yc.toByteArray=l,Yc.fromByteArray=f;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)t[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(p){var m=p.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=p.indexOf("=");h===-1&&(h=m);var g=h===m?0:4-h%4;return[h,g]}function a(p){var m=o(p),h=m[0],g=m[1];return(h+g)*3/4-g}function c(p,m,h){return(m+h)*3/4-h}function l(p){var m,h=o(p),g=h[0],w=h[1],E=new n(c(p,g,w)),y=0,b=w>0?g-4:g,S;for(S=0;S<b;S+=4)m=e[p.charCodeAt(S)]<<18|e[p.charCodeAt(S+1)]<<12|e[p.charCodeAt(S+2)]<<6|e[p.charCodeAt(S+3)],E[y++]=m>>16&255,E[y++]=m>>8&255,E[y++]=m&255;return w===2&&(m=e[p.charCodeAt(S)]<<2|e[p.charCodeAt(S+1)]>>4,E[y++]=m&255),w===1&&(m=e[p.charCodeAt(S)]<<10|e[p.charCodeAt(S+1)]<<4|e[p.charCodeAt(S+2)]>>2,E[y++]=m>>8&255,E[y++]=m&255),E}function d(p){return t[p>>18&63]+t[p>>12&63]+t[p>>6&63]+t[p&63]}function u(p,m,h){for(var g,w=[],E=m;E<h;E+=3)g=(p[E]<<16&16711680)+(p[E+1]<<8&65280)+(p[E+2]&255),w.push(d(g));return w.join("")}function f(p){for(var m,h=p.length,g=h%3,w=[],E=16383,y=0,b=h-g;y<b;y+=E)w.push(u(p,y,y+E>b?b:y+E));return g===1?(m=p[h-1],w.push(t[m>>2]+t[m<<4&63]+"==")):g===2&&(m=(p[h-2]<<8)+p[h-1],w.push(t[m>>10]+t[m>>4&63]+t[m<<2&63]+"=")),w.join("")}return Yc}var ef={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Kv;function MR(){return Kv||(Kv=1,ef.read=function(t,e,n,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,l=c>>1,d=-7,u=n?i-1:0,f=n?-1:1,p=t[e+u];for(u+=f,s=p&(1<<-d)-1,p>>=-d,d+=a;d>0;s=s*256+t[e+u],u+=f,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=r;d>0;o=o*256+t[e+u],u+=f,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(p?-1:1)*o*Math.pow(2,s-r)},ef.write=function(t,e,n,r,i,s){var o,a,c,l=s*8-i-1,d=(1<<l)-1,u=d>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,m=r?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+u>=1?e+=f/c:e+=f*Math.pow(2,1-u),e*c>=2&&(o++,c/=2),o+u>=d?(a=0,o=d):o+u>=1?(a=(e*c-1)*Math.pow(2,i),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=a&255,p+=m,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[n+p]=o&255,p+=m,o/=256,l-=8);t[n+p-m]|=h*128}),ef}/*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -18,7 +18,7 @@ Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},Gp=n,G
18
18
  The chosen QR Code version cannot contain this amount of data.
19
19
  Minimum version required to store current data is: `+D+`.
20
20
  `);const U=y(B,T,N),L=t.getSymbolSize(B),k=new r(L);return p(k,B),m(k),h(k,B),w(k,T,0),B>=7&&g(k,B),E(k,U),isNaN(_)&&(_=o.getBestMask(k,w.bind(null,k,T))),o.applyMask(_,k),w(k,T,_),{modules:k,version:B,errorCorrectionLevel:T,maskPattern:_,segments:N}}return Np.create=function(B,T){if(typeof B>"u"||B==="")throw new Error("No input text");let _=e.M,N,D;return typeof T<"u"&&(_=e.from(T.errorCorrectionLevel,e.M),N=l.from(T.version),D=o.from(T.maskPattern),T.toSJISFunc&&t.setToSJISFunction(T.toSJISFunc)),S(B,N,_,D)},Np}var Yp={},Qp={},nS;function rS(){return nS||(nS=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},t.getImageWidth=function(r,i){const s=t.getScale(r,i);return Math.floor((r+i.margin*2)*s)},t.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),d=s.margin*c,u=[s.color.light,s.color.dark];for(let f=0;f<l;f++)for(let p=0;p<l;p++){let m=(f*l+p)*4,h=s.color.light;if(f>=d&&p>=d&&f<l-d&&p<l-d){const g=Math.floor((f-d)/c),w=Math.floor((p-d)/c);h=u[a[g*o+w]?1:0]}r[m++]=h.r,r[m++]=h.g,r[m++]=h.b,r[m]=h.a}}})(Qp)),Qp}var iS;function pP(){return iS||(iS=1,(function(t){const e=rS();function n(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=r()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),u=l.getContext("2d"),f=u.createImageData(d,d);return e.qrToImageData(f.data,s,c),n(u,l,d),u.putImageData(f,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),d=c.type||"image/png",u=c.rendererOpts||{};return l.toDataURL(d,u.quality)}})(Yp)),Yp}var Jp={},sS;function gP(){if(sS)return Jp;sS=1;const t=rS();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function n(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,l=!1,d=0;for(let u=0;u<i.length;u++){const f=Math.floor(u%s),p=Math.floor(u/s);!f&&!l&&(l=!0),i[u]?(d++,u>0&&f>0&&i[u-1]||(a+=l?n("M",f+o,.5+p+o):n("m",c,0),c=0,l=!1),f+1<s&&i[u+1]||(a+=n("h",d),d=0)):c++}return a}return Jp.render=function(s,o,a){const c=t.getOptions(o),l=s.modules.size,d=s.modules.data,u=l+c.margin*2,f=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",p="<path "+e(c.color.dark,"stroke")+' d="'+r(d,l,c.margin)+'"/>',m='viewBox="0 0 '+u+" "+u+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+m+' shape-rendering="crispEdges">'+f+p+`</svg>
21
- `;return typeof a=="function"&&a(null,g),g},Jp}var oS;function mP(){if(oS)return Ya;oS=1;const t=Qk(),e=hP(),n=pP(),r=gP();function i(s,o,a,c,l){const d=[].slice.call(arguments,1),u=d.length,f=typeof d[u-1]=="function";if(!f&&!t())throw new Error("Callback required as last argument");if(f){if(u<2)throw new Error("Too few arguments provided");u===2?(l=a,a=o,o=c=void 0):u===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(u<1)throw new Error("Too few arguments provided");return u===1?(a=o,o=c=void 0):u===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(p,m){try{const h=e.create(a,c);p(s(h,o,c))}catch(h){m(h)}})}try{const p=e.create(a,c);l(null,s(p,o,c))}catch(p){l(p)}}return Ya.create=e.create,Ya.toCanvas=i.bind(null,n.render),Ya.toDataURL=i.bind(null,n.renderToDataURL),Ya.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),Ya}var wP=mP();const yP=or(wP);let dl=0,aS="",cS="",lS="",uS="",dS="",fS="",vf=0;function hS(){if(typeof window>"u"||typeof document>"u"||(dl+=1,dl>1))return;aS=document.body.style.overflow,cS=document.body.style.paddingRight,lS=document.body.style.position,uS=document.body.style.top,dS=document.body.style.width,fS=document.documentElement.style.overscrollBehavior,vf=window.scrollY||document.documentElement.scrollTop||0;const t=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${vf}px`,document.body.style.width="100%",t>0&&(document.body.style.paddingRight=`${t}px`),document.documentElement.style.overscrollBehavior="contain"}function Zp(){typeof window>"u"||typeof document>"u"||dl===0||(dl-=1,!(dl>0)&&(document.body.style.overflow=aS,document.body.style.paddingRight=cS,document.body.style.position=lS,document.body.style.top=uS,document.body.style.width=dS,document.documentElement.style.overscrollBehavior=fS,window.scrollTo(0,vf),vf=0))}function eg(t,e){let n=5381;for(let r=0;r<e.length;r+=1)n=(n<<5)+n^e.charCodeAt(r);return`${t}-${(n>>>0).toString(36)}`}function tg(t,e){if(typeof document>"u")return;const n=`style[data-xwk-style="${t}"]`;let r=document.head.querySelector(n);r||(r=document.createElement("style"),r.dataset.xwkStyle=t,document.head.appendChild(r)),r.textContent!==e&&(r.textContent=e)}const qi=304,Ef="#111827",ng="#ffffff",pS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAPoAAAD6AG1e1JrAAALz0lEQVR4nO2diZcVxRXG/YNMQnCcMDgzaBKJSTQSzXKymT3xJOTEJdGcHEnkkOVkOUnYZGYIIHswiAhOwLAZEAURUAQEYVQGEAFhQGQZ6K6b+rrrvlfvzVuq31rtu3XOd97wXnd19b2/rq6qe7u57qbegEStq+ua3QCRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgA6OrLqnt2ruzfmt1OAaAG6uzNOnZsT0CfmBXQDTMDGjU9oI9OC+j6qQF9ZFos/I3v8Bu2wbbYp9OA0unB+QgADuqC0+Fw/dn2WOzUdv15yz8DuntxSBNXh/ToxpD+vlVR70uK5u6Mhb/xHX7DNtgW+7SbOlDXWFN3lwfnKQDkO74vvlrhqFEzAhqnr9ofrAhp+ouK1g8oentI0eVrRIrKF2yDbY8MxfvO2KaiulAneggco/NDdKtINQDshNHa6e262/728pAe36Xo0BmisIi3lYp/C6DQyHyniuyD3w7rOufrur+jj4FjfXxGbhvSqlQCwFcgHN+h79UPrQ1p6xGiq+FIxxUDwaUU2v+aPsa2QaKH9TExTgAI3AM12y4tAQDuw7gC0RXf1x/SqydGOq3YlVxNUQVgwLHv/09IbXrgeOOsuG3Nts+HFgCMxHGlfWw6BnQBrT+cvacXck49iw0ZPjYMEN29JB4joCdI06whFQDA8ejqMUX7/XOKhi5nHd9Av48oODaDd0636Q+6bWgj2pqWsYH3AMCQN+ru/mY9LXvm4EjD+1BCC8R+3Ua0FW1OAwReA4B7Kq6oOxcF9Nq7WWNXWhgcHvXbyswEqgQBZe9JogmL4rb7Pi7wFoBuM8r/2rKQjp6PDRtU4J2gQqeqKo6Hcky3+RtPhNEswWcIvAQAXScMd8+/Qzr5QWzQJFe+KjATuHCFaI/uRZ45oGjeTkVTtyr68+ZY+Bvf4Tdsg23L1VeqcFtP6bbjHHiq2Gy7pgIAvudjUef0xWTOV5R7tb97gWj5XqXn7IruWGBWC2dmYwCYUUD8b/yGbe5YGET7YF/UUax+FwhwDt/SEPg6JvAOAGiMHkVvPxpb0LUbtmcE+08RTdmk6DPz4p4EQp0MWLdRJjJo/ZuPP8rshzpQF+rMQODYpmtmYWq17llGe9oLeAcA5tAIwmwYMACEJSycd7Xhvjt5YxjVgTk5T8cqMTzvhzqi+b3+DnUfO597zFKF4UU8wdfbgH8A9MXh2M/rLpuvuqLr+pS96lfuVzR+Xhg5C/XUcuDFdaFuHOOpfWrE8YtBidvImFnNt2tqAIB4HHDb/CCaUhWCgP958Wrc3UfdfJ2XY1H3GBMImrxBRce225Lv/GWvqWhcMbbX31iBlwDYEIzX9+A9J3INy59nLhHd+7SKBnLdDQrIdJrxAvIEfrxS0Zm8gSrfsZa8oqJ4RbSPB/ZMHQAMAcYDn54b0O53YsNyxO+UNjxmCuiWkbXT6LZxfoA9VeXxyoLdetA303/nNw0AzslzuWK7zJjgU3MC2nEsNvA77xN9s8pFFk4ZqyblC/uiDV9fFkZtQsF6QhLnc9pZswaIDQegyyzvIg+vzXFuzD3BrXPDKIWr2hU2OAaxfHTjUJT/VykEZtEKK5aPrIvn+2Mdnd9lsphgC9ikGRA0FABO4pi4KqQlryr6/gr3VbJOk9yJBRv0CJUai3uUcbNDmq6nZxD+rrZO5ChwONgZHL39956MbQGbNGOq2DAA0M1hsPab9YquBnF3+cEwEiqygzgXCKrpstn5qGPL29lRO7KJ8F01ECTJE+w2eQ0/71d0YdiMbbRNfqtt0+gxTUMA4BOevFFlFkeumU8kYP5ijYGgjifOzr9ZH+OFwWwbuB1I80IYtxoIktjiQQ3+JTON5BVDzCSmbIxt0aieoO4AcBbP7/RcncOtmUwe83lF0//ws/WDgJ2PVO/tR3OnbfbfGGR+ck79IOBe8KG1cZYy5dmCl5mRWDKqQRDUFQB0iziRP/5PZU+Qcgv/e1hD8Ov/1h4Cexbx8vGRzs+HYJeebmLa2V7j4A07/1ca9CtB7rnbtuDv/rRZRfGIeq9t1A2ALhN5g/OJSqdv8ffoCietrx0EvJh0q7WOUGoNn39Dsif2qVUEj53/yLrs+KeULTjYBNu11Xl2UBcAMEhDEAVXHYd0y0XQbAge3VB9F5izkpggm4i3QQYSIoHVQsDOxwCP7/XlmsG2Qj4BbkkdVUxTmwKArZ3H3cO6vEk0GNpU+WCI59e3PR7QviKxBBcIsO9n51cOAY9/ppjxj4vzbVvt0rart3/qBgBH9b6wMKA33nN3gj1WQBeYFIJu4/zPace9XiaaWKrwPgdPE92+IK4zycITOx9ZzPmDX5fjHtI2u3NhvL5Qz3FAXXsAvhIR2j1w2t0ZtrH+ssX9dsDOR0bPwQTQuTgDILc5Jnmy8zGQKzb4LXU8G7p6zwQaMg1EF4quNEl3bA+G/vZ8PCLuKvHQRbcZdCKDGM/xuR7H1SkDZ4kmLC6f6cszn79uKZ8zUOg4yIFA79UI5zcEABsCDKqSpHfbEEx9oTgEnD7+Re2gN8+61+9auK63hih6Kml0AQj4ySW08R9by898CtWP3AeMWxqZP9iwpWB7SvaKw5SMiw2BnVrFEETp49ohX1oS0JEh93q5btfCdQ6eI/ry0jimwRDYzscj6UTJnY+p5/gaTj29A4AhaDeLMjsrhKBnewwBjI6YPBzxlaUhHT3nXh+X4SCWa7FzD7/6rzA69jgTm0CbHttemfPrtfjkHQAMAWYHmN/uKLAsW6woa7vZO1TmdS+IxR9PkKjJm2BB5pdrQnpQa7jM4kwhpyH+j7A0v1am7yWV+T1JPfVefvYOABsCBF9eHHR3XuQks12fhgD59py3n8T5WIfHejych24bwajLRfL7SjkPmUD3LA+jV8zw90n236YvgFsaEIDyDgAbAqyUPX/E3YlcsFhSbE29UOFtEIF7wApBc3Tuvn5FF4eT14c2JHmEjM+xFiHoVAPAEIwxBtj8Vq6BXBzgOsXibZB/gBh8fv5BBMG0gH62Ohufd63XtQ0ofG7IReianT33Zvqg6UmhDAH+3jSQa6haFK4Kjp2oHQxHF5rHc0/w01WK3r+Su28tCp/Tc29StFbgg/O9AIAh6JgV59KtO5xrsGoKV3FeO/Qnq8pnHnWbRZx7V6rohQ9RO6pvRuZc8CYRHMcX53sDQAaCnvi5vLVv5BquIqObT7xN5EcrTfq443Iytv3hUyGdvVSDdph9nz1E0fl1eOR8rwCwIcDAqP9A5cbnfeBAvOPP1fn5ECBh872ETygXascaDTSueh9fHeMVAFCngQALRk/vVzmGTGJ0OO67TyZ3fj4EeC/gqQog4G1Xv04R0B09fj4e5h0ADAFSwLEsumKfOwT58/Nq387BD35gveFkgvUG3gYPrGJ1z1fnewsAQ3BTTxwVe2JveQj4txMXrKeGapBW1m2Wm+2nf1zagaeCo4dEPHa+1wBkIOiNw7xL9xSHgL87rh2EJ3RGV3nlF4MA6/+l3g+Q/1SwfQ6+ymsAIgOaT6y3L9ptIChgdLxICkGhWjs/A4F5qgmRwMECgae0PRWcGgBsQyLsixc2s/E5yRJhYISDC8Xpaw0BQLxrcRDlBqCgDQwCngq+ISVPBacKgBwI9FU45+XspYcEkLscMnVqDcEEK/MIJXoqeEa6nJ8qAGzDooudtC6MwsK3Lwidc/VqCQGOiWOjDZPMU8Fpc37qAGB1mSdrr58Wrxw2Y3ElimH0xG1I8lSwb0olAJEDqny5Qy2U+X+JmvCGkpYHQCQAiAQAkQAgEgBEAoBIABAJACIBQCQAiAQAkQAgEgBEAoBIABAJACIBQCQAiAQAkQAgEgBEAoBIABAJACIBoNUlALS4BIAWlwDQ4hIAWlwCQItLAGhxCQAtLgGgxSUAtLgEgBaXANDiEgBaXP8HtafgB6DpoQ0AAAAASUVORK5CYII=";let bP=0;class gS{constructor(e,n){this.lastFocusedElement=null,this.cachedStyleKey="",this.cachedStyle="",this.qrUri="",this.qrCopied=!1,this.qrLightMode=!1,this.availability={},this.offEvents=[],this.openHandlers=new Set,this.closeHandlers=new Set,this.connectHandlers=new Set,this.presentation=n,this.titleId=`xwk-title-${++bP}`,this.onDocumentKeyDown=r=>this.handleDocumentKeyDown(r),this.options={manager:e.manager,mount:e.mount,...wf(e)},this.offEvents.push(e.manager.on("qr",({adapterId:r,uri:i,deeplink:s})=>this.showQr(r,i,s)),e.manager.on("connecting",({adapterId:r,recovering:i})=>{i||this.setLoading(r)}),e.manager.on("connected",({adapterId:r,session:i})=>this.handleConnected(r,i??e.manager.getSession())),e.manager.on("error",({adapterId:r,error:i})=>this.setError(i,r)))}autoOpen(){this.open()}open(){if(this.activeGroupId=void 0,this.lastFocusedElement=document.activeElement instanceof HTMLElement?document.activeElement:null,this.renderView("list"),this.openHandlers.forEach(e=>e()),this.refreshAvailability(),this.pendingQr){const{adapterId:e,uri:n,deeplink:r}=this.pendingQr;this.pendingQr=void 0,this.showQr(e,n,r)}}close(e=!0,n=e,r=!0){document.removeEventListener("keydown",this.onDocumentKeyDown),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),e&&this.options.manager.cancelPendingConnection(),this.resetQrState();const i=this.root;if(!(i!=null&&i.isConnected)){this.root=void 0,this.presentation==="modal"&&Zp(),n&&this.restoreFocus(),e&&this.closeHandlers.forEach(o=>o());return}const s=()=>{this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=void 0),i.remove(),this.root===i&&(this.root=void 0),this.presentation==="modal"&&Zp(),n&&this.restoreFocus(),e&&this.closeHandlers.forEach(o=>o())};if(this.presentation==="inline"||!r||this.prefersReducedMotion()){s();return}i.dataset.xwkState="closing",this.closeTimer&&window.clearTimeout(this.closeTimer),this.closeTimer=window.setTimeout(s,190)}destroy(){this.options.manager.cancelPendingConnection(),this.close(!1,!1,!1),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),this.closeTimer&&window.clearTimeout(this.closeTimer),this.offEvents.splice(0).forEach(e=>e()),this.openHandlers.clear(),this.closeHandlers.clear(),this.connectHandlers.clear()}isOpen(){var e;return!!((e=this.root)!=null&&e.isConnected)}on(e,n){if(e==="connect"){const s=n;return this.connectHandlers.add(s),()=>{this.connectHandlers.delete(s)}}const r=e==="open"?this.openHandlers:this.closeHandlers,i=n;return r.add(i),()=>{r.delete(i)}}onClose(e){return this.on("close",e)}updateOptions(e){this.options={...this.options,mount:e.mount??this.options.mount,...wf(e)},this.activeGroupId=void 0}bind(){var e,n,r,i,s,o,a,c;(n=(e=this.root)==null?void 0:e.querySelector("[data-xwk-close]"))==null||n.addEventListener("click",()=>this.close()),(i=(r=this.root)==null?void 0:r.querySelector("[data-xwk-back]"))==null||i.addEventListener("click",()=>this.handleBack()),(o=(s=this.root)==null?void 0:s.querySelector("[data-xwk-copy]"))==null||o.addEventListener("click",()=>void this.copyQrUri()),(c=(a=this.root)==null?void 0:a.querySelector("[data-xwk-retry]"))==null||c.addEventListener("click",()=>void this.retryQrConnection()),this.bindGroupButtons(),this.bindWalletButtons(),this.focusInitialElement()}bindGroupButtons(){var e;(e=this.root)==null||e.querySelectorAll("[data-wallet-group-id]").forEach(n=>n.addEventListener("click",()=>{const r=n.dataset.walletGroupId;r&&this.showWalletGroup(r)}))}bindWalletButtons(){var e;(e=this.root)==null||e.querySelectorAll("[data-wallet-id]").forEach(n=>n.addEventListener("click",async()=>{const r=n.dataset.walletId;if(!r)return;const i=this.options.manager.getWallets().find(o=>o.id===r),s=this.options.manager.getAdapter(r);try{if(this.shouldDelegateToWalletConnectModal(i,s)){this.presentation==="modal"?this.close(!1,!1,!1):this.activeRequestAdapterId=r,await this.waitForPaint(),await this.options.manager.connect(r);return}this.setLoading(r),await this.waitForPaint(),await this.options.manager.connect(r)}catch{}}))}shouldDelegateToWalletConnectModal(e,n){return!!(this.isDefaultWalletConnectUiMode()&&(e==null?void 0:e.id)==="walletconnect"&&e.type==="walletconnect"&&n)}bindChrome(){var e,n,r,i,s,o,a,c,l,d;(n=(e=this.root)==null?void 0:e.querySelector("[data-xwk-close]"))==null||n.addEventListener("click",()=>this.close()),(i=(r=this.root)==null?void 0:r.querySelector("[data-xwk-back]"))==null||i.addEventListener("click",()=>this.handleBack()),(o=(s=this.root)==null?void 0:s.querySelector("[data-xwk-copy]"))==null||o.addEventListener("click",()=>void this.copyQrUri()),(c=(a=this.root)==null?void 0:a.querySelector("[data-xwk-qr-theme]"))==null||c.addEventListener("click",()=>this.toggleQrTheme()),(d=(l=this.root)==null?void 0:l.querySelector("[data-xwk-retry]"))==null||d.addEventListener("click",()=>void this.retryQrConnection()),this.focusInitialElement()}handleBack(){var n,r,i;const e=this.activeGroupId;if(((n=this.root)==null?void 0:n.dataset.xwkView)==="qr"&&e&&this.getGroups().some(s=>s.id===e)){this.options.manager.cancelPendingConnection(),this.resetQrState(),this.renderView("list",!1),this.showWalletGroup(e);return}(((r=this.root)==null?void 0:r.dataset.xwkView)==="qr"||((i=this.root)==null?void 0:i.dataset.xwkView)==="connect")&&this.options.manager.cancelPendingConnection(),this.showList()}async retryQrConnection(){var r,i;const e=(r=this.qrState)==null?void 0:r.adapterId;if(!e)return;const n=(i=this.root)==null?void 0:i.querySelector("[data-xwk-retry]");n&&(n.disabled=!0,n.classList.add("xwk-retrying"),n.innerHTML=`${this.refreshIcon()} ${this.escapeHtml(this.messages().retrying)}`);try{await this.waitForPaint(),this.setLoading(e),await this.waitForPaint(),await this.options.manager.connect(e)}catch{}}async copyQrUri(){var e;this.qrUri&&(await this.copyText(this.qrUri),this.qrCopied=!0,((e=this.qrState)==null?void 0:e.status)==="ready"&&(this.qrState={...this.qrState,copied:!0}),this.updateQrCopyButton(),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),this.qrCopyResetTimer=window.setTimeout(()=>{var n;this.qrCopied=!1,((n=this.qrState)==null?void 0:n.status)==="ready"&&(this.qrState={...this.qrState,copied:!1}),this.updateQrCopyButton()},1400))}toggleQrTheme(){var n,r;if(((n=this.qrState)==null?void 0:n.status)!=="ready")return;this.qrLightMode=!this.qrLightMode;const e=(r=this.root)==null?void 0:r.querySelector(".xwk-qr-code");e instanceof HTMLElement&&this.renderQr(e,this.qrState.uri),this.updateQrThemeButton()}async copyText(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{await navigator.clipboard.writeText(e);return}catch{}const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy")}finally{n.remove()}}resetQrState(){this.activeRequestAdapterId=void 0,this.qrCopyResetTimer&&(window.clearTimeout(this.qrCopyResetTimer),this.qrCopyResetTimer=void 0),this.qrUri="",this.qrCopied=!1,this.qrLightMode=!1,this.pendingQr=void 0,this.qrState=void 0}updateQrCopyButton(){var r,i;const e=(r=this.root)==null?void 0:r.querySelector("[data-xwk-copy]");if(!e)return;e.innerHTML=this.renderQrCopyButtonContent();const n=(i=this.root)==null?void 0:i.querySelector("[data-xwk-copy-live]");n&&(n.textContent=this.qrCopied?this.messages().qrUriCopied:"")}updateQrThemeButton(){var n;const e=(n=this.root)==null?void 0:n.querySelector("[data-xwk-qr-theme]");e&&(e.innerHTML=this.qrThemeIcon(),e.setAttribute("aria-label",this.qrLightMode?"Use dark QR":"Use light QR"),e.setAttribute("title",this.qrLightMode?"Use dark QR":"Use light QR"),e.setAttribute("aria-pressed",String(this.qrLightMode)))}renderView(e,n=!0){const r=this.pendingQr,i=this.activeRequestAdapterId;this.close(!1,!1,!1),this.pendingQr=r,this.activeRequestAdapterId=i,this.presentation==="modal"&&(this.removeExistingOverlays(),hS()),this.root=document.createElement("div"),this.root.className=this.presentation==="inline"?"xwk-overlay xwk-inline":"xwk-overlay",this.root.dataset.xwkView=e,this.root.dataset.xwkState=n?"opening":"open",this.root.innerHTML=this.renderShell(),(this.options.mount??document.body).appendChild(this.root),n&&window.requestAnimationFrame(()=>{var s;(s=this.root)!=null&&s.isConnected&&(this.root.dataset.xwkState="open")}),this.presentation==="modal"&&(this.root.addEventListener("click",s=>{s.target===this.root&&this.close()}),document.addEventListener("keydown",this.onDocumentKeyDown)),this.bind()}ensureMounted(e){var n;if(!((n=this.root)!=null&&n.isConnected)||!this.root.querySelector(".xwk-modal")){this.renderView(e);return}this.setView(e)}setView(e){this.root&&(this.root.dataset.xwkView=e),this.focusInitialElement()}handleDocumentKeyDown(e){var o;if(!((o=this.root)!=null&&o.isConnected))return;if(e.key==="Escape"){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const n=this.getFocusableElements();if(!n.length){e.preventDefault();return}const r=n[0],i=n[n.length-1],s=document.activeElement;if(e.shiftKey&&s===r){e.preventDefault(),i.focus();return}!e.shiftKey&&s===i&&(e.preventDefault(),r.focus())}focusInitialElement(){this.presentation!=="inline"&&window.setTimeout(()=>{var e,n;(e=this.root)!=null&&e.isConnected&&((n=this.root.querySelector(".xwk-modal"))==null||n.focus({preventScroll:!0}))},0)}restoreFocus(){var e;(e=this.lastFocusedElement)!=null&&e.isConnected&&(this.lastFocusedElement.focus({preventScroll:!0}),this.lastFocusedElement=null)}getFocusableElements(){if(!this.root)return[];const e=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(this.root.querySelectorAll(e)).filter(n=>n.offsetParent!==null&&!n.classList.contains("xwk-hidden"))}removeExistingOverlays(){(this.options.mount??document.body).querySelectorAll(".xwk-overlay").forEach(n=>n.remove())}prefersReducedMotion(){var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)}getGroups(){var n;if(this.options.walletConnectUiMode!=="group")return[];if((n=this.options.groups)!=null&&n.length)return this.options.groups;const e=this.getWallets().filter(r=>r.group==="WalletConnect").map(r=>r.id);return e.length?[{id:"walletconnect",name:"WalletConnect",icon:pS,walletIds:e,maxPreviewIcons:5}]:[]}getWallets(){const e=this.options.manager.getWallets(),n=this.options.wallets;if(!(n!=null&&n.length))return e;const r=new Map(e.map(i=>[i.id,i]));return n.map(i=>r.get(i)).filter(i=>!!i)}getGroupWallets(e){const n=new Map(this.getWallets().map(r=>[r.id,r]));return e.walletIds.map(r=>n.get(r)).filter(r=>!!r)}getUngroupedWallets(e){const n=new Set(e.flatMap(r=>r.walletIds));return this.getWallets().filter(r=>!n.has(r.id))}async refreshAvailability(){var i;if(this.availability=await this.options.manager.getWalletAvailability(),((i=this.root)==null?void 0:i.dataset.xwkView)!=="list")return;const e=this.root.querySelector(".xwk-grid");if(!e)return;const n=this.options.layout??"list",r=this.activeGroupId?this.getGroups().find(s=>s.id===this.activeGroupId):void 0;e.innerHTML=r?this.getGroupWallets(r).map(s=>this.renderWallet(s,n)).join(""):this.renderWalletList(n),this.bindGroupButtons(),this.bindWalletButtons()}showList(){var r,i,s,o,a,c,l,d,u,f,p;if(this.activeGroupId=void 0,this.resetQrState(),!((r=this.root)!=null&&r.querySelector(".xwk-list"))){this.renderView("list",!1);return}this.ensureMounted("list"),(s=(i=this.root)==null?void 0:i.querySelector(".xwk-list"))==null||s.classList.remove("xwk-hidden"),(a=(o=this.root)==null?void 0:o.querySelector(".xwk-qr"))==null||a.classList.add("xwk-hidden"),(l=(c=this.root)==null?void 0:c.querySelector(".xwk-connect"))==null||l.classList.add("xwk-hidden"),(u=(d=this.root)==null?void 0:d.querySelector("[data-xwk-back]"))==null||u.classList.add("xwk-hidden");const e=(f=this.root)==null?void 0:f.querySelector(".xwk-title");e&&(e.textContent=this.options.title??this.messages().connectWallet);const n=(p=this.root)==null?void 0:p.querySelector(".xwk-grid");n&&(n.innerHTML=this.renderWalletList(this.options.layout??"list")),this.bindGroupButtons(),this.bindWalletButtons()}showWalletGroup(e){var s,o,a,c;const n=this.getGroups().find(l=>l.id===e);if(!n||!this.root)return;this.resetQrState(),this.activeGroupId=e,this.ensureMounted("list"),(s=this.root.querySelector(".xwk-list"))==null||s.classList.remove("xwk-hidden"),(o=this.root.querySelector(".xwk-qr"))==null||o.classList.add("xwk-hidden"),(a=this.root.querySelector(".xwk-connect"))==null||a.classList.add("xwk-hidden"),(c=this.root.querySelector("[data-xwk-back]"))==null||c.classList.remove("xwk-hidden");const r=this.root.querySelector(".xwk-title");r&&(r.textContent=n.name);const i=this.root.querySelector(".xwk-grid");i&&(i.innerHTML=this.getGroupWallets(n).map(l=>this.renderWallet(l,this.options.layout??"list")).join("")),this.bindWalletButtons()}showQr(e,n,r){var o;if(this.isStaleAdapterEvent(e))return;if(!this.root){this.pendingQr={adapterId:e,uri:n,deeplink:r};return}this.qrUri=n;const i=this.options.manager.getWallets().find(a=>a.id===e);this.qrCopied=!1,this.qrLightMode=!1,this.qrState={status:"ready",adapterId:e,walletName:(i==null?void 0:i.name)??"WalletConnect",uri:n,deeplink:r,copied:!1},this.renderQrShell(this.qrState);const s=(o=this.root)==null?void 0:o.querySelector(".xwk-qr-code");s instanceof HTMLElement&&this.renderQr(s,n)}setLoading(e){this.activeRequestAdapterId=e;const n=this.options.manager.getWallets().find(i=>i.id===e),r=this.options.manager.getAdapter(e);if(this.shouldUseCustomWalletConnectQr(n,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"loading",adapterId:e,walletName:(n==null?void 0:n.name)??e},this.renderQrShell(this.qrState);return}this.renderConnectShell(n,e)}setError(e,n){var a,c,l,d,u;if(n&&this.isStaleAdapterEvent(n)||!n&&!this.activeRequestAdapterId&&((a=this.root)==null?void 0:a.dataset.xwkView)!=="qr")return;const r=this.getFriendlyErrorMessage(e);if(((c=this.root)==null?void 0:c.dataset.xwkView)==="qr"||this.qrState){const f=this.qrState;if(this.isRejectedError(e,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"rejected",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect"},this.renderQrShell(this.qrState);return}if(this.isTimeoutError(e,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"timeout",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect"},this.renderQrShell(this.qrState);return}this.qrState={status:"error",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect",message:r},this.renderQrShell(this.qrState);return}const i=(l=this.root)==null?void 0:l.querySelector(".xwk-status");i&&(i.textContent=r,i.classList.add("xwk-error"),i.setAttribute("role","alert"));const s=(d=this.root)==null?void 0:d.querySelector(".xwk-connect-status");s&&(s.textContent=r,s.classList.add("xwk-error-text"),s.setAttribute("role","alert"));const o=(u=this.root)==null?void 0:u.querySelector(".xwk-qr-loading");o&&(o.textContent=r,o.classList.add("xwk-error-text"),o.setAttribute("role","alert"))}shouldUseCustomWalletConnectQr(e,n){return!!(!this.isDefaultWalletConnectUiMode()&&(n!=null&&n.capabilities.qr)&&(e==null?void 0:e.group)==="WalletConnect")}isDefaultWalletConnectUiMode(){return!this.options.walletConnectUiMode||this.options.walletConnectUiMode==="default"}handleConnected(e,n){var r;if(!this.isStaleAdapterEvent(e)){if(this.activeRequestAdapterId=void 0,n&&this.connectHandlers.forEach(i=>i(n)),this.presentation==="inline"){this.showList();const i=(r=this.root)==null?void 0:r.querySelector(".xwk-status");i&&(i.textContent=this.messages().connected);return}this.close(!1,!0)}}isStaleAdapterEvent(e){return!this.activeRequestAdapterId||this.activeRequestAdapterId!==e}isRejectedError(e,n){return Wa(e)?e.code===fe.WalletKitErrorCode.CONNECTION_REJECTED||e.code===fe.WalletKitErrorCode.SIGN_REJECTED:/reject|denied|cancelled|canceled|closed|user rejected|proposal expired|expired/i.test(n)}isTimeoutError(e,n){return Wa(e)&&e.code===fe.WalletKitErrorCode.REQUEST_TIMEOUT?!0:/timeout|timed out/i.test(n)}getFriendlyErrorMessage(e){if(Wa(e))switch(e.code){case fe.WalletKitErrorCode.CONNECTION_REJECTED:return"Connection was rejected in the wallet.";case fe.WalletKitErrorCode.SIGN_REJECTED:return"Request was rejected in the wallet.";case fe.WalletKitErrorCode.REQUEST_TIMEOUT:return"Wallet request timed out. Please try again.";case fe.WalletKitErrorCode.WALLET_NOT_INSTALLED:case fe.WalletKitErrorCode.WALLET_NOT_AVAILABLE:return"Wallet is not available in this browser.";case fe.WalletKitErrorCode.UNSUPPORTED_METHOD:return"This wallet does not support the requested action.";case fe.WalletKitErrorCode.NETWORK_MISMATCH:return"Wallet network does not match this dApp.";default:return this.formatDisplayErrorMessage(e.message)}const n=Ms(e);return/reject|denied|cancelled|canceled|closed|proposal expired|expired/i.test(n)?"Request was rejected in the wallet.":/timeout|timed out/i.test(n)?"Wallet request timed out. Please try again.":/not installed|provider is not available|not available/i.test(n)?"Wallet is not available in this browser.":this.formatDisplayErrorMessage(n)}formatDisplayErrorMessage(e){const n=e.replace(/\s+/g," ").trim();return n?n.length<=180&&!/^\[?\{/.test(n)?n:/^\[?\{/.test(n)?"Wallet request failed. Please try again.":`${n.slice(0,177).trimEnd()}...`:"Wallet request failed. Please try again."}renderShellAttributes(e){const n=this.presentation==="modal"?'role="dialog" aria-modal="true"':'role="region"';return`class="${e}" ${n} aria-labelledby="${this.titleId}" tabindex="-1"`}renderHeaderEnd(){return this.presentation==="inline"?'<span class="xwk-header-spacer" aria-hidden="true"></span>':`<button class="xwk-close" data-xwk-close aria-label="${this.escapeHtml(this.messages().close)}">&times;</button>`}renderShell(){const e=this.messages(),n=this.resolveTheme(),r=this.options.layout??"list",i=this.options.size??"default",s=this.options.textSize??"sm";return this.ensureStyles(n,r,i,s),`<section ${this.renderShellAttributes(`xwk-modal xwk-layout-${r}`)}><div class="xwk-header"><button class="xwk-back xwk-hidden" data-xwk-back aria-label="${this.escapeHtml(e.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(this.options.title??e.connectWallet)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-list">${this.renderNetworkBadge()}<div class="xwk-grid">${this.renderWalletList(r)}</div><div class="xwk-status" role="status" aria-live="polite"></div></div><div class="xwk-connect xwk-hidden"><div class="xwk-spinner" aria-hidden="true"><div class="xwk-connect-icon"></div></div><strong class="xwk-connect-name"></strong><p class="xwk-connect-status" role="status" aria-live="polite">${this.escapeHtml(e.approveRequest)}</p></div><div class="xwk-qr xwk-hidden"><h3 class="xwk-qr-title"></h3><div class="xwk-qr-code">${this.renderQrLoading()}</div><p class="xwk-qr-help">${this.escapeHtml(e.waitingForWalletConnectUri)}</p></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`}renderNetworkBadge(){const e=this.options.manager.getNetwork();if(!e||e.networkType==="MAINNET")return"";const{dotColor:n,badgeBg:r,badgeBorder:i,textColor:s,label:o}=this.resolveNetworkBadgeStyle(e),a=`background:${r};border-color:${i};color:${s}`,c=`<span class="xwk-network-dot" style="background:${n}" aria-hidden="true"></span>`;return`<div class="xwk-network-row"><span class="xwk-network-badge" style="${a}">${c}${this.escapeHtml(o)}</span></div>`}resolveNetworkBadgeStyle(e){const n=this.resolveThemeMode()==="dark",r=String(e.family??"xrpl").toLowerCase(),i=String(e.id??"").toLowerCase(),s=String(e.name??"").toLowerCase();if(r.includes("evm")||i.includes("evm")||s.includes("evm"))return{label:"XRPL EVM",dotColor:"#a78bfa",badgeBg:n?"rgba(167,139,250,.10)":"#f5f3ff",badgeBorder:n?"rgba(167,139,250,.20)":"#ddd6fe",textColor:n?"#c4b5fd":"#6d28d9"};if(e.networkType==="DEVNET")return{label:"DEVNET",dotColor:"#38bdf8",badgeBg:n?"rgba(56,189,248,.10)":"#f0f9ff",badgeBorder:n?"rgba(56,189,248,.20)":"#bae6fd",textColor:n?"#7dd3fc":"#0369a1"};if(e.networkType==="TESTNET")return{label:"TESTNET",dotColor:n?"#fbbf24":"#f59e0b",badgeBg:n?"rgba(245,158,11,.12)":"#fef3c7",badgeBorder:n?"rgba(245,158,11,.20)":"#fde68a",textColor:n?"#fbbf24":"#92400e"};const a=this.resolveTheme();return{label:(e.name||"CUSTOM").toUpperCase().slice(0,10),dotColor:a.muted,badgeBg:a.surface,badgeBorder:a.border,textColor:a.muted}}renderQrShell(e){var y;const n=this.messages(),r=this.resolveTheme(),i=this.options.layout??"list",s=this.options.size??"default",o=this.options.textSize??"sm",a=e.status==="ready"&&!!e.uri;e.status==="ready"&&e.uri;const c=e.status==="ready"?e.deeplink:void 0,l=a?' aria-hidden="true"':"",d=a&&c?`<a class="xwk-action xwk-action-primary" data-xwk-open href="${this.escapeHtml(c)}">${this.escapeHtml(n.openWallet)}</a>`:"",u=a?`<button class="xwk-action xwk-copy-inside" data-xwk-copy type="button">${this.renderQrCopyButtonContent()}</button>`:"",f=a?`<button class="xwk-qr-theme-action" data-xwk-qr-theme type="button" aria-label="${this.qrLightMode?"Use dark QR":"Use light QR"}" title="${this.qrLightMode?"Use dark QR":"Use light QR"}" aria-pressed="${this.qrLightMode?"true":"false"}">${this.qrThemeIcon()}</button>`:"",p=e.status==="rejected"||e.status==="timeout"||e.status==="error"?`<button class="xwk-action xwk-action-primary" data-xwk-retry type="button">${this.refreshIcon()} ${this.escapeHtml(n.tryAgain)}</button>`:"",m=[u,d].filter(Boolean).length,h=u||d||p?`<div class="xwk-qr-card-actions ${m>1?"xwk-qr-card-actions-dual":""}">${u}${d}${p}</div>`:`<div class="xwk-qr-card-actions xwk-qr-card-actions-placeholder" aria-hidden="true"><button class="xwk-action xwk-copy-inside" type="button" disabled>${this.renderQrCopyButtonContent()}</button></div>`,g=e.status==="rejected"?`<div class="xwk-qr-message" role="alert"><strong>${this.escapeHtml(n.connectionCanceledTitle)}</strong><span>${this.escapeHtml(n.requestRejected)}</span></div>`:e.status==="timeout"?`<div class="xwk-qr-message xwk-error-text" role="alert"><strong>${this.escapeHtml(n.connectionTimedOutTitle)}</strong><span>${this.escapeHtml(n.requestTimedOut)}</span></div>`:e.status==="error"?`<div class="xwk-qr-message xwk-error-text" role="alert"><strong>${this.escapeHtml(n.connectionFailedTitle)}</strong><span>${this.escapeHtml(e.message)}</span></div>`:this.renderQrLoading(),w="",E=a?n.helpScan:e.status==="rejected"||e.status==="timeout"?n.helpTryAgainNewRequest:e.status==="error"?n.pleaseTryAgain:n.waitingForWalletConnectUri;(y=this.root)!=null&&y.isConnected||this.renderView("qr"),this.root&&(this.root.dataset.xwkView="qr",this.ensureStyles(r,i,s,o),this.root.innerHTML=`<section ${this.renderShellAttributes("xwk-modal xwk-qr-modal")}><div class="xwk-header"><button class="xwk-back" data-xwk-back aria-label="${this.escapeHtml(n.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(e.walletName)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-qr xwk-standalone-qr"><div class="xwk-qr-card"><div class="xwk-qr-code-wrap"><div class="xwk-qr-code"${l}>${g}</div>${f}</div>${w}${h}</div><p class="xwk-qr-help">${this.escapeHtml(E)}</p><span class="xwk-sr-only">${this.escapeHtml(n.qrSrHint)}</span><span class="xwk-sr-only" aria-live="assertive" data-xwk-copy-live></span></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`,this.bindChrome())}renderQrLoading(){return`<span class="xwk-qr-loading" role="status" aria-live="polite"><span class="xwk-qr-loading-spinner"></span><span>${this.escapeHtml(this.messages().generatingQr)}</span></span>`}renderQrCopyButtonContent(){const e=this.messages();return this.qrCopied?`${this.checkIcon()} ${this.escapeHtml(e.copied)}`:`${this.linkIcon()} ${this.escapeHtml(e.copyUri)}`}renderConnectShell(e,n){var d;const r=this.messages(),i=this.resolveTheme(),s=this.options.layout??"list",o=this.options.size??"default",a=this.options.textSize??"sm",c=(e==null?void 0:e.name)??n,l=this.getConnectStatusText(e,n);(d=this.root)!=null&&d.isConnected||this.renderView("connect"),this.root&&(this.root.dataset.xwkView="connect",this.ensureStyles(i,s,o,a),this.root.innerHTML=`<section ${this.renderShellAttributes("xwk-modal xwk-connect-modal")}><div class="xwk-header"><button class="xwk-back" data-xwk-back aria-label="${this.escapeHtml(r.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(r.connect)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-connect xwk-standalone-connect"><div class="xwk-spinner" aria-hidden="true"><div class="xwk-connect-icon">${this.renderWalletIcon(e)}</div></div><strong class="xwk-connect-name">${this.escapeHtml(c)}</strong><p class="xwk-connect-status" role="status" aria-live="polite">${this.escapeHtml(l)}</p></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`,this.bindChrome())}getConnectStatusText(e,n){const r=this.messages(),i=this.options.manager.getAdapter(n),s=(e==null?void 0:e.name)??(i==null?void 0:i.metadata.name)??r.walletFallbackName;return(e==null?void 0:e.type)==="hardware"?r.confirmOnDevice(s):(e==null?void 0:e.type)==="walletconnect"||(e==null?void 0:e.group)==="WalletConnect"||(e==null?void 0:e.type)==="mobile"||i!=null&&i.capabilities.qr||i!=null&&i.capabilities.deeplink?r.openWalletAppApprove(s):(e==null?void 0:e.type)==="snap"?r.approveBrowserWallet():r.clickConnectPopup(s)}renderStyles(e,n,r,i){const s=`${n}|${r}|${i}|${this.resolveThemeMode()}|${JSON.stringify(e)}`;if(s===this.cachedStyleKey)return this.cachedStyle;const o=n==="card"||n==="grid",a=r==="wide"?"640px":r==="compact"?"400px":"520px",c=n==="icon"?"repeat(4,minmax(0,1fr))":o?"repeat(3,minmax(0,1fr))":"1fr",l=n==="list"?"left":"center",d=n==="list"?"row":"column",u=n==="icon"?"78px":o?"100px":"64px",f=n==="icon"?"38px":o?"42px":"40px",p=n==="icon"?"none":"block",m=i==="lg"?"20px":i==="md"?"18px":"16px",h=i==="lg"?"17px":i==="md"?"16px":"15px",g=i==="lg"?"14px":i==="md"?"13px":"12px",w=i==="lg"?"13px":"12px",E=i==="lg"?"16px":i==="md"?"15px":"14px",y=this.resolveThemeMode()==="dark"?e.foreground:"#333333",b=this.resolveThemeMode()==="dark"?"#cbd5e1":"#5c6878",S=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.08)":"#f0f1f3",v=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",B=this.resolveThemeMode()==="dark"?"#94a3b8":"#9ca3af",T=this.resolveThemeMode()==="dark"?"rgba(56,189,248,.12)":"rgba(0,120,174,.10)",_=this.resolveThemeMode()==="dark"?"rgba(56,189,248,.22)":"rgba(0,120,174,.18)",N=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)",D=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",U=e.muted,L=e.spinnerTrail,k=e.muted,C=e.overlayBlur>0?`blur(${e.overlayBlur}px)`:"none",P=`.xwk-overlay{position:fixed;inset:0;background:${e.overlay};-webkit-backdrop-filter:${C};backdrop-filter:${C};display:grid;overscroll-behavior:contain;place-items:center;z-index:2147483647;font-family:${e.fontFamily};font-size:${E};opacity:0;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));transition:opacity .2s ease-out}.xwk-overlay[data-xwk-state="open"]{opacity:1}.xwk-overlay[data-xwk-state="closing"]{opacity:0;transition-duration:.18s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-modal{box-sizing:border-box;display:block;width:min(${a},100%);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:${e.shadow};color:${e.foreground};opacity:0;overflow:hidden;transform:translateY(8px) scale(.97);transform-origin:center bottom;transition:opacity .24s cubic-bezier(.22,1,.36,1),transform .24s cubic-bezier(.22,1,.36,1)}.xwk-overlay[data-xwk-state="open"] .xwk-modal{opacity:1;transform:translateY(0) scale(1)}.xwk-overlay[data-xwk-state="closing"] .xwk-modal{opacity:0;transform:translateY(6px) scale(.985);transition-duration:.18s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;column-gap:8px;padding:8px 18px;background:${e.headerBackground};border-bottom:1px solid ${e.border}}.xwk-title{font-size:${m};font-weight:500;text-align:center;color:${e.foreground};min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-close,.xwk-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:0;border-radius:999px;box-shadow:none;box-sizing:border-box;color:${e.muted};cursor:pointer;display:inline-flex;font:inherit;height:44px;justify-content:center;margin:0;min-height:0;outline:none;overflow:hidden;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-back{justify-self:start}.xwk-close{font-size:26px;font-weight:500;justify-self:end;line-height:1}.xwk-close:hover,.xwk-back:hover{background:${e.surfaceHover};box-shadow:none;color:${e.foreground};transform:none}.xwk-close:focus-visible,.xwk-back:focus-visible,.xwk-wallet:focus-visible,.xwk-action:focus-visible,.xwk-qr-theme-action:focus-visible{outline:2px solid ${e.accent};outline-offset:2px;text-decoration:none}.xwk-body{-webkit-overflow-scrolling:touch;box-sizing:border-box;max-height:min(620px,calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overscroll-behavior:contain;overflow:auto;padding:12px 22px 18px}.xwk-list,.xwk-connect,.xwk-qr{display:none}.xwk-overlay[data-xwk-view="list"] .xwk-list{display:block}.xwk-overlay[data-xwk-view="connect"] .xwk-connect{display:block}.xwk-overlay[data-xwk-view="qr"] .xwk-qr{display:block}.xwk-network-row{align-items:center;display:flex;justify-content:flex-end;margin:-2px 0 8px;min-height:22px}.xwk-network-badge{align-items:center;background:${this.resolveThemeMode()==="dark"?"rgba(245,158,11,.12)":"#fef3c7"};border:1px solid ${this.resolveThemeMode()==="dark"?"rgba(245,158,11,.20)":"#fde68a"};border-radius:999px;color:${this.resolveThemeMode()==="dark"?"#fbbf24":"#92400e"};display:inline-flex;font-size:10px;font-weight:560;letter-spacing:0;line-height:1;padding:5px 9px;text-transform:none}.xwk-network-dot{border-radius:999px;display:inline-block;height:6px;margin-right:5px;width:6px}.xwk-grid{display:grid;grid-template-columns:${c};gap:7px}.xwk-wallet{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:0;border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:flex;flex-direction:${d};font:inherit;gap:12px;justify-content:${n==="list"?"flex-start":"center"};line-height:1.2;margin:0;min-height:${u};min-width:0;outline:none;overflow:hidden;padding:${n==="list"?"12px 12px":"12px 10px"};text-align:${l};touch-action:manipulation;transform:none;transition:background-color .16s ease;width:100%}.xwk-wallet:hover{background:${e.surfaceHover};box-shadow:none;transform:none}.xwk-wallet:active{background:${e.surfaceHover};transform:none}.xwk-wallet img:not(.xwk-mini-icon),.xwk-icon-fallback{border-radius:${e.walletRadius};flex:0 0 auto;height:${f};object-fit:contain;overflow:hidden;width:${f}}.xwk-icon-fallback{align-items:center;background:${e.accent};color:${e.accentText};display:inline-flex;font-weight:700;justify-content:center}.xwk-wallet-group{margin-top:0;min-height:${u}}.xwk-wallet-group .xwk-wallet-info{align-items:center;display:${n==="list"?"flex":"grid"};gap:${n==="list"?"10px":"2px"}}.xwk-wallet-group .xwk-name{flex:1 1 auto}.xwk-wallet-group .xwk-group{display:${n==="list"?"none":p}}.xwk-group-placeholder{visibility:hidden}.xwk-wallet-info{display:grid;gap:2px;min-width:0;width:100%}.xwk-name{color:${y};display:block;font-size:${n==="list"?h:g};font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-group{color:${e.muted};display:${p};font-size:${w};font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-group-icons{align-items:center;display:${n==="list"?"inline-flex":"none"};flex:0 0 auto;gap:4px;justify-content:flex-end;margin-left:auto;min-width:0}.xwk-mini-icon,.xwk-mini-fallback,.xwk-mini-more{align-items:center;border:1px solid ${N};border-radius:10px;box-sizing:border-box;display:inline-flex;flex:0 0 auto;height:32px;justify-content:center;object-fit:cover;overflow:hidden;width:32px}.xwk-mini-fallback,.xwk-mini-more{background:${e.background};color:${e.muted};font-size:12px;font-weight:600}.xwk-mini-more{border-radius:999px;width:auto;min-width:32px;padding:0 8px}.xwk-wallet-badges{align-items:center;display:inline-flex;flex:0 0 auto;gap:6px;justify-content:flex-end;margin-left:auto;min-width:0}.xwk-wallet-badge{align-items:center;background:${S};border:1px solid ${v};border-radius:999px;color:${b};display:inline-flex;flex:0 0 auto;font-size:11px;font-weight:500;gap:6px;line-height:1;min-height:24px;padding:0 10px;visibility:hidden}.xwk-wallet-badge:before{background:${B};border-radius:999px;content:"";height:6px;width:6px}.xwk-wallet-badge.xwk-installed,.xwk-wallet-badge.xwk-recommended{visibility:visible}.xwk-wallet-badge.xwk-recommended{background:${T};border-color:${_};color:${e.accent}}.xwk-wallet-badge.xwk-recommended:before{background:currentColor}.xwk-status{color:${e.accent};font-size:12px;margin-top:8px;min-height:0;max-width:100%;overflow-wrap:anywhere}.xwk-status.xwk-error,.xwk-error-text{color:${e.error}}.xwk-status.xwk-error{background:${e.surface};border:1px solid ${e.border};border-radius:10px;box-sizing:border-box;line-height:1.35;padding:9px 10px}.xwk-hidden{display:none}.xwk-back.xwk-hidden{display:inline-flex;pointer-events:none;visibility:hidden}.xwk-connect{text-align:center;padding:30px 0 16px}.xwk-spinner{display:grid;margin:0 auto 16px;place-items:center;position:relative;width:104px;height:104px}.xwk-spinner:before{animation:xwk-spin 1s linear infinite;border:3px solid transparent;border-top-color:${U};border-right-color:${L};border-radius:50%;content:"";height:96px;position:absolute;width:96px}.xwk-connect-icon img,.xwk-connect-icon .xwk-icon-fallback{border-radius:${e.walletRadius};height:66px;object-fit:contain;overflow:hidden;width:66px}.xwk-connect-name{display:block;font-size:${h};font-weight:600;margin-top:4px}.xwk-connect-status{color:${e.muted};font-size:${E};font-weight:400;line-height:1.45;margin:14px auto 0;max-width:420px}.xwk-qr{text-align:center}.xwk-qr-title{color:${e.foreground};font-size:${m};font-weight:500;margin:0 0 14px}.xwk-qr-card{background:${e.surface};border:1px solid ${e.border};border-radius:14px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:0 auto 10px;min-height:386px;padding:12px;width:min(332px,100%)}.xwk-qr-code-wrap{position:relative;flex:0 0 auto;margin:0 auto 10px;width:100%}.xwk-qr-code{aspect-ratio:1/1;background:transparent;border:0;border-radius:10px;box-sizing:border-box;color:${e.muted};display:grid;min-height:0;padding:0;place-items:center;width:100%}.xwk-qr-code-light{background:#fff;padding:8px}.xwk-qr-theme-action{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.background};border:1px solid ${D};border-radius:999px;box-shadow:none;box-sizing:border-box;color:${e.muted};cursor:pointer;display:inline-flex;height:34px;justify-content:center;margin:0;min-height:0;opacity:0;outline:none;padding:0;pointer-events:none;position:absolute;right:8px;top:8px;touch-action:manipulation;transform:none;transition:opacity .14s ease,background-color .16s ease,border-color .16s ease,color .16s ease;width:34px}.xwk-qr-code-wrap:hover .xwk-qr-theme-action,.xwk-qr-code-wrap:focus-within .xwk-qr-theme-action,.xwk-qr-theme-action:focus-visible{opacity:1;pointer-events:auto}.xwk-qr-theme-action:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;color:${e.foreground};transform:none}.xwk-qr-theme-action svg{height:17px;width:17px}.xwk-qr-code canvas,.xwk-qr-code img,.xwk-qr-code svg{aspect-ratio:1/1;display:block;height:auto;max-width:100%;width:100%}.xwk-qr-loading{align-items:center;color:${k};display:inline-flex;font-size:13px;gap:8px}.xwk-qr-message{align-items:center;color:${e.muted};display:grid;font-size:${E};gap:7px;line-height:1.35;max-width:260px;text-align:center}.xwk-qr-message strong{color:${e.foreground};font-size:${h};font-weight:600}.xwk-qr-message span{display:block;max-width:100%;overflow-wrap:anywhere}.xwk-qr-loading-spinner{animation:xwk-spin 1s linear infinite;border:2px solid ${L};border-top-color:${U};border-radius:999px;display:inline-block;height:18px;width:18px}.xwk-qr-help{color:${e.muted};font-size:${E};font-weight:400;line-height:1.35;margin:10px auto 0;max-width:420px;min-height:22px;white-space:nowrap}.xwk-qr-fallback{color:${e.muted};font-size:11px;line-height:1.5;overflow-wrap:anywhere}.xwk-actions{display:grid;gap:10px;grid-template-columns:1fr 1fr;margin-top:14px}.xwk-qr-card-actions{display:grid;flex:0 0 auto;gap:10px;grid-template-columns:1fr;min-height:46px}.xwk-qr-card-actions-dual{grid-template-columns:repeat(auto-fit,minmax(0,1fr))}.xwk-qr-card-actions-placeholder{visibility:hidden}.xwk-action{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:1px solid ${D};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;font:inherit;font-size:${E};font-weight:560;gap:8px;justify-content:center;line-height:1.2;margin:0;min-height:46px;min-width:0;outline:none;overflow:hidden;padding:0 12px;text-decoration:none;touch-action:manipulation;transform:none;transition:background-color .16s ease,border-color .16s ease;white-space:nowrap;width:100%}.xwk-copy-inside{background:${e.surface};border-color:${D};color:${e.foreground};font-size:${E};width:100%}.xwk-action:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;text-decoration:none;transform:none}.xwk-action:active{background:${e.surfaceHover};box-shadow:none;opacity:1;text-decoration:none;transform:none}.xwk-copy-inside:hover{background:${e.surfaceHover};box-shadow:none;text-decoration:none}.xwk-action-primary{background:${e.surface};border-color:${D};color:${e.foreground}}.xwk-action-primary:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;color:${e.foreground};text-decoration:none}.xwk-action svg{flex:0 0 auto;opacity:.58}.xwk-copied-icon{color:${e.success};opacity:1!important}.xwk-action:disabled{cursor:default;opacity:.76}.xwk-retrying .xwk-refresh-icon{animation:xwk-spin .7s linear infinite}.xwk-footer{border-top:0;color:${e.muted};font-size:11px;font-weight:400;padding:12px 16px 14px;text-align:center}@keyframes xwk-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.xwk-overlay,.xwk-modal,.xwk-wallet,.xwk-action,.xwk-close,.xwk-back,.xwk-qr-theme-action{transition-duration:1ms!important;animation-duration:1ms!important}.xwk-spinner:before,.xwk-qr-loading-spinner{animation:none}}@media(max-width:640px){.xwk-overlay{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));place-items:end center}.xwk-modal{border-bottom-left-radius:0;border-bottom-right-radius:0;max-height:calc(100dvh - 24px - env(safe-area-inset-top));transform:translateY(100%);width:100%}.xwk-overlay[data-xwk-state="open"] .xwk-modal{transform:translateY(0);transition-duration:.32s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.xwk-overlay[data-xwk-state="closing"] .xwk-modal{transform:translateY(100%);transition-duration:.24s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-header{grid-template-columns:44px minmax(0,1fr) 44px;column-gap:8px;padding:10px 16px}.xwk-body{max-height:calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:14px 16px 16px}.xwk-grid{grid-template-columns:${n==="icon"?"repeat(3,minmax(0,1fr))":"1fr"}}.xwk-wallet-badges{gap:4px}.xwk-wallet-badge{font-size:10px;min-height:22px;padding:0 8px}.xwk-actions{grid-template-columns:1fr}.xwk-qr-card{min-height:358px;padding:12px;width:min(304px,100%)}.xwk-qr-code-wrap{width:100%}.xwk-action{font-size:clamp(12px,3.55vw,${E});gap:6px;padding:0 10px}.xwk-action svg{height:17px;width:17px;flex:0 0 auto}.xwk-qr-card-actions-dual{grid-template-columns:1fr}.xwk-qr-help{font-size:clamp(12px,3.45vw,${E});min-height:38px;white-space:normal}}@media(max-width:360px){.xwk-qr-card{min-height:354px;width:min(284px,100%)}}@media(max-height:560px){.xwk-body{max-height:calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:10px 16px}.xwk-connect{padding:18px 0 10px}.xwk-spinner{height:82px;margin-bottom:12px;width:82px}.xwk-spinner:before{height:76px;width:76px}.xwk-connect-icon img,.xwk-connect-icon .xwk-icon-fallback{border-radius:${e.walletRadius};height:54px;width:54px}.xwk-qr-card{min-height:320px;width:min(260px,100%)}.xwk-qr-title{margin-bottom:10px}.xwk-qr-help{margin-top:8px}.xwk-footer{padding:8px 16px 10px}}`;return this.cachedStyleKey=s,this.cachedStyle=P,P}ensureStyles(e,n,r,i){const s=`${this.renderStyles(e,n,r,i)}${this.renderMobileSheetOverrides(e)}`;tg(eg("xwk-modal",s),s)}renderMobileSheetOverrides(e){const n=`.xwk-inline{background:transparent!important;display:block!important;inset:auto!important;opacity:1!important;overflow:visible!important;padding:0!important;place-items:initial!important;position:relative!important;z-index:auto!important}.xwk-inline .xwk-modal{border:1px solid ${e.border}!important;border-radius:${e.radius}!important;box-shadow:none!important;max-height:none!important;max-width:none!important;opacity:1!important;transform:none!important;transition:none!important;width:100%!important}.xwk-inline .xwk-body{max-height:none!important}.xwk-inline .xwk-header-spacer{display:block;height:44px;width:44px}.xwk-inline[data-xwk-state="closing"] .xwk-modal{opacity:1!important;transform:none!important}`;return`.xwk-modal:focus{outline:none}.xwk-sr-only{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.xwk-error-text,.xwk-connect-status.xwk-error-text,.xwk-qr-loading.xwk-error-text{color:${e.error}!important}.xwk-close,.xwk-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;appearance:none;background:transparent!important;border:0!important;box-shadow:none!important;margin:0;outline:none!important}.xwk-close:focus-visible,.xwk-back:focus-visible{outline:2px solid ${e.accent}!important;outline-offset:0}@media(max-width:640px){.xwk-overlay{padding:max(12px,env(safe-area-inset-top)) 0 0!important;place-items:end center!important}.xwk-modal{align-self:end!important;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-left:0!important;border-right:0!important;border-top-left-radius:${e.radius}!important;border-top-right-radius:${e.radius}!important;height:auto!important;max-height:calc(100dvh - env(safe-area-inset-top))!important;max-width:none!important;width:100vw!important}.xwk-header{border-top-left-radius:${e.radius};border-top-right-radius:${e.radius}}.xwk-body{padding-bottom:max(6px,calc(6px + env(safe-area-inset-bottom)))!important}.xwk-overlay[data-xwk-view="list"] .xwk-body{padding-bottom:max(2px,calc(2px + env(safe-area-inset-bottom)))!important}.xwk-network-row{margin:-4px 0 8px!important}.xwk-overlay[data-xwk-view="list"] .xwk-footer{padding-top:6px!important}}${n}`}renderWalletList(e){const n=this.getGroups();return n.length?[...this.getUngroupedWallets(n).map(r=>this.renderWallet(r,e)),...n.map(r=>this.renderWalletGroup(r,e))].join(""):this.getWallets().map(r=>this.renderWallet(r,e)).join("")}renderWalletGroup(e,n){const r=this.messages(),i=this.getGroupWallets(e),s=e.maxPreviewIcons??5,o=i.slice(0,s),a=i.length-o.length,c=e.icon?`<img src="${this.escapeHtml(e.icon)}" alt="">`:`<span class="xwk-icon-fallback">${this.escapeHtml(e.name.slice(0,1).toUpperCase())}</span>`,l=n==="list"?`<span class="xwk-group">${this.escapeHtml(r.walletCount(i.length))}</span>`:n==="card"||n==="grid"?`<span class="xwk-group">+${this.escapeHtml(r.walletCount(i.length))}</span>`:"",d=o.length?`<span class="xwk-group-icons">${o.map(u=>this.renderMiniWalletIcon(u)).join("")}${a>0?`<span class="xwk-mini-more" aria-label="${this.escapeHtml(r.moreWallets(a))}">+${a}</span>`:""}</span>`:"";return`<button class="xwk-wallet xwk-wallet-group" data-wallet-group-id="${this.escapeHtml(e.id)}">${c}<span class="xwk-wallet-info"><span class="xwk-name">${this.escapeHtml(e.name)}</span>${l}${d}</span></button>`}renderWallet(e,n){const r=this.renderWalletIcon(e),s=this.options.showWalletGroup===!0&&n!=="icon"?`<span class="xwk-group">${this.escapeHtml(this.getWalletSecondaryLabel(e))}</span>`:"",o=this.renderWalletBadges(e,n);return`<button class="xwk-wallet" data-wallet-id="${this.escapeHtml(e.id)}">${r}<span class="xwk-wallet-info"><span class="xwk-name">${this.escapeHtml(e.name)}</span>${s}</span>${o}</button>`}renderWalletBadges(e,n){if(n!=="list")return"";const r=e.group==="Extensions"||e.type==="snap",i=[],s=this.messages();if(e.recommended&&i.push(`<span class="xwk-wallet-badge xwk-recommended">${this.escapeHtml(s.recommended||"Recommended")}</span>`),r){const o=this.availability[e.id]?"xwk-wallet-badge xwk-installed":"xwk-wallet-badge";i.push(`<span class="${o}">${this.escapeHtml(s.installed||"Installed")}</span>`)}return i.length?`<span class="xwk-wallet-badges">${i.join("")}</span>`:""}getWalletSecondaryLabel(e){return e.recommended&&e.group==="Recommended"?this.humanizeWalletType(e.type):e.group??this.humanizeWalletType(e.type)}humanizeWalletType(e){const n=this.messages();switch(e){case"mobile":return n.mobileWallet;case"extension":return n.extensionWallet;case"walletconnect":return n.walletConnectWallet;case"snap":return n.xrplSnapWallet;case"hardware":return n.hardwareWallet;case"embedded":return n.embeddedWallet;default:return String(e)}}renderWalletIcon(e){if(e!=null&&e.icon)return`<img src="${this.escapeHtml(e.icon)}" alt="">`;const n=(e==null?void 0:e.name.slice(0,1).toUpperCase())??"W";return`<span class="xwk-icon-fallback">${this.escapeHtml(n)}</span>`}renderMiniWalletIcon(e){return e.icon?`<img class="xwk-mini-icon" src="${this.escapeHtml(e.icon)}" alt="">`:`<span class="xwk-mini-icon xwk-mini-fallback">${this.escapeHtml(e.name.slice(0,1).toUpperCase())}</span>`}backIcon(){return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}linkIcon(){return this.copyActionIcon()}copyActionIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="8" y="8" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2"/><path d="M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}refreshIcon(){return'<svg class="xwk-refresh-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M20 11a8 8 0 1 0-2.34 5.66" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5v6h-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}qrThemeIcon(){return this.qrLightMode?'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M20.2 14.4A7.4 7.4 0 0 1 9.6 3.8 8.3 8.3 0 1 0 20.2 14.4Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg>':'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2"/><path d="M12 2v2.2M12 19.8V22M4.9 4.9l1.6 1.6M17.5 17.5l1.6 1.6M2 12h2.2M19.8 12H22M4.9 19.1l1.6-1.6M17.5 6.5l1.6-1.6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}checkIcon(){return'<svg class="xwk-copied-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="10" fill="currentColor"/><path d="m7.8 12.4 2.7 2.7 5.9-6.2" stroke="#fff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}messages(){return Xr(this.options.language,this.options.messages)}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode??"light"}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}escapeHtml(e){return String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}async renderQr(e,n){e.replaceChildren();try{e.classList.toggle("xwk-qr-code-light",this.qrLightMode);const i=this.resolveThemeMode()==="dark"&&!this.qrLightMode?ng:Ef;new I2({width:qi,height:qi,type:"svg",data:n,margin:4,qrOptions:{errorCorrectionLevel:"H"},dotsOptions:{type:"dots",color:i,roundSize:!0},cornersSquareOptions:{type:"extra-rounded",color:i},cornersDotOptions:{type:"dot",color:i},backgroundOptions:{color:this.qrLightMode?"#ffffff":"transparent"}}).append(e)}catch{try{const r=await yP.toDataURL(n,{errorCorrectionLevel:"H",margin:2,width:qi,color:{dark:Ef,light:"#ffffff"}}),i=document.createElement("img");i.src=r,i.alt="WalletConnect QR code",i.width=qi,i.height=qi,e.replaceChildren(i)}catch{const r=document.createElement("div");r.className="xwk-qr-fallback",r.textContent=n,e.replaceChildren(r)}}}waitForPaint(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}}class rg extends gS{constructor(e){super(e,"modal")}}class ig extends gS{constructor(e){super(e,"inline")}mount(e){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`WalletInline mount target was not found: ${String(e)}`);this.options={...this.options,mount:n},this.open()}isMounted(){return this.isOpen()}}function mS(t){return new rg(t)}function vP(t){return new ig(t)}const wS=1e7,yS=2e6;function bS(){return async({address:t,network:e})=>{var h,g,w;if(!(e!=null&&e.rpcUrl))return null;const n=Qc(e),r=nf(e);if(!r)return null;const i=await vS(r,{method:"account_info",params:[{account:t,ledger_index:"validated"}]});if(((h=i.result)==null?void 0:h.error)==="actNotFound")return{value:"0",formatted:`0 ${n}`,symbol:n,activationStatus:"unfunded",spendable:!1,reserveLocked:!1,available:"0",availableFormatted:`0 ${n}`,total:"0",totalFormatted:`0 ${n}`,reserve:"0",ownerCount:0,raw:i};const s=(g=i.result)==null?void 0:g.account_data,o=sg(s==null?void 0:s.Balance);if(o==null||(w=i.result)!=null&&w.error)return null;const a=(s==null?void 0:s.OwnerCount)??0,c=await EP(r).catch(()=>({baseDrops:wS,incDrops:yS})),l=c.baseDrops+a*c.incDrops,d=Math.max(o-l,0),u=o>0&&d<=0,f=og(d),p=og(o),m=og(l);return{value:f,formatted:`${f} ${n}`,symbol:n,activationStatus:"active",spendable:d>0,reserveLocked:u,available:f,availableFormatted:`${f} ${n}`,total:p,totalFormatted:`${p} ${n}`,reserve:m,ownerCount:a,raw:{accountInfo:i,reserveInfo:c}}}}async function vS(t,e){const n=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Wallet RPC request failed: ${n.status}`);return n.json()}async function EP(t){var s,o;const n=(o=(s=(await vS(t,{method:"server_state",params:[]})).result)==null?void 0:s.state)==null?void 0:o.validated_ledger,r=ES(n==null?void 0:n.reserve_base,n==null?void 0:n.reserve_base_xrp,wS),i=ES(n==null?void 0:n.reserve_inc,n==null?void 0:n.reserve_inc_xrp,yS);return{baseDrops:r,incDrops:i}}function sg(t){if(t==null)return null;const e=typeof t=="number"?t:Number(t);return Number.isFinite(e)?e:null}function ES(t,e,n){const r=sg(t);if(r!=null)return r;const i=sg(e);return i!=null?Math.round(i*1e6):n}function og(t){return AP(t/1e6)}function AP(t){if(!Number.isFinite(t))return"0";const e=t>=100?2:t>=1?4:6;return t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:0})}class Af{constructor(e){this.identityName=null,this.identityAvatar=null,this.identityRequest=0,this.identityCache=new Map,this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",this.balanceRequest=0,this.balanceRefreshTimers=new Set,this.panelOpen=!1,this.addressQrOpen=!1,this.txSectionOpen=!0,this.panelScrollLocked=!1,this.connecting=!1,this.copied=!1,this.copyInProgress=!1,this.accountAction=null,this.offEvents=[],this.onDocumentPointerDown=r=>this.handleDocumentPointerDown(r),this.onDocumentKeyDown=r=>this.handleDocumentKeyDown(r),this.target=this.resolveTarget(e.target);const n=Xr(e.language,e.messages);this.options={language:e.language,messages:n,label:n.connectWallet,showAdapterIcon:!0,showChevron:!0,showWeb3Name:!0,fallbackToAddress:!0,copyAddress:!0,showAddressQr:!0,showRecentTransactions:!1,maxVisibleTransactions:5,explorer:!1,disconnect:!0,accountPanel:!0,accountPanelMode:"modal",showBalance:!1,size:"md",variant:"default",themeMode:"light",theme:{},identityResolver:e.identityResolver??AS(),balanceResolver:e.balanceResolver??bS(),explorerUrl:e.explorerUrl,formatAddress:e.formatAddress,...e},this.offEvents.push(e.manager.on("connecting",()=>{this.connecting=!0,this.render()})),this.offEvents.push(e.manager.on("connected",({session:r})=>{this.connecting=!1,this.panelOpen=!1,this.addressQrOpen=!1,this.renderConnectedState(r??e.manager.getSession()),this.resolveBalance(r??e.manager.getSession())})),this.offEvents.push(e.manager.on("session_restored",({session:r})=>{this.connecting=!1,this.renderConnectedState(r),this.resolveBalance(r)})),this.offEvents.push(e.manager.on("session_stale",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.manager.on("session_expired",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.manager.on("disconnected",()=>{this.connecting=!1,this.panelOpen=!1,this.addressQrOpen=!1,this.identityName=null,this.identityAvatar=null,this.identityRequest+=1,this.identityResolvingKey=void 0,this.clearIdentitySettleTimer(),this.clearBalanceRefreshTimers(),this.balanceRequest+=1,this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",this.render()})),this.offEvents.push(e.manager.on("tx_submitted",()=>{this.scheduleBalanceRefresh([1600,4e3]),this.render()})),this.offEvents.push(e.manager.on("tx_confirmed",()=>{this.clearBalanceRefreshTimers(),this.resolveBalance(e.manager.getSession()),this.render()})),this.offEvents.push(e.manager.on("tx_failed",()=>{this.render()})),this.offEvents.push(e.manager.on("accountChanged",()=>{this.clearBalanceRefreshTimers(),this.resolveBalance(e.manager.getSession())})),this.offEvents.push(e.manager.on("networkChanged",()=>{this.clearBalanceRefreshTimers(),this.resolveBalance(e.manager.getSession())})),this.offEvents.push(e.manager.on("error",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.modal.onClose(()=>{this.options.manager.getSession()||(this.connecting=!1,this.render())}))}mount(e=document.body){const n=this.resolveTarget(e);if(!n)throw new Error("Wallet button target was not found");this.target=n,n.innerHTML="",n.appendChild(this.createRoot()),this.render(),this.resolveIdentity(this.options.manager.getSession()),this.resolveBalance(this.options.manager.getSession())}updateOptions(e){const n="language"in e||"messages"in e?Xr(e.language??this.options.language,e.messages??this.options.messages):this.options.messages;this.options={...this.options,...e,messages:n},("showWeb3Name"in e||"identityResolver"in e)&&this.resolveIdentity(this.options.manager.getSession()),("showBalance"in e||"balanceResolver"in e)&&this.resolveBalance(this.options.manager.getSession()),this.render()}refreshIdentity(){return this.resolveIdentity(this.options.manager.getSession(),{force:!0})}refreshBalance(){return this.resolveBalance(this.options.manager.getSession())}async refreshAccount(){await Promise.all([this.refreshIdentity(),this.refreshBalance()])}destroy(){this.removePanelListeners(),this.removeAccountPanelPortal(),this.syncPanelScrollLock(!1),this.identityRequest+=1,this.identityResolvingKey=void 0,this.clearBalanceRefreshTimers(),this.copyResetTimer&&window.clearTimeout(this.copyResetTimer),this.identitySettleTimer&&window.clearTimeout(this.identitySettleTimer),this.offEvents.splice(0).forEach(e=>e()),this.target&&(this.target.innerHTML=""),this.target=void 0}render(){this.target&&(this.target.innerHTML="",this.target.appendChild(this.createRoot()),this.syncAccountPanelPortal(),this.syncPanelListeners())}createRoot(){var r;const e=document.createElement("div");e.className="xwk-button-root";const n=this.panelOpen&&this.options.accountPanelMode!=="modal"?this.renderPanel():"";return this.ensureStyles(),e.innerHTML=`${this.renderButton()}${n}`,this.repairFallbackIcon(e),(r=e.querySelector("[data-xwk-wallet-button]"))==null||r.addEventListener("click",i=>{i.stopPropagation(),this.onButtonClick()}),this.bindPanelActions(e),this.renderAddressQrIfNeeded(e),e}onButtonClick(){if(!this.options.manager.getSession()){this.options.modal.open();return}this.options.accountPanel&&(this.panelOpen=!this.panelOpen,this.render())}closePanel(){this.panelOpen=!1,this.addressQrOpen=!1,this.render()}handleDocumentPointerDown(e){var n;!this.panelOpen||!this.target||e.target instanceof Node&&this.target.contains(e.target)||e.target instanceof Node&&((n=this.accountPanelPortal)!=null&&n.contains(e.target))||(this.panelOpen=!1,this.addressQrOpen=!1,this.render())}handleDocumentKeyDown(e){if(!this.panelOpen)return;if(e.key==="Escape"){this.panelOpen=!1,this.addressQrOpen=!1,this.render();return}if(e.key!=="Tab"||this.options.accountPanelMode!=="modal")return;const n=this.getAccountPanelFocusableElements();if(!n.length){e.preventDefault();return}const r=n[0],i=n[n.length-1],s=document.activeElement;if(e.shiftKey&&s===r){e.preventDefault(),i.focus();return}!e.shiftKey&&s===i&&(e.preventDefault(),r.focus())}syncPanelListeners(){this.removePanelListeners(),this.syncPanelScrollLock(this.panelOpen&&this.options.accountPanelMode==="modal"),this.panelOpen&&(document.addEventListener("pointerdown",this.onDocumentPointerDown),document.addEventListener("keydown",this.onDocumentKeyDown),this.options.accountPanelMode==="modal"&&window.setTimeout(()=>{var e;(e=this.getAccountPanelRoot())==null||e.focus({preventScroll:!0})},0))}syncAccountPanelPortal(){if(!this.panelOpen||this.options.accountPanelMode!=="modal"){this.removeAccountPanelPortal();return}const e=this.accountPanelPortal??document.createElement("div"),n=!this.accountPanelPortal;e.className="xwk-account-portal",e.dataset.xwkEntering=n?"true":"false",this.ensureStyles(),e.innerHTML=this.renderPanel(),n&&document.body.appendChild(e),this.accountPanelPortal=e,this.bindPanelActions(e),this.renderAddressQrIfNeeded(e)}removeAccountPanelPortal(){var e;(e=this.accountPanelPortal)==null||e.remove(),this.accountPanelPortal=void 0}bindPanelActions(e){var n,r,i,s,o,a,c;(n=e.querySelector("[data-xwk-account-close]"))==null||n.addEventListener("click",()=>this.closePanel()),(r=e.querySelector("[data-xwk-account-back]"))==null||r.addEventListener("click",l=>{l.stopPropagation(),this.closeAddressQr()}),(i=e.querySelector("[data-xwk-account-overlay]"))==null||i.addEventListener("click",l=>{l.target===l.currentTarget&&this.closePanel()}),(s=e.querySelector("[data-xwk-copy-address]"))==null||s.addEventListener("click",l=>{l.stopPropagation(),this.copyAddress()}),(o=e.querySelector("[data-xwk-address-qr]"))==null||o.addEventListener("click",l=>{l.stopPropagation(),this.openAddressQr()}),(a=e.querySelector("[data-xwk-tx-toggle]"))==null||a.addEventListener("click",l=>{l.stopPropagation(),this.txSectionOpen=!this.txSectionOpen,this.render()}),(c=e.querySelector("[data-xwk-disconnect]"))==null||c.addEventListener("click",()=>void this.disconnect())}openAddressQr(){this.options.manager.getSession()&&(this.panelOpen=!0,this.addressQrOpen=!0,this.render())}closeAddressQr(){this.addressQrOpen=!1,this.panelOpen=!0,this.render()}removePanelListeners(){document.removeEventListener("pointerdown",this.onDocumentPointerDown),document.removeEventListener("keydown",this.onDocumentKeyDown)}syncPanelScrollLock(e){e!==this.panelScrollLocked&&(this.panelScrollLocked=e,e?hS():Zp())}async disconnect(){if(!this.accountAction){this.accountAction="disconnect",this.render();try{await Promise.all([this.options.manager.disconnect(),this.delay(450)]),this.options.modal.close()}finally{this.accountAction=null,this.render()}}}async copyAddress(){if(this.copyInProgress||this.accountAction)return;const e=this.getSessionAddress(this.options.manager.getSession());if(e){this.copyInProgress=!0;try{await this.copyText(e),this.copied=!0,this.copyResetTimer&&window.clearTimeout(this.copyResetTimer),this.copyResetTimer=window.setTimeout(()=>{this.copied=!1,this.render()},1400)}finally{this.copyInProgress=!1,this.render()}}}delay(e){return new Promise(n=>window.setTimeout(n,e))}async copyText(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{await navigator.clipboard.writeText(e);return}catch{}const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy")}finally{n.remove()}}async resolveIdentity(e,n={}){var o,a,c,l,d,u;const r=this.getSessionAddress(e);if(!e||!r||!this.shouldShowWeb3Name()||!this.options.identityResolver){this.identityName=null,this.identityAvatar=null,this.identityResolvingKey=void 0,(a=(o=this.options).onIdentityChange)==null||a.call(o,null,e),this.clearIdentitySettleTimer();return}const i=++this.identityRequest,s=this.identityCacheKey(e);n.force&&this.identityCache.delete(s),this.identityResolvingKey=s;try{const f=await this.options.identityResolver(r,e,{force:n.force});if(i!==this.identityRequest)return;const p=typeof f=="string"?{name:f}:f??null;this.identityName=(p==null?void 0:p.name)??null,this.identityAvatar=(p==null?void 0:p.avatar)??null,this.identityCache.set(s,p),(l=(c=this.options).onIdentityChange)==null||l.call(c,p,e),this.clearIdentitySettleTimer(),this.render()}catch{i===this.identityRequest&&(this.identityName=null,this.identityAvatar=null,this.identityCache.set(s,null),(u=(d=this.options).onIdentityChange)==null||u.call(d,null,e),this.clearIdentitySettleTimer(),this.render())}finally{i===this.identityRequest&&this.identityResolvingKey===s&&(this.identityResolvingKey=void 0)}}renderConnectedState(e){if(!e||!this.getSessionAddress(e)||!this.shouldShowWeb3Name()||!this.options.identityResolver){this.clearIdentitySettleTimer(),this.identityName=null,this.identityAvatar=null,this.render();return}const n=this.identityCacheKey(e),r=this.identityCache.get(n);if(r!==void 0){this.identityName=(r==null?void 0:r.name)??null,this.identityAvatar=(r==null?void 0:r.avatar)??null,this.clearIdentitySettleTimer(),this.render(),this.identityResolvingKey!==n&&this.resolveIdentity(e);return}this.identityName=null,this.identityAvatar=null,this.identityResolvingKey!==n&&this.resolveIdentity(e),this.clearIdentitySettleTimer(),this.identitySettleTimer=window.setTimeout(()=>{this.identitySettleTimer=void 0,this.render()},260)}clearIdentitySettleTimer(){this.identitySettleTimer&&(window.clearTimeout(this.identitySettleTimer),this.identitySettleTimer=void 0)}identityCacheKey(e){var n;return`${((n=e.account.network)==null?void 0:n.id)??e.account.networkType??"unknown"}:${this.getSessionAddress(e)}`}async resolveBalance(e){var i,s,o,a,c,l,d,u,f;if(!e||!this.options.showBalance||!this.options.balanceResolver){this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",e&&delete e.balance,(s=(i=this.options).onBalanceChange)==null||s.call(i,null,e);return}const n=++this.balanceRequest,r=this.getSessionAddress(e);if(!r){this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",delete e.balance,(a=(o=this.options).onBalanceChange)==null||a.call(o,null,e);return}this.balanceLoading=!0,this.render();try{const p=await this.options.balanceResolver({address:r,network:e.account.network,session:e});if(n!==this.balanceRequest)return;this.balance=this.normalizeBalance(p),this.activationStatus=((c=this.balance)==null?void 0:c.activationStatus)??(this.balance?"active":"unknown"),e.account.activationStatus=this.activationStatus,this.balance?e.balance=this.balance:delete e.balance,(d=(l=this.options).onBalanceChange)==null||d.call(l,this.balance,e),this.balanceLoading=!1,this.render()}catch{n===this.balanceRequest&&(this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",delete e.balance,(f=(u=this.options).onBalanceChange)==null||f.call(u,null,e),this.render())}finally{n===this.balanceRequest&&(this.balanceLoading=!1)}}renderButton(){var l;const e=this.messages(),n=this.options.manager.getSession(),r=!!n,i=this.connecting?e.connecting:n?this.getAccountLabel(n):this.options.label,s=n&&this.options.showBalance&&this.balanceLoading?`<span class="xwk-button-balance xwk-button-balance-loading">${this.balanceSpinnerIcon()}</span>`:n&&this.options.showBalance&&this.activationStatus==="unfunded"?`<span class="xwk-button-balance">(${this.escapeHtml(e.notActivated)})</span>`:n&&this.options.showBalance&&((l=this.balance)!=null&&l.formatted)?`<span class="xwk-button-balance">(${this.escapeHtml(this.balance.formatted)})</span>`:"",o=this.options.showAdapterIcon?this.renderWalletIcon(r?n==null?void 0:n.wallet:void 0):"",a=r&&this.options.showRecentTransactions&&this.getPendingTransactionCount()>0?'<span class="xwk-button-pending-dot" aria-hidden="true"></span>':"",c=r&&this.options.showChevron&&this.options.accountPanel?`<span class="xwk-button-chevron" aria-hidden="true">${this.chevronIcon()}</span>`:"";return`<button class="xwk-account-button" data-xwk-wallet-button type="button">${o}${a}<span class="xwk-button-label">${this.escapeHtml(i)}${s}</span>${c}</button>`}renderPanel(){const e=this.messages(),n=this.options.manager.getSession();if(!n)return"";const r=this.addressQrOpen?this.renderAddressQrPanelContent(n):this.renderPanelContent(n),i=this.addressQrOpen?e.addressQr:e.connected,s=!this.addressQrOpen&&this.options.showRecentTransactions&&this.getVisibleTransactions(n).length>0,o=`${this.addressQrOpen?" xwk-account-panel-address-qr":""}${s?" xwk-account-panel-with-transactions":""}`,a=this.addressQrOpen?`<button class="xwk-account-back" type="button" data-xwk-account-back aria-label="${this.escapeHtml(e.back)}">${this.backIcon()}</button>`:"<span></span>";return this.options.accountPanelMode==="modal"?`<div class="xwk-account-overlay" data-xwk-account-overlay role="presentation"><section class="xwk-account-panel xwk-account-panel-modal${o}" role="dialog" aria-modal="true" aria-label="${this.escapeHtml(i)}" tabindex="-1"><div class="xwk-account-modal-header">${a}<h2>${this.escapeHtml(i)}</h2><button class="xwk-account-close" type="button" data-xwk-account-close aria-label="${this.escapeHtml(e.close)}">&times;</button></div><div class="xwk-account-modal-body">${r}</div></section></div>`:`<div class="xwk-account-panel xwk-account-panel-dropdown${o}" role="dialog" aria-label="${this.escapeHtml(i)}">${r}</div>`}renderPanelContent(e){var v;const n=this.messages(),r=this.getSessionAddress(e),i=this.getAccountLabel(e),s=this.getExplorerUrl(e),o=this.accountAction==="disconnect",a=this.copied?this.copiedIcon():this.copyIcon(),c=o?this.spinnerIcon():this.logoutIcon(),l=this.options.copyAddress?`<button type="button" data-xwk-copy-address${o?" disabled":""}>${a}<span>${this.copied?this.escapeHtml(n.copied):this.escapeHtml(n.copyAddress)}</span></button>`:"",d=this.options.explorer&&s?`<a href="${this.escapeHtml(s)}" target="_blank" rel="noreferrer">${this.externalIcon()}<span>${this.escapeHtml(n.viewExplorer)}</span></a>`:"",u=this.options.disconnect?`<button type="button" data-xwk-disconnect${this.copyInProgress||o?" disabled":""}>${c}<span>${o?this.escapeHtml(n.disconnecting):this.escapeHtml(n.disconnect)}</span></button>`:"",f=Qc(e.account.network),p=this.options.showBalance&&this.activationStatus==="unfunded"?`<div class="xwk-account-warning">${this.escapeHtml(n.accountNotActivated(f))}</div>`:"",m=this.options.showBalance&&this.balanceLoading?`<div class="xwk-account-balance xwk-account-balance-loading">${this.balanceSpinnerIcon()}<span>${this.escapeHtml(n.connecting)}</span></div>`:this.options.showBalance&&this.activationStatus!=="unfunded"&&((v=this.balance)!=null&&v.formatted)?`<div class="xwk-account-balance">${this.escapeHtml(this.balance.formatted)}</div>`:"",h=m?`<div class="xwk-account-meta-row">${m}</div>`:"",g=this.renderAddressQrButton(r),w=this.shouldShowWeb3Name()&&this.identityName,E=w&&r?`<div class="xwk-account-address">${this.escapeHtml(this.formatAddress(r))}${g}</div>`:"",y=`<div class="xwk-account-panel-actions">${l}${d}${u}</div>`,b=!w&&g&&this.options.fallbackToAddress?`<div class="xwk-account-name xwk-account-name-with-qr xwk-account-name-address"><span>${this.escapeHtml(i)}</span>${g}</div>`:`<div class="xwk-account-name">${this.escapeHtml(i)}</div>`,S=this.renderTransactionHistory(e);return`<div class="xwk-account-hero">${this.renderAccountAvatar(e)}</div>${b}${E}${h}${p}${S}${y}`}renderAddressQrPanelContent(e){const n=this.messages(),r=this.getSessionAddress(e);if(!r)return"";const i=this.copied?this.copiedIcon():this.copyIcon(),s=this.options.copyAddress?`<button type="button" data-xwk-copy-address>${i}<span>${this.copied?this.escapeHtml(n.copied):this.escapeHtml(n.copyAddress)}</span></button>`:"";return`<div class="xwk-address-qr-content"><div class="xwk-address-qr-code" data-xwk-address-qr-code data-address="${this.escapeHtml(r)}" aria-hidden="true"></div><div class="xwk-address-qr-chip">${this.escapeHtml(r)}</div><div class="xwk-account-panel-actions">${s}</div></div>`}renderAddressQrButton(e){if(!this.options.showAddressQr||!e)return"";const n=this.messages();return`<button class="xwk-address-qr-trigger" type="button" data-xwk-address-qr aria-label="${this.escapeHtml(n.showAddressQr)}" title="${this.escapeHtml(n.showAddressQr)}">${this.qrIcon()}</button>`}renderTransactionHistory(e){if(!this.options.showRecentTransactions)return"";const n=this.getVisibleTransactions(e);if(!n.length)return"";const r=this.messages(),i=n.length>9?"9+":String(n.length),s=this.txSectionOpen?"open":"closed",o=this.txSectionOpen?`<div class="xwk-tx-list" role="list">${n.map(a=>this.renderTransactionRow(a)).join("")}</div>`:"";return`<section class="xwk-tx-section" aria-label="${this.escapeHtml(r.recentTransactions)}"><button class="xwk-tx-header" type="button" data-xwk-tx-toggle aria-expanded="${this.txSectionOpen?"true":"false"}"><span>${this.escapeHtml(r.recentTransactions)}</span><span class="xwk-tx-count">${this.escapeHtml(i)}</span><span class="xwk-tx-chevron ${s}" aria-hidden="true">${this.chevronUpIcon()}</span></button>${o}</section>`}renderTransactionRow(e){const n=this.messages(),r=this.transactionStatusLabel(e),i=this.getTransactionExplorerUrl(e),s=i?`<a class="xwk-tx-link" href="${this.escapeHtml(i)}" target="_blank" rel="noreferrer">${this.escapeHtml(n.view)}${this.externalIcon()}</a>`:"";return`<div class="xwk-tx-row xwk-tx-row-${this.escapeHtml(e.status)}" role="listitem"><span class="xwk-tx-status" aria-hidden="true">${this.transactionStatusIcon(e.status)}</span><div class="xwk-tx-main"><span class="xwk-tx-label">${this.escapeHtml(r)}</span><span class="xwk-tx-hash">${this.escapeHtml(this.formatHash(e.hash))} &middot; ${this.escapeHtml(this.formatRelativeTime(e))}</span></div>${s}</div>`}transactionStatusLabel(e){const n=this.messages();return e.status==="confirmed"?n.transactionConfirmed:e.status==="failed"?n.transactionFailed:e.status==="unknown"?n.transactionUnknown:n.transactionSubmitted}transactionStatusIcon(e){return e==="confirmed"?this.checkIcon():e==="failed"?this.closeIcon():e==="unknown"?this.questionIcon():'<span class="xwk-tx-spinner" aria-hidden="true"></span>'}getVisibleTransactions(e){const n=this.getSessionAddress(e),r=Math.max(1,Math.floor(this.options.maxVisibleTransactions));return this.getRecentTransactions(e).filter(i=>{var s;return!n||!((s=i.account)!=null&&s.address)||i.account.address===n}).slice(0,r)}getRecentTransactions(e){var i,s,o;const n=((s=(i=this.options.manager).getTransactions)==null?void 0:s.call(i))??[],r=(o=e==null?void 0:e.account.network)==null?void 0:o.id;return[...n].sort((a,c)=>this.transactionTimestamp(c)-this.transactionTimestamp(a)).filter(a=>{var c,l;return!r||!((l=(c=a.account)==null?void 0:c.network)!=null&&l.id)||a.account.network.id===r})}getPendingTransactionCount(){return this.getRecentTransactions(this.options.manager.getSession()).filter(e=>e.status==="submitted").length}transactionTimestamp(e){return e.confirmedAt??e.failedAt??e.submittedAt??0}getTransactionExplorerUrl(e){var r,i,s,o;const n=(s=(i=this.options).transactionExplorerUrl)==null?void 0:s.call(i,e.hash,(r=e.account)==null?void 0:r.network);return n||np((o=e.account)==null?void 0:o.network,e.hash)}formatHash(e){return e.length>12?`${e.slice(0,6)}...${e.slice(-6)}`:e}formatRelativeTime(e){const n=this.transactionTimestamp(e);if(!n)return"";const r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i} min ago`;const s=Math.floor(i/60);return s<24?`${s} hr ago`:s<48?"yesterday":`${Math.floor(s/24)} days ago`}getAccountLabel(e){var r,i;if(this.shouldShowWeb3Name()&&this.identityName)return this.identityName;if(!this.options.fallbackToAddress)return((r=e.wallet)==null?void 0:r.name)??e.adapterId;const n=this.getSessionAddress(e);return n?(this.options.formatAddress??this.formatAddress)(n):((i=e.wallet)==null?void 0:i.name)??e.adapterId}renderAccountAvatar(e){if(this.identityAvatar)return`<img class="xwk-account-avatar" src="${this.escapeHtml(this.identityAvatar)}" alt="">`;const[n,r,i]=this.getAddressGradient(this.getSessionAddress(e));return`<div class="xwk-account-art" style="--xwk-avatar-from:${n};--xwk-avatar-to:${r};--xwk-avatar-spot:${i}"><span></span></div>`}getExplorerUrl(e){var s;if(this.options.explorerUrl)return this.options.explorerUrl(e);const n=this.getSessionAddress(e);if(!n)return;const r=iE(e.account.network,n);if(r)return r;const i=((s=e.account.network)==null?void 0:s.networkType)??e.account.networkType;return i==="TESTNET"?`https://testnet.xrpl.org/accounts/${encodeURIComponent(n)}`:i==="DEVNET"?`https://devnet.xrpl.org/accounts/${encodeURIComponent(n)}`:`https://livenet.xrpl.org/accounts/${encodeURIComponent(n)}`}getSessionAddress(e){const n=e==null?void 0:e.account,r=typeof(n==null?void 0:n.address)=="string"?n.address:"";return r||(typeof(n==null?void 0:n.classicAddress)=="string"?n.classicAddress:"")}shouldShowWeb3Name(){return this.options.showWeb3Name??!0}messages(){return Xr(this.options.language,this.options.messages)}renderWalletIcon(e,n){const r=(e==null?void 0:e.icon)??n;if(r)return`<img class="xwk-button-icon" src="${this.escapeHtml(r)}" alt="">`;if(!e)return`<span class="xwk-button-icon xwk-button-icon-fallback xwk-button-icon-svg-fallback" aria-hidden="true">${this.walletIcon()}</span>`;const i=e.name.slice(0,1).toUpperCase();return`<span class="xwk-button-icon xwk-button-icon-fallback xwk-button-icon-initial" aria-hidden="true">${this.escapeHtml(i)}</span>`}repairFallbackIcon(e){e.querySelectorAll(".xwk-button-icon-svg-fallback").forEach(n=>{n.querySelector("svg")||(n.innerHTML=this.walletIcon())})}getAccountPanelFocusableElements(){const e=this.getAccountPanelRoot();if(!e)return[];const n=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>r.offsetParent!==null)}getAccountPanelRoot(){var e,n;return((e=this.accountPanelPortal)==null?void 0:e.querySelector(".xwk-account-panel-modal"))??((n=this.target)==null?void 0:n.querySelector(".xwk-account-panel-modal"))??null}walletIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4.5 7.5A2.5 2.5 0 0 1 7 5h11.5A1.5 1.5 0 0 1 20 6.5V9H7A2.5 2.5 0 0 1 4.5 6.5v1Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M4 9h15.5A2.5 2.5 0 0 1 22 11.5v5A2.5 2.5 0 0 1 19.5 19h-13A2.5 2.5 0 0 1 4 16.5V9Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M17 13.5h5V17h-5a1.75 1.75 0 1 1 0-3.5Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>'}backIcon(){return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}qrIcon(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4 4h6v6H4V4Zm10 0h6v6h-6V4ZM4 14h6v6H4v-6Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M14 14h2v2h-2v-2Zm4 0h2v2h-2v-2Zm-4 4h2v2h-2v-2Zm4 0h2v2h-2v-2Z" fill="currentColor"/></svg>'}renderAddressQrIfNeeded(e){if(!this.addressQrOpen)return;const n=e.querySelector("[data-xwk-address-qr-code]"),r=n==null?void 0:n.dataset.address;if(!(!n||!r||n.dataset.xwkRendered===r)){n.dataset.xwkRendered=r,n.replaceChildren();try{const i=this.resolveThemeMode()==="dark"?ng:Ef;new I2({width:qi,height:qi,type:"svg",data:r,margin:4,qrOptions:{errorCorrectionLevel:"H"},dotsOptions:{type:"dots",color:i,roundSize:!0},cornersSquareOptions:{type:"extra-rounded",color:i},cornersDotOptions:{type:"dot",color:i},backgroundOptions:{color:"transparent"}}).append(n)}catch{const i=document.createElement("div");i.className="xwk-address-qr-fallback",i.textContent=r,n.replaceChildren(i)}}}normalizeBalance(e){var r;if(e==null)return null;const n=Qc((r=this.options.manager.getSession())==null?void 0:r.account.network);return typeof e=="string"||typeof e=="number"?{value:String(e),formatted:`${e} ${n}`,symbol:n}:{...e,formatted:e.formatted||e.availableFormatted||`${e.value} ${e.symbol||n}`,symbol:e.symbol||n,activationStatus:e.activationStatus}}scheduleBalanceRefresh(e){!this.options.showBalance||!this.options.balanceResolver||(this.clearBalanceRefreshTimers(),e.forEach(n=>{let r=0;r=window.setTimeout(()=>{this.balanceRefreshTimers.delete(r),this.resolveBalance(this.options.manager.getSession())},n),this.balanceRefreshTimers.add(r)}))}clearBalanceRefreshTimers(){this.balanceRefreshTimers.forEach(e=>window.clearTimeout(e)),this.balanceRefreshTimers.clear()}chevronIcon(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="m6 9 6 6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}chevronUpIcon(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="m18 15-6-6-6 6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}checkIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="m5 12.5 4.2 4.2L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}closeIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="m7 7 10 10M17 7 7 17" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg>'}questionIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M9.7 9a2.4 2.4 0 1 1 3.8 2c-.9.6-1.5 1.1-1.5 2.4" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/><path d="M12 17h.01" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>'}copyIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="8" y="8" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2"/><path d="M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}copiedIcon(){return'<svg class="xwk-copied-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="10" fill="currentColor"/><path d="m7.8 12.4 2.7 2.7 5.9-6.2" stroke="#fff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}externalIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M14 4h6v6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 4 10 14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M11 5H7a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3v-4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}logoutIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M10 6H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15 8l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M19 12H9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}spinnerIcon(){return'<span class="xwk-action-spinner" aria-hidden="true"></span>'}balanceSpinnerIcon(){return'<span class="xwk-balance-spinner" aria-hidden="true"></span>'}ensureStyles(){const e=this.renderStyles();tg(eg("xwk-button",e),e)}renderStyles(){const e=this.resolveTheme(),n=this.resolveThemeMode(),r=this.options.size==="lg"?"50px":this.options.size==="sm"?"44px":"46px",i=this.options.variant==="pill"?"999px":e.walletRadius??"10px",s=this.options.variant==="default"||this.options.variant==="pill"?e.surface:e.background,o=this.options.variant==="default"||this.options.variant==="pill"?e.surfaceHover:e.surface,a=this.options.variant==="minimal"?"transparent":e.border,c=this.resolveVisibleBorder(e.border),l=n==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",d=e.fallbackIconBackground,u=e.fallbackIconColor,f=e.overlayBlur>0?`blur(${e.overlayBlur}px)`:"none";return`.xwk-button-root{display:inline-block;max-width:100%;position:relative;font-family:${e.fontFamily};font-size:14px}.xwk-account-button{align-items:center;background:${s};border:1px solid ${a};border-radius:${i};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;gap:8px;font:inherit;font-weight:560;max-width:100%;min-height:${r};overflow:hidden;padding:0 12px 0 10px;touch-action:manipulation;transition:background-color .16s ease,border-color .16s ease;white-space:nowrap;-webkit-tap-highlight-color:transparent;transform:none}.xwk-account-button:hover{background:${o};box-shadow:none;opacity:1;transform:none}.xwk-account-button:active{background:${o};opacity:1;transform:none}.xwk-account-button:focus-visible,.xwk-button-chevron:focus-visible,.xwk-account-panel-actions button:focus-visible,.xwk-account-panel-actions a:focus-visible,.xwk-address-qr-trigger:focus-visible,.xwk-tx-header:focus-visible,.xwk-tx-link:focus-visible{outline:2px solid ${e.accent};outline-offset:2px;text-decoration:none}.xwk-button-icon{background:${e.background};border:1px solid ${c};border-radius:10px;box-sizing:border-box;display:inline-flex;flex:0 0 28px;height:28px;isolation:isolate;line-height:0;max-width:28px;min-width:28px;object-fit:contain;overflow:hidden;position:relative;width:28px}.xwk-button-icon-fallback{align-items:center;background:${d};color:${u};justify-content:center}.xwk-button-icon-initial{font-size:12px;line-height:1}.xwk-button-icon-svg-fallback{font-size:0}.xwk-button-icon-svg-fallback svg{display:block;flex:0 0 17px;height:17px;max-height:17px;max-width:17px;min-height:17px;min-width:17px;width:17px}.xwk-button-pending-dot{background:${e.accent};border:2px solid ${s};border-radius:999px;box-sizing:border-box;flex:0 0 9px;height:9px;margin-left:-13px;margin-right:4px;position:relative;width:9px;z-index:1}.xwk-button-label{display:inline-block;flex:1 1 0;font-size:13px;font-weight:560;line-height:1.1;max-width:220px;min-width:0;overflow:hidden;padding-right:2px;text-overflow:ellipsis;white-space:nowrap}.xwk-button-balance{color:${e.muted};font-weight:500;margin-left:4px}.xwk-button-balance-loading{display:inline-flex;vertical-align:-2px}.xwk-balance-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.muted};border-radius:999px;box-sizing:border-box;display:inline-block;flex:0 0 13px;height:13px;width:13px}.xwk-button-chevron{align-items:center;background:${e.background};border:1px solid ${c};border-radius:999px;color:${e.muted};display:inline-flex;flex:0 0 26px;height:26px;justify-content:center;line-height:1;touch-action:manipulation;width:26px}.xwk-button-chevron:hover{background:${e.surfaceHover};color:${e.foreground}}.xwk-account-overlay{align-items:center;background:${e.overlay};-webkit-backdrop-filter:${f};backdrop-filter:${f};display:flex;inset:0;justify-content:center;overscroll-behavior:contain;padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));position:fixed;z-index:2147483647}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-overlay{animation:xwk-account-overlay-in .18s ease-out}.xwk-account-panel{background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:${e.shadow};box-sizing:border-box;color:${e.foreground};display:grid;gap:12px;overflow:hidden;z-index:2147483647}.xwk-account-panel:focus{outline:none}.xwk-account-panel-dropdown{box-shadow:none;justify-items:center;margin-top:10px;min-width:320px;padding:18px;position:absolute;right:0;top:100%;width:min(360px,calc(100vw - 32px))}.xwk-account-panel-modal{gap:0;grid-template-rows:auto minmax(0,1fr);height:min(527px,calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));max-width:520px;position:relative;transform-origin:center bottom;width:min(520px,100%)}.xwk-account-panel-modal.xwk-account-panel-with-transactions{height:min(650px,calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation:xwk-account-panel-in .22s cubic-bezier(.22,1,.36,1)}.xwk-account-modal-header{align-items:center;background:${e.headerBackground};border-bottom:1px solid ${e.border};display:grid;grid-template-columns:44px minmax(0,1fr) 44px;column-gap:8px;padding:8px 18px}.xwk-account-modal-header h2{color:${e.foreground};font-size:16px;font-weight:500;line-height:1.2;margin:0;min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-account-modal-body{-webkit-overflow-scrolling:touch;align-items:center;display:flex;flex-direction:column;gap:12px;min-height:0;overflow:hidden;overscroll-behavior:contain;padding:22px 28px 28px}.xwk-account-panel-with-transactions .xwk-account-modal-body{overflow:auto;padding-top:14px}.xwk-account-modal-body>.xwk-account-hero,.xwk-account-modal-body>.xwk-account-name,.xwk-account-modal-body>.xwk-account-address,.xwk-account-modal-body>.xwk-account-meta-row,.xwk-account-modal-body>.xwk-account-warning,.xwk-account-modal-body>.xwk-tx-section,.xwk-account-modal-body>.xwk-account-panel-actions{flex-shrink:0}.xwk-account-close,.xwk-account-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent!important;border:0!important;border-radius:999px;box-shadow:none!important;color:${e.muted};cursor:pointer;display:inline-flex;font:inherit;font-size:26px;font-weight:500;height:44px;justify-content:center;line-height:1;margin:0;min-height:0;outline:none!important;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-account-back{font-size:0;justify-self:start}.xwk-account-close{justify-self:end}.xwk-account-close:hover,.xwk-account-back:hover{background:${e.surfaceHover}!important;box-shadow:none!important;color:${e.foreground};transform:none}.xwk-account-close:focus-visible,.xwk-account-back:focus-visible{outline:2px solid ${e.accent}!important;outline-offset:0}.xwk-account-hero{height:154px;margin-top:4px;position:relative;width:180px}.xwk-account-panel-with-transactions .xwk-account-hero{height:126px;margin-bottom:0}.xwk-account-panel-with-transactions .xwk-account-art,.xwk-account-panel-with-transactions .xwk-account-avatar{top:0}.xwk-account-panel-dropdown .xwk-account-hero{height:132px;width:160px}.xwk-account-art,.xwk-account-avatar{border-radius:999px;height:118px;left:31px;position:absolute;top:8px;width:118px}.xwk-account-panel-dropdown .xwk-account-art,.xwk-account-panel-dropdown .xwk-account-avatar{height:104px;left:28px;width:104px}.xwk-account-art{align-items:center;background:radial-gradient(circle at 58% 38%,var(--xwk-avatar-spot),transparent 0 22%,transparent 23%),linear-gradient(160deg,var(--xwk-avatar-from),var(--xwk-avatar-to));display:flex;justify-content:center}.xwk-account-art span{background:rgba(255,255,255,.18);border-radius:999px;height:50px;width:50px}.xwk-account-panel-dropdown .xwk-account-art span{height:42px;width:42px}.xwk-account-avatar{background:${e.surface};border:1px solid ${c};box-sizing:border-box;display:block;object-fit:cover;overflow:hidden}.xwk-account-panel-with-transactions .xwk-account-name{position:relative;z-index:1}.xwk-account-name{color:${e.foreground};font-size:21px;font-weight:650;line-height:1.2;max-width:100%;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-account-panel-dropdown .xwk-account-name{font-size:18px}.xwk-account-name-with-qr,.xwk-account-address{align-items:center;display:inline-flex;gap:6px;justify-content:center}.xwk-account-name-with-qr span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-account-name-address{background:${e.surface};border:1px solid ${e.border};border-radius:14px;color:${e.muted};font-size:16px;font-weight:600;line-height:1.2;max-width:min(260px,100%);padding:7px 6px 7px 14px}.xwk-account-address{background:${e.surface};border:1px solid ${e.border};border-radius:12px;color:${e.muted};font-size:14px;font-weight:520;line-height:1.25;max-width:100%;overflow:hidden;padding:8px 8px 8px 12px;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-address-qr-trigger{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:0;border-radius:10px;box-shadow:none;color:currentColor;cursor:pointer;display:inline-flex;flex:0 0 34px;height:34px;justify-content:center;margin:-4px -3px -4px 0;min-height:0;outline:none;overflow:visible;padding:0;touch-action:manipulation;transform:none;width:34px}.xwk-address-qr-trigger svg{display:block;height:17px;overflow:visible;width:17px}.xwk-address-qr-trigger:hover{background:${e.surfaceHover};box-shadow:none;transform:none}.xwk-account-meta-row{align-items:center;display:flex;gap:8px;justify-content:center;max-width:100%;min-height:42px}.xwk-account-balance{align-items:center;background:${e.surface};border:1px solid ${l};border-radius:999px;box-sizing:border-box;color:${e.muted};display:inline-flex;font-size:13px;font-weight:560;height:42px;justify-content:center;letter-spacing:0;line-height:1;padding:0 14px;text-align:center}.xwk-account-balance-loading{align-items:center;display:inline-flex;gap:6px}.xwk-account-warning{align-items:center;background:${e.surface};border:1px solid ${l};border-radius:12px;box-sizing:border-box;color:${e.muted};display:flex;font-size:13px;font-weight:520;justify-content:center;line-height:1.25;min-height:54px;padding:0 14px;text-align:center;width:100%}.xwk-address-qr-content{align-content:center;display:grid;gap:14px;justify-items:center;min-height:100%;width:100%}.xwk-address-qr-code{aspect-ratio:1/1;background:${e.surface};border:1px solid ${e.border};border-radius:14px;box-sizing:border-box;display:grid;max-width:304px;padding:12px;place-items:center;width:min(304px,100%)}.xwk-address-qr-code svg,.xwk-address-qr-code canvas,.xwk-address-qr-code img{aspect-ratio:1/1;display:block;height:auto;max-width:100%;width:100%}.xwk-address-qr-chip{background:${e.surface};border:1px solid ${e.border};border-radius:12px;box-sizing:border-box;color:${e.muted};font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;font-weight:520;line-height:1.45;max-width:100%;overflow-wrap:anywhere;padding:9px 11px;text-align:center;width:100%}.xwk-address-qr-fallback{color:${e.muted};font-size:12px;line-height:1.45;overflow-wrap:anywhere}.xwk-tx-section{background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-sizing:border-box;display:grid;overflow:hidden;width:100%}.xwk-tx-header{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface}!important;border:0!important;box-shadow:none!important;color:${e.muted};cursor:pointer;display:flex;font:inherit;font-size:10px;font-weight:650;gap:6px;letter-spacing:.07em;line-height:1.2;margin:0;min-height:34px;outline:none;padding:0 12px;text-align:left;text-transform:uppercase;touch-action:manipulation;transform:none;transition:background-color .16s ease,color .16s ease;width:100%}.xwk-tx-header:hover,.xwk-tx-header:active{background:${e.surfaceHover}!important;border:0!important;box-shadow:none!important;color:${e.foreground};opacity:1;text-decoration:none;transform:none}.xwk-tx-count{align-items:center;background:${e.background};border:1px solid ${l};border-radius:999px;box-sizing:border-box;color:${e.muted};display:inline-flex;font-size:10px;font-weight:650;height:16px;justify-content:center;letter-spacing:0;line-height:1;min-width:18px;padding:0 5px;text-transform:none}.xwk-tx-chevron{align-items:center;color:${e.muted};display:inline-flex;flex:0 0 16px;height:16px;justify-content:center;margin-left:auto;transition:transform .18s ease;width:16px}.xwk-tx-chevron.closed{transform:rotate(-90deg)}.xwk-tx-chevron svg{display:block;height:12px;width:12px}.xwk-tx-list{-webkit-overflow-scrolling:touch;display:grid;gap:0;max-height:86px;overflow:auto;overscroll-behavior:contain;scrollbar-color:${e.muted} transparent;scrollbar-width:thin}.xwk-tx-list::-webkit-scrollbar{width:6px}.xwk-tx-list::-webkit-scrollbar-track{background:transparent}.xwk-tx-list::-webkit-scrollbar-thumb{background:${e.muted};border-radius:999px}.xwk-tx-row{align-items:center;background:${e.surface};border-top:1px solid ${l};box-sizing:border-box;display:grid;gap:8px;grid-template-columns:24px minmax(0,1fr) auto;min-height:42px;padding:7px 10px;transition:background-color .16s ease}.xwk-tx-row:hover{background:${e.surface};box-shadow:none;transform:none}.xwk-tx-row:first-child{border-top:0}.xwk-tx-status{align-items:center;background:${e.background};border-radius:999px;color:${e.accent};display:inline-flex;height:24px;justify-content:center;width:24px}.xwk-tx-row-confirmed .xwk-tx-status{color:${e.success}}.xwk-tx-row-failed .xwk-tx-status{color:${e.error}}.xwk-tx-row-unknown .xwk-tx-status{color:${e.muted}}.xwk-tx-main{display:grid;gap:2px;min-width:0}.xwk-tx-label{color:${e.foreground};font-size:12px;font-weight:600;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-tx-hash{color:${e.muted};font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-tx-link{align-items:center;border-radius:9px;color:${e.accent};display:inline-flex;font:inherit;font-size:12px;font-weight:650;gap:3px;line-height:1.2;min-height:28px;padding:0 6px;text-decoration:none}.xwk-tx-link:hover{background:${e.surfaceHover};box-shadow:none;text-decoration:none;transform:none}.xwk-tx-link svg{height:12px;width:12px}.xwk-tx-empty{background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-sizing:border-box;color:${e.muted};font-size:13px;line-height:1.35;padding:14px;text-align:center;width:100%}.xwk-tx-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.accent};border-radius:999px;box-sizing:border-box;display:block;height:14px;width:14px}.xwk-account-panel-actions{display:grid;gap:10px;grid-template-columns:1fr;width:100%}.xwk-account-modal-body .xwk-account-panel-actions{margin-top:auto}.xwk-account-panel-with-transactions .xwk-account-modal-body .xwk-account-panel-actions{margin-top:0}.xwk-account-panel-actions button,.xwk-account-panel-actions a{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:flex;font:inherit;font-size:14px;font-weight:560;gap:8px;justify-content:center;line-height:1.2;min-height:46px;min-width:0;outline:none;overflow:hidden;padding:0 12px;text-decoration:none;touch-action:manipulation;transform:none;transition:background-color .16s ease,border-color .16s ease;width:100%}.xwk-account-panel-actions button:disabled{cursor:wait;opacity:1}.xwk-account-panel-actions svg{flex:0 0 auto;opacity:.58}.xwk-account-panel-actions span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-account-panel-actions button:hover,.xwk-account-panel-actions a:hover{background:${e.surfaceHover};border-color:${l};box-shadow:none;text-decoration:none;transform:none}.xwk-account-panel-actions button:active,.xwk-account-panel-actions a:active{background:${e.surfaceHover};opacity:1;text-decoration:none;transform:none}.xwk-copied-icon{color:${e.success};opacity:1!important}.xwk-action-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.muted};border-radius:999px;box-sizing:border-box;display:inline-block;height:17px;width:17px}@keyframes xwk-action-spin{to{transform:rotate(360deg)}}@keyframes xwk-account-overlay-in{from{opacity:0}to{opacity:1}}@keyframes xwk-account-panel-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.xwk-account-button,.xwk-tx-chevron,.xwk-account-panel-actions button,.xwk-account-panel-actions a{transition:none}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-overlay,.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation-duration:1ms!important}.xwk-action-spinner,.xwk-balance-spinner,.xwk-tx-spinner{animation:none}}@media(max-width:520px){.xwk-account-panel-dropdown{bottom:0;left:0;margin-top:0;min-width:0;position:fixed;right:0;top:auto;width:100vw}.xwk-account-overlay{align-items:flex-end;padding:max(12px,env(safe-area-inset-top)) 0 0}.xwk-account-panel-modal{align-self:flex-end;border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;border-left:0;border-right:0;border-top-left-radius:${e.radius};border-top-right-radius:${e.radius};height:min(527px,calc(100dvh - env(safe-area-inset-top)));max-width:none;width:100vw}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation:xwk-account-sheet-in .28s cubic-bezier(.32,.72,0,1)}.xwk-account-modal-header{border-top-left-radius:${e.radius};border-top-right-radius:${e.radius};grid-template-columns:44px minmax(0,1fr) 44px;padding:10px 16px}.xwk-account-modal-body{min-height:0;padding:18px 20px max(22px,calc(22px + env(safe-area-inset-bottom)))}.xwk-button-label{max-width:min(150px,calc(100vw - 140px))}}@keyframes xwk-account-sheet-in{from{opacity:1;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}`}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveVisibleBorder(e){const n=typeof e=="string"?e.trim().toLowerCase():"";return!n||n==="transparent"||n==="none"?this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)":e??(this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)")}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode}resolveTarget(e){if(!e)return;if(typeof e!="string")return e;const n=document.querySelector(e);if(!n)throw new Error(`Wallet button target was not found: ${e}`);return n}formatAddress(e){return`${e.slice(0,6)}...${e.slice(-4)}`}getAddressGradient(e){const n=[["#0ea5e9","#6366f1","#93c5fd"],["#14b8a6","#2563eb","#99f6e4"],["#f97316","#db2777","#fed7aa"],["#8b5cf6","#06b6d4","#ddd6fe"],["#22c55e","#0f766e","#bbf7d0"],["#f43f5e","#7c3aed","#fecdd3"]];let r=0;for(let s=0;s<e.length;s+=1)r=(r<<5)-r+e.charCodeAt(s)|0;const i=n[Math.abs(r)%n.length];return[i[0],i[1],i[2]]}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}escapeHtml(e){return String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}}function AS(t={}){const e=t.endpoint??"https://app.xrpdomains.xyz/api/xrplnft/getName",n=t.profileEndpoint??"https://app.xrpdomains.xyz/api/xrplnft/getAddress",r=t.timeoutMs??3e3,i=t.cacheTtlMs??6e5,s=new Map;return async(o,a,c)=>{if(!a||!sE(a.account.network))return null;const l=s.get(o);if(!(c!=null&&c.force)&&l&&l.expiresAt>Date.now())return l.value;const d=new AbortController,u=window.setTimeout(()=>d.abort(),r);try{const f=`address=${encodeURIComponent(o)}${c!=null&&c.force?`&_=${Date.now()}`:""}`,p=`${e}${e.includes("?")?"&":"?"}${f}`,m=await fetch(p,{signal:d.signal});if(!m.ok)return null;const h=await m.json(),g=typeof h.data=="string"?h.data:typeof h.name=="string"?h.name:null,w=g?await SP(n,g,d.signal):void 0,E=g?{name:g,source:"xrpdomains",avatar:w,verified:!0}:null;return s.set(o,{value:E,expiresAt:Date.now()+i}),E}finally{window.clearTimeout(u)}}}async function SP(t,e,n){try{const r=`${t}${t.includes("?")?"&":"?"}domain=${encodeURIComponent(e)}`,i=await fetch(r,{signal:n});if(!i.ok)return;const s=await i.json();return _P(Sf(s),t)}catch{return}}function Sf(t){if(!t||typeof t!="object")return;const e=t,n=e.avatar;if(typeof n=="string"&&n.trim())return n.trim();const r=e.profile_info??e.profileInfo,i=Sf(r);if(i)return i;const s=Sf(e.data);if(s)return s;const o=Sf(e.result);if(o)return o}function _P(t,e){if(t){if(/^(?:https?:|data:|blob:|ipfs:|ar:)/i.test(t))return t;if(t.startsWith("//"))try{return`${new URL(e).protocol}${t}`}catch{return t}try{const n=new URL(e);return new URL(t.replace(/^\/+/,""),`${n.origin}/`).toString()}catch{return t}}}function SS(t){const e=new Af(t);return t.target&&e.mount(t.target),e}const xP=5e3,TP=3;class ag{constructor(e){this.options=e,this.offEvents=[],this.dismissTimers=new Map,this.toasts=new Map,this.offEvents.push(e.manager.on("tx_submitted",({hash:n,transaction:r})=>this.upsert(n,r??{hash:n,status:"submitted",submittedAt:Date.now()})),e.manager.on("tx_confirmed",({hash:n,transaction:r})=>this.upsert(n,r??{hash:n,status:"confirmed",submittedAt:Date.now(),confirmedAt:Date.now()})),e.manager.on("tx_failed",({hash:n,transaction:r,error:i})=>{n&&this.upsert(n,r??{hash:n,status:"failed",submittedAt:Date.now(),failedAt:Date.now(),error:i})}),e.manager.on("disconnected",()=>this.clearAll()))}mount(e=this.options.mount??document.body){var n;(n=this.root)!=null&&n.isConnected||(this.root=document.createElement("div"),this.root.className=`xwk-toast-root xwk-toast-root--${this.position()}`,this.root.setAttribute("aria-live","polite"),this.root.setAttribute("aria-label","Transaction notifications"),this.ensureStyles(),e.appendChild(this.root),this.render())}destroy(){var e;this.clearTimers(),this.offEvents.splice(0).forEach(n=>n()),(e=this.root)==null||e.remove(),this.root=void 0,this.toasts.clear()}clearAll(){this.clearTimers(),this.toasts.clear(),this.render()}upsert(e,n){var r;this.toasts.set(e,n),!((r=this.root)!=null&&r.isConnected)&&typeof document<"u"&&this.mount(),this.enforceLimit(),this.render(),(n.status==="confirmed"||n.status==="failed")&&this.scheduleDismiss(e)}enforceLimit(){const e=this.options.maxVisible??TP;[...this.toasts.entries()].sort((r,i)=>this.getTimestamp(i[1])-this.getTimestamp(r[1])).slice(e).forEach(([r])=>this.remove(r))}scheduleDismiss(e){const n=this.options.autoDismissMs??xP;if(n<=0)return;const r=this.dismissTimers.get(e);r&&window.clearTimeout(r);const i=window.setTimeout(()=>this.remove(e),n);this.dismissTimers.set(e,i)}remove(e){const n=this.dismissTimers.get(e);n&&window.clearTimeout(n),this.dismissTimers.delete(e),this.toasts.delete(e),this.render()}render(){if(!this.root)return;this.root.className=`xwk-toast-root xwk-toast-root--${this.position()}`,this.ensureStyles();const e=[...this.toasts.values()].sort((n,r)=>this.getTimestamp(n)-this.getTimestamp(r)).map(n=>this.renderToast(n)).join("");this.root.innerHTML=e,this.root.querySelectorAll("[data-xwk-toast-dismiss]").forEach(n=>{n.addEventListener("click",()=>{const r=n.dataset.xwkToastDismiss;r&&this.remove(r)})})}renderToast(e){var c;const n=this.messages(),r=e.hash,i=this.formatHash(r),s=e.status==="confirmed"?"Transaction confirmed":e.status==="failed"?"Transaction failed":e.status==="unknown"?"Transaction status unknown":"Transaction submitted",o=this.getExplorerUrl(r,(c=e.account)==null?void 0:c.network),a=o?`<a class="xwk-toast-link" href="${this.escapeHtml(o)}" target="_blank" rel="noopener">View ${this.externalIcon()}</a>`:"";return`<div class="xwk-toast xwk-toast--${e.status}" data-hash="${this.escapeHtml(r)}" role="status"><div class="xwk-toast-icon">${this.renderStatusIcon(e.status)}</div><div class="xwk-toast-body"><span class="xwk-toast-label">${this.escapeHtml(s)}</span><span class="xwk-toast-hash">${this.escapeHtml(i)}</span></div>${a}<button class="xwk-toast-dismiss" data-xwk-toast-dismiss="${this.escapeHtml(r)}" aria-label="${this.escapeHtml(n.close)}" type="button">&times;</button></div>`}renderStatusIcon(e){return e==="confirmed"?`<span class="xwk-toast-icon-mark" aria-hidden="true">${this.checkIcon()}</span>`:e==="failed"?`<span class="xwk-toast-icon-mark" aria-hidden="true">${this.closeIcon()}</span>`:e==="unknown"?'<span class="xwk-toast-icon-mark" aria-hidden="true">?</span>':'<span class="xwk-toast-spinner" aria-hidden="true"></span>'}renderStyles(){const e=this.resolveTheme();return`.xwk-toast-root{bottom:24px;display:flex;flex-direction:column-reverse;font-family:${e.fontFamily};gap:10px;pointer-events:none;position:fixed;z-index:2147483646}.xwk-toast-root--bottom-right{right:24px}.xwk-toast-root--bottom-left{left:24px}.xwk-toast-root--bottom-center{left:50%;transform:translateX(-50%)}.xwk-toast{align-items:center;animation:xwk-toast-in .18s ease-out both;background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:none;box-sizing:border-box;color:${e.foreground};display:flex;gap:12px;max-width:420px;min-width:330px;padding:12px 12px 12px 16px;pointer-events:auto}.xwk-toast-icon{align-items:center;border-radius:999px;display:flex;flex:0 0 32px;height:32px;justify-content:center;width:32px}.xwk-toast-spinner{animation:xwk-spin .9s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.accent};border-radius:999px;display:block;height:18px;width:18px}.xwk-toast--submitted .xwk-toast-icon{background:${e.surface};color:${e.accent}}.xwk-toast--confirmed .xwk-toast-icon{background:${e.surface};color:${e.success}}.xwk-toast--failed .xwk-toast-icon{background:${e.surface};color:${e.error}}.xwk-toast--unknown .xwk-toast-icon{background:${e.surface};color:${e.muted}}.xwk-toast-icon-mark{display:inline-flex}.xwk-toast-body{display:flex;flex:1 1 auto;flex-direction:column;gap:2px;min-width:0}.xwk-toast-label{color:${e.foreground};font-size:13px;font-weight:600;white-space:nowrap}.xwk-toast-hash{color:${e.muted};font-family:ui-monospace,"Cascadia Code",monospace;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-toast-link{-webkit-tap-highlight-color:transparent;align-items:center;border-radius:${e.walletRadius};box-sizing:border-box;color:${e.accent};display:inline-flex;flex:0 0 auto;font:inherit;font-size:12px;font-weight:600;gap:4px;line-height:1.2;min-height:32px;outline:none;overflow:hidden;padding:0 6px;text-decoration:none;touch-action:manipulation;transform:none;white-space:nowrap}.xwk-toast-link:hover{background:${e.surfaceHover};text-decoration:none}.xwk-toast-link svg{height:13px;width:13px}.xwk-toast-dismiss{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:1px solid ${e.border};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;flex:0 0 44px;font:inherit;font-size:24px;font-weight:400;height:44px;justify-content:center;line-height:1;margin:0;min-height:0;outline:none;overflow:hidden;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-toast-dismiss:hover{background:${e.surfaceHover};border-color:${e.border};box-shadow:none;color:${e.foreground};transform:none}.xwk-toast-dismiss:focus-visible,.xwk-toast-link:focus-visible{outline:2px solid ${e.accent};outline-offset:2px}@keyframes xwk-toast-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes xwk-spin{to{transform:rotate(360deg)}}@media(max-width:480px){.xwk-toast-root{bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px;transform:none}.xwk-toast{max-width:100%;min-width:0;width:100%}}@media(prefers-reduced-motion:reduce){.xwk-toast,.xwk-toast-spinner{animation:none}}`}ensureStyles(){const e=this.renderStyles();tg(eg("xwk-toast",e),e)}getExplorerUrl(e,n){var i,s;const r=(s=(i=this.options).explorerUrl)==null?void 0:s.call(i,e,n);return r||np(n,e)}getTimestamp(e){return e.confirmedAt??e.failedAt??e.submittedAt}formatHash(e){return e.length>12?`${e.slice(0,6)}...${e.slice(-6)}`:e}position(){return this.options.position??"bottom-right"}messages(){return Xr(this.options.language,this.options.messages)}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode??"light"}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}clearTimers(){this.dismissTimers.forEach(e=>window.clearTimeout(e)),this.dismissTimers.clear()}escapeHtml(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}checkIcon(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="m5 12 4 4 10-10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'}closeIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>'}externalIcon(){return'<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M14 5h5v5M10 14 19 5M19 14v4a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}function _S(t){const e=new ag(t);return t.mount&&e.mount(t.mount),e}function _f(t){let e;const n=t.adapters??OP(t,r=>{e==null||e.emitQr(r.adapterId,r.uri,r.deeplink)});return e=new cE({...UP(t),adapters:n,storage:NP(t.storage)}),e}function xS(t){const e=_f(t),n=BP(t),r=t.modal===!1?void 0:mS({manager:e,...n.ui}),i=CP(t,n.ui),s=i?_S({manager:e,...i}):void 0;s==null||s.mount();const o=RP(t),a=r&&o?SS({manager:e,modal:r,...o}):void 0;return t.autoReconnect&&IP(e),r&&n.autoOpen&&r.autoOpen(),{manager:e,modal:r,button:a,openModal:()=>r==null?void 0:r.open(),closeModal:()=>r==null?void 0:r.close(),disconnect:()=>e.disconnect(),toast:s,refreshIdentity:()=>a==null?void 0:a.refreshIdentity(),refreshBalance:()=>a==null?void 0:a.refreshBalance(),refreshAccount:()=>a==null?void 0:a.refreshAccount(),getSession:()=>e.getSession(),signAndSubmit:e.signAndSubmit.bind(e),signTransaction:e.signTransaction.bind(e),signMessage:e.signMessage.bind(e)}}function IP(t){const e=()=>{(typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame.bind(globalThis):r=>globalThis.setTimeout(()=>r(Date.now()),16))(()=>{t.autoReconnect()})};if(typeof window<"u"&&typeof document<"u"&&document.readyState!=="complete"){window.addEventListener("load",e,{once:!0});return}e()}function CP(t,e){var s;const r=(typeof t.modal=="object"?t.modal:{}).toast??((s=t.ui)==null?void 0:s.toast);if(!r)return;const i=r===!0?{}:r;return{language:e.language,messages:e.messages,themeMode:e.themeMode,themeName:e.themeName,theme:e.theme,customTheme:e.customTheme,...i}}function OP(t,e){const n=t.wallets==="all"||!t.wallets?void 0:new Set(t.wallets),r=[];if(fl(n,"xaman")&&t.xamanClientId&&r.push(y2({apiKey:t.xamanClientId,onQr:e})),fl(n,"gemwallet")&&r.push(_A()),fl(n,"crossmark")&&r.push(fE()),fl(n,"dropfi")&&r.push(gE()),fl(n,"xrplsnap")&&r.push(v2()),t.walletConnectProjectId&&PP(n)){const i=kP(t);r.push(...jA({projectId:t.walletConnectProjectId,mode:i==="default"?"default":"details",wallets:LP(n),metadata:$A({name:t.appName,description:t.appDescription??`${t.appName} XRPL wallet connection`,url:t.appUrl??MP(),icons:t.appIcons??[]}),onQr:e,signMessageDestination:t.walletConnectSignMessageDestination,useModal:i==="default"?!0:void 0,modalMode:i==="default"?"always":void 0}))}return r}function NP(t){if(t==="localStorage")return Jc();if(t!=="memory")return t}function BP(t){var a,c,l,d,u,f,p,m;const e=typeof t.modal=="object"?t.modal:{},{autoOpen:n=!1,...r}=e,i=((c=(a=t.ui)==null?void 0:a.modal)==null?void 0:c.width)??((l=e.modal)==null?void 0:l.width),s=((u=(d=t.ui)==null?void 0:d.walletConnect)==null?void 0:u.mode)??((f=e.walletConnect)==null?void 0:f.mode)??"default",o={...t.ui,...r,modal:{...(p=t.ui)==null?void 0:p.modal,...e.modal,...i?{width:i}:{}},walletConnect:{...(m=t.ui)==null?void 0:m.walletConnect,...e.walletConnect,mode:s}};return{autoOpen:n,ui:S2(o)}}function RP(t){var p,m,h,g,w,E,y,b,S,v;if(!t.connectButton)return;const n=$P(t.connectButton)?{target:t.connectButton}:t.connectButton;if(!n.target)return;const{accountStatus:r,accountPanelMode:i,showBalance:s,target:o,...a}=n,c=t.identity??{},l=typeof t.modal=="object"?t.modal:{},d={...t.ui,...l,modal:{...(p=t.ui)==null?void 0:p.modal,...l.modal},accountPanel:{...(m=t.ui)==null?void 0:m.accountPanel,...l.accountPanel},connectButton:{...(h=t.ui)==null?void 0:h.connectButton,...l.connectButton},identity:{...(g=t.ui)==null?void 0:g.identity,...l.identity,enabled:((E=(w=t.ui)==null?void 0:w.identity)==null?void 0:E.enabled)??((y=l.identity)==null?void 0:y.enabled)??c.web3Name,fallbackToAddress:((S=(b=t.ui)==null?void 0:b.identity)==null?void 0:S.fallbackToAddress)??((v=l.identity)==null?void 0:v.fallbackToAddress)??c.fallbackToAddress}},u=DP(s),f={...a,...u===void 0?{}:{showBalance:u}};return{target:o,..._2(d,f)}}function DP(t){var n;return t==null||typeof t!="object"||!("smallScreen"in t||"largeScreen"in t)?t:typeof window<"u"&&((n=window.matchMedia)==null?void 0:n.call(window,"(max-width: 640px)").matches)?t.smallScreen??t.largeScreen:t.largeScreen??t.smallScreen}function kP(t){var e,n;return((n=(e=t.ui)==null?void 0:e.walletConnect)==null?void 0:n.mode)??"default"}function fl(t,e){return t?e==="xrplsnap"?t.has("xrplsnap")||t.has("xrpl-snap"):t.has(e):!0}function PP(t){return t?t.has("walletconnect")||["staticbit","bitget","joey","girin","bifrost"].some(e=>t.has(e)):!0}function LP(t){if(!t||t.has("walletconnect"))return"all";const e=["staticbit","bitget","joey","girin","bifrost"].filter(n=>t.has(n));return e.length?e:"all"}function MP(){return typeof window<"u"?window.location.origin:"https://xrpl.org"}function UP(t){const{adapters:e,storage:n,walletConnectProjectId:r,walletConnectSignMessageDestination:i,xamanClientId:s,wallets:o,ui:a,...c}=t;return c}const FP=_f;function $P(t){return typeof t=="string"?!0:typeof HTMLElement<"u"&&t instanceof HTMLElement}var Yr={},Ao={},cg={exports:{}},TS;function lg(){return TS||(TS=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function s(c,l,d,u,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,u||c,f),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],d,u;if(this._eventsCount===0)return l;for(u in d=this._events)e.call(d,u)&&l.push(n?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=n?n+l:l,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,p=u.length,m=new Array(p);f<p;f++)m[f]=u[f].fn;return m},a.prototype.listenerCount=function(l){var d=n?n+l:l,u=this._events[d];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,d,u,f,p,m){var h=n?n+l:l;if(!this._events[h])return!1;var g=this._events[h],w=arguments.length,E,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),w){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,u),!0;case 4:return g.fn.call(g.context,d,u,f),!0;case 5:return g.fn.call(g.context,d,u,f,p),!0;case 6:return g.fn.call(g.context,d,u,f,p,m),!0}for(y=1,E=new Array(w-1);y<w;y++)E[y-1]=arguments[y];g.fn.apply(g.context,E)}else{var b=g.length,S;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),w){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,d);break;case 3:g[y].fn.call(g[y].context,d,u);break;case 4:g[y].fn.call(g[y].context,d,u,f);break;default:if(!E)for(S=1,E=new Array(w-1);S<w;S++)E[S-1]=arguments[S];g[y].fn.apply(g[y].context,E)}}return!0},a.prototype.on=function(l,d,u){return s(this,l,d,u,!1)},a.prototype.once=function(l,d,u){return s(this,l,d,u,!0)},a.prototype.removeListener=function(l,d,u,f){var p=n?n+l:l;if(!this._events[p])return this;if(!d)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!f||m.once)&&(!u||m.context===u)&&o(this,p);else{for(var h=0,g=[],w=m.length;h<w;h++)(m[h].fn!==d||f&&!m[h].once||u&&m[h].context!==u)&&g.push(m[h]);g.length?this._events[p]=g.length===1?g[0]:g:o(this,p)}return this},a.prototype.removeAllListeners=function(l){var d;return l?(d=n?n+l:l,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(cg)),cg.exports}var We={},IS;function Ie(){if(IS)return We;IS=1,Object.defineProperty(We,"__esModule",{value:!0}),We.XRPLFaucetError=We.NotFoundError=We.ValidationError=We.ResponseFormatError=We.TimeoutError=We.RippledNotInitializedError=We.DisconnectedError=We.NotConnectedError=We.RippledError=We.ConnectionError=We.UnexpectedError=We.XrplError=void 0;class t extends Error{constructor(p="",m){super(p),this.name=this.constructor.name,this.message=p,this.data=m,Error.captureStackTrace!=null&&Error.captureStackTrace(this,this.constructor)}toString(){let p=`[${this.name}(${this.message}`;return this.data&&(p+=`, ${JSON.stringify(this.data)}`),p+=")]",p}inspect(){return this.toString()}}We.XrplError=t;class e extends t{}We.RippledError=e;class n extends t{}We.UnexpectedError=n;class r extends t{}We.ConnectionError=r;class i extends r{}We.NotConnectedError=i;class s extends r{}We.DisconnectedError=s;class o extends r{}We.RippledNotInitializedError=o;class a extends r{}We.TimeoutError=a;class c extends r{}We.ResponseFormatError=c;class l extends t{}We.ValidationError=l;class d extends t{}We.XRPLFaucetError=d;class u extends t{constructor(p="Not found"){super(p)}}return We.NotFoundError=u,We}var ug={},CS;function OS(){return CS||(CS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_API_VERSION=t.RIPPLED_API_V2=t.RIPPLED_API_V1=void 0,t.RIPPLED_API_V1=1,t.RIPPLED_API_V2=2,t.DEFAULT_API_VERSION=t.RIPPLED_API_V2})(ug)),ug}var So={},hl={},NS;function BS(){if(NS)return hl;NS=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.AccountRootFlags=void 0;var t;return(function(e){e[e.lsfPasswordSpent=65536]="lsfPasswordSpent",e[e.lsfRequireDestTag=131072]="lsfRequireDestTag",e[e.lsfRequireAuth=262144]="lsfRequireAuth",e[e.lsfDisallowXRP=524288]="lsfDisallowXRP",e[e.lsfDisableMaster=1048576]="lsfDisableMaster",e[e.lsfNoFreeze=2097152]="lsfNoFreeze",e[e.lsfGlobalFreeze=4194304]="lsfGlobalFreeze",e[e.lsfDefaultRipple=8388608]="lsfDefaultRipple",e[e.lsfDepositAuth=16777216]="lsfDepositAuth",e[e.lsfAMM=33554432]="lsfAMM",e[e.lsfDisallowIncomingNFTokenOffer=67108864]="lsfDisallowIncomingNFTokenOffer",e[e.lsfDisallowIncomingCheck=134217728]="lsfDisallowIncomingCheck",e[e.lsfDisallowIncomingPayChan=268435456]="lsfDisallowIncomingPayChan",e[e.lsfDisallowIncomingTrustline=536870912]="lsfDisallowIncomingTrustline",e[e.lsfAllowTrustLineClawback=2147483648]="lsfAllowTrustLineClawback"})(t||(hl.AccountRootFlags=t={})),hl}var Qr={},Qe={},dg={},_o={},fg={},pl={},RS;function jP(){return RS||(RS=1,Object.defineProperty(pl,"__esModule",{value:!0}),pl.crypto=void 0,pl.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),pl}var Hi={},DS;function hg(){if(DS)return Hi;DS=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.anumber=t,Hi.abytes=n,Hi.ahash=r,Hi.aexists=i,Hi.aoutput=s;function t(o){if(!Number.isSafeInteger(o)||o<0)throw new Error("positive integer expected, got "+o)}function e(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function n(o,...a){if(!e(o))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(o.length))throw new Error("Uint8Array expected of length "+a+", got length="+o.length)}function r(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(o.outputLen),t(o.blockLen)}function i(o,a=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(a&&o.finished)throw new Error("Hash#digest() has already been called")}function s(o,a){n(o);const c=a.outputLen;if(o.length<c)throw new Error("digestInto() expects output buffer of length at least "+c)}return Hi}var kS;function lr(){return kS||(kS=1,(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=r,t.byteSwap32=d,t.bytesToHex=f,t.hexToBytes=h,t.asyncLoop=w,t.utf8ToBytes=E,t.toBytes=y,t.concatBytes=b,t.checkOpts=v,t.wrapConstructor=B,t.wrapConstructorWithOpts=T,t.wrapXOFConstructorWithOpts=_,t.randomBytes=N;const e=jP(),n=hg();function r(D){return D instanceof Uint8Array||ArrayBuffer.isView(D)&&D.constructor.name==="Uint8Array"}const i=D=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength);t.u8=i;const s=D=>new Uint32Array(D.buffer,D.byteOffset,Math.floor(D.byteLength/4));t.u32=s;const o=D=>new DataView(D.buffer,D.byteOffset,D.byteLength);t.createView=o;const a=(D,U)=>D<<32-U|D>>>U;t.rotr=a;const c=(D,U)=>D<<U|D>>>32-U>>>0;t.rotl=c,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const l=D=>D<<24&4278190080|D<<8&16711680|D>>>8&65280|D>>>24&255;t.byteSwap=l,t.byteSwapIfBE=t.isLE?D=>D:D=>(0,t.byteSwap)(D);function d(D){for(let U=0;U<D.length;U++)D[U]=(0,t.byteSwap)(D[U])}const u=Array.from({length:256},(D,U)=>U.toString(16).padStart(2,"0"));function f(D){(0,n.abytes)(D);let U="";for(let L=0;L<D.length;L++)U+=u[D[L]];return U}const p={_0:48,_9:57,A:65,F:70,a:97,f:102};function m(D){if(D>=p._0&&D<=p._9)return D-p._0;if(D>=p.A&&D<=p.F)return D-(p.A-10);if(D>=p.a&&D<=p.f)return D-(p.a-10)}function h(D){if(typeof D!="string")throw new Error("hex string expected, got "+typeof D);const U=D.length,L=U/2;if(U%2)throw new Error("hex string expected, got unpadded hex of length "+U);const k=new Uint8Array(L);for(let C=0,P=0;C<L;C++,P+=2){const A=m(D.charCodeAt(P)),x=m(D.charCodeAt(P+1));if(A===void 0||x===void 0){const I=D[P]+D[P+1];throw new Error('hex string expected, got non-hex character "'+I+'" at index '+P)}k[C]=A*16+x}return k}const g=async()=>{};t.nextTick=g;async function w(D,U,L){let k=Date.now();for(let C=0;C<D;C++){L(C);const P=Date.now()-k;P>=0&&P<U||(await(0,t.nextTick)(),k+=P)}}function E(D){if(typeof D!="string")throw new Error("utf8ToBytes expected string, got "+typeof D);return new Uint8Array(new TextEncoder().encode(D))}function y(D){return typeof D=="string"&&(D=E(D)),(0,n.abytes)(D),D}function b(...D){let U=0;for(let k=0;k<D.length;k++){const C=D[k];(0,n.abytes)(C),U+=C.length}const L=new Uint8Array(U);for(let k=0,C=0;k<D.length;k++){const P=D[k];L.set(P,C),C+=P.length}return L}class S{clone(){return this._cloneInto()}}t.Hash=S;function v(D,U){if(U!==void 0&&{}.toString.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(D,U)}function B(D){const U=k=>D().update(y(k)).digest(),L=D();return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=()=>D(),U}function T(D){const U=(k,C)=>D(C).update(y(k)).digest(),L=D({});return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=k=>D(k),U}function _(D){const U=(k,C)=>D(C).update(y(k)).digest(),L=D({});return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=k=>D(k),U}function N(D=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(D));if(e.crypto&&typeof e.crypto.randomBytes=="function")return e.crypto.randomBytes(D);throw new Error("crypto.getRandomValues must be defined")}})(fg)),fg}var Jr={},PS;function LS(){if(PS)return Jr;PS=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.equal=Jr.concat=Jr.HEX_REGEX=void 0;const t=lr();Jr.HEX_REGEX=/^[A-F0-9]*$/iu;function e(r){return(0,t.concatBytes)(...r)}Jr.concat=e;function n(r,i){if(r.byteLength!==i.byteLength)return!1;const s=new Int8Array(r),o=new Int8Array(i);for(let a=0;a!==r.byteLength;a++)if(s[a]!==o[a])return!1;return!0}return Jr.equal=n,Jr}var MS;function $e(){return MS||(MS=1,(function(t){var e=_o&&_o.__createBinding||(Object.create?(function(l,d,u,f){f===void 0&&(f=u);var p=Object.getOwnPropertyDescriptor(d,u);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[u]}}),Object.defineProperty(l,f,p)}):(function(l,d,u,f){f===void 0&&(f=u),l[f]=d[u]})),n=_o&&_o.__exportStar||function(l,d){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(d,u)&&e(d,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.stringToHex=t.hexToString=t.hexToBytes=t.bytesToHex=void 0;const r=lr(),i=LS(),s=l=>(0,r.bytesToHex)(l instanceof Uint8Array?l:Uint8Array.from(l)).toUpperCase();t.bytesToHex=s;const o=l=>{const d=l.length,u=new Uint8Array(d/2);if(!i.HEX_REGEX.test(l))throw new Error("Invalid hex string");for(let f=0;f<u.length;f++){const p=f*2,m=l.slice(p,p+2),h=Number.parseInt(m,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");u[f]=h}return u};t.hexToBytes=o;const a=(l,d="utf8")=>new TextDecoder(d).decode((0,t.hexToBytes)(l));t.hexToString=a;const c=l=>(0,t.bytesToHex)(new TextEncoder().encode(l));t.stringToHex=c,t.randomBytes=r.randomBytes,n(LS(),t)})(_o)),_o}var Ke={},pg={},US;function gg(){return US||(US=1,(function(t){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hexnopad=t.base32hex=t.base32nopad=t.base32=t.base16=t.utils=void 0;function e($){return $ instanceof Uint8Array||ArrayBuffer.isView($)&&$.constructor.name==="Uint8Array"}function n($,...X){if(!e($))throw new Error("Uint8Array expected");if(X.length>0&&!X.includes($.length))throw new Error("Uint8Array expected of length "+X+", got length="+$.length)}function r($,X){return Array.isArray(X)?X.length===0?!0:$?X.every(ee=>typeof ee=="string"):X.every(ee=>Number.isSafeInteger(ee)):!1}function i($){if(typeof $!="function")throw new Error("function expected");return!0}function s($,X){if(typeof X!="string")throw new Error(`${$}: string expected`);return!0}function o($){if(!Number.isSafeInteger($))throw new Error(`invalid integer: ${$}`)}function a($){if(!Array.isArray($))throw new Error("array expected")}function c($,X){if(!r(!0,X))throw new Error(`${$}: array of strings expected`)}function l($,X){if(!r(!1,X))throw new Error(`${$}: array of numbers expected`)}function d(...$){const X=J=>J,ee=(J,q)=>K=>J(q(K)),ne=$.map(J=>J.encode).reduceRight(ee,X),Y=$.map(J=>J.decode).reduce(ee,X);return{encode:ne,decode:Y}}function u($){const X=typeof $=="string"?$.split(""):$,ee=X.length;c("alphabet",X);const ne=new Map(X.map((Y,J)=>[Y,J]));return{encode:Y=>(a(Y),Y.map(J=>{if(!Number.isSafeInteger(J)||J<0||J>=ee)throw new Error(`alphabet.encode: digit index outside alphabet "${J}". Allowed: ${$}`);return X[J]})),decode:Y=>(a(Y),Y.map(J=>{s("alphabet.decode",J);const q=ne.get(J);if(q===void 0)throw new Error(`Unknown letter: "${J}". Allowed: ${$}`);return q}))}}function f($=""){return s("join",$),{encode:X=>(c("join.decode",X),X.join($)),decode:X=>(s("join.decode",X),X.split($))}}function p($,X="="){return o($),s("padding",X),{encode(ee){for(c("padding.encode",ee);ee.length*$%8;)ee.push(X);return ee},decode(ee){c("padding.decode",ee);let ne=ee.length;if(ne*$%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;ne>0&&ee[ne-1]===X;ne--)if((ne-1)*$%8===0)throw new Error("padding: invalid, string has too much padding");return ee.slice(0,ne)}}}function m($){return i($),{encode:X=>X,decode:X=>$(X)}}function h($,X,ee){if(X<2)throw new Error(`convertRadix: invalid from=${X}, base cannot be less than 2`);if(ee<2)throw new Error(`convertRadix: invalid to=${ee}, base cannot be less than 2`);if(a($),!$.length)return[];let ne=0;const Y=[],J=Array.from($,K=>{if(o(K),K<0||K>=X)throw new Error(`invalid integer: ${K}`);return K}),q=J.length;for(;;){let K=0,W=!0;for(let H=ne;H<q;H++){const V=J[H],Q=X*K,te=Q+V;if(!Number.isSafeInteger(te)||Q/X!==K||te-V!==Q)throw new Error("convertRadix: carry overflow");const ie=te/ee;K=te%ee;const se=Math.floor(ie);if(J[H]=se,!Number.isSafeInteger(se)||se*ee+K!==te)throw new Error("convertRadix: carry overflow");if(W)se?W=!1:ne=H;else continue}if(Y.push(K),W)break}for(let K=0;K<$.length-1&&$[K]===0;K++)Y.push(0);return Y.reverse()}const g=($,X)=>X===0?$:g(X,$%X),w=($,X)=>$+(X-g($,X)),E=(()=>{let $=[];for(let X=0;X<40;X++)$.push(2**X);return $})();function y($,X,ee,ne){if(a($),X<=0||X>32)throw new Error(`convertRadix2: wrong from=${X}`);if(ee<=0||ee>32)throw new Error(`convertRadix2: wrong to=${ee}`);if(w(X,ee)>32)throw new Error(`convertRadix2: carry overflow from=${X} to=${ee} carryBits=${w(X,ee)}`);let Y=0,J=0;const q=E[X],K=E[ee]-1,W=[];for(const H of $){if(o(H),H>=q)throw new Error(`convertRadix2: invalid data word=${H} from=${X}`);if(Y=Y<<X|H,J+X>32)throw new Error(`convertRadix2: carry overflow pos=${J} from=${X}`);for(J+=X;J>=ee;J-=ee)W.push((Y>>J-ee&K)>>>0);const V=E[J];if(V===void 0)throw new Error("invalid carry");Y&=V-1}if(Y=Y<<ee-J&K,!ne&&J>=X)throw new Error("Excess padding");if(!ne&&Y>0)throw new Error(`Non-zero padding: ${Y}`);return ne&&J>0&&W.push(Y>>>0),W}function b($){o($);const X=2**8;return{encode:ee=>{if(!e(ee))throw new Error("radix.encode input should be Uint8Array");return h(Array.from(ee),X,$)},decode:ee=>(l("radix.decode",ee),Uint8Array.from(h(ee,$,X)))}}function S($,X=!1){if(o($),$<=0||$>32)throw new Error("radix2: bits should be in (0..32]");if(w(8,$)>32||w($,8)>32)throw new Error("radix2: carry overflow");return{encode:ee=>{if(!e(ee))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(ee),8,$,!X)},decode:ee=>(l("radix2.decode",ee),Uint8Array.from(y(ee,$,8,X)))}}function v($){return i($),function(...X){try{return $.apply(null,X)}catch{}}}function B($,X){return o($),i(X),{encode(ee){if(!e(ee))throw new Error("checksum.encode: input should be Uint8Array");const ne=X(ee).slice(0,$),Y=new Uint8Array(ee.length+$);return Y.set(ee),Y.set(ne,ee.length),Y},decode(ee){if(!e(ee))throw new Error("checksum.decode: input should be Uint8Array");const ne=ee.slice(0,-$),Y=ee.slice(-$),J=X(ne).slice(0,$);for(let q=0;q<$;q++)if(J[q]!==Y[q])throw new Error("Invalid checksum");return ne}}}t.utils={alphabet:u,chain:d,checksum:B,convertRadix:h,convertRadix2:y,radix:b,radix2:S,join:f,padding:p},t.base16=d(S(4),u("0123456789ABCDEF"),f("")),t.base32=d(S(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),p(5),f("")),t.base32nopad=d(S(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),t.base32hex=d(S(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),p(5),f("")),t.base32hexnopad=d(S(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),t.base32crockford=d(S(5),u("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),m($=>$.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const T=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",_=($,X)=>{s("base64",$);const ee=X?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,ne=X?"base64url":"base64";if($.length>0&&!ee.test($))throw new Error("invalid base64");return Uint8Array.fromBase64($,{alphabet:ne,lastChunkHandling:"strict"})};t.base64=T?{encode($){return n($),$.toBase64()},decode($){return _($,!1)}}:d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),p(6),f("")),t.base64nopad=d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),t.base64url=T?{encode($){return n($),$.toBase64({alphabet:"base64url"})},decode($){return _($,!0)}}:d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),p(6),f("")),t.base64urlnopad=d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const N=$=>d(b(58),u($),f(""));t.base58=N("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=N("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=N("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const D=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode($){let X="";for(let ee=0;ee<$.length;ee+=8){const ne=$.subarray(ee,ee+8);X+=t.base58.encode(ne).padStart(D[ne.length],"1")}return X},decode($){let X=[];for(let ee=0;ee<$.length;ee+=11){const ne=$.slice(ee,ee+11),Y=D.indexOf(ne.length),J=t.base58.decode(ne);for(let q=0;q<J.length-Y;q++)if(J[q]!==0)throw new Error("base58xmr: wrong padding");X=X.concat(Array.from(J.slice(J.length-Y)))}return Uint8Array.from(X)}};const U=$=>d(B(4,X=>$($(X))),t.base58);t.createBase58check=U,t.base58check=t.createBase58check;const L=d(u("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),k=[996825010,642813549,513874426,1027748829,705979059];function C($){const X=$>>25;let ee=($&33554431)<<5;for(let ne=0;ne<k.length;ne++)(X>>ne&1)===1&&(ee^=k[ne]);return ee}function P($,X,ee=1){const ne=$.length;let Y=1;for(let J=0;J<ne;J++){const q=$.charCodeAt(J);if(q<33||q>126)throw new Error(`Invalid prefix (${$})`);Y=C(Y)^q>>5}Y=C(Y);for(let J=0;J<ne;J++)Y=C(Y)^$.charCodeAt(J)&31;for(let J of X)Y=C(Y)^J;for(let J=0;J<6;J++)Y=C(Y);return Y^=ee,L.encode(y([Y%E[30]],30,5,!1))}function A($){const X=$==="bech32"?1:734539939,ee=S(5),ne=ee.decode,Y=ee.encode,J=v(ne);function q(Q,te,ie=90){s("bech32.encode prefix",Q),e(te)&&(te=Array.from(te)),l("bech32.encode",te);const se=Q.length;if(se===0)throw new TypeError(`Invalid prefix length ${se}`);const ce=se+7+te.length;if(ie!==!1&&ce>ie)throw new TypeError(`Length ${ce} exceeds limit ${ie}`);const oe=Q.toLowerCase(),ue=P(oe,te,X);return`${oe}1${L.encode(te)}${ue}`}function K(Q,te=90){s("bech32.decode input",Q);const ie=Q.length;if(ie<8||te!==!1&&ie>te)throw new TypeError(`invalid string length: ${ie} (${Q}). Expected (8..${te})`);const se=Q.toLowerCase();if(Q!==se&&Q!==Q.toUpperCase())throw new Error("String must be lowercase or uppercase");const ce=se.lastIndexOf("1");if(ce===0||ce===-1)throw new Error('Letter "1" must be present between prefix and data only');const oe=se.slice(0,ce),ue=se.slice(ce+1);if(ue.length<6)throw new Error("Data must be at least 6 characters long");const we=L.decode(ue).slice(0,-6),me=P(oe,we,X);if(!ue.endsWith(me))throw new Error(`Invalid checksum in ${Q}: expected "${me}"`);return{prefix:oe,words:we}}const W=v(K);function H(Q){const{prefix:te,words:ie}=K(Q,!1);return{prefix:te,words:ie,bytes:ne(ie)}}function V(Q,te){return q(Q,Y(te))}return{encode:q,decode:K,encodeFromBytes:V,decodeToBytes:H,decodeUnsafe:W,fromWords:ne,fromWordsUnsafe:J,toWords:Y}}t.bech32=A("bech32"),t.bech32m=A("bech32m"),t.utf8={encode:$=>new TextDecoder().decode($),decode:$=>new TextEncoder().encode($)};const x=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",I={encode($){return n($),$.toHex()},decode($){return s("hex",$),Uint8Array.fromHex($)}};t.hex=x?I:d(S(4),u("0123456789abcdef"),f(""),m($=>{if(typeof $!="string"||$.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof $} with length ${$.length}`);return $.toLowerCase()}));const R={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},O="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",M=($,X)=>{if(typeof $!="string"||!R.hasOwnProperty($))throw new TypeError(O);if(!e(X))throw new TypeError("bytesToString() expects Uint8Array");return R[$].encode(X)};t.bytesToString=M,t.str=t.bytesToString;const z=($,X)=>{if(!R.hasOwnProperty($))throw new TypeError(O);if(typeof X!="string")throw new TypeError("stringToBytes() expects string");return R[$].decode(X)};t.stringToBytes=z,t.bytes=t.stringToBytes})(pg)),pg}var xo={},Zr={},ur={},FS;function mg(){if(FS)return ur;FS=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.HashMD=ur.Maj=ur.Chi=void 0,ur.setBigUint64=n;const t=hg(),e=lr();function n(o,a,c,l){if(typeof o.setBigUint64=="function")return o.setBigUint64(a,c,l);const d=BigInt(32),u=BigInt(4294967295),f=Number(c>>d&u),p=Number(c&u),m=l?4:0,h=l?0:4;o.setUint32(a+m,f,l),o.setUint32(a+h,p,l)}const r=(o,a,c)=>o&a^~o&c;ur.Chi=r;const i=(o,a,c)=>o&a^o&c^a&c;ur.Maj=i;class s extends e.Hash{constructor(a,c,l,d){super(),this.blockLen=a,this.outputLen=c,this.padOffset=l,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(a),this.view=(0,e.createView)(this.buffer)}update(a){(0,t.aexists)(this);const{view:c,buffer:l,blockLen:d}=this;a=(0,e.toBytes)(a);const u=a.length;for(let f=0;f<u;){const p=Math.min(d-this.pos,u-f);if(p===d){const m=(0,e.createView)(a);for(;d<=u-f;f+=d)this.process(m,f);continue}l.set(a.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===d&&(this.process(c,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){(0,t.aexists)(this),(0,t.aoutput)(a,this),this.finished=!0;const{buffer:c,view:l,blockLen:d,isLE:u}=this;let{pos:f}=this;c[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>d-f&&(this.process(l,0),f=0);for(let w=f;w<d;w++)c[w]=0;n(l,d-8,BigInt(this.length*8),u),this.process(l,0);const p=(0,e.createView)(a),m=this.outputLen;if(m%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=m/4,g=this.get();if(h>g.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<h;w++)p.setUint32(4*w,g[w],u)}digest(){const{buffer:a,outputLen:c}=this;this.digestInto(a);const l=a.slice(0,c);return this.destroy(),l}_cloneInto(a){a||(a=new this.constructor),a.set(...this.get());const{blockLen:c,buffer:l,length:d,finished:u,destroyed:f,pos:p}=this;return a.length=d,a.pos=p,a.finished=u,a.destroyed=f,d%c&&a.buffer.set(l),a}}return ur.HashMD=s,ur}var $S;function jS(){if($S)return Zr;$S=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.sha224=Zr.sha256=Zr.SHA256=void 0;const t=mg(),e=lr(),n=new Uint32Array([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]),r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class s extends t.HashMD{constructor(){super(64,32,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0,this.F=r[5]|0,this.G=r[6]|0,this.H=r[7]|0}get(){const{A:c,B:l,C:d,D:u,E:f,F:p,G:m,H:h}=this;return[c,l,d,u,f,p,m,h]}set(c,l,d,u,f,p,m,h){this.A=c|0,this.B=l|0,this.C=d|0,this.D=u|0,this.E=f|0,this.F=p|0,this.G=m|0,this.H=h|0}process(c,l){for(let E=0;E<16;E++,l+=4)i[E]=c.getUint32(l,!1);for(let E=16;E<64;E++){const y=i[E-15],b=i[E-2],S=(0,e.rotr)(y,7)^(0,e.rotr)(y,18)^y>>>3,v=(0,e.rotr)(b,17)^(0,e.rotr)(b,19)^b>>>10;i[E]=v+i[E-7]+S+i[E-16]|0}let{A:d,B:u,C:f,D:p,E:m,F:h,G:g,H:w}=this;for(let E=0;E<64;E++){const y=(0,e.rotr)(m,6)^(0,e.rotr)(m,11)^(0,e.rotr)(m,25),b=w+y+(0,t.Chi)(m,h,g)+n[E]+i[E]|0,v=((0,e.rotr)(d,2)^(0,e.rotr)(d,13)^(0,e.rotr)(d,22))+(0,t.Maj)(d,u,f)|0;w=g,g=h,h=m,m=p+b|0,p=f,f=u,u=d,d=b+v|0}d=d+this.A|0,u=u+this.B|0,f=f+this.C|0,p=p+this.D|0,m=m+this.E|0,h=h+this.F|0,g=g+this.G|0,w=w+this.H|0,this.set(d,u,f,p,m,h,g,w)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}Zr.SHA256=s;class o extends s{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Zr.sha256=(0,e.wrapConstructor)(()=>new s),Zr.sha224=(0,e.wrapConstructor)(()=>new o),Zr}var Qa={},xf={},qS;function qP(){if(qS)return xf;qS=1,Object.defineProperty(xf,"__esModule",{value:!0});function t(e){return Array.isArray(e)?new Uint8Array(e):e}return xf.default=t,xf}var HS;function wg(){if(HS)return Qa;HS=1;var t=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});const e=t(qP());function n(r){function i(s){return r((0,e.default)(s))}return i.create=()=>{const s=r.create();return{update(o){return s.update((0,e.default)(o)),this},digest(){return s.digest()}}},i}return Qa.default=n,Qa}var VS;function zS(){if(VS)return xo;VS=1;var t=xo&&xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xo,"__esModule",{value:!0}),xo.sha256=void 0;const e=jS(),n=t(wg());return xo.sha256=(0,n.default)(e.sha256),xo}var To={},WS;function HP(){if(WS)return To;WS=1,Object.defineProperty(To,"__esModule",{value:!0}),To.concatArgs=To.arrayEqual=void 0;function t(r,i){return r.length!==i.length?!1:r.every((s,o)=>s===i[o])}To.arrayEqual=t;function e(r){return typeof r=="number"}function n(...r){return r.flatMap(i=>e(i)?[i]:Array.from(i))}return To.concatArgs=n,To}var KS;function VP(){if(KS)return Ke;KS=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.isValidClassicAddress=Ke.decodeAccountPublic=Ke.encodeAccountPublic=Ke.encodeNodePublic=Ke.decodeNodePublic=Ke.decodeAddress=Ke.decodeAccountID=Ke.encodeAddress=Ke.encodeAccountID=Ke.decodeSeed=Ke.encodeSeed=Ke.codec=void 0;const t=gg(),e=zS(),n=HP();class r{constructor(v){this._sha256=v.sha256,this._codec=t.base58xrp}encode(v,B){const T=B.versions;return this._encodeVersioned(v,T,B.expectedLength)}decode(v,B){var T;const _=B.versions,N=B.versionTypes,D=this.decodeChecked(v);if(_.length>1&&!B.expectedLength)throw new Error("expectedLength is required because there are >= 2 possible versions");const U=typeof _[0]=="number"?1:_[0].length,L=(T=B.expectedLength)!==null&&T!==void 0?T:D.length-U,k=D.slice(0,-L),C=D.slice(-L);for(let P=0;P<_.length;P++){const A=Array.isArray(_[P])?_[P]:[_[P]];if((0,n.arrayEqual)(k,A))return{version:A,bytes:C,type:N?N[P]:null}}throw new Error("version_invalid: version bytes do not match any of the provided version(s)")}encodeChecked(v){const B=this._sha256(this._sha256(v)).slice(0,4);return this._encodeRaw(Uint8Array.from((0,n.concatArgs)(v,B)))}decodeChecked(v){const B=this._decodeRaw(v);if(B.byteLength<5)throw new Error("invalid_input_size: decoded data must have length >= 5");if(!this._verifyCheckSum(B))throw new Error("checksum_invalid");return B.slice(0,-4)}_encodeVersioned(v,B,T){if(!b(v,T))throw new Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Uint8Array.");return this.encodeChecked((0,n.concatArgs)(B,v))}_encodeRaw(v){return this._codec.encode(Uint8Array.from(v))}_decodeRaw(v){return this._codec.decode(v)}_verifyCheckSum(v){const B=this._sha256(this._sha256(v.slice(0,-4))).slice(0,4),T=v.slice(-4);return(0,n.arrayEqual)(B,T)}}const i=0,s=35,o=33,a=28,c=[1,225,75],l={sha256:e.sha256},d=new r(l);Ke.codec=d;function u(S,v){if(!b(S,16))throw new Error("entropy must have length 16");const B={expectedLength:16,versions:v==="ed25519"?c:[o]};return d.encode(S,B)}Ke.encodeSeed=u;function f(S,v={versionTypes:["ed25519","secp256k1"],versions:[c,o],expectedLength:16}){return d.decode(S,v)}Ke.decodeSeed=f;function p(S){const v={versions:[i],expectedLength:20};return d.encode(S,v)}Ke.encodeAccountID=p,Ke.encodeAddress=p;function m(S){const v={versions:[i],expectedLength:20};return d.decode(S,v).bytes}Ke.decodeAccountID=m,Ke.decodeAddress=m;function h(S){const v={versions:[a],expectedLength:33};return d.decode(S,v).bytes}Ke.decodeNodePublic=h;function g(S){const v={versions:[a],expectedLength:33};return d.encode(S,v)}Ke.encodeNodePublic=g;function w(S){const v={versions:[s],expectedLength:33};return d.encode(S,v)}Ke.encodeAccountPublic=w;function E(S){const v={versions:[s],expectedLength:33};return d.decode(S,v).bytes}Ke.decodeAccountPublic=E;function y(S){try{m(S)}catch{return!1}return!0}Ke.isValidClassicAddress=y;function b(S,v){return"byteLength"in S?S.byteLength===v:S.length===v}return Ke}var GS;function yn(){return GS||(GS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isValidXAddress=t.decodeXAddress=t.xAddressToClassicAddress=t.encodeXAddress=t.classicAddressToXAddress=t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.decodeNodePublic=t.encodeNodePublic=t.decodeAccountID=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const e=$e(),n=VP();Object.defineProperty(t,"codec",{enumerable:!0,get:function(){return n.codec}}),Object.defineProperty(t,"encodeSeed",{enumerable:!0,get:function(){return n.encodeSeed}}),Object.defineProperty(t,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}}),Object.defineProperty(t,"encodeAccountID",{enumerable:!0,get:function(){return n.encodeAccountID}}),Object.defineProperty(t,"decodeAccountID",{enumerable:!0,get:function(){return n.decodeAccountID}}),Object.defineProperty(t,"encodeNodePublic",{enumerable:!0,get:function(){return n.encodeNodePublic}}),Object.defineProperty(t,"decodeNodePublic",{enumerable:!0,get:function(){return n.decodeNodePublic}}),Object.defineProperty(t,"encodeAccountPublic",{enumerable:!0,get:function(){return n.encodeAccountPublic}}),Object.defineProperty(t,"decodeAccountPublic",{enumerable:!0,get:function(){return n.decodeAccountPublic}}),Object.defineProperty(t,"isValidClassicAddress",{enumerable:!0,get:function(){return n.isValidClassicAddress}});const r={main:Uint8Array.from([5,68]),test:Uint8Array.from([4,147])},i=4294967295;function s(f,p,m){const h=(0,n.decodeAccountID)(f);return o(h,p,m)}t.classicAddressToXAddress=s;function o(f,p,m){if(f.length!==20)throw new Error("Account ID must be 20 bytes");if(p!==!1&&p>i)throw new Error("Invalid tag");const h=p||0,g=p===!1||p==null?0:1,w=(0,e.concat)([m?r.test:r.main,f,Uint8Array.from([g,h&255,h>>8&255,h>>16&255,h>>24&255,0,0,0,0])]);return n.codec.encodeChecked(w)}t.encodeXAddress=o;function a(f){const{accountId:p,tag:m,test:h}=c(f);return{classicAddress:(0,n.encodeAccountID)(p),tag:m,test:h}}t.xAddressToClassicAddress=a;function c(f){const p=n.codec.decodeChecked(f),m=l(p),h=p.slice(2,22),g=d(p);return{accountId:h,tag:g,test:m}}t.decodeXAddress=c;function l(f){const p=f.slice(0,2);if((0,e.equal)(r.main,p))return!1;if((0,e.equal)(r.test,p))return!0;throw new Error("Invalid X-address: bad prefix")}function d(f){const p=f[22];if(p>=2)throw new Error("Unsupported X-address");if(p===1)return f[23]+f[24]*256+f[25]*65536+f[26]*16777216;if(p!==0)throw new Error("flag must be zero to indicate no tag");if(!(0,e.equal)((0,e.hexToBytes)("0000000000000000"),f.slice(23,31)))throw new Error("remaining bytes must be zero");return!1}function u(f){try{c(f)}catch{return!1}return!0}t.isValidXAddress=u})(dg)),dg}var yg={},ei={},gl={};const zP={FIELDS:JSON.parse('[["Generic",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":0,"type":"Unknown"}],["Invalid",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":-1,"type":"Unknown"}],["ObjectEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STObject"}],["ArrayEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STArray"}],["taker_gets_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Amount"}],["taker_pays_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":259,"type":"Amount"}],["LedgerEntryType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt16"}],["TransactionType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt16"}],["SignerWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt16"}],["TransferFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt16"}],["TradingFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt16"}],["DiscountedFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt16"}],["Version",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt16"}],["HookStateChangeCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt16"}],["HookEmitCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt16"}],["HookExecutionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt16"}],["HookApiVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt16"}],["LedgerFixType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt16"}],["ManagementFeeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt16"}],["NetworkID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt32"}],["Flags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt32"}],["SourceTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt32"}],["Sequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt32"}],["PreviousTxnLgrSeq",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt32"}],["LedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt32"}],["CloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt32"}],["ParentCloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt32"}],["SigningTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt32"}],["Expiration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt32"}],["TransferRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt32"}],["WalletSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt32"}],["OwnerCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt32"}],["DestinationTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"UInt32"}],["LastUpdateTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"UInt32"}],["HighQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt32"}],["HighQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt32"}],["LowQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt32"}],["LowQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt32"}],["QualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt32"}],["QualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt32"}],["StampEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt32"}],["BondAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt32"}],["LoadFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt32"}],["OfferSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt32"}],["FirstLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt32"}],["LastLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt32"}],["TransactionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt32"}],["OperationLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt32"}],["ReferenceFeeUnits",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt32"}],["ReserveBase",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt32"}],["ReserveIncrement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"UInt32"}],["SetFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"UInt32"}],["ClearFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"UInt32"}],["SignerQuorum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"UInt32"}],["CancelAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"UInt32"}],["FinishAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"UInt32"}],["SignerListID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"UInt32"}],["SettleDelay",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"UInt32"}],["TicketCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":40,"type":"UInt32"}],["TicketSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":41,"type":"UInt32"}],["NFTokenTaxon",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":42,"type":"UInt32"}],["MintedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":43,"type":"UInt32"}],["BurnedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":44,"type":"UInt32"}],["HookStateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":45,"type":"UInt32"}],["EmitGeneration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":46,"type":"UInt32"}],["VoteWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":48,"type":"UInt32"}],["FirstNFTokenSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":50,"type":"UInt32"}],["OracleDocumentID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":51,"type":"UInt32"}],["PermissionValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":52,"type":"UInt32"}],["MutableFlags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":53,"type":"UInt32"}],["StartDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":54,"type":"UInt32"}],["PaymentInterval",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":55,"type":"UInt32"}],["GracePeriod",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":56,"type":"UInt32"}],["PreviousPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":57,"type":"UInt32"}],["NextPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":58,"type":"UInt32"}],["PaymentRemaining",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":59,"type":"UInt32"}],["PaymentTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":60,"type":"UInt32"}],["LoanSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":61,"type":"UInt32"}],["CoverRateMinimum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":62,"type":"UInt32"}],["CoverRateLiquidation",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":63,"type":"UInt32"}],["OverpaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":64,"type":"UInt32"}],["InterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":65,"type":"UInt32"}],["LateInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":66,"type":"UInt32"}],["CloseInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":67,"type":"UInt32"}],["OverpaymentInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":68,"type":"UInt32"}],["IndexNext",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt64"}],["IndexPrevious",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt64"}],["BookNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt64"}],["OwnerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt64"}],["BaseFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt64"}],["ExchangeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt64"}],["LowNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt64"}],["HighNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt64"}],["DestinationNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt64"}],["Cookie",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt64"}],["ServerVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt64"}],["NFTokenOfferNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt64"}],["EmitBurden",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt64"}],["HookOn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt64"}],["HookInstructionCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt64"}],["HookReturnCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt64"}],["ReferenceCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt64"}],["XChainClaimID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt64"}],["XChainAccountCreateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt64"}],["XChainAccountClaimCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt64"}],["AssetPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt64"}],["MaximumAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt64"}],["OutstandingAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt64"}],["MPTAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt64"}],["IssuerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt64"}],["SubjectNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt64"}],["LockedAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt64"}],["VaultNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt64"}],["LoanBrokerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt64"}],["EmailHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash128"}],["LedgerHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash256"}],["ParentHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash256"}],["TransactionHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash256"}],["AccountHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash256"}],["PreviousTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Hash256"}],["LedgerIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Hash256"}],["WalletLocator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Hash256"}],["RootIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Hash256"}],["AccountTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Hash256"}],["NFTokenID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Hash256"}],["EmitParentTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Hash256"}],["EmitNonce",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Hash256"}],["EmitHookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Hash256"}],["AMMID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Hash256"}],["BookDirectory",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Hash256"}],["InvoiceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Hash256"}],["Nickname",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Hash256"}],["Amendment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Hash256"}],["Digest",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"Hash256"}],["Channel",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Hash256"}],["ConsensusHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Hash256"}],["CheckID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Hash256"}],["ValidatedHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Hash256"}],["PreviousPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Hash256"}],["NextPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Hash256"}],["NFTokenBuyOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Hash256"}],["NFTokenSellOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Hash256"}],["HookStateKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Hash256"}],["HookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Hash256"}],["HookNamespace",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"Hash256"}],["HookSetTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"Hash256"}],["DomainID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"Hash256"}],["VaultID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"Hash256"}],["ParentBatchID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"Hash256"}],["LoanBrokerID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"Hash256"}],["LoanID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"Hash256"}],["hash",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Hash256"}],["index",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Hash256"}],["Amount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Amount"}],["Balance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Amount"}],["LimitAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Amount"}],["TakerPays",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Amount"}],["TakerGets",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Amount"}],["LowLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Amount"}],["HighLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Amount"}],["Fee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Amount"}],["SendMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Amount"}],["DeliverMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Amount"}],["Amount2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Amount"}],["BidMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Amount"}],["BidMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Amount"}],["MinimumOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Amount"}],["RippleEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Amount"}],["DeliveredAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Amount"}],["NFTokenBrokerFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Amount"}],["BaseFeeDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Amount"}],["ReserveBaseDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Amount"}],["ReserveIncrementDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Amount"}],["LPTokenOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Amount"}],["LPTokenIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Amount"}],["EPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Amount"}],["Price",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Amount"}],["SignatureReward",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Amount"}],["MinAccountCreateAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Amount"}],["LPTokenBalance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Amount"}],["PublicKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Blob"}],["MessageKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Blob"}],["SigningPubKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Blob"}],["TxnSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":4,"type":"Blob"}],["URI",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Blob"}],["Signature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":6,"type":"Blob"}],["Domain",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":7,"type":"Blob"}],["FundCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"Blob"}],["RemoveCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"Blob"}],["ExpireCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"Blob"}],["CreateCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"Blob"}],["MemoType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"Blob"}],["MemoData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":13,"type":"Blob"}],["MemoFormat",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":14,"type":"Blob"}],["Fulfillment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"Blob"}],["Condition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":17,"type":"Blob"}],["MasterSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":18,"type":"Blob"}],["UNLModifyValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"Blob"}],["ValidatorToDisable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"Blob"}],["ValidatorToReEnable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"Blob"}],["HookStateData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"Blob"}],["HookReturnString",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"Blob"}],["HookParameterName",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"Blob"}],["HookParameterValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"Blob"}],["DIDDocument",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"Blob"}],["Data",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":27,"type":"Blob"}],["AssetClass",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":28,"type":"Blob"}],["Provider",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":29,"type":"Blob"}],["MPTokenMetadata",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":30,"type":"Blob"}],["CredentialType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":31,"type":"Blob"}],["Account",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"AccountID"}],["Owner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"AccountID"}],["Destination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"AccountID"}],["Issuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"AccountID"}],["Authorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"AccountID"}],["Unauthorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":6,"type":"AccountID"}],["RegularKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"AccountID"}],["NFTokenMinter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"AccountID"}],["EmitCallback",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"AccountID"}],["Holder",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"AccountID"}],["Delegate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"AccountID"}],["HookAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"AccountID"}],["OtherChainSource",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":18,"type":"AccountID"}],["OtherChainDestination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"AccountID"}],["AttestationSignerAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"AccountID"}],["AttestationRewardAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"AccountID"}],["LockingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"AccountID"}],["IssuingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"AccountID"}],["Subject",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"AccountID"}],["Borrower",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"AccountID"}],["Counterparty",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"AccountID"}],["Number",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Number"}],["AssetsAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Number"}],["AssetsMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Number"}],["AssetsTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Number"}],["LossUnrealized",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Number"}],["DebtTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Number"}],["DebtMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Number"}],["CoverAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Number"}],["LoanOriginationFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Number"}],["LoanServiceFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Number"}],["LatePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Number"}],["ClosePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Number"}],["PrincipalOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Number"}],["PrincipalRequested",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Number"}],["TotalValueOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"Number"}],["PeriodicPayment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Number"}],["ManagementFeeOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Number"}],["LoanScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Int32"}],["TransactionMetaData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"STObject"}],["CreatedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"STObject"}],["DeletedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STObject"}],["ModifiedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STObject"}],["PreviousFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STObject"}],["FinalFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STObject"}],["NewFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STObject"}],["TemplateEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STObject"}],["Memo",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STObject"}],["SignerEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STObject"}],["NFToken",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STObject"}],["EmitDetails",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STObject"}],["Hook",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"STObject"}],["Permission",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"STObject"}],["Signer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STObject"}],["Majority",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STObject"}],["DisabledValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STObject"}],["EmittedTxn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STObject"}],["HookExecution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STObject"}],["HookDefinition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STObject"}],["HookParameter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"STObject"}],["HookGrant",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STObject"}],["VoteEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STObject"}],["AuctionSlot",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STObject"}],["AuthAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STObject"}],["XChainClaimProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STObject"}],["XChainCreateAccountProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STObject"}],["XChainClaimAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STObject"}],["XChainCreateAccountAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"STObject"}],["PriceData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"STObject"}],["Credential",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"STObject"}],["RawTransaction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"STObject"}],["BatchSigner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"STObject"}],["Book",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"STObject"}],["CounterpartySignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":37,"type":"STObject"}],["Signers",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":3,"type":"STArray"}],["SignerEntries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STArray"}],["Template",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STArray"}],["Necessary",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STArray"}],["Sufficient",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STArray"}],["AffectedNodes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STArray"}],["Memos",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STArray"}],["NFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STArray"}],["Hooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STArray"}],["VoteSlots",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STArray"}],["AdditionalBooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STArray"}],["Majorities",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STArray"}],["DisabledValidators",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"STArray"}],["HookExecutions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STArray"}],["HookParameters",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STArray"}],["HookGrants",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STArray"}],["XChainClaimAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STArray"}],["XChainCreateAccountAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STArray"}],["PriceDataSeries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STArray"}],["AuthAccounts",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STArray"}],["AuthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STArray"}],["UnauthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STArray"}],["AcceptedCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STArray"}],["Permissions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STArray"}],["RawTransactions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STArray"}],["BatchSigners",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":31,"type":"STArray"}],["CloseResolution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt8"}],["Method",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt8"}],["TransactionResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt8"}],["Scale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt8"}],["AssetScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt8"}],["TickSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt8"}],["UNLModifyDisabling",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt8"}],["HookResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt8"}],["WasLockingChainSend",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt8"}],["WithdrawalPolicy",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt8"}],["TakerPaysCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash160"}],["TakerPaysIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash160"}],["TakerGetsCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash160"}],["TakerGetsIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash160"}],["Paths",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"PathSet"}],["Indexes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Vector256"}],["Hashes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Vector256"}],["Amendments",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Vector256"}],["NFTokenOffers",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"Vector256"}],["CredentialIDs",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Vector256"}],["MPTokenIssuanceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash192"}],["ShareMPTID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash192"}],["LockingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Issue"}],["IssuingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Issue"}],["Asset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Issue"}],["Asset2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Issue"}],["XChainBridge",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"XChainBridge"}],["BaseAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Currency"}],["QuoteAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Currency"}],["Transaction",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Transaction"}],["LedgerEntry",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"LedgerEntry"}],["Validation",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Validation"}],["Metadata",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Metadata"}]]'),LEDGER_ENTRY_TYPES:{AMM:121,AccountRoot:97,Amendments:102,Bridge:105,Check:67,Credential:129,DID:73,Delegate:131,DepositPreauth:112,DirectoryNode:100,Escrow:117,FeeSettings:115,Invalid:-1,LedgerHashes:104,Loan:137,LoanBroker:136,MPToken:127,MPTokenIssuance:126,NFTokenOffer:55,NFTokenPage:80,NegativeUNL:78,Offer:111,Oracle:128,PayChannel:120,PermissionedDomain:130,RippleState:114,SignerList:83,Ticket:84,Vault:132,XChainOwnedClaimID:113,XChainOwnedCreateAccountClaimID:116},TRANSACTION_RESULTS:{tecAMM_ACCOUNT:168,tecAMM_BALANCE:163,tecAMM_EMPTY:166,tecAMM_FAILED:164,tecAMM_INVALID_TOKENS:165,tecAMM_NOT_EMPTY:167,tecARRAY_EMPTY:190,tecARRAY_TOO_LARGE:191,tecBAD_CREDENTIALS:193,tecCANT_ACCEPT_OWN_NFTOKEN_OFFER:158,tecCLAIM:100,tecCRYPTOCONDITION_ERROR:146,tecDIR_FULL:121,tecDST_TAG_NEEDED:143,tecDUPLICATE:149,tecEMPTY_DID:187,tecEXPIRED:148,tecFAILED_PROCESSING:105,tecFROZEN:137,tecHAS_OBLIGATIONS:151,tecHOOK_REJECTED:153,tecINCOMPLETE:169,tecINSUFFICIENT_FUNDS:159,tecINSUFFICIENT_PAYMENT:161,tecINSUFFICIENT_RESERVE:141,tecINSUFF_FEE:136,tecINSUF_RESERVE_LINE:122,tecINSUF_RESERVE_OFFER:123,tecINTERNAL:144,tecINVALID_UPDATE_TIME:188,tecINVARIANT_FAILED:147,tecKILLED:150,tecLIMIT_EXCEEDED:195,tecLOCKED:192,tecMAX_SEQUENCE_REACHED:154,tecNEED_MASTER_KEY:142,tecNFTOKEN_BUY_SELL_MISMATCH:156,tecNFTOKEN_OFFER_TYPE_MISMATCH:157,tecNO_ALTERNATIVE_KEY:130,tecNO_AUTH:134,tecNO_DELEGATE_PERMISSION:198,tecNO_DST:124,tecNO_DST_INSUF_XRP:125,tecNO_ENTRY:140,tecNO_ISSUER:133,tecNO_LINE:135,tecNO_LINE_INSUF_RESERVE:126,tecNO_LINE_REDUNDANT:127,tecNO_PERMISSION:139,tecNO_REGULAR_KEY:131,tecNO_SUITABLE_NFTOKEN_PAGE:155,tecNO_TARGET:138,tecOBJECT_NOT_FOUND:160,tecOVERSIZE:145,tecOWNERS:132,tecPATH_DRY:128,tecPATH_PARTIAL:101,tecPRECISION_LOSS:197,tecPSEUDO_ACCOUNT:196,tecTOKEN_PAIR_NOT_FOUND:189,tecTOO_SOON:152,tecUNFUNDED:129,tecUNFUNDED_ADD:102,tecUNFUNDED_AMM:162,tecUNFUNDED_OFFER:103,tecUNFUNDED_PAYMENT:104,tecWRONG_ASSET:194,tecXCHAIN_ACCOUNT_CREATE_PAST:181,tecXCHAIN_ACCOUNT_CREATE_TOO_MANY:182,tecXCHAIN_BAD_CLAIM_ID:172,tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR:185,tecXCHAIN_BAD_TRANSFER_ISSUE:170,tecXCHAIN_CLAIM_NO_QUORUM:173,tecXCHAIN_CREATE_ACCOUNT_DISABLED:186,tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE:175,tecXCHAIN_INSUFF_CREATE_AMOUNT:180,tecXCHAIN_NO_CLAIM_ID:171,tecXCHAIN_NO_SIGNERS_LIST:178,tecXCHAIN_PAYMENT_FAILED:183,tecXCHAIN_PROOF_UNKNOWN_KEY:174,tecXCHAIN_REWARD_MISMATCH:177,tecXCHAIN_SELF_COMMIT:184,tecXCHAIN_SENDING_ACCOUNT_MISMATCH:179,tecXCHAIN_WRONG_CHAIN:176,tefALREADY:-198,tefBAD_ADD_AUTH:-197,tefBAD_AUTH:-196,tefBAD_AUTH_MASTER:-183,tefBAD_LEDGER:-195,tefBAD_QUORUM:-185,tefBAD_SIGNATURE:-186,tefCREATED:-194,tefEXCEPTION:-193,tefFAILURE:-199,tefINTERNAL:-192,tefINVALID_LEDGER_FIX_TYPE:-178,tefINVARIANT_FAILED:-182,tefMASTER_DISABLED:-188,tefMAX_LEDGER:-187,tefNFTOKEN_IS_NOT_TRANSFERABLE:-179,tefNOT_MULTI_SIGNING:-184,tefNO_AUTH_REQUIRED:-191,tefNO_TICKET:-180,tefPAST_SEQ:-190,tefTOO_BIG:-181,tefWRONG_PRIOR:-189,telBAD_DOMAIN:-398,telBAD_PATH_COUNT:-397,telBAD_PUBLIC_KEY:-396,telCAN_NOT_QUEUE:-392,telCAN_NOT_QUEUE_BALANCE:-391,telCAN_NOT_QUEUE_BLOCKED:-389,telCAN_NOT_QUEUE_BLOCKS:-390,telCAN_NOT_QUEUE_FEE:-388,telCAN_NOT_QUEUE_FULL:-387,telENV_RPC_FAILED:-383,telFAILED_PROCESSING:-395,telINSUF_FEE_P:-394,telLOCAL_ERROR:-399,telNETWORK_ID_MAKES_TX_NON_CANONICAL:-384,telNO_DST_PARTIAL:-393,telREQUIRES_NETWORK_ID:-385,telWRONG_NETWORK:-386,temARRAY_EMPTY:-253,temARRAY_TOO_LARGE:-252,temBAD_AMM_TOKENS:-261,temBAD_AMOUNT:-298,temBAD_CURRENCY:-297,temBAD_EXPIRATION:-296,temBAD_FEE:-295,temBAD_ISSUER:-294,temBAD_LIMIT:-293,temBAD_NFTOKEN_TRANSFER_FEE:-262,temBAD_OFFER:-292,temBAD_PATH:-291,temBAD_PATH_LOOP:-290,temBAD_QUORUM:-271,temBAD_REGKEY:-289,temBAD_SEND_XRP_LIMIT:-288,temBAD_SEND_XRP_MAX:-287,temBAD_SEND_XRP_NO_DIRECT:-286,temBAD_SEND_XRP_PARTIAL:-285,temBAD_SEND_XRP_PATHS:-284,temBAD_SEQUENCE:-283,temBAD_SIGNATURE:-282,temBAD_SIGNER:-272,temBAD_SRC_ACCOUNT:-281,temBAD_TICK_SIZE:-269,temBAD_TRANSFER_FEE:-251,temBAD_TRANSFER_RATE:-280,temBAD_WEIGHT:-270,temCANNOT_PREAUTH_SELF:-267,temDISABLED:-273,temDST_IS_SRC:-279,temDST_NEEDED:-278,temEMPTY_DID:-254,temINVALID:-277,temINVALID_ACCOUNT_ID:-268,temINVALID_COUNT:-266,temINVALID_FLAG:-276,temINVALID_INNER_BATCH:-250,temMALFORMED:-299,temREDUNDANT:-275,temRIPPLE_EMPTY:-274,temSEQ_AND_TICKET:-263,temUNCERTAIN:-265,temUNKNOWN:-264,temXCHAIN_BAD_PROOF:-259,temXCHAIN_BRIDGE_BAD_ISSUES:-258,temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT:-256,temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT:-255,temXCHAIN_BRIDGE_NONDOOR_OWNER:-257,temXCHAIN_EQUAL_DOOR_ACCOUNTS:-260,terADDRESS_COLLISION:-86,terFUNDS_SPENT:-98,terINSUF_FEE_B:-97,terLAST:-91,terNO_ACCOUNT:-96,terNO_AMM:-87,terNO_AUTH:-95,terNO_DELEGATE_PERMISSION:-85,terNO_LINE:-94,terNO_RIPPLE:-90,terOWNERS:-93,terPRE_SEQ:-92,terPRE_TICKET:-88,terQUEUED:-89,terRETRY:-99,tesSUCCESS:0},TRANSACTION_TYPES:{AMMBid:39,AMMClawback:31,AMMCreate:35,AMMDelete:40,AMMDeposit:36,AMMVote:38,AMMWithdraw:37,AccountDelete:21,AccountSet:3,Batch:71,CheckCancel:18,CheckCash:17,CheckCreate:16,Clawback:30,CredentialAccept:59,CredentialCreate:58,CredentialDelete:60,DIDDelete:50,DIDSet:49,DelegateSet:64,DepositPreauth:19,EnableAmendment:100,EscrowCancel:4,EscrowCreate:1,EscrowFinish:2,Invalid:-1,LedgerStateFix:53,LoanBrokerCoverClawback:78,LoanBrokerCoverDeposit:76,LoanBrokerCoverWithdraw:77,LoanBrokerDelete:75,LoanBrokerSet:74,LoanDelete:81,LoanManage:82,LoanPay:84,LoanSet:80,MPTokenAuthorize:57,MPTokenIssuanceCreate:54,MPTokenIssuanceDestroy:55,MPTokenIssuanceSet:56,NFTokenAcceptOffer:29,NFTokenBurn:26,NFTokenCancelOffer:28,NFTokenCreateOffer:27,NFTokenMint:25,NFTokenModify:61,OfferCancel:8,OfferCreate:7,OracleDelete:52,OracleSet:51,Payment:0,PaymentChannelClaim:15,PaymentChannelCreate:13,PaymentChannelFund:14,PermissionedDomainDelete:63,PermissionedDomainSet:62,SetFee:101,SetRegularKey:5,SignerListSet:12,TicketCreate:10,TrustSet:20,UNLModify:102,VaultClawback:70,VaultCreate:65,VaultDelete:67,VaultDeposit:68,VaultSet:66,VaultWithdraw:69,XChainAccountCreateCommit:44,XChainAddAccountCreateAttestation:46,XChainAddClaimAttestation:45,XChainClaim:43,XChainCommit:42,XChainCreateBridge:48,XChainCreateClaimID:41,XChainModifyBridge:47},TYPES:{AccountID:8,Amount:6,Blob:7,Currency:26,Done:-1,Hash128:4,Hash160:17,Hash192:21,Hash256:5,Int32:10,Int64:11,Issue:24,LedgerEntry:10002,Metadata:10004,NotPresent:0,Number:9,PathSet:18,STArray:15,STObject:14,Transaction:10001,UInt16:1,UInt32:2,UInt384:22,UInt512:23,UInt64:3,UInt8:16,UInt96:20,Unknown:-2,Validation:10003,Vector256:19,XChainBridge:25}};var bg={},Io={},XS;function YS(){if(XS)return Io;XS=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.BytesLookup=Io.Bytes=void 0;class t{constructor(r,i,s){this.name=r,this.ordinal=i,this.ordinalWidth=s,this.bytes=new Uint8Array(s);for(let o=0;o<s;o++)this.bytes[s-o-1]=i>>>o*8&255}toJSON(){return this.name}toBytesSink(r){r.put(this.bytes)}toBytes(){return this.bytes}}Io.Bytes=t;class e{constructor(r,i){this.ordinalWidth=i,Object.entries(r).forEach(([s,o])=>{this.add(s,o)})}add(r,i){if(this[r])throw new SyntaxError(`Attempted to add a value with a duplicate name "${r}". This is not allowed because it is unclear how to decode.`);if(this[i.toString()])throw new SyntaxError(`Attempted to add a duplicate value under a different name (Given name: "${r}" and previous name: "${this[i.toString()]}. This is not allowed because it is unclear how to decode.
21
+ `;return typeof a=="function"&&a(null,g),g},Jp}var oS;function mP(){if(oS)return Ya;oS=1;const t=Qk(),e=hP(),n=pP(),r=gP();function i(s,o,a,c,l){const d=[].slice.call(arguments,1),u=d.length,f=typeof d[u-1]=="function";if(!f&&!t())throw new Error("Callback required as last argument");if(f){if(u<2)throw new Error("Too few arguments provided");u===2?(l=a,a=o,o=c=void 0):u===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(u<1)throw new Error("Too few arguments provided");return u===1?(a=o,o=c=void 0):u===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(p,m){try{const h=e.create(a,c);p(s(h,o,c))}catch(h){m(h)}})}try{const p=e.create(a,c);l(null,s(p,o,c))}catch(p){l(p)}}return Ya.create=e.create,Ya.toCanvas=i.bind(null,n.render),Ya.toDataURL=i.bind(null,n.renderToDataURL),Ya.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),Ya}var wP=mP();const yP=or(wP);let dl=0,aS="",cS="",lS="",uS="",dS="",fS="",vf=0;function hS(){if(typeof window>"u"||typeof document>"u"||(dl+=1,dl>1))return;aS=document.body.style.overflow,cS=document.body.style.paddingRight,lS=document.body.style.position,uS=document.body.style.top,dS=document.body.style.width,fS=document.documentElement.style.overscrollBehavior,vf=window.scrollY||document.documentElement.scrollTop||0;const t=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${vf}px`,document.body.style.width="100%",t>0&&(document.body.style.paddingRight=`${t}px`),document.documentElement.style.overscrollBehavior="contain"}function Zp(){typeof window>"u"||typeof document>"u"||dl===0||(dl-=1,!(dl>0)&&(document.body.style.overflow=aS,document.body.style.paddingRight=cS,document.body.style.position=lS,document.body.style.top=uS,document.body.style.width=dS,document.documentElement.style.overscrollBehavior=fS,window.scrollTo(0,vf),vf=0))}function eg(t,e){let n=5381;for(let r=0;r<e.length;r+=1)n=(n<<5)+n^e.charCodeAt(r);return`${t}-${(n>>>0).toString(36)}`}function tg(t,e){if(typeof document>"u")return;const n=`style[data-xwk-style="${t}"]`;let r=document.head.querySelector(n);r||(r=document.createElement("style"),r.dataset.xwkStyle=t,document.head.appendChild(r)),r.textContent!==e&&(r.textContent=e)}const qi=304,Ef="#111827",ng="#ffffff",pS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAPoAAAD6AG1e1JrAAALz0lEQVR4nO2diZcVxRXG/YNMQnCcMDgzaBKJSTQSzXKymT3xJOTEJdGcHEnkkOVkOUnYZGYIIHswiAhOwLAZEAURUAQEYVQGEAFhQGQZ6K6b+rrrvlfvzVuq31rtu3XOd97wXnd19b2/rq6qe7u57qbegEStq+ua3QCRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgAEAkAIgFAJACIBACRACASAEQCgEgA6OrLqnt2ruzfmt1OAaAG6uzNOnZsT0CfmBXQDTMDGjU9oI9OC+j6qQF9ZFos/I3v8Bu2wbbYp9OA0unB+QgADuqC0+Fw/dn2WOzUdv15yz8DuntxSBNXh/ToxpD+vlVR70uK5u6Mhb/xHX7DNtgW+7SbOlDXWFN3lwfnKQDkO74vvlrhqFEzAhqnr9ofrAhp+ouK1g8oentI0eVrRIrKF2yDbY8MxfvO2KaiulAneggco/NDdKtINQDshNHa6e262/728pAe36Xo0BmisIi3lYp/C6DQyHyniuyD3w7rOufrur+jj4FjfXxGbhvSqlQCwFcgHN+h79UPrQ1p6xGiq+FIxxUDwaUU2v+aPsa2QaKH9TExTgAI3AM12y4tAQDuw7gC0RXf1x/SqydGOq3YlVxNUQVgwLHv/09IbXrgeOOsuG3Nts+HFgCMxHGlfWw6BnQBrT+cvacXck49iw0ZPjYMEN29JB4joCdI06whFQDA8ejqMUX7/XOKhi5nHd9Av48oODaDd0636Q+6bWgj2pqWsYH3AMCQN+ru/mY9LXvm4EjD+1BCC8R+3Ua0FW1OAwReA4B7Kq6oOxcF9Nq7WWNXWhgcHvXbyswEqgQBZe9JogmL4rb7Pi7wFoBuM8r/2rKQjp6PDRtU4J2gQqeqKo6Hcky3+RtPhNEswWcIvAQAXScMd8+/Qzr5QWzQJFe+KjATuHCFaI/uRZ45oGjeTkVTtyr68+ZY+Bvf4Tdsg23L1VeqcFtP6bbjHHiq2Gy7pgIAvudjUef0xWTOV5R7tb97gWj5XqXn7IruWGBWC2dmYwCYUUD8b/yGbe5YGET7YF/UUax+FwhwDt/SEPg6JvAOAGiMHkVvPxpb0LUbtmcE+08RTdmk6DPz4p4EQp0MWLdRJjJo/ZuPP8rshzpQF+rMQODYpmtmYWq17llGe9oLeAcA5tAIwmwYMACEJSycd7Xhvjt5YxjVgTk5T8cqMTzvhzqi+b3+DnUfO597zFKF4UU8wdfbgH8A9MXh2M/rLpuvuqLr+pS96lfuVzR+Xhg5C/XUcuDFdaFuHOOpfWrE8YtBidvImFnNt2tqAIB4HHDb/CCaUhWCgP958Wrc3UfdfJ2XY1H3GBMImrxBRce225Lv/GWvqWhcMbbX31iBlwDYEIzX9+A9J3INy59nLhHd+7SKBnLdDQrIdJrxAvIEfrxS0Zm8gSrfsZa8oqJ4RbSPB/ZMHQAMAcYDn54b0O53YsNyxO+UNjxmCuiWkbXT6LZxfoA9VeXxyoLdetA303/nNw0AzslzuWK7zJjgU3MC2nEsNvA77xN9s8pFFk4ZqyblC/uiDV9fFkZtQsF6QhLnc9pZswaIDQegyyzvIg+vzXFuzD3BrXPDKIWr2hU2OAaxfHTjUJT/VykEZtEKK5aPrIvn+2Mdnd9lsphgC9ikGRA0FABO4pi4KqQlryr6/gr3VbJOk9yJBRv0CJUai3uUcbNDmq6nZxD+rrZO5ChwONgZHL39956MbQGbNGOq2DAA0M1hsPab9YquBnF3+cEwEiqygzgXCKrpstn5qGPL29lRO7KJ8F01ECTJE+w2eQ0/71d0YdiMbbRNfqtt0+gxTUMA4BOevFFlFkeumU8kYP5ijYGgjifOzr9ZH+OFwWwbuB1I80IYtxoIktjiQQ3+JTON5BVDzCSmbIxt0aieoO4AcBbP7/RcncOtmUwe83lF0//ws/WDgJ2PVO/tR3OnbfbfGGR+ck79IOBe8KG1cZYy5dmCl5mRWDKqQRDUFQB0iziRP/5PZU+Qcgv/e1hD8Ov/1h4Cexbx8vGRzs+HYJeebmLa2V7j4A07/1ca9CtB7rnbtuDv/rRZRfGIeq9t1A2ALhN5g/OJSqdv8ffoCietrx0EvJh0q7WOUGoNn39Dsif2qVUEj53/yLrs+KeULTjYBNu11Xl2UBcAMEhDEAVXHYd0y0XQbAge3VB9F5izkpggm4i3QQYSIoHVQsDOxwCP7/XlmsG2Qj4BbkkdVUxTmwKArZ3H3cO6vEk0GNpU+WCI59e3PR7QviKxBBcIsO9n51cOAY9/ppjxj4vzbVvt0rart3/qBgBH9b6wMKA33nN3gj1WQBeYFIJu4/zPace9XiaaWKrwPgdPE92+IK4zycITOx9ZzPmDX5fjHtI2u3NhvL5Qz3FAXXsAvhIR2j1w2t0ZtrH+ssX9dsDOR0bPwQTQuTgDILc5Jnmy8zGQKzb4LXU8G7p6zwQaMg1EF4quNEl3bA+G/vZ8PCLuKvHQRbcZdCKDGM/xuR7H1SkDZ4kmLC6f6cszn79uKZ8zUOg4yIFA79UI5zcEABsCDKqSpHfbEEx9oTgEnD7+Re2gN8+61+9auK63hih6Kml0AQj4ySW08R9by898CtWP3AeMWxqZP9iwpWB7SvaKw5SMiw2BnVrFEETp49ohX1oS0JEh93q5btfCdQ6eI/ry0jimwRDYzscj6UTJnY+p5/gaTj29A4AhaDeLMjsrhKBnewwBjI6YPBzxlaUhHT3nXh+X4SCWa7FzD7/6rzA69jgTm0CbHttemfPrtfjkHQAMAWYHmN/uKLAsW6woa7vZO1TmdS+IxR9PkKjJm2BB5pdrQnpQa7jM4kwhpyH+j7A0v1am7yWV+T1JPfVefvYOABsCBF9eHHR3XuQks12fhgD59py3n8T5WIfHejych24bwajLRfL7SjkPmUD3LA+jV8zw90n236YvgFsaEIDyDgAbAqyUPX/E3YlcsFhSbE29UOFtEIF7wApBc3Tuvn5FF4eT14c2JHmEjM+xFiHoVAPAEIwxBtj8Vq6BXBzgOsXibZB/gBh8fv5BBMG0gH62Ohufd63XtQ0ofG7IReianT33Zvqg6UmhDAH+3jSQa6haFK4Kjp2oHQxHF5rHc0/w01WK3r+Su28tCp/Tc29StFbgg/O9AIAh6JgV59KtO5xrsGoKV3FeO/Qnq8pnHnWbRZx7V6rohQ9RO6pvRuZc8CYRHMcX53sDQAaCnvi5vLVv5BquIqObT7xN5EcrTfq443Iytv3hUyGdvVSDdph9nz1E0fl1eOR8rwCwIcDAqP9A5cbnfeBAvOPP1fn5ECBh872ETygXascaDTSueh9fHeMVAFCngQALRk/vVzmGTGJ0OO67TyZ3fj4EeC/gqQog4G1Xv04R0B09fj4e5h0ADAFSwLEsumKfOwT58/Nq387BD35gveFkgvUG3gYPrGJ1z1fnewsAQ3BTTxwVe2JveQj4txMXrKeGapBW1m2Wm+2nf1zagaeCo4dEPHa+1wBkIOiNw7xL9xSHgL87rh2EJ3RGV3nlF4MA6/+l3g+Q/1SwfQ6+ymsAIgOaT6y3L9ptIChgdLxICkGhWjs/A4F5qgmRwMECgae0PRWcGgBsQyLsixc2s/E5yRJhYISDC8Xpaw0BQLxrcRDlBqCgDQwCngq+ISVPBacKgBwI9FU45+XspYcEkLscMnVqDcEEK/MIJXoqeEa6nJ8qAGzDooudtC6MwsK3Lwidc/VqCQGOiWOjDZPMU8Fpc37qAGB1mSdrr58Wrxw2Y3ElimH0xG1I8lSwb0olAJEDqny5Qy2U+X+JmvCGkpYHQCQAiAQAkQAgEgBEAoBIABAJACIBQCQAiAQAkQAgEgBEAoBIABAJACIBQCQAiAQAkQAgEgBEAoBIABAJACIBoNUlALS4BIAWlwDQ4hIAWlwCQItLAGhxCQAtLgGgxSUAtLgEgBaXANDiEgBaXP8HtafgB6DpoQ0AAAAASUVORK5CYII=";let bP=0;class gS{constructor(e,n){this.lastFocusedElement=null,this.cachedStyleKey="",this.cachedStyle="",this.qrUri="",this.qrCopied=!1,this.qrLightMode=!1,this.availability={},this.offEvents=[],this.openHandlers=new Set,this.closeHandlers=new Set,this.connectHandlers=new Set,this.presentation=n,this.titleId=`xwk-title-${++bP}`,this.onDocumentKeyDown=r=>this.handleDocumentKeyDown(r),this.options={manager:e.manager,mount:e.mount,...wf(e)},this.offEvents.push(e.manager.on("qr",({adapterId:r,uri:i,deeplink:s})=>this.showQr(r,i,s)),e.manager.on("connecting",({adapterId:r,recovering:i})=>{i||this.setLoading(r)}),e.manager.on("connected",({adapterId:r,session:i})=>this.handleConnected(r,i??e.manager.getSession())),e.manager.on("error",({adapterId:r,error:i})=>this.setError(i,r)))}autoOpen(){this.open()}open(){if(this.activeGroupId=void 0,this.lastFocusedElement=document.activeElement instanceof HTMLElement?document.activeElement:null,this.renderView("list"),this.openHandlers.forEach(e=>e()),this.refreshAvailability(),this.pendingQr){const{adapterId:e,uri:n,deeplink:r}=this.pendingQr;this.pendingQr=void 0,this.showQr(e,n,r)}}close(e=!0,n=e,r=!0){document.removeEventListener("keydown",this.onDocumentKeyDown),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),e&&this.options.manager.cancelPendingConnection(),this.resetQrState();const i=this.root;if(!(i!=null&&i.isConnected)){this.root=void 0,this.presentation==="modal"&&Zp(),n&&this.restoreFocus(),e&&this.closeHandlers.forEach(o=>o());return}const s=()=>{this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=void 0),i.remove(),this.root===i&&(this.root=void 0),this.presentation==="modal"&&Zp(),n&&this.restoreFocus(),e&&this.closeHandlers.forEach(o=>o())};if(this.presentation==="inline"||!r||this.prefersReducedMotion()){s();return}i.dataset.xwkState="closing",this.closeTimer&&window.clearTimeout(this.closeTimer),this.closeTimer=window.setTimeout(s,190)}destroy(){this.options.manager.cancelPendingConnection(),this.close(!1,!1,!1),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),this.closeTimer&&window.clearTimeout(this.closeTimer),this.offEvents.splice(0).forEach(e=>e()),this.openHandlers.clear(),this.closeHandlers.clear(),this.connectHandlers.clear()}isOpen(){var e;return!!((e=this.root)!=null&&e.isConnected)}on(e,n){if(e==="connect"){const s=n;return this.connectHandlers.add(s),()=>{this.connectHandlers.delete(s)}}const r=e==="open"?this.openHandlers:this.closeHandlers,i=n;return r.add(i),()=>{r.delete(i)}}onClose(e){return this.on("close",e)}updateOptions(e){this.options={...this.options,mount:e.mount??this.options.mount,...wf(e)},this.activeGroupId=void 0}bind(){var e,n,r,i,s,o,a,c;(n=(e=this.root)==null?void 0:e.querySelector("[data-xwk-close]"))==null||n.addEventListener("click",()=>this.close()),(i=(r=this.root)==null?void 0:r.querySelector("[data-xwk-back]"))==null||i.addEventListener("click",()=>this.handleBack()),(o=(s=this.root)==null?void 0:s.querySelector("[data-xwk-copy]"))==null||o.addEventListener("click",()=>void this.copyQrUri()),(c=(a=this.root)==null?void 0:a.querySelector("[data-xwk-retry]"))==null||c.addEventListener("click",()=>void this.retryQrConnection()),this.bindGroupButtons(),this.bindWalletButtons(),this.focusInitialElement()}bindGroupButtons(){var e;(e=this.root)==null||e.querySelectorAll("[data-wallet-group-id]").forEach(n=>n.addEventListener("click",()=>{const r=n.dataset.walletGroupId;r&&this.showWalletGroup(r)}))}bindWalletButtons(){var e;(e=this.root)==null||e.querySelectorAll("[data-wallet-id]").forEach(n=>n.addEventListener("click",async()=>{const r=n.dataset.walletId;if(!r)return;const i=this.options.manager.getWallets().find(o=>o.id===r),s=this.options.manager.getAdapter(r);try{if(this.shouldDelegateToWalletConnectModal(i,s)){this.presentation==="modal"?this.close(!1,!1,!1):this.activeRequestAdapterId=r,await this.waitForPaint(),await this.options.manager.connect(r);return}this.setLoading(r),await this.waitForPaint(),await this.options.manager.connect(r)}catch{}}))}shouldDelegateToWalletConnectModal(e,n){return!!(this.isDefaultWalletConnectUiMode()&&(e==null?void 0:e.id)==="walletconnect"&&e.type==="walletconnect"&&n)}bindChrome(){var e,n,r,i,s,o,a,c,l,d;(n=(e=this.root)==null?void 0:e.querySelector("[data-xwk-close]"))==null||n.addEventListener("click",()=>this.close()),(i=(r=this.root)==null?void 0:r.querySelector("[data-xwk-back]"))==null||i.addEventListener("click",()=>this.handleBack()),(o=(s=this.root)==null?void 0:s.querySelector("[data-xwk-copy]"))==null||o.addEventListener("click",()=>void this.copyQrUri()),(c=(a=this.root)==null?void 0:a.querySelector("[data-xwk-qr-theme]"))==null||c.addEventListener("click",()=>this.toggleQrTheme()),(d=(l=this.root)==null?void 0:l.querySelector("[data-xwk-retry]"))==null||d.addEventListener("click",()=>void this.retryQrConnection()),this.focusInitialElement()}handleBack(){var n,r,i;const e=this.activeGroupId;if(((n=this.root)==null?void 0:n.dataset.xwkView)==="qr"&&e&&this.getGroups().some(s=>s.id===e)){this.options.manager.cancelPendingConnection(),this.resetQrState(),this.renderView("list",!1),this.showWalletGroup(e);return}(((r=this.root)==null?void 0:r.dataset.xwkView)==="qr"||((i=this.root)==null?void 0:i.dataset.xwkView)==="connect")&&this.options.manager.cancelPendingConnection(),this.showList()}async retryQrConnection(){var r,i;const e=(r=this.qrState)==null?void 0:r.adapterId;if(!e)return;const n=(i=this.root)==null?void 0:i.querySelector("[data-xwk-retry]");n&&(n.disabled=!0,n.classList.add("xwk-retrying"),n.innerHTML=`${this.refreshIcon()} ${this.escapeHtml(this.messages().retrying)}`);try{await this.waitForPaint(),this.setLoading(e),await this.waitForPaint(),await this.options.manager.connect(e)}catch{}}async copyQrUri(){var e;this.qrUri&&(await this.copyText(this.qrUri),this.qrCopied=!0,((e=this.qrState)==null?void 0:e.status)==="ready"&&(this.qrState={...this.qrState,copied:!0}),this.updateQrCopyButton(),this.qrCopyResetTimer&&window.clearTimeout(this.qrCopyResetTimer),this.qrCopyResetTimer=window.setTimeout(()=>{var n;this.qrCopied=!1,((n=this.qrState)==null?void 0:n.status)==="ready"&&(this.qrState={...this.qrState,copied:!1}),this.updateQrCopyButton()},1400))}toggleQrTheme(){var n,r;if(((n=this.qrState)==null?void 0:n.status)!=="ready")return;this.qrLightMode=!this.qrLightMode;const e=(r=this.root)==null?void 0:r.querySelector(".xwk-qr-code");e instanceof HTMLElement&&this.renderQr(e,this.qrState.uri),this.updateQrThemeButton()}async copyText(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{await navigator.clipboard.writeText(e);return}catch{}const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy")}finally{n.remove()}}resetQrState(){this.activeRequestAdapterId=void 0,this.qrCopyResetTimer&&(window.clearTimeout(this.qrCopyResetTimer),this.qrCopyResetTimer=void 0),this.qrUri="",this.qrCopied=!1,this.qrLightMode=!1,this.pendingQr=void 0,this.qrState=void 0}updateQrCopyButton(){var r,i;const e=(r=this.root)==null?void 0:r.querySelector("[data-xwk-copy]");if(!e)return;e.innerHTML=this.renderQrCopyButtonContent();const n=(i=this.root)==null?void 0:i.querySelector("[data-xwk-copy-live]");n&&(n.textContent=this.qrCopied?this.messages().qrUriCopied:"")}updateQrThemeButton(){var n;const e=(n=this.root)==null?void 0:n.querySelector("[data-xwk-qr-theme]");e&&(e.innerHTML=this.qrThemeIcon(),e.setAttribute("aria-label",this.qrLightMode?"Use dark QR":"Use light QR"),e.setAttribute("title",this.qrLightMode?"Use dark QR":"Use light QR"),e.setAttribute("aria-pressed",String(this.qrLightMode)))}renderView(e,n=!0){const r=this.pendingQr,i=this.activeRequestAdapterId;this.close(!1,!1,!1),this.pendingQr=r,this.activeRequestAdapterId=i,this.presentation==="modal"&&(this.removeExistingOverlays(),hS()),this.root=document.createElement("div"),this.root.className=this.presentation==="inline"?"xwk-overlay xwk-inline":"xwk-overlay",this.root.dataset.xwkView=e,this.root.dataset.xwkState=n?"opening":"open",this.root.innerHTML=this.renderShell(),(this.options.mount??document.body).appendChild(this.root),n&&window.requestAnimationFrame(()=>{var s;(s=this.root)!=null&&s.isConnected&&(this.root.dataset.xwkState="open")}),this.presentation==="modal"&&(this.root.addEventListener("click",s=>{s.target===this.root&&this.close()}),document.addEventListener("keydown",this.onDocumentKeyDown)),this.bind()}ensureMounted(e){var n;if(!((n=this.root)!=null&&n.isConnected)||!this.root.querySelector(".xwk-modal")){this.renderView(e);return}this.setView(e)}setView(e){this.root&&(this.root.dataset.xwkView=e),this.focusInitialElement()}handleDocumentKeyDown(e){var o;if(!((o=this.root)!=null&&o.isConnected))return;if(e.key==="Escape"){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const n=this.getFocusableElements();if(!n.length){e.preventDefault();return}const r=n[0],i=n[n.length-1],s=document.activeElement;if(e.shiftKey&&s===r){e.preventDefault(),i.focus();return}!e.shiftKey&&s===i&&(e.preventDefault(),r.focus())}focusInitialElement(){this.presentation!=="inline"&&window.setTimeout(()=>{var e,n;(e=this.root)!=null&&e.isConnected&&((n=this.root.querySelector(".xwk-modal"))==null||n.focus({preventScroll:!0}))},0)}restoreFocus(){var e;(e=this.lastFocusedElement)!=null&&e.isConnected&&(this.lastFocusedElement.focus({preventScroll:!0}),this.lastFocusedElement=null)}getFocusableElements(){if(!this.root)return[];const e=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(this.root.querySelectorAll(e)).filter(n=>n.offsetParent!==null&&!n.classList.contains("xwk-hidden"))}removeExistingOverlays(){(this.options.mount??document.body).querySelectorAll(".xwk-overlay").forEach(n=>n.remove())}prefersReducedMotion(){var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)}getGroups(){var n;if(this.options.walletConnectUiMode!=="group")return[];if((n=this.options.groups)!=null&&n.length)return this.options.groups;const e=this.getWallets().filter(r=>r.group==="WalletConnect").map(r=>r.id);return e.length?[{id:"walletconnect",name:"WalletConnect",icon:pS,walletIds:e,maxPreviewIcons:5}]:[]}getWallets(){const e=this.options.manager.getWallets(),n=this.options.wallets;if(!(n!=null&&n.length))return e;const r=new Map(e.map(i=>[i.id,i]));return n.map(i=>r.get(i)).filter(i=>!!i)}getGroupWallets(e){const n=new Map(this.getWallets().map(r=>[r.id,r]));return e.walletIds.map(r=>n.get(r)).filter(r=>!!r)}getUngroupedWallets(e){const n=new Set(e.flatMap(r=>r.walletIds));return this.getWallets().filter(r=>!n.has(r.id))}async refreshAvailability(){var i;if(this.availability=await this.options.manager.getWalletAvailability(),((i=this.root)==null?void 0:i.dataset.xwkView)!=="list")return;const e=this.root.querySelector(".xwk-grid");if(!e)return;const n=this.options.layout??"list",r=this.activeGroupId?this.getGroups().find(s=>s.id===this.activeGroupId):void 0;e.innerHTML=r?this.getGroupWallets(r).map(s=>this.renderWallet(s,n)).join(""):this.renderWalletList(n),this.bindGroupButtons(),this.bindWalletButtons()}showList(){var r,i,s,o,a,c,l,d,u,f,p;if(this.activeGroupId=void 0,this.resetQrState(),!((r=this.root)!=null&&r.querySelector(".xwk-list"))){this.renderView("list",!1);return}this.ensureMounted("list"),(s=(i=this.root)==null?void 0:i.querySelector(".xwk-list"))==null||s.classList.remove("xwk-hidden"),(a=(o=this.root)==null?void 0:o.querySelector(".xwk-qr"))==null||a.classList.add("xwk-hidden"),(l=(c=this.root)==null?void 0:c.querySelector(".xwk-connect"))==null||l.classList.add("xwk-hidden"),(u=(d=this.root)==null?void 0:d.querySelector("[data-xwk-back]"))==null||u.classList.add("xwk-hidden");const e=(f=this.root)==null?void 0:f.querySelector(".xwk-title");e&&(e.textContent=this.options.title??this.messages().connectWallet);const n=(p=this.root)==null?void 0:p.querySelector(".xwk-grid");n&&(n.innerHTML=this.renderWalletList(this.options.layout??"list")),this.bindGroupButtons(),this.bindWalletButtons()}showWalletGroup(e){var s,o,a,c;const n=this.getGroups().find(l=>l.id===e);if(!n||!this.root)return;this.resetQrState(),this.activeGroupId=e,this.ensureMounted("list"),(s=this.root.querySelector(".xwk-list"))==null||s.classList.remove("xwk-hidden"),(o=this.root.querySelector(".xwk-qr"))==null||o.classList.add("xwk-hidden"),(a=this.root.querySelector(".xwk-connect"))==null||a.classList.add("xwk-hidden"),(c=this.root.querySelector("[data-xwk-back]"))==null||c.classList.remove("xwk-hidden");const r=this.root.querySelector(".xwk-title");r&&(r.textContent=n.name);const i=this.root.querySelector(".xwk-grid");i&&(i.innerHTML=this.getGroupWallets(n).map(l=>this.renderWallet(l,this.options.layout??"list")).join("")),this.bindWalletButtons()}showQr(e,n,r){var o;if(this.isStaleAdapterEvent(e))return;if(!this.root){this.pendingQr={adapterId:e,uri:n,deeplink:r};return}this.qrUri=n;const i=this.options.manager.getWallets().find(a=>a.id===e);this.qrCopied=!1,this.qrLightMode=!1,this.qrState={status:"ready",adapterId:e,walletName:(i==null?void 0:i.name)??"WalletConnect",uri:n,deeplink:r,copied:!1},this.renderQrShell(this.qrState);const s=(o=this.root)==null?void 0:o.querySelector(".xwk-qr-code");s instanceof HTMLElement&&this.renderQr(s,n)}setLoading(e){this.activeRequestAdapterId=e;const n=this.options.manager.getWallets().find(i=>i.id===e),r=this.options.manager.getAdapter(e);if(this.shouldUseCustomWalletConnectQr(n,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"loading",adapterId:e,walletName:(n==null?void 0:n.name)??e},this.renderQrShell(this.qrState);return}this.renderConnectShell(n,e)}setError(e,n){var a,c,l,d,u;if(n&&this.isStaleAdapterEvent(n)||!n&&!this.activeRequestAdapterId&&((a=this.root)==null?void 0:a.dataset.xwkView)!=="qr")return;const r=this.getFriendlyErrorMessage(e);if(((c=this.root)==null?void 0:c.dataset.xwkView)==="qr"||this.qrState){const f=this.qrState;if(this.isRejectedError(e,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"rejected",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect"},this.renderQrShell(this.qrState);return}if(this.isTimeoutError(e,r)){this.qrUri="",this.qrCopied=!1,this.qrState={status:"timeout",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect"},this.renderQrShell(this.qrState);return}this.qrState={status:"error",adapterId:f==null?void 0:f.adapterId,walletName:(f==null?void 0:f.walletName)??"WalletConnect",message:r},this.renderQrShell(this.qrState);return}const i=(l=this.root)==null?void 0:l.querySelector(".xwk-status");i&&(i.textContent=r,i.classList.add("xwk-error"),i.setAttribute("role","alert"));const s=(d=this.root)==null?void 0:d.querySelector(".xwk-connect-status");s&&(s.textContent=r,s.classList.add("xwk-error-text"),s.setAttribute("role","alert"));const o=(u=this.root)==null?void 0:u.querySelector(".xwk-qr-loading");o&&(o.textContent=r,o.classList.add("xwk-error-text"),o.setAttribute("role","alert"))}shouldUseCustomWalletConnectQr(e,n){return!!(!this.isDefaultWalletConnectUiMode()&&(n!=null&&n.capabilities.qr)&&(e==null?void 0:e.group)==="WalletConnect")}isDefaultWalletConnectUiMode(){return!this.options.walletConnectUiMode||this.options.walletConnectUiMode==="default"}handleConnected(e,n){var r;if(!this.isStaleAdapterEvent(e)){if(this.activeRequestAdapterId=void 0,n&&this.connectHandlers.forEach(i=>i(n)),this.presentation==="inline"){this.showList();const i=(r=this.root)==null?void 0:r.querySelector(".xwk-status");i&&(i.textContent=this.messages().connected);return}this.close(!1,!0)}}isStaleAdapterEvent(e){return!this.activeRequestAdapterId||this.activeRequestAdapterId!==e}isRejectedError(e,n){return Wa(e)?e.code===fe.WalletKitErrorCode.CONNECTION_REJECTED||e.code===fe.WalletKitErrorCode.SIGN_REJECTED:/reject|denied|cancelled|canceled|closed|user rejected|proposal expired|expired/i.test(n)}isTimeoutError(e,n){return Wa(e)&&e.code===fe.WalletKitErrorCode.REQUEST_TIMEOUT?!0:/timeout|timed out/i.test(n)}getFriendlyErrorMessage(e){if(Wa(e))switch(e.code){case fe.WalletKitErrorCode.CONNECTION_REJECTED:return"Connection was rejected in the wallet.";case fe.WalletKitErrorCode.SIGN_REJECTED:return"Request was rejected in the wallet.";case fe.WalletKitErrorCode.REQUEST_TIMEOUT:return"Wallet request timed out. Please try again.";case fe.WalletKitErrorCode.WALLET_NOT_INSTALLED:case fe.WalletKitErrorCode.WALLET_NOT_AVAILABLE:return"Wallet is not available in this browser.";case fe.WalletKitErrorCode.UNSUPPORTED_METHOD:return"This wallet does not support the requested action.";case fe.WalletKitErrorCode.NETWORK_MISMATCH:return"Wallet network does not match this dApp.";default:return this.formatDisplayErrorMessage(e.message)}const n=Ms(e);return/reject|denied|cancelled|canceled|closed|proposal expired|expired/i.test(n)?"Request was rejected in the wallet.":/timeout|timed out/i.test(n)?"Wallet request timed out. Please try again.":/not installed|provider is not available|not available/i.test(n)?"Wallet is not available in this browser.":this.formatDisplayErrorMessage(n)}formatDisplayErrorMessage(e){const n=e.replace(/\s+/g," ").trim();return n?n.length<=180&&!/^\[?\{/.test(n)?n:/^\[?\{/.test(n)?"Wallet request failed. Please try again.":`${n.slice(0,177).trimEnd()}...`:"Wallet request failed. Please try again."}renderShellAttributes(e){const n=this.presentation==="modal"?'role="dialog" aria-modal="true"':'role="region"';return`class="${e}" ${n} aria-labelledby="${this.titleId}" tabindex="-1"`}renderHeaderEnd(){return this.presentation==="inline"?'<span class="xwk-header-spacer" aria-hidden="true"></span>':`<button class="xwk-close" data-xwk-close aria-label="${this.escapeHtml(this.messages().close)}">&times;</button>`}renderShell(){const e=this.messages(),n=this.resolveTheme(),r=this.options.layout??"list",i=this.options.size??"default",s=this.options.textSize??"sm";return this.ensureStyles(n,r,i,s),`<section ${this.renderShellAttributes(`xwk-modal xwk-layout-${r}`)}><div class="xwk-header"><button class="xwk-back xwk-hidden" data-xwk-back aria-label="${this.escapeHtml(e.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(this.options.title??e.connectWallet)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-list">${this.renderNetworkBadge()}<div class="xwk-grid">${this.renderWalletList(r)}</div><div class="xwk-status" role="status" aria-live="polite"></div></div><div class="xwk-connect xwk-hidden"><div class="xwk-spinner" aria-hidden="true"><div class="xwk-connect-icon"></div></div><strong class="xwk-connect-name"></strong><p class="xwk-connect-status" role="status" aria-live="polite">${this.escapeHtml(e.approveRequest)}</p></div><div class="xwk-qr xwk-hidden"><h3 class="xwk-qr-title"></h3><div class="xwk-qr-code">${this.renderQrLoading()}</div><p class="xwk-qr-help">${this.escapeHtml(e.waitingForWalletConnectUri)}</p></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`}renderNetworkBadge(){const e=this.options.manager.getNetwork();if(!e||e.networkType==="MAINNET")return"";const{dotColor:n,badgeBg:r,badgeBorder:i,textColor:s,label:o}=this.resolveNetworkBadgeStyle(e),a=`background:${r};border-color:${i};color:${s}`,c=`<span class="xwk-network-dot" style="background:${n}" aria-hidden="true"></span>`;return`<div class="xwk-network-row"><span class="xwk-network-badge" style="${a}">${c}${this.escapeHtml(o)}</span></div>`}resolveNetworkBadgeStyle(e){const n=this.resolveThemeMode()==="dark",r=String(e.family??"xrpl").toLowerCase(),i=String(e.id??"").toLowerCase(),s=String(e.name??"").toLowerCase();if(r.includes("evm")||i.includes("evm")||s.includes("evm"))return{label:"XRPL EVM",dotColor:"#a78bfa",badgeBg:n?"rgba(167,139,250,.10)":"#f5f3ff",badgeBorder:n?"rgba(167,139,250,.20)":"#ddd6fe",textColor:n?"#c4b5fd":"#6d28d9"};if(e.networkType==="DEVNET")return{label:"DEVNET",dotColor:"#38bdf8",badgeBg:n?"rgba(56,189,248,.10)":"#f0f9ff",badgeBorder:n?"rgba(56,189,248,.20)":"#bae6fd",textColor:n?"#7dd3fc":"#0369a1"};if(e.networkType==="TESTNET")return{label:"TESTNET",dotColor:n?"#fbbf24":"#f59e0b",badgeBg:n?"rgba(245,158,11,.12)":"#fef3c7",badgeBorder:n?"rgba(245,158,11,.20)":"#fde68a",textColor:n?"#fbbf24":"#92400e"};const a=this.resolveTheme();return{label:(e.name||"CUSTOM").toUpperCase().slice(0,10),dotColor:a.muted,badgeBg:a.surface,badgeBorder:a.border,textColor:a.muted}}renderQrShell(e){var y;const n=this.messages(),r=this.resolveTheme(),i=this.options.layout??"list",s=this.options.size??"default",o=this.options.textSize??"sm",a=e.status==="ready"&&!!e.uri;e.status==="ready"&&e.uri;const c=e.status==="ready"?e.deeplink:void 0,l=a?' aria-hidden="true"':"",d=a&&c?`<a class="xwk-action xwk-action-primary" data-xwk-open href="${this.escapeHtml(c)}">${this.escapeHtml(n.openWallet)}</a>`:"",u=a?`<button class="xwk-action xwk-copy-inside" data-xwk-copy type="button">${this.renderQrCopyButtonContent()}</button>`:"",f=a?`<button class="xwk-qr-theme-action" data-xwk-qr-theme type="button" aria-label="${this.qrLightMode?"Use dark QR":"Use light QR"}" title="${this.qrLightMode?"Use dark QR":"Use light QR"}" aria-pressed="${this.qrLightMode?"true":"false"}">${this.qrThemeIcon()}</button>`:"",p=e.status==="rejected"||e.status==="timeout"||e.status==="error"?`<button class="xwk-action xwk-action-primary" data-xwk-retry type="button">${this.refreshIcon()} ${this.escapeHtml(n.tryAgain)}</button>`:"",m=[u,d].filter(Boolean).length,h=u||d||p?`<div class="xwk-qr-card-actions ${m>1?"xwk-qr-card-actions-dual":""}">${u}${d}${p}</div>`:`<div class="xwk-qr-card-actions xwk-qr-card-actions-placeholder" aria-hidden="true"><button class="xwk-action xwk-copy-inside" type="button" disabled>${this.renderQrCopyButtonContent()}</button></div>`,g=e.status==="rejected"?`<div class="xwk-qr-message" role="alert"><strong>${this.escapeHtml(n.connectionCanceledTitle)}</strong><span>${this.escapeHtml(n.requestRejected)}</span></div>`:e.status==="timeout"?`<div class="xwk-qr-message xwk-error-text" role="alert"><strong>${this.escapeHtml(n.connectionTimedOutTitle)}</strong><span>${this.escapeHtml(n.requestTimedOut)}</span></div>`:e.status==="error"?`<div class="xwk-qr-message xwk-error-text" role="alert"><strong>${this.escapeHtml(n.connectionFailedTitle)}</strong><span>${this.escapeHtml(e.message)}</span></div>`:this.renderQrLoading(),w="",E=a?n.helpScan:e.status==="rejected"||e.status==="timeout"?n.helpTryAgainNewRequest:e.status==="error"?n.pleaseTryAgain:n.waitingForWalletConnectUri;(y=this.root)!=null&&y.isConnected||this.renderView("qr"),this.root&&(this.root.dataset.xwkView="qr",this.ensureStyles(r,i,s,o),this.root.innerHTML=`<section ${this.renderShellAttributes("xwk-modal xwk-qr-modal")}><div class="xwk-header"><button class="xwk-back" data-xwk-back aria-label="${this.escapeHtml(n.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(e.walletName)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-qr xwk-standalone-qr"><div class="xwk-qr-card"><div class="xwk-qr-code-wrap"><div class="xwk-qr-code"${l}>${g}</div>${f}</div>${w}${h}</div><p class="xwk-qr-help">${this.escapeHtml(E)}</p><span class="xwk-sr-only">${this.escapeHtml(n.qrSrHint)}</span><span class="xwk-sr-only" aria-live="assertive" data-xwk-copy-live></span></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`,this.bindChrome())}renderQrLoading(){return`<span class="xwk-qr-loading" role="status" aria-live="polite"><span class="xwk-qr-loading-spinner"></span><span>${this.escapeHtml(this.messages().generatingQr)}</span></span>`}renderQrCopyButtonContent(){const e=this.messages();return this.qrCopied?`${this.checkIcon()} ${this.escapeHtml(e.copied)}`:`${this.linkIcon()} ${this.escapeHtml(e.copyUri)}`}renderConnectShell(e,n){var d;const r=this.messages(),i=this.resolveTheme(),s=this.options.layout??"list",o=this.options.size??"default",a=this.options.textSize??"sm",c=(e==null?void 0:e.name)??n,l=this.getConnectStatusText(e,n);(d=this.root)!=null&&d.isConnected||this.renderView("connect"),this.root&&(this.root.dataset.xwkView="connect",this.ensureStyles(i,s,o,a),this.root.innerHTML=`<section ${this.renderShellAttributes("xwk-modal xwk-connect-modal")}><div class="xwk-header"><button class="xwk-back" data-xwk-back aria-label="${this.escapeHtml(r.back)}">${this.backIcon()}</button><div class="xwk-title" id="${this.titleId}">${this.escapeHtml(r.connect)}</div>${this.renderHeaderEnd()}</div><div class="xwk-body"><div class="xwk-connect xwk-standalone-connect"><div class="xwk-spinner" aria-hidden="true"><div class="xwk-connect-icon">${this.renderWalletIcon(e)}</div></div><strong class="xwk-connect-name">${this.escapeHtml(c)}</strong><p class="xwk-connect-status" role="status" aria-live="polite">${this.escapeHtml(l)}</p></div></div><div class="xwk-footer">${this.escapeHtml(this.options.footerText??"XRPL Wallet Kit")}</div></section>`,this.bindChrome())}getConnectStatusText(e,n){const r=this.messages(),i=this.options.manager.getAdapter(n),s=(e==null?void 0:e.name)??(i==null?void 0:i.metadata.name)??r.walletFallbackName;return(e==null?void 0:e.type)==="hardware"?r.confirmOnDevice(s):(e==null?void 0:e.type)==="walletconnect"||(e==null?void 0:e.group)==="WalletConnect"||(e==null?void 0:e.type)==="mobile"||i!=null&&i.capabilities.qr||i!=null&&i.capabilities.deeplink?r.openWalletAppApprove(s):(e==null?void 0:e.type)==="snap"?r.approveBrowserWallet():r.clickConnectPopup(s)}renderStyles(e,n,r,i){const s=`${n}|${r}|${i}|${this.resolveThemeMode()}|${JSON.stringify(e)}`;if(s===this.cachedStyleKey)return this.cachedStyle;const o=n==="card"||n==="grid",a=r==="wide"?"640px":r==="compact"?"400px":"520px",c=n==="icon"?"repeat(4,minmax(0,1fr))":o?"repeat(3,minmax(0,1fr))":"1fr",l=n==="list"?"left":"center",d=n==="list"?"row":"column",u=n==="icon"?"78px":o?"100px":"64px",f=n==="icon"?"38px":o?"42px":"40px",p=n==="icon"?"none":"block",m=i==="lg"?"20px":i==="md"?"18px":"16px",h=i==="lg"?"17px":i==="md"?"16px":"15px",g=i==="lg"?"14px":i==="md"?"13px":"12px",w=i==="lg"?"13px":"12px",E=i==="lg"?"16px":i==="md"?"15px":"14px",y=this.resolveThemeMode()==="dark"?e.foreground:"#333333",b=this.resolveThemeMode()==="dark"?"#cbd5e1":"#5c6878",S=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.08)":"#f0f1f3",v=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",B=this.resolveThemeMode()==="dark"?"#94a3b8":"#9ca3af",T=this.resolveThemeMode()==="dark"?"rgba(56,189,248,.12)":"rgba(0,120,174,.10)",_=this.resolveThemeMode()==="dark"?"rgba(56,189,248,.22)":"rgba(0,120,174,.18)",N=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)",D=this.resolveThemeMode()==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",U=e.muted,L=e.spinnerTrail,k=e.muted,C=e.overlayBlur>0?`blur(${e.overlayBlur}px)`:"none",P=`.xwk-overlay{position:fixed;inset:0;background:${e.overlay};-webkit-backdrop-filter:${C};backdrop-filter:${C};display:grid;overscroll-behavior:contain;place-items:center;z-index:2147483647;font-family:${e.fontFamily};font-size:${E};opacity:0;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));transition:opacity .2s ease-out}.xwk-overlay[data-xwk-state="open"]{opacity:1}.xwk-overlay[data-xwk-state="closing"]{opacity:0;transition-duration:.18s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-modal{box-sizing:border-box;display:block;width:min(${a},100%);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:${e.shadow};color:${e.foreground};opacity:0;overflow:hidden;transform:translateY(8px) scale(.97);transform-origin:center bottom;transition:opacity .24s cubic-bezier(.22,1,.36,1),transform .24s cubic-bezier(.22,1,.36,1)}.xwk-overlay[data-xwk-state="open"] .xwk-modal{opacity:1;transform:translateY(0) scale(1)}.xwk-overlay[data-xwk-state="closing"] .xwk-modal{opacity:0;transform:translateY(6px) scale(.985);transition-duration:.18s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;column-gap:8px;padding:8px 18px;background:${e.headerBackground};border-bottom:1px solid ${e.border}}.xwk-title{font-size:${m};font-weight:500;text-align:center;color:${e.foreground};min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-close,.xwk-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:0;border-radius:999px;box-shadow:none;box-sizing:border-box;color:${e.muted};cursor:pointer;display:inline-flex;font:inherit;height:44px;justify-content:center;margin:0;min-height:0;outline:none;overflow:hidden;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-back{justify-self:start}.xwk-close{font-size:26px;font-weight:500;justify-self:end;line-height:1}.xwk-close:hover,.xwk-back:hover{background:${e.surfaceHover};box-shadow:none;color:${e.foreground};transform:none}.xwk-close:focus-visible,.xwk-back:focus-visible,.xwk-wallet:focus-visible,.xwk-action:focus-visible,.xwk-qr-theme-action:focus-visible{outline:2px solid ${e.accent};outline-offset:2px;text-decoration:none}.xwk-body{-webkit-overflow-scrolling:touch;box-sizing:border-box;max-height:min(620px,calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overscroll-behavior:contain;overflow:auto;padding:12px 22px 18px}.xwk-list,.xwk-connect,.xwk-qr{display:none}.xwk-overlay[data-xwk-view="list"] .xwk-list{display:block}.xwk-overlay[data-xwk-view="connect"] .xwk-connect{display:block}.xwk-overlay[data-xwk-view="qr"] .xwk-qr{display:block}.xwk-network-row{align-items:center;display:flex;justify-content:flex-end;margin:-2px 0 8px;min-height:22px}.xwk-network-badge{align-items:center;background:${this.resolveThemeMode()==="dark"?"rgba(245,158,11,.12)":"#fef3c7"};border:1px solid ${this.resolveThemeMode()==="dark"?"rgba(245,158,11,.20)":"#fde68a"};border-radius:999px;color:${this.resolveThemeMode()==="dark"?"#fbbf24":"#92400e"};display:inline-flex;font-size:10px;font-weight:560;letter-spacing:0;line-height:1;padding:5px 9px;text-transform:none}.xwk-network-dot{border-radius:999px;display:inline-block;height:6px;margin-right:5px;width:6px}.xwk-grid{display:grid;grid-template-columns:${c};gap:7px}.xwk-wallet{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:0;border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:flex;flex-direction:${d};font:inherit;gap:12px;justify-content:${n==="list"?"flex-start":"center"};line-height:1.2;margin:0;min-height:${u};min-width:0;outline:none;overflow:hidden;padding:${n==="list"?"12px 12px":"12px 10px"};text-align:${l};touch-action:manipulation;transform:none;transition:background-color .16s ease;width:100%}.xwk-wallet:hover{background:${e.surfaceHover};box-shadow:none;transform:none}.xwk-wallet:active{background:${e.surfaceHover};transform:none}.xwk-wallet img:not(.xwk-mini-icon),.xwk-icon-fallback{border-radius:${e.walletRadius};flex:0 0 auto;height:${f};object-fit:contain;overflow:hidden;width:${f}}.xwk-icon-fallback{align-items:center;background:${e.accent};color:${e.accentText};display:inline-flex;font-weight:700;justify-content:center}.xwk-wallet-group{margin-top:0;min-height:${u}}.xwk-wallet-group .xwk-wallet-info{align-items:center;display:${n==="list"?"flex":"grid"};gap:${n==="list"?"10px":"2px"}}.xwk-wallet-group .xwk-name{flex:1 1 auto}.xwk-wallet-group .xwk-group{display:${n==="list"?"none":p}}.xwk-group-placeholder{visibility:hidden}.xwk-wallet-info{display:grid;gap:2px;min-width:0;width:100%}.xwk-name{color:${y};display:block;font-size:${n==="list"?h:g};font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-group{color:${e.muted};display:${p};font-size:${w};font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-group-icons{align-items:center;display:${n==="list"?"inline-flex":"none"};flex:0 0 auto;gap:4px;justify-content:flex-end;margin-left:auto;min-width:0}.xwk-mini-icon,.xwk-mini-fallback,.xwk-mini-more{align-items:center;border:1px solid ${N};border-radius:10px;box-sizing:border-box;display:inline-flex;flex:0 0 auto;height:32px;justify-content:center;object-fit:cover;overflow:hidden;width:32px}.xwk-mini-fallback,.xwk-mini-more{background:${e.background};color:${e.muted};font-size:12px;font-weight:600}.xwk-mini-more{border-radius:999px;width:auto;min-width:32px;padding:0 8px}.xwk-wallet-badges{align-items:center;display:inline-flex;flex:0 0 auto;gap:6px;justify-content:flex-end;margin-left:auto;min-width:0}.xwk-wallet-badge{align-items:center;background:${S};border:1px solid ${v};border-radius:999px;color:${b};display:inline-flex;flex:0 0 auto;font-size:11px;font-weight:500;gap:6px;line-height:1;min-height:24px;padding:0 10px;visibility:hidden}.xwk-wallet-badge:before{background:${B};border-radius:999px;content:"";height:6px;width:6px}.xwk-wallet-badge.xwk-installed,.xwk-wallet-badge.xwk-recommended{visibility:visible}.xwk-wallet-badge.xwk-recommended{background:${T};border-color:${_};color:${e.accent}}.xwk-wallet-badge.xwk-recommended:before{background:currentColor}.xwk-status{color:${e.accent};font-size:12px;margin-top:8px;min-height:0;max-width:100%;overflow-wrap:anywhere}.xwk-status.xwk-error,.xwk-error-text{color:${e.error}}.xwk-status.xwk-error{background:${e.surface};border:1px solid ${e.border};border-radius:10px;box-sizing:border-box;line-height:1.35;padding:9px 10px}.xwk-hidden{display:none}.xwk-back.xwk-hidden{display:inline-flex;pointer-events:none;visibility:hidden}.xwk-connect{text-align:center;padding:30px 0 16px}.xwk-spinner{display:grid;margin:0 auto 16px;place-items:center;position:relative;width:104px;height:104px}.xwk-spinner:before{animation:xwk-spin 1s linear infinite;border:3px solid transparent;border-top-color:${U};border-right-color:${L};border-radius:50%;content:"";height:96px;position:absolute;width:96px}.xwk-connect-icon img,.xwk-connect-icon .xwk-icon-fallback{border-radius:${e.walletRadius};height:66px;object-fit:contain;overflow:hidden;width:66px}.xwk-connect-name{display:block;font-size:${h};font-weight:600;margin-top:4px}.xwk-connect-status{color:${e.muted};font-size:${E};font-weight:400;line-height:1.45;margin:14px auto 0;max-width:420px}.xwk-qr{text-align:center}.xwk-qr-title{color:${e.foreground};font-size:${m};font-weight:500;margin:0 0 14px}.xwk-qr-card{background:${e.surface};border:1px solid ${e.border};border-radius:14px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:0 auto 10px;min-height:386px;padding:12px;width:min(332px,100%)}.xwk-qr-code-wrap{position:relative;flex:0 0 auto;margin:0 auto 10px;width:100%}.xwk-qr-code{aspect-ratio:1/1;background:transparent;border:0;border-radius:10px;box-sizing:border-box;color:${e.muted};display:grid;min-height:0;padding:0;place-items:center;width:100%}.xwk-qr-code-light{background:#fff;padding:8px}.xwk-qr-theme-action{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.background};border:1px solid ${D};border-radius:999px;box-shadow:none;box-sizing:border-box;color:${e.muted};cursor:pointer;display:inline-flex;height:34px;justify-content:center;margin:0;min-height:0;opacity:0;outline:none;padding:0;pointer-events:none;position:absolute;right:8px;top:8px;touch-action:manipulation;transform:none;transition:opacity .14s ease,background-color .16s ease,border-color .16s ease,color .16s ease;width:34px}.xwk-qr-code-wrap:hover .xwk-qr-theme-action,.xwk-qr-code-wrap:focus-within .xwk-qr-theme-action,.xwk-qr-theme-action:focus-visible{opacity:1;pointer-events:auto}.xwk-qr-theme-action:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;color:${e.foreground};transform:none}.xwk-qr-theme-action svg{height:17px;width:17px}.xwk-qr-code canvas,.xwk-qr-code img,.xwk-qr-code svg{aspect-ratio:1/1;display:block;height:auto;max-width:100%;width:100%}.xwk-qr-loading{align-items:center;color:${k};display:inline-flex;font-size:13px;gap:8px}.xwk-qr-message{align-items:center;color:${e.muted};display:grid;font-size:${E};gap:7px;line-height:1.35;max-width:260px;text-align:center}.xwk-qr-message strong{color:${e.foreground};font-size:${h};font-weight:600}.xwk-qr-message span{display:block;max-width:100%;overflow-wrap:anywhere}.xwk-qr-loading-spinner{animation:xwk-spin 1s linear infinite;border:2px solid ${L};border-top-color:${U};border-radius:999px;display:inline-block;height:18px;width:18px}.xwk-qr-help{color:${e.muted};font-size:${E};font-weight:400;line-height:1.35;margin:10px auto 0;max-width:420px;min-height:22px;white-space:nowrap}.xwk-qr-fallback{color:${e.muted};font-size:11px;line-height:1.5;overflow-wrap:anywhere}.xwk-actions{display:grid;gap:10px;grid-template-columns:1fr 1fr;margin-top:14px}.xwk-qr-card-actions{display:grid;flex:0 0 auto;gap:10px;grid-template-columns:1fr;min-height:46px}.xwk-qr-card-actions-dual{grid-template-columns:repeat(auto-fit,minmax(0,1fr))}.xwk-qr-card-actions-placeholder{visibility:hidden}.xwk-action{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:1px solid ${D};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;font:inherit;font-size:${E};font-weight:560;gap:8px;justify-content:center;line-height:1.2;margin:0;min-height:46px;min-width:0;outline:none;overflow:hidden;padding:0 12px;text-decoration:none;touch-action:manipulation;transform:none;transition:background-color .16s ease,border-color .16s ease;white-space:nowrap;width:100%}.xwk-copy-inside{background:${e.surface};border-color:${D};color:${e.foreground};font-size:${E};width:100%}.xwk-action:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;text-decoration:none;transform:none}.xwk-action:active{background:${e.surfaceHover};box-shadow:none;opacity:1;text-decoration:none;transform:none}.xwk-copy-inside:hover{background:${e.surfaceHover};box-shadow:none;text-decoration:none}.xwk-action-primary{background:${e.surface};border-color:${D};color:${e.foreground}}.xwk-action-primary:hover{background:${e.surfaceHover};border-color:${D};box-shadow:none;color:${e.foreground};text-decoration:none}.xwk-action svg{flex:0 0 auto;opacity:.58}.xwk-copied-icon{color:${e.success};opacity:1!important}.xwk-action:disabled{cursor:default;opacity:.76}.xwk-retrying .xwk-refresh-icon{animation:xwk-spin .7s linear infinite}.xwk-footer{border-top:0;color:${e.muted};font-size:11px;font-weight:400;padding:12px 16px 14px;text-align:center}@keyframes xwk-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.xwk-overlay,.xwk-modal,.xwk-wallet,.xwk-action,.xwk-close,.xwk-back,.xwk-qr-theme-action{transition-duration:1ms!important;animation-duration:1ms!important}.xwk-spinner:before,.xwk-qr-loading-spinner{animation:none}}@media(max-width:640px){.xwk-overlay{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));place-items:end center}.xwk-modal{border-bottom-left-radius:0;border-bottom-right-radius:0;max-height:calc(100dvh - 24px - env(safe-area-inset-top));transform:translateY(100%);width:100%}.xwk-overlay[data-xwk-state="open"] .xwk-modal{transform:translateY(0);transition-duration:.32s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.xwk-overlay[data-xwk-state="closing"] .xwk-modal{transform:translateY(100%);transition-duration:.24s;transition-timing-function:cubic-bezier(.4,0,1,1)}.xwk-header{grid-template-columns:44px minmax(0,1fr) 44px;column-gap:8px;padding:10px 16px}.xwk-body{max-height:calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:14px 16px 16px}.xwk-grid{grid-template-columns:${n==="icon"?"repeat(3,minmax(0,1fr))":"1fr"}}.xwk-wallet-badges{gap:4px}.xwk-wallet-badge{font-size:10px;min-height:22px;padding:0 8px}.xwk-actions{grid-template-columns:1fr}.xwk-qr-card{min-height:358px;padding:12px;width:min(304px,100%)}.xwk-qr-code-wrap{width:100%}.xwk-action{font-size:clamp(12px,3.55vw,${E});gap:6px;padding:0 10px}.xwk-action svg{height:17px;width:17px;flex:0 0 auto}.xwk-qr-card-actions-dual{grid-template-columns:1fr}.xwk-qr-help{font-size:clamp(12px,3.45vw,${E});min-height:38px;white-space:normal}}@media(max-width:360px){.xwk-qr-card{min-height:354px;width:min(284px,100%)}}@media(max-height:560px){.xwk-body{max-height:calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:10px 16px}.xwk-connect{padding:18px 0 10px}.xwk-spinner{height:82px;margin-bottom:12px;width:82px}.xwk-spinner:before{height:76px;width:76px}.xwk-connect-icon img,.xwk-connect-icon .xwk-icon-fallback{border-radius:${e.walletRadius};height:54px;width:54px}.xwk-qr-card{min-height:320px;width:min(260px,100%)}.xwk-qr-title{margin-bottom:10px}.xwk-qr-help{margin-top:8px}.xwk-footer{padding:8px 16px 10px}}`;return this.cachedStyleKey=s,this.cachedStyle=P,P}ensureStyles(e,n,r,i){const s=`${this.renderStyles(e,n,r,i)}${this.renderMobileSheetOverrides(e)}`;tg(eg("xwk-modal",s),s)}renderMobileSheetOverrides(e){const n=`.xwk-inline{background:transparent!important;display:block!important;inset:auto!important;opacity:1!important;overflow:visible!important;padding:0!important;place-items:initial!important;position:relative!important;z-index:auto!important}.xwk-inline .xwk-modal{border:1px solid ${e.border}!important;border-radius:${e.radius}!important;box-shadow:none!important;max-height:none!important;max-width:none!important;opacity:1!important;transform:none!important;transition:none!important;width:100%!important}.xwk-inline .xwk-body{max-height:none!important}.xwk-inline .xwk-header-spacer{display:block;height:44px;width:44px}.xwk-inline[data-xwk-state="closing"] .xwk-modal{opacity:1!important;transform:none!important}`;return`.xwk-modal:focus{outline:none}.xwk-sr-only{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.xwk-error-text,.xwk-connect-status.xwk-error-text,.xwk-qr-loading.xwk-error-text{color:${e.error}!important}.xwk-close,.xwk-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;appearance:none;background:transparent!important;border:0!important;box-shadow:none!important;margin:0;outline:none!important}.xwk-close:focus-visible,.xwk-back:focus-visible{outline:2px solid ${e.accent}!important;outline-offset:0}@media(max-width:640px){.xwk-overlay{padding:max(12px,env(safe-area-inset-top)) 0 0!important;place-items:end center!important}.xwk-modal{align-self:end!important;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-left:0!important;border-right:0!important;border-top-left-radius:${e.radius}!important;border-top-right-radius:${e.radius}!important;height:auto!important;max-height:calc(100dvh - env(safe-area-inset-top))!important;max-width:none!important;width:100vw!important}.xwk-header{border-top-left-radius:${e.radius};border-top-right-radius:${e.radius}}.xwk-body{padding-bottom:max(6px,calc(6px + env(safe-area-inset-bottom)))!important}.xwk-overlay[data-xwk-view="list"] .xwk-body{padding-bottom:max(2px,calc(2px + env(safe-area-inset-bottom)))!important}.xwk-network-row{margin:-4px 0 8px!important}.xwk-overlay[data-xwk-view="list"] .xwk-footer{padding-top:6px!important}}${n}`}renderWalletList(e){const n=this.getGroups();return n.length?[...this.getUngroupedWallets(n).map(r=>this.renderWallet(r,e)),...n.map(r=>this.renderWalletGroup(r,e))].join(""):this.getWallets().map(r=>this.renderWallet(r,e)).join("")}renderWalletGroup(e,n){const r=this.messages(),i=this.getGroupWallets(e),s=e.maxPreviewIcons??5,o=i.slice(0,s),a=i.length-o.length,c=e.icon?`<img src="${this.escapeHtml(e.icon)}" alt="">`:`<span class="xwk-icon-fallback">${this.escapeHtml(e.name.slice(0,1).toUpperCase())}</span>`,l=n==="list"?`<span class="xwk-group">${this.escapeHtml(r.walletCount(i.length))}</span>`:n==="card"||n==="grid"?`<span class="xwk-group">+${this.escapeHtml(r.walletCount(i.length))}</span>`:"",d=o.length?`<span class="xwk-group-icons">${o.map(u=>this.renderMiniWalletIcon(u)).join("")}${a>0?`<span class="xwk-mini-more" aria-label="${this.escapeHtml(r.moreWallets(a))}">+${a}</span>`:""}</span>`:"";return`<button class="xwk-wallet xwk-wallet-group" data-wallet-group-id="${this.escapeHtml(e.id)}">${c}<span class="xwk-wallet-info"><span class="xwk-name">${this.escapeHtml(e.name)}</span>${l}${d}</span></button>`}renderWallet(e,n){const r=this.renderWalletIcon(e),s=this.options.showWalletGroup===!0&&n!=="icon"?`<span class="xwk-group">${this.escapeHtml(this.getWalletSecondaryLabel(e))}</span>`:"",o=this.renderWalletBadges(e,n);return`<button class="xwk-wallet" data-wallet-id="${this.escapeHtml(e.id)}">${r}<span class="xwk-wallet-info"><span class="xwk-name">${this.escapeHtml(e.name)}</span>${s}</span>${o}</button>`}renderWalletBadges(e,n){if(n!=="list")return"";const r=e.group==="Extensions"||e.type==="snap",i=[],s=this.messages();if(e.recommended&&i.push(`<span class="xwk-wallet-badge xwk-recommended">${this.escapeHtml(s.recommended||"Recommended")}</span>`),r){const o=this.availability[e.id]?"xwk-wallet-badge xwk-installed":"xwk-wallet-badge";i.push(`<span class="${o}">${this.escapeHtml(s.installed||"Installed")}</span>`)}return i.length?`<span class="xwk-wallet-badges">${i.join("")}</span>`:""}getWalletSecondaryLabel(e){return e.recommended&&e.group==="Recommended"?this.humanizeWalletType(e.type):e.group??this.humanizeWalletType(e.type)}humanizeWalletType(e){const n=this.messages();switch(e){case"mobile":return n.mobileWallet;case"extension":return n.extensionWallet;case"walletconnect":return n.walletConnectWallet;case"snap":return n.xrplSnapWallet;case"hardware":return n.hardwareWallet;case"embedded":return n.embeddedWallet;default:return String(e)}}renderWalletIcon(e){if(e!=null&&e.icon)return`<img src="${this.escapeHtml(e.icon)}" alt="">`;const n=(e==null?void 0:e.name.slice(0,1).toUpperCase())??"W";return`<span class="xwk-icon-fallback">${this.escapeHtml(n)}</span>`}renderMiniWalletIcon(e){return e.icon?`<img class="xwk-mini-icon" src="${this.escapeHtml(e.icon)}" alt="">`:`<span class="xwk-mini-icon xwk-mini-fallback">${this.escapeHtml(e.name.slice(0,1).toUpperCase())}</span>`}backIcon(){return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}linkIcon(){return this.copyActionIcon()}copyActionIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="8" y="8" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2"/><path d="M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}refreshIcon(){return'<svg class="xwk-refresh-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M20 11a8 8 0 1 0-2.34 5.66" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5v6h-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}qrThemeIcon(){return this.qrLightMode?'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M20.2 14.4A7.4 7.4 0 0 1 9.6 3.8 8.3 8.3 0 1 0 20.2 14.4Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg>':'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2"/><path d="M12 2v2.2M12 19.8V22M4.9 4.9l1.6 1.6M17.5 17.5l1.6 1.6M2 12h2.2M19.8 12H22M4.9 19.1l1.6-1.6M17.5 6.5l1.6-1.6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}checkIcon(){return'<svg class="xwk-copied-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="10" fill="currentColor"/><path d="m7.8 12.4 2.7 2.7 5.9-6.2" stroke="#fff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}messages(){return Xr(this.options.language,this.options.messages)}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode??"light"}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}escapeHtml(e){return String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}async renderQr(e,n){e.replaceChildren();try{e.classList.toggle("xwk-qr-code-light",this.qrLightMode);const i=this.resolveThemeMode()==="dark"&&!this.qrLightMode?ng:Ef;new I2({width:qi,height:qi,type:"svg",data:n,margin:4,qrOptions:{errorCorrectionLevel:"H"},dotsOptions:{type:"dots",color:i,roundSize:!0},cornersSquareOptions:{type:"extra-rounded",color:i},cornersDotOptions:{type:"dot",color:i},backgroundOptions:{color:this.qrLightMode?"#ffffff":"transparent"}}).append(e)}catch{try{const r=await yP.toDataURL(n,{errorCorrectionLevel:"H",margin:2,width:qi,color:{dark:Ef,light:"#ffffff"}}),i=document.createElement("img");i.src=r,i.alt="WalletConnect QR code",i.width=qi,i.height=qi,e.replaceChildren(i)}catch{const r=document.createElement("div");r.className="xwk-qr-fallback",r.textContent=n,e.replaceChildren(r)}}}waitForPaint(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}}class rg extends gS{constructor(e){super(e,"modal")}}class ig extends gS{constructor(e){super(e,"inline")}mount(e){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`WalletInline mount target was not found: ${String(e)}`);this.options={...this.options,mount:n},this.open()}isMounted(){return this.isOpen()}}function mS(t){return new rg(t)}function vP(t){return new ig(t)}const wS=1e7,yS=2e6;function bS(){return async({address:t,network:e})=>{var h,g,w;if(!(e!=null&&e.rpcUrl))return null;const n=Qc(e),r=nf(e);if(!r)return null;const i=await vS(r,{method:"account_info",params:[{account:t,ledger_index:"validated"}]});if(((h=i.result)==null?void 0:h.error)==="actNotFound")return{value:"0",formatted:`0 ${n}`,symbol:n,activationStatus:"unfunded",spendable:!1,reserveLocked:!1,available:"0",availableFormatted:`0 ${n}`,total:"0",totalFormatted:`0 ${n}`,reserve:"0",ownerCount:0,raw:i};const s=(g=i.result)==null?void 0:g.account_data,o=sg(s==null?void 0:s.Balance);if(o==null||(w=i.result)!=null&&w.error)return null;const a=(s==null?void 0:s.OwnerCount)??0,c=await EP(r).catch(()=>({baseDrops:wS,incDrops:yS})),l=c.baseDrops+a*c.incDrops,d=Math.max(o-l,0),u=o>0&&d<=0,f=og(d),p=og(o),m=og(l);return{value:f,formatted:`${f} ${n}`,symbol:n,activationStatus:"active",spendable:d>0,reserveLocked:u,available:f,availableFormatted:`${f} ${n}`,total:p,totalFormatted:`${p} ${n}`,reserve:m,ownerCount:a,raw:{accountInfo:i,reserveInfo:c}}}}async function vS(t,e){const n=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Wallet RPC request failed: ${n.status}`);return n.json()}async function EP(t){var s,o;const n=(o=(s=(await vS(t,{method:"server_state",params:[]})).result)==null?void 0:s.state)==null?void 0:o.validated_ledger,r=ES(n==null?void 0:n.reserve_base,n==null?void 0:n.reserve_base_xrp,wS),i=ES(n==null?void 0:n.reserve_inc,n==null?void 0:n.reserve_inc_xrp,yS);return{baseDrops:r,incDrops:i}}function sg(t){if(t==null)return null;const e=typeof t=="number"?t:Number(t);return Number.isFinite(e)?e:null}function ES(t,e,n){const r=sg(t);if(r!=null)return r;const i=sg(e);return i!=null?Math.round(i*1e6):n}function og(t){return AP(t/1e6)}function AP(t){if(!Number.isFinite(t))return"0";const e=t>=100?2:t>=1?4:6;return t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:0})}class Af{constructor(e){this.identityName=null,this.identityAvatar=null,this.identityRequest=0,this.identityCache=new Map,this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",this.balanceRequest=0,this.balanceRefreshTimers=new Set,this.panelOpen=!1,this.addressQrOpen=!1,this.txSectionOpen=!0,this.panelScrollLocked=!1,this.connecting=!1,this.copied=!1,this.copyInProgress=!1,this.accountAction=null,this.offEvents=[],this.onDocumentPointerDown=r=>this.handleDocumentPointerDown(r),this.onDocumentKeyDown=r=>this.handleDocumentKeyDown(r),this.target=this.resolveTarget(e.target);const n=Xr(e.language,e.messages);this.options={language:e.language,messages:n,label:n.connectWallet,showAdapterIcon:!0,showChevron:!0,showWeb3Name:!0,fallbackToAddress:!0,copyAddress:!0,showAddressQr:!0,showRecentTransactions:!1,maxVisibleTransactions:5,explorer:!1,disconnect:!0,accountPanel:!0,accountPanelMode:"modal",showBalance:!1,size:"md",variant:"default",themeMode:"light",theme:{},identityResolver:e.identityResolver??AS(),balanceResolver:e.balanceResolver??bS(),explorerUrl:e.explorerUrl,formatAddress:e.formatAddress,...e},this.offEvents.push(e.manager.on("connecting",()=>{this.connecting=!0,this.render()})),this.offEvents.push(e.manager.on("connected",({session:r})=>{this.connecting=!1,this.panelOpen=!1,this.addressQrOpen=!1,this.renderConnectedState(r??e.manager.getSession()),this.resolveBalance(r??e.manager.getSession())})),this.offEvents.push(e.manager.on("session_restored",({session:r})=>{this.connecting=!1,this.renderConnectedState(r),this.resolveBalance(r)})),this.offEvents.push(e.manager.on("session_stale",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.manager.on("session_expired",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.manager.on("disconnected",()=>{this.connecting=!1,this.panelOpen=!1,this.addressQrOpen=!1,this.identityName=null,this.identityAvatar=null,this.identityRequest+=1,this.identityResolvingKey=void 0,this.clearIdentitySettleTimer(),this.clearBalanceRefreshTimers(),this.balanceRequest+=1,this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",this.render()})),this.offEvents.push(e.manager.on("tx_submitted",()=>{this.scheduleBalanceRefresh([1600,4e3]),this.render()})),this.offEvents.push(e.manager.on("tx_confirmed",()=>{this.clearBalanceRefreshTimers(),this.resolveBalance(e.manager.getSession()),this.render()})),this.offEvents.push(e.manager.on("tx_failed",()=>{this.render()})),this.offEvents.push(e.manager.on("accountChanged",()=>{this.clearBalanceRefreshTimers();const r=e.manager.getSession();this.renderConnectedState(r),this.resolveBalance(r)})),this.offEvents.push(e.manager.on("networkChanged",()=>{this.clearBalanceRefreshTimers();const r=e.manager.getSession();this.renderConnectedState(r),this.resolveBalance(r)})),this.offEvents.push(e.manager.on("error",()=>{this.connecting=!1,this.render()})),this.offEvents.push(e.modal.onClose(()=>{this.options.manager.getSession()||(this.connecting=!1,this.render())}))}mount(e=document.body){const n=this.resolveTarget(e);if(!n)throw new Error("Wallet button target was not found");this.target=n,n.innerHTML="",n.appendChild(this.createRoot()),this.render(),this.resolveIdentity(this.options.manager.getSession()),this.resolveBalance(this.options.manager.getSession())}updateOptions(e){const n="language"in e||"messages"in e?Xr(e.language??this.options.language,e.messages??this.options.messages):this.options.messages;this.options={...this.options,...e,messages:n},("showWeb3Name"in e||"identityResolver"in e)&&this.resolveIdentity(this.options.manager.getSession()),("showBalance"in e||"balanceResolver"in e)&&this.resolveBalance(this.options.manager.getSession()),this.render()}refreshIdentity(){return this.resolveIdentity(this.options.manager.getSession(),{force:!0})}refreshBalance(){return this.resolveBalance(this.options.manager.getSession())}async refreshAccount(){await Promise.all([this.refreshIdentity(),this.refreshBalance()])}destroy(){this.removePanelListeners(),this.removeAccountPanelPortal(),this.syncPanelScrollLock(!1),this.identityRequest+=1,this.identityResolvingKey=void 0,this.clearBalanceRefreshTimers(),this.copyResetTimer&&window.clearTimeout(this.copyResetTimer),this.identitySettleTimer&&window.clearTimeout(this.identitySettleTimer),this.offEvents.splice(0).forEach(e=>e()),this.target&&(this.target.innerHTML=""),this.target=void 0}render(){this.target&&(this.target.innerHTML="",this.target.appendChild(this.createRoot()),this.syncAccountPanelPortal(),this.syncPanelListeners())}createRoot(){var r;const e=document.createElement("div");e.className="xwk-button-root";const n=this.panelOpen&&this.options.accountPanelMode!=="modal"?this.renderPanel():"";return this.ensureStyles(),e.innerHTML=`${this.renderButton()}${n}`,this.repairFallbackIcon(e),(r=e.querySelector("[data-xwk-wallet-button]"))==null||r.addEventListener("click",i=>{i.stopPropagation(),this.onButtonClick()}),this.bindPanelActions(e),this.renderAddressQrIfNeeded(e),e}onButtonClick(){if(!this.options.manager.getSession()){this.options.modal.open();return}this.options.accountPanel&&(this.panelOpen=!this.panelOpen,this.render())}closePanel(){this.panelOpen=!1,this.addressQrOpen=!1,this.render()}handleDocumentPointerDown(e){var n;!this.panelOpen||!this.target||e.target instanceof Node&&this.target.contains(e.target)||e.target instanceof Node&&((n=this.accountPanelPortal)!=null&&n.contains(e.target))||(this.panelOpen=!1,this.addressQrOpen=!1,this.render())}handleDocumentKeyDown(e){if(!this.panelOpen)return;if(e.key==="Escape"){this.panelOpen=!1,this.addressQrOpen=!1,this.render();return}if(e.key!=="Tab"||this.options.accountPanelMode!=="modal")return;const n=this.getAccountPanelFocusableElements();if(!n.length){e.preventDefault();return}const r=n[0],i=n[n.length-1],s=document.activeElement;if(e.shiftKey&&s===r){e.preventDefault(),i.focus();return}!e.shiftKey&&s===i&&(e.preventDefault(),r.focus())}syncPanelListeners(){this.removePanelListeners(),this.syncPanelScrollLock(this.panelOpen&&this.options.accountPanelMode==="modal"),this.panelOpen&&(document.addEventListener("pointerdown",this.onDocumentPointerDown),document.addEventListener("keydown",this.onDocumentKeyDown),this.options.accountPanelMode==="modal"&&window.setTimeout(()=>{var e;(e=this.getAccountPanelRoot())==null||e.focus({preventScroll:!0})},0))}syncAccountPanelPortal(){if(!this.panelOpen||this.options.accountPanelMode!=="modal"){this.removeAccountPanelPortal();return}const e=this.accountPanelPortal??document.createElement("div"),n=!this.accountPanelPortal;e.className="xwk-account-portal",e.dataset.xwkEntering=n?"true":"false",this.ensureStyles(),e.innerHTML=this.renderPanel(),n&&document.body.appendChild(e),this.accountPanelPortal=e,this.bindPanelActions(e),this.renderAddressQrIfNeeded(e)}removeAccountPanelPortal(){var e;(e=this.accountPanelPortal)==null||e.remove(),this.accountPanelPortal=void 0}bindPanelActions(e){var n,r,i,s,o,a,c;(n=e.querySelector("[data-xwk-account-close]"))==null||n.addEventListener("click",()=>this.closePanel()),(r=e.querySelector("[data-xwk-account-back]"))==null||r.addEventListener("click",l=>{l.stopPropagation(),this.closeAddressQr()}),(i=e.querySelector("[data-xwk-account-overlay]"))==null||i.addEventListener("click",l=>{l.target===l.currentTarget&&this.closePanel()}),(s=e.querySelector("[data-xwk-copy-address]"))==null||s.addEventListener("click",l=>{l.stopPropagation(),this.copyAddress()}),(o=e.querySelector("[data-xwk-address-qr]"))==null||o.addEventListener("click",l=>{l.stopPropagation(),this.openAddressQr()}),(a=e.querySelector("[data-xwk-tx-toggle]"))==null||a.addEventListener("click",l=>{l.stopPropagation(),this.txSectionOpen=!this.txSectionOpen,this.render()}),(c=e.querySelector("[data-xwk-disconnect]"))==null||c.addEventListener("click",()=>void this.disconnect())}openAddressQr(){this.options.manager.getSession()&&(this.panelOpen=!0,this.addressQrOpen=!0,this.render())}closeAddressQr(){this.addressQrOpen=!1,this.panelOpen=!0,this.render()}removePanelListeners(){document.removeEventListener("pointerdown",this.onDocumentPointerDown),document.removeEventListener("keydown",this.onDocumentKeyDown)}syncPanelScrollLock(e){e!==this.panelScrollLocked&&(this.panelScrollLocked=e,e?hS():Zp())}async disconnect(){if(!this.accountAction){this.accountAction="disconnect",this.render();try{await Promise.all([this.options.manager.disconnect(),this.delay(450)]),this.options.modal.close()}finally{this.accountAction=null,this.render()}}}async copyAddress(){if(this.copyInProgress||this.accountAction)return;const e=this.getSessionAddress(this.options.manager.getSession());if(e){this.copyInProgress=!0;try{await this.copyText(e),this.copied=!0,this.copyResetTimer&&window.clearTimeout(this.copyResetTimer),this.copyResetTimer=window.setTimeout(()=>{this.copied=!1,this.render()},1400)}finally{this.copyInProgress=!1,this.render()}}}delay(e){return new Promise(n=>window.setTimeout(n,e))}async copyText(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{await navigator.clipboard.writeText(e);return}catch{}const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy")}finally{n.remove()}}async resolveIdentity(e,n={}){var o,a,c,l,d,u;const r=this.getSessionAddress(e);if(!e||!r||!this.shouldShowWeb3Name()||!this.options.identityResolver){this.identityName=null,this.identityAvatar=null,this.identityResolvingKey=void 0,(a=(o=this.options).onIdentityChange)==null||a.call(o,null,e),this.clearIdentitySettleTimer();return}const i=++this.identityRequest,s=this.identityCacheKey(e);n.force&&this.identityCache.delete(s),this.identityResolvingKey=s;try{const f=await this.options.identityResolver(r,e,{force:n.force});if(i!==this.identityRequest)return;const p=typeof f=="string"?{name:f}:f??null;this.identityName=(p==null?void 0:p.name)??null,this.identityAvatar=(p==null?void 0:p.avatar)??null,this.identityCache.set(s,p),(l=(c=this.options).onIdentityChange)==null||l.call(c,p,e),this.clearIdentitySettleTimer(),this.render()}catch{i===this.identityRequest&&(this.identityName=null,this.identityAvatar=null,this.identityCache.set(s,null),(u=(d=this.options).onIdentityChange)==null||u.call(d,null,e),this.clearIdentitySettleTimer(),this.render())}finally{i===this.identityRequest&&this.identityResolvingKey===s&&(this.identityResolvingKey=void 0)}}renderConnectedState(e){if(!e||!this.getSessionAddress(e)||!this.shouldShowWeb3Name()||!this.options.identityResolver){this.clearIdentitySettleTimer(),this.identityName=null,this.identityAvatar=null,this.render();return}const n=this.identityCacheKey(e),r=this.identityCache.get(n);if(r!==void 0){this.identityName=(r==null?void 0:r.name)??null,this.identityAvatar=(r==null?void 0:r.avatar)??null,this.clearIdentitySettleTimer(),this.render(),this.identityResolvingKey!==n&&this.resolveIdentity(e);return}this.identityName=null,this.identityAvatar=null,this.identityResolvingKey!==n&&this.resolveIdentity(e),this.clearIdentitySettleTimer(),this.identitySettleTimer=window.setTimeout(()=>{this.identitySettleTimer=void 0,this.render()},260)}clearIdentitySettleTimer(){this.identitySettleTimer&&(window.clearTimeout(this.identitySettleTimer),this.identitySettleTimer=void 0)}identityCacheKey(e){var n;return`${((n=e.account.network)==null?void 0:n.id)??e.account.networkType??"unknown"}:${this.getSessionAddress(e)}`}async resolveBalance(e){var i,s,o,a,c,l,d,u,f;if(!e||!this.options.showBalance||!this.options.balanceResolver){this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",e&&delete e.balance,(s=(i=this.options).onBalanceChange)==null||s.call(i,null,e),this.render();return}const n=++this.balanceRequest,r=this.getSessionAddress(e);if(!r){this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",delete e.balance,(a=(o=this.options).onBalanceChange)==null||a.call(o,null,e),this.render();return}this.balanceLoading=!0,this.render();try{const p=await this.options.balanceResolver({address:r,network:e.account.network,session:e});if(n!==this.balanceRequest)return;this.balance=this.normalizeBalance(p),this.activationStatus=((c=this.balance)==null?void 0:c.activationStatus)??(this.balance?"active":"unknown"),e.account.activationStatus=this.activationStatus,this.balance?e.balance=this.balance:delete e.balance,(d=(l=this.options).onBalanceChange)==null||d.call(l,this.balance,e),this.balanceLoading=!1,this.render()}catch{n===this.balanceRequest&&(this.balance=null,this.balanceLoading=!1,this.activationStatus="unknown",delete e.balance,(f=(u=this.options).onBalanceChange)==null||f.call(u,null,e),this.render())}finally{n===this.balanceRequest&&(this.balanceLoading=!1)}}renderButton(){var l;const e=this.messages(),n=this.options.manager.getSession(),r=!!n,i=this.connecting?e.connecting:n?this.getAccountLabel(n):this.options.label,s=n&&this.options.showBalance&&this.balanceLoading?`<span class="xwk-button-balance xwk-button-balance-loading">${this.balanceSpinnerIcon()}</span>`:n&&this.options.showBalance&&this.activationStatus==="unfunded"?`<span class="xwk-button-balance">(${this.escapeHtml(e.notActivated)})</span>`:n&&this.options.showBalance&&((l=this.balance)!=null&&l.formatted)?`<span class="xwk-button-balance">(${this.escapeHtml(this.balance.formatted)})</span>`:"",o=this.options.showAdapterIcon?this.renderWalletIcon(r?n==null?void 0:n.wallet:void 0):"",a=r&&this.options.showRecentTransactions&&this.getPendingTransactionCount()>0?'<span class="xwk-button-pending-dot" aria-hidden="true"></span>':"",c=r&&this.options.showChevron&&this.options.accountPanel?`<span class="xwk-button-chevron" aria-hidden="true">${this.chevronIcon()}</span>`:"";return`<button class="xwk-account-button" data-xwk-wallet-button type="button">${o}${a}<span class="xwk-button-label">${this.escapeHtml(i)}${s}</span>${c}</button>`}renderPanel(){const e=this.messages(),n=this.options.manager.getSession();if(!n)return"";const r=this.addressQrOpen?this.renderAddressQrPanelContent(n):this.renderPanelContent(n),i=this.addressQrOpen?e.addressQr:e.connected,s=!this.addressQrOpen&&this.options.showRecentTransactions&&this.getVisibleTransactions(n).length>0,o=`${this.addressQrOpen?" xwk-account-panel-address-qr":""}${s?" xwk-account-panel-with-transactions":""}`,a=this.addressQrOpen?`<button class="xwk-account-back" type="button" data-xwk-account-back aria-label="${this.escapeHtml(e.back)}">${this.backIcon()}</button>`:"<span></span>";if(this.options.accountPanelMode==="modal")return`<div class="xwk-account-overlay" data-xwk-account-overlay role="presentation"><section class="xwk-account-panel xwk-account-panel-modal${o}" role="dialog" aria-modal="true" aria-label="${this.escapeHtml(i)}" tabindex="-1"><div class="xwk-account-modal-header">${a}<h2>${this.escapeHtml(i)}</h2><button class="xwk-account-close" type="button" data-xwk-account-close aria-label="${this.escapeHtml(e.close)}">&times;</button></div><div class="xwk-account-modal-body">${r}</div></section></div>`;const c=this.addressQrOpen?`<div class="xwk-account-dropdown-header"><button class="xwk-account-back" type="button" data-xwk-account-back aria-label="${this.escapeHtml(e.back)}">${this.backIcon()}</button><strong>${this.escapeHtml(i)}</strong></div>`:"";return`<div class="xwk-account-panel xwk-account-panel-dropdown${o}" role="dialog" aria-label="${this.escapeHtml(i)}">${c}${r}</div>`}renderPanelContent(e){var v;const n=this.messages(),r=this.getSessionAddress(e),i=this.getAccountLabel(e),s=this.getExplorerUrl(e),o=this.accountAction==="disconnect",a=this.copied?this.copiedIcon():this.copyIcon(),c=o?this.spinnerIcon():this.logoutIcon(),l=this.options.copyAddress?`<button type="button" data-xwk-copy-address${o?" disabled":""}>${a}<span>${this.copied?this.escapeHtml(n.copied):this.escapeHtml(n.copyAddress)}</span></button>`:"",d=this.options.explorer&&s?`<a href="${this.escapeHtml(s)}" target="_blank" rel="noreferrer">${this.externalIcon()}<span>${this.escapeHtml(n.viewExplorer)}</span></a>`:"",u=this.options.disconnect?`<button type="button" data-xwk-disconnect${this.copyInProgress||o?" disabled":""}>${c}<span>${o?this.escapeHtml(n.disconnecting):this.escapeHtml(n.disconnect)}</span></button>`:"",f=Qc(e.account.network),p=this.options.showBalance&&this.activationStatus==="unfunded"?`<div class="xwk-account-warning">${this.escapeHtml(n.accountNotActivated(f))}</div>`:"",m=this.options.showBalance&&this.balanceLoading?`<div class="xwk-account-balance xwk-account-balance-loading">${this.balanceSpinnerIcon()}<span>${this.escapeHtml(n.connecting)}</span></div>`:this.options.showBalance&&this.activationStatus!=="unfunded"&&((v=this.balance)!=null&&v.formatted)?`<div class="xwk-account-balance">${this.escapeHtml(this.balance.formatted)}</div>`:"",h=m?`<div class="xwk-account-meta-row">${m}</div>`:"",g=this.renderAddressQrButton(r),w=this.shouldShowWeb3Name()&&this.identityName,E=w&&r?`<div class="xwk-account-address">${this.escapeHtml(this.formatAddress(r))}${g}</div>`:"",y=`<div class="xwk-account-panel-actions">${l}${d}${u}</div>`,b=!w&&g&&this.options.fallbackToAddress?`<div class="xwk-account-name xwk-account-name-with-qr xwk-account-name-address"><span>${this.escapeHtml(i)}</span>${g}</div>`:`<div class="xwk-account-name">${this.escapeHtml(i)}</div>`,S=this.renderTransactionHistory(e);return`<div class="xwk-account-hero">${this.renderAccountAvatar(e)}</div>${b}${E}${h}${p}${S}${y}`}renderAddressQrPanelContent(e){const n=this.messages(),r=this.getSessionAddress(e);if(!r)return"";const i=this.copied?this.copiedIcon():this.copyIcon(),s=this.options.copyAddress?`<button type="button" data-xwk-copy-address>${i}<span>${this.copied?this.escapeHtml(n.copied):this.escapeHtml(n.copyAddress)}</span></button>`:"";return`<div class="xwk-address-qr-content"><div class="xwk-address-qr-code" data-xwk-address-qr-code data-address="${this.escapeHtml(r)}" aria-hidden="true"></div><div class="xwk-address-qr-chip">${this.escapeHtml(r)}</div><div class="xwk-account-panel-actions">${s}</div></div>`}renderAddressQrButton(e){if(!this.options.showAddressQr||!e)return"";const n=this.messages();return`<button class="xwk-address-qr-trigger" type="button" data-xwk-address-qr aria-label="${this.escapeHtml(n.showAddressQr)}" title="${this.escapeHtml(n.showAddressQr)}">${this.qrIcon()}</button>`}renderTransactionHistory(e){if(!this.options.showRecentTransactions)return"";const n=this.getVisibleTransactions(e);if(!n.length)return"";const r=this.messages(),i=n.length>9?"9+":String(n.length),s=this.txSectionOpen?"open":"closed",a=`<div class="xwk-tx-list ${this.txSectionOpen?"open":"closed"}" role="list" aria-hidden="${this.txSectionOpen?"false":"true"}"><div class="xwk-tx-list-inner">${n.map(c=>this.renderTransactionRow(c)).join("")}</div></div>`;return`<section class="xwk-tx-section" aria-label="${this.escapeHtml(r.recentTransactions)}"><button class="xwk-tx-header" type="button" data-xwk-tx-toggle aria-expanded="${this.txSectionOpen?"true":"false"}"><span>${this.escapeHtml(r.recentTransactions)}</span><span class="xwk-tx-count">${this.escapeHtml(i)}</span><span class="xwk-tx-chevron ${s}" aria-hidden="true">${this.chevronUpIcon()}</span></button>${a}</section>`}renderTransactionRow(e){const n=this.messages(),r=this.transactionStatusLabel(e),i=this.getTransactionExplorerUrl(e),s=i?`<a class="xwk-tx-link" href="${this.escapeHtml(i)}" target="_blank" rel="noreferrer">${this.escapeHtml(n.view)}${this.externalIcon()}</a>`:"";return`<div class="xwk-tx-row xwk-tx-row-${this.escapeHtml(e.status)}" role="listitem"><span class="xwk-tx-status" aria-hidden="true">${this.transactionStatusIcon(e.status)}</span><div class="xwk-tx-main"><span class="xwk-tx-label">${this.escapeHtml(r)}</span><span class="xwk-tx-hash">${this.escapeHtml(this.formatHash(e.hash))} &middot; ${this.escapeHtml(this.formatRelativeTime(e))}</span></div>${s}</div>`}transactionStatusLabel(e){const n=this.messages();return e.status==="confirmed"?n.transactionConfirmed:e.status==="failed"?n.transactionFailed:e.status==="unknown"?n.transactionUnknown:n.transactionSubmitted}transactionStatusIcon(e){return e==="confirmed"?this.checkIcon():e==="failed"?this.closeIcon():e==="unknown"?this.questionIcon():'<span class="xwk-tx-spinner" aria-hidden="true"></span>'}getVisibleTransactions(e){const n=this.getSessionAddress(e),r=Math.max(1,Math.floor(this.options.maxVisibleTransactions));return this.getRecentTransactions(e).filter(i=>{var s;return!n||!((s=i.account)!=null&&s.address)||i.account.address===n}).slice(0,r)}getRecentTransactions(e){var i,s,o;const n=((s=(i=this.options.manager).getTransactions)==null?void 0:s.call(i))??[],r=(o=e==null?void 0:e.account.network)==null?void 0:o.id;return[...n].sort((a,c)=>this.transactionTimestamp(c)-this.transactionTimestamp(a)).filter(a=>{var c,l;return!r||!((l=(c=a.account)==null?void 0:c.network)!=null&&l.id)||a.account.network.id===r})}getPendingTransactionCount(){return this.getRecentTransactions(this.options.manager.getSession()).filter(e=>e.status==="submitted").length}transactionTimestamp(e){return e.confirmedAt??e.failedAt??e.submittedAt??0}getTransactionExplorerUrl(e){var r,i,s,o;const n=(s=(i=this.options).transactionExplorerUrl)==null?void 0:s.call(i,e.hash,(r=e.account)==null?void 0:r.network);return n||np((o=e.account)==null?void 0:o.network,e.hash)}formatHash(e){return e.length>12?`${e.slice(0,6)}...${e.slice(-6)}`:e}formatRelativeTime(e){const n=this.transactionTimestamp(e);if(!n)return"";const r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i} min ago`;const s=Math.floor(i/60);return s<24?`${s} hr ago`:s<48?"yesterday":`${Math.floor(s/24)} days ago`}getAccountLabel(e){var r,i;if(this.shouldShowWeb3Name()&&this.identityName)return this.identityName;if(!this.options.fallbackToAddress)return((r=e.wallet)==null?void 0:r.name)??e.adapterId;const n=this.getSessionAddress(e);return n?(this.options.formatAddress??this.formatAddress)(n):((i=e.wallet)==null?void 0:i.name)??e.adapterId}renderAccountAvatar(e){if(this.identityAvatar)return`<img class="xwk-account-avatar" src="${this.escapeHtml(this.identityAvatar)}" alt="">`;const[n,r,i]=this.getAddressGradient(this.getSessionAddress(e));return`<div class="xwk-account-art" style="--xwk-avatar-from:${n};--xwk-avatar-to:${r};--xwk-avatar-spot:${i}"><span></span></div>`}getExplorerUrl(e){var s;if(this.options.explorerUrl)return this.options.explorerUrl(e);const n=this.getSessionAddress(e);if(!n)return;const r=iE(e.account.network,n);if(r)return r;const i=((s=e.account.network)==null?void 0:s.networkType)??e.account.networkType;return i==="TESTNET"?`https://testnet.xrpl.org/accounts/${encodeURIComponent(n)}`:i==="DEVNET"?`https://devnet.xrpl.org/accounts/${encodeURIComponent(n)}`:`https://livenet.xrpl.org/accounts/${encodeURIComponent(n)}`}getSessionAddress(e){const n=e==null?void 0:e.account,r=typeof(n==null?void 0:n.address)=="string"?n.address:"";return r||(typeof(n==null?void 0:n.classicAddress)=="string"?n.classicAddress:"")}shouldShowWeb3Name(){return this.options.showWeb3Name??!0}messages(){return Xr(this.options.language,this.options.messages)}renderWalletIcon(e,n){const r=(e==null?void 0:e.icon)??n;if(r)return`<img class="xwk-button-icon" src="${this.escapeHtml(r)}" alt="">`;if(!e)return`<span class="xwk-button-icon xwk-button-icon-fallback xwk-button-icon-svg-fallback" aria-hidden="true">${this.walletIcon()}</span>`;const i=e.name.slice(0,1).toUpperCase();return`<span class="xwk-button-icon xwk-button-icon-fallback xwk-button-icon-initial" aria-hidden="true">${this.escapeHtml(i)}</span>`}repairFallbackIcon(e){e.querySelectorAll(".xwk-button-icon-svg-fallback").forEach(n=>{n.querySelector("svg")||(n.innerHTML=this.walletIcon())})}getAccountPanelFocusableElements(){const e=this.getAccountPanelRoot();if(!e)return[];const n=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>r.offsetParent!==null)}getAccountPanelRoot(){var e,n;return((e=this.accountPanelPortal)==null?void 0:e.querySelector(".xwk-account-panel-modal"))??((n=this.target)==null?void 0:n.querySelector(".xwk-account-panel-modal"))??null}walletIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4.5 7.5A2.5 2.5 0 0 1 7 5h11.5A1.5 1.5 0 0 1 20 6.5V9H7A2.5 2.5 0 0 1 4.5 6.5v1Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M4 9h15.5A2.5 2.5 0 0 1 22 11.5v5A2.5 2.5 0 0 1 19.5 19h-13A2.5 2.5 0 0 1 4 16.5V9Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M17 13.5h5V17h-5a1.75 1.75 0 1 1 0-3.5Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>'}backIcon(){return'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}qrIcon(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4 4h6v6H4V4Zm10 0h6v6h-6V4ZM4 14h6v6H4v-6Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M14 14h2v2h-2v-2Zm4 0h2v2h-2v-2Zm-4 4h2v2h-2v-2Zm4 0h2v2h-2v-2Z" fill="currentColor"/></svg>'}renderAddressQrIfNeeded(e){if(!this.addressQrOpen)return;const n=e.querySelector("[data-xwk-address-qr-code]"),r=n==null?void 0:n.dataset.address;if(!(!n||!r||n.dataset.xwkRendered===r)){n.dataset.xwkRendered=r,n.replaceChildren();try{const i=this.resolveThemeMode()==="dark"?ng:Ef;new I2({width:qi,height:qi,type:"svg",data:r,margin:4,qrOptions:{errorCorrectionLevel:"H"},dotsOptions:{type:"dots",color:i,roundSize:!0},cornersSquareOptions:{type:"extra-rounded",color:i},cornersDotOptions:{type:"dot",color:i},backgroundOptions:{color:"transparent"}}).append(n)}catch{const i=document.createElement("div");i.className="xwk-address-qr-fallback",i.textContent=r,n.replaceChildren(i)}}}normalizeBalance(e){var r;if(e==null)return null;const n=Qc((r=this.options.manager.getSession())==null?void 0:r.account.network);return typeof e=="string"||typeof e=="number"?{value:String(e),formatted:`${e} ${n}`,symbol:n}:{...e,formatted:e.formatted||e.availableFormatted||`${e.value} ${e.symbol||n}`,symbol:e.symbol||n,activationStatus:e.activationStatus}}scheduleBalanceRefresh(e){!this.options.showBalance||!this.options.balanceResolver||(this.clearBalanceRefreshTimers(),e.forEach(n=>{let r=0;r=window.setTimeout(()=>{this.balanceRefreshTimers.delete(r),this.resolveBalance(this.options.manager.getSession())},n),this.balanceRefreshTimers.add(r)}))}clearBalanceRefreshTimers(){this.balanceRefreshTimers.forEach(e=>window.clearTimeout(e)),this.balanceRefreshTimers.clear()}chevronIcon(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="m6 9 6 6 6-6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}chevronUpIcon(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="m18 15-6-6-6 6" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}checkIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="m5 12.5 4.2 4.2L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}closeIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="m7 7 10 10M17 7 7 17" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg>'}questionIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none"><path d="M9.7 9a2.4 2.4 0 1 1 3.8 2c-.9.6-1.5 1.1-1.5 2.4" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/><path d="M12 17h.01" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>'}copyIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="8" y="8" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2"/><path d="M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}copiedIcon(){return'<svg class="xwk-copied-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="10" fill="currentColor"/><path d="m7.8 12.4 2.7 2.7 5.9-6.2" stroke="#fff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}externalIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M14 4h6v6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 4 10 14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M11 5H7a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3v-4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}logoutIcon(){return'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M10 6H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15 8l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M19 12H9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'}spinnerIcon(){return'<span class="xwk-action-spinner" aria-hidden="true"></span>'}balanceSpinnerIcon(){return'<span class="xwk-balance-spinner" aria-hidden="true"></span>'}ensureStyles(){const e=this.renderStyles();tg(eg("xwk-button",e),e)}renderStyles(){const e=this.resolveTheme(),n=this.resolveThemeMode(),r=this.options.size==="lg"?"50px":this.options.size==="sm"?"44px":"46px",i=this.options.variant==="pill"?"999px":e.walletRadius??"10px",s=this.options.variant==="default"||this.options.variant==="pill"?e.surface:e.background,o=this.options.variant==="default"||this.options.variant==="pill"?e.surfaceHover:e.surface,a=this.options.variant==="minimal"?"transparent":e.border,c=this.resolveVisibleBorder(e.border),l=n==="dark"?"rgba(255,255,255,.10)":"rgba(15,23,42,.08)",d=e.fallbackIconBackground,u=e.fallbackIconColor,f=e.overlayBlur>0?`blur(${e.overlayBlur}px)`:"none";return`.xwk-button-root{display:inline-block;max-width:100%;position:relative;font-family:${e.fontFamily};font-size:14px}.xwk-account-button{align-items:center;background:${s};border:1px solid ${a};border-radius:${i};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;gap:8px;font:inherit;font-weight:560;max-width:100%;min-height:${r};overflow:hidden;padding:0 12px 0 10px;touch-action:manipulation;transition:background-color .16s ease,border-color .16s ease;white-space:nowrap;-webkit-tap-highlight-color:transparent;transform:none}.xwk-account-button:hover{background:${o};box-shadow:none;opacity:1;transform:none}.xwk-account-button:active{background:${o};opacity:1;transform:none}.xwk-account-button:focus-visible,.xwk-button-chevron:focus-visible,.xwk-account-panel-actions button:focus-visible,.xwk-account-panel-actions a:focus-visible,.xwk-address-qr-trigger:focus-visible,.xwk-tx-header:focus-visible,.xwk-tx-link:focus-visible{outline:2px solid ${e.accent};outline-offset:2px;text-decoration:none}.xwk-button-icon{background:${e.background};border:1px solid ${c};border-radius:10px;box-sizing:border-box;display:inline-flex;flex:0 0 28px;height:28px;isolation:isolate;line-height:0;max-width:28px;min-width:28px;object-fit:contain;overflow:hidden;position:relative;width:28px}.xwk-button-icon-fallback{align-items:center;background:${d};color:${u};justify-content:center}.xwk-button-icon-initial{font-size:12px;line-height:1}.xwk-button-icon-svg-fallback{font-size:0}.xwk-button-icon-svg-fallback svg{display:block;flex:0 0 17px;height:17px;max-height:17px;max-width:17px;min-height:17px;min-width:17px;width:17px}.xwk-button-pending-dot{background:${e.accent};border:2px solid ${s};border-radius:999px;box-sizing:border-box;flex:0 0 9px;height:9px;margin-left:-13px;margin-right:4px;position:relative;width:9px;z-index:1}.xwk-button-label{display:inline-block;flex:1 1 0;font-size:13px;font-weight:560;line-height:1.1;max-width:220px;min-width:0;overflow:hidden;padding-right:2px;text-overflow:ellipsis;white-space:nowrap}.xwk-button-balance{color:${e.muted};font-weight:500;margin-left:4px}.xwk-button-balance-loading{display:inline-flex;vertical-align:-2px}.xwk-balance-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.muted};border-radius:999px;box-sizing:border-box;display:inline-block;flex:0 0 13px;height:13px;width:13px}.xwk-button-chevron{align-items:center;background:${e.background};border:1px solid ${c};border-radius:999px;color:${e.muted};display:inline-flex;flex:0 0 26px;height:26px;justify-content:center;line-height:1;touch-action:manipulation;width:26px}.xwk-button-chevron:hover{background:${e.surfaceHover};color:${e.foreground}}.xwk-account-overlay{align-items:center;background:${e.overlay};-webkit-backdrop-filter:${f};backdrop-filter:${f};display:flex;inset:0;justify-content:center;overscroll-behavior:contain;padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));position:fixed;z-index:2147483647}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-overlay{animation:xwk-account-overlay-in .18s ease-out}.xwk-account-panel{background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:${e.shadow};box-sizing:border-box;color:${e.foreground};display:grid;gap:12px;overflow:hidden;z-index:2147483647}.xwk-account-panel:focus{outline:none}.xwk-account-panel-dropdown{box-shadow:none;justify-items:center;margin-top:10px;min-width:320px;padding:18px;position:absolute;right:0;top:100%;width:min(360px,calc(100vw - 32px))}.xwk-account-dropdown-header{align-items:center;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;margin:-4px 0 0;width:100%}.xwk-account-dropdown-header strong{font-size:14px;font-weight:600;line-height:1.2;min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-account-panel-modal{gap:0;grid-template-rows:auto minmax(0,1fr);height:min(527px,calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));max-width:520px;position:relative;transform-origin:center bottom;width:min(520px,100%)}.xwk-account-panel-modal.xwk-account-panel-with-transactions{height:min(650px,calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation:xwk-account-panel-in .22s cubic-bezier(.22,1,.36,1)}.xwk-account-modal-header{align-items:center;background:${e.headerBackground};border-bottom:1px solid ${e.border};display:grid;grid-template-columns:44px minmax(0,1fr) 44px;column-gap:8px;padding:8px 18px}.xwk-account-modal-header h2{color:${e.foreground};font-size:16px;font-weight:500;line-height:1.2;margin:0;min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-account-modal-body{-webkit-overflow-scrolling:touch;align-items:center;display:flex;flex-direction:column;gap:12px;min-height:0;overflow:hidden;overscroll-behavior:contain;padding:22px 28px 28px}.xwk-account-panel-with-transactions .xwk-account-modal-body{overflow:auto;padding-top:14px}.xwk-account-modal-body>.xwk-account-hero,.xwk-account-modal-body>.xwk-account-name,.xwk-account-modal-body>.xwk-account-address,.xwk-account-modal-body>.xwk-account-meta-row,.xwk-account-modal-body>.xwk-account-warning,.xwk-account-modal-body>.xwk-tx-section,.xwk-account-modal-body>.xwk-account-panel-actions{flex-shrink:0}.xwk-account-close,.xwk-account-back{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent!important;border:0!important;border-radius:999px;box-shadow:none!important;color:${e.muted};cursor:pointer;display:inline-flex;font:inherit;font-size:26px;font-weight:500;height:44px;justify-content:center;line-height:1;margin:0;min-height:0;outline:none!important;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-account-back{font-size:0;justify-self:start}.xwk-account-close{justify-self:end}.xwk-account-close:hover,.xwk-account-back:hover{background:${e.surfaceHover}!important;box-shadow:none!important;color:${e.foreground};transform:none}.xwk-account-close:focus-visible,.xwk-account-back:focus-visible{outline:2px solid ${e.accent}!important;outline-offset:0}.xwk-account-hero{height:154px;margin-top:4px;position:relative;width:180px}.xwk-account-panel-with-transactions .xwk-account-hero{height:126px;margin-bottom:0}.xwk-account-panel-with-transactions .xwk-account-art,.xwk-account-panel-with-transactions .xwk-account-avatar{top:0}.xwk-account-panel-dropdown .xwk-account-hero{height:132px;width:160px}.xwk-account-art,.xwk-account-avatar{border-radius:999px;height:118px;left:31px;position:absolute;top:8px;width:118px}.xwk-account-panel-dropdown .xwk-account-art,.xwk-account-panel-dropdown .xwk-account-avatar{height:104px;left:28px;width:104px}.xwk-account-art{align-items:center;background:radial-gradient(circle at 58% 38%,var(--xwk-avatar-spot),transparent 0 22%,transparent 23%),linear-gradient(160deg,var(--xwk-avatar-from),var(--xwk-avatar-to));display:flex;justify-content:center}.xwk-account-art span{background:rgba(255,255,255,.18);border-radius:999px;height:50px;width:50px}.xwk-account-panel-dropdown .xwk-account-art span{height:42px;width:42px}.xwk-account-avatar{background:${e.surface};border:1px solid ${c};box-sizing:border-box;display:block;object-fit:cover;overflow:hidden}.xwk-account-panel-with-transactions .xwk-account-name{position:relative;z-index:1}.xwk-account-name{color:${e.foreground};font-size:21px;font-weight:650;line-height:1.2;max-width:100%;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-account-panel-dropdown .xwk-account-name{font-size:18px}.xwk-account-name-with-qr,.xwk-account-address{align-items:center;display:inline-flex;gap:6px;justify-content:center}.xwk-account-name-with-qr span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-account-name-address{background:${e.surface};border:1px solid ${e.border};border-radius:14px;color:${e.muted};font-size:16px;font-weight:600;line-height:1.2;max-width:min(260px,100%);padding:7px 6px 7px 14px}.xwk-account-address{background:${e.surface};border:1px solid ${e.border};border-radius:12px;color:${e.muted};font-size:14px;font-weight:520;line-height:1.25;max-width:100%;overflow:hidden;padding:8px 8px 8px 12px;text-align:center;text-overflow:ellipsis;white-space:nowrap}.xwk-address-qr-trigger{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:0;border-radius:10px;box-shadow:none;color:currentColor;cursor:pointer;display:inline-flex;flex:0 0 40px;height:40px;justify-content:center;margin:-7px -6px -7px 0;min-height:40px;outline:none;overflow:visible;padding:0;touch-action:manipulation;transform:none;width:40px}.xwk-address-qr-trigger svg{display:block;height:17px;overflow:visible;width:17px}.xwk-address-qr-trigger:hover{background:${e.surfaceHover};box-shadow:none;transform:none}.xwk-account-meta-row{align-items:center;display:flex;gap:8px;justify-content:center;max-width:100%;min-height:42px}.xwk-account-balance{align-items:center;background:${e.surface};border:1px solid ${l};border-radius:999px;box-sizing:border-box;color:${e.muted};display:inline-flex;font-size:13px;font-weight:560;height:42px;justify-content:center;letter-spacing:0;line-height:1;padding:0 14px;text-align:center}.xwk-account-balance-loading{align-items:center;display:inline-flex;gap:6px}.xwk-account-warning{align-items:center;background:${e.surface};border:1px solid ${l};border-radius:12px;box-sizing:border-box;color:${e.muted};display:flex;font-size:13px;font-weight:520;justify-content:center;line-height:1.25;min-height:54px;padding:0 14px;text-align:center;width:100%}.xwk-address-qr-content{align-content:center;display:grid;gap:14px;justify-items:center;min-height:100%;width:100%}.xwk-address-qr-code{aspect-ratio:1/1;background:${e.surface};border:1px solid ${e.border};border-radius:14px;box-sizing:border-box;display:grid;max-width:304px;padding:12px;place-items:center;width:min(304px,100%)}.xwk-address-qr-code svg,.xwk-address-qr-code canvas,.xwk-address-qr-code img{aspect-ratio:1/1;display:block;height:auto;max-width:100%;width:100%}.xwk-address-qr-chip{background:${e.surface};border:1px solid ${e.border};border-radius:12px;box-sizing:border-box;color:${e.muted};font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;font-weight:520;line-height:1.45;max-width:100%;overflow-wrap:anywhere;padding:9px 11px;text-align:center;width:100%}.xwk-address-qr-fallback{color:${e.muted};font-size:12px;line-height:1.45;overflow-wrap:anywhere}.xwk-tx-section{background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-sizing:border-box;display:grid;overflow:hidden;width:100%}.xwk-tx-header{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface}!important;border:0!important;box-shadow:none!important;color:${e.muted};cursor:pointer;display:flex;font:inherit;font-size:10px;font-weight:650;gap:6px;letter-spacing:.07em;line-height:1.2;margin:0;min-height:34px;outline:none;padding:0 12px;text-align:left;text-transform:uppercase;touch-action:manipulation;transform:none;transition:background-color .16s ease,color .16s ease;width:100%}.xwk-tx-header:hover,.xwk-tx-header:active{background:${e.surfaceHover}!important;border:0!important;box-shadow:none!important;color:${e.foreground};opacity:1;text-decoration:none;transform:none}.xwk-tx-count{align-items:center;background:${e.background};border:1px solid ${l};border-radius:999px;box-sizing:border-box;color:${e.muted};display:inline-flex;font-size:10px;font-weight:650;height:16px;justify-content:center;letter-spacing:0;line-height:1;min-width:18px;padding:0 5px;text-transform:none}.xwk-tx-chevron{align-items:center;color:${e.muted};display:inline-flex;flex:0 0 16px;height:16px;justify-content:center;margin-left:auto;transition:transform .18s ease;width:16px}.xwk-tx-chevron.closed{transform:rotate(-90deg)}.xwk-tx-chevron svg{display:block;height:12px;width:12px}.xwk-tx-list{display:grid;grid-template-rows:1fr;overflow:hidden;transition:grid-template-rows .18s ease}.xwk-tx-list.closed{grid-template-rows:0fr}.xwk-tx-list-inner{min-height:0;overflow:hidden}.xwk-tx-row{align-items:center;background:${e.surface};border-top:1px solid ${l};box-sizing:border-box;display:grid;gap:8px;grid-template-columns:24px minmax(0,1fr) auto;min-height:42px;padding:7px 10px;transition:background-color .16s ease}.xwk-tx-row:hover{background:${e.surface};box-shadow:none;transform:none}.xwk-tx-row:first-child{border-top:0}.xwk-tx-status{align-items:center;background:${e.background};border-radius:999px;color:${e.accent};display:inline-flex;height:24px;justify-content:center;width:24px}.xwk-tx-row-confirmed .xwk-tx-status{color:${e.success}}.xwk-tx-row-failed .xwk-tx-status{color:${e.error}}.xwk-tx-row-unknown .xwk-tx-status{color:${e.muted}}.xwk-tx-main{display:grid;gap:2px;min-width:0}.xwk-tx-label{color:${e.foreground};font-size:12px;font-weight:600;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-tx-hash{color:${e.muted};font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-tx-link{align-items:center;border-radius:9px;color:${e.accent};display:inline-flex;font:inherit;font-size:12px;font-weight:650;gap:3px;line-height:1.2;min-height:28px;padding:0 6px;text-decoration:none}.xwk-tx-link:hover{background:${e.surfaceHover};box-shadow:none;text-decoration:none;transform:none}.xwk-tx-link svg{height:12px;width:12px}.xwk-tx-empty{background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-sizing:border-box;color:${e.muted};font-size:13px;line-height:1.35;padding:14px;text-align:center;width:100%}.xwk-tx-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.accent};border-radius:999px;box-sizing:border-box;display:block;height:14px;width:14px}.xwk-account-panel-actions{display:grid;gap:10px;grid-template-columns:1fr;width:100%}.xwk-account-modal-body .xwk-account-panel-actions{margin-top:auto}.xwk-account-panel-with-transactions .xwk-account-modal-body .xwk-account-panel-actions{margin-top:0}.xwk-account-panel-actions button,.xwk-account-panel-actions a{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:${e.surface};border:1px solid ${l};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:flex;font:inherit;font-size:14px;font-weight:560;gap:8px;justify-content:center;line-height:1.2;min-height:46px;min-width:0;outline:none;overflow:hidden;padding:0 12px;text-decoration:none;touch-action:manipulation;transform:none;transition:background-color .16s ease,border-color .16s ease;width:100%}.xwk-account-panel-actions button:disabled{cursor:wait;opacity:1}.xwk-account-panel-actions svg{flex:0 0 auto;opacity:.58}.xwk-account-panel-actions span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-account-panel-actions button:hover,.xwk-account-panel-actions a:hover{background:${e.surfaceHover};border-color:${l};box-shadow:none;text-decoration:none;transform:none}.xwk-account-panel-actions button:active,.xwk-account-panel-actions a:active{background:${e.surfaceHover};opacity:1;text-decoration:none;transform:none}.xwk-copied-icon{color:${e.success};opacity:1!important}.xwk-action-spinner{animation:xwk-action-spin .8s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.muted};border-radius:999px;box-sizing:border-box;display:inline-block;height:17px;width:17px}@keyframes xwk-action-spin{to{transform:rotate(360deg)}}@keyframes xwk-account-overlay-in{from{opacity:0}to{opacity:1}}@keyframes xwk-account-panel-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.xwk-account-button,.xwk-tx-list,.xwk-tx-chevron,.xwk-account-panel-actions button,.xwk-account-panel-actions a{transition:none}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-overlay,.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation-duration:1ms!important}.xwk-action-spinner,.xwk-balance-spinner,.xwk-tx-spinner{animation:none}}@media(max-width:520px){.xwk-account-panel-dropdown{bottom:0;left:0;margin-top:0;min-width:0;position:fixed;right:0;top:auto;width:100vw}.xwk-account-overlay{align-items:flex-end;padding:max(12px,env(safe-area-inset-top)) 0 0}.xwk-account-panel-modal{align-self:flex-end;border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;border-left:0;border-right:0;border-top-left-radius:${e.radius};border-top-right-radius:${e.radius};height:min(527px,calc(100dvh - env(safe-area-inset-top)));max-width:none;width:100vw}.xwk-account-panel-modal.xwk-account-panel-with-transactions{height:min(650px,calc(100dvh - env(safe-area-inset-top)))}.xwk-account-portal[data-xwk-entering="true"] .xwk-account-panel-modal{animation:xwk-account-sheet-in .28s cubic-bezier(.32,.72,0,1)}.xwk-account-modal-header{border-top-left-radius:${e.radius};border-top-right-radius:${e.radius};grid-template-columns:44px minmax(0,1fr) 44px;padding:10px 16px}.xwk-account-modal-body{min-height:0;padding:18px 20px max(22px,calc(22px + env(safe-area-inset-bottom)))}.xwk-button-label{max-width:min(150px,calc(100vw - 140px))}}@keyframes xwk-account-sheet-in{from{opacity:1;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}`}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveVisibleBorder(e){const n=typeof e=="string"?e.trim().toLowerCase():"";return!n||n==="transparent"||n==="none"?this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)":e??(this.resolveThemeMode()==="dark"?"rgba(255,255,255,.12)":"rgba(15,23,42,.08)")}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode}resolveTarget(e){if(!e)return;if(typeof e!="string")return e;const n=document.querySelector(e);if(!n)throw new Error(`Wallet button target was not found: ${e}`);return n}formatAddress(e){return`${e.slice(0,6)}...${e.slice(-4)}`}getAddressGradient(e){const n=[["#0ea5e9","#6366f1","#93c5fd"],["#14b8a6","#2563eb","#99f6e4"],["#f97316","#db2777","#fed7aa"],["#8b5cf6","#06b6d4","#ddd6fe"],["#22c55e","#0f766e","#bbf7d0"],["#f43f5e","#7c3aed","#fecdd3"]];let r=0;for(let s=0;s<e.length;s+=1)r=(r<<5)-r+e.charCodeAt(s)|0;const i=n[Math.abs(r)%n.length];return[i[0],i[1],i[2]]}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}escapeHtml(e){return String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}}function AS(t={}){const e=t.endpoint??"https://app.xrpdomains.xyz/api/xrplnft/getName",n=t.profileEndpoint??"https://app.xrpdomains.xyz/api/xrplnft/getAddress",r=t.timeoutMs??3e3,i=t.cacheTtlMs??6e5,s=new Map;return async(o,a,c)=>{if(!a||!sE(a.account.network))return null;const l=s.get(o);if(!(c!=null&&c.force)&&l&&l.expiresAt>Date.now())return l.value;const d=new AbortController,u=window.setTimeout(()=>d.abort(),r);try{const f=`address=${encodeURIComponent(o)}${c!=null&&c.force?`&_=${Date.now()}`:""}`,p=`${e}${e.includes("?")?"&":"?"}${f}`,m=await fetch(p,{signal:d.signal});if(!m.ok)return null;const h=await m.json(),g=typeof h.data=="string"?h.data:typeof h.name=="string"?h.name:null,w=g?await SP(n,g,d.signal):void 0,E=g?{name:g,source:"xrpdomains",avatar:w,verified:!0}:null;return s.set(o,{value:E,expiresAt:Date.now()+i}),E}finally{window.clearTimeout(u)}}}async function SP(t,e,n){try{const r=`${t}${t.includes("?")?"&":"?"}domain=${encodeURIComponent(e)}`,i=await fetch(r,{signal:n});if(!i.ok)return;const s=await i.json();return _P(Sf(s),t)}catch{return}}function Sf(t){if(!t||typeof t!="object")return;const e=t,n=e.avatar;if(typeof n=="string"&&n.trim())return n.trim();const r=e.profile_info??e.profileInfo,i=Sf(r);if(i)return i;const s=Sf(e.data);if(s)return s;const o=Sf(e.result);if(o)return o}function _P(t,e){if(t){if(/^(?:https?:|data:|blob:|ipfs:|ar:)/i.test(t))return t;if(t.startsWith("//"))try{return`${new URL(e).protocol}${t}`}catch{return t}try{const n=new URL(e);return new URL(t.replace(/^\/+/,""),`${n.origin}/`).toString()}catch{return t}}}function SS(t){const e=new Af(t);return t.target&&e.mount(t.target),e}const xP=5e3,TP=3;class ag{constructor(e){this.options=e,this.offEvents=[],this.dismissTimers=new Map,this.toasts=new Map,this.offEvents.push(e.manager.on("tx_submitted",({hash:n,transaction:r})=>this.upsert(n,r??{hash:n,status:"submitted",submittedAt:Date.now()})),e.manager.on("tx_confirmed",({hash:n,transaction:r})=>this.upsert(n,r??{hash:n,status:"confirmed",submittedAt:Date.now(),confirmedAt:Date.now()})),e.manager.on("tx_failed",({hash:n,transaction:r,error:i})=>{n&&this.upsert(n,r??{hash:n,status:"failed",submittedAt:Date.now(),failedAt:Date.now(),error:i})}),e.manager.on("disconnected",()=>this.clearAll()))}mount(e=this.options.mount??document.body){var n;(n=this.root)!=null&&n.isConnected||(this.root=document.createElement("div"),this.root.className=`xwk-toast-root xwk-toast-root--${this.position()}`,this.root.setAttribute("aria-live","polite"),this.root.setAttribute("aria-label","Transaction notifications"),this.ensureStyles(),e.appendChild(this.root),this.render())}destroy(){var e;this.clearTimers(),this.offEvents.splice(0).forEach(n=>n()),(e=this.root)==null||e.remove(),this.root=void 0,this.toasts.clear()}clearAll(){this.clearTimers(),this.toasts.clear(),this.render()}upsert(e,n){var r;this.toasts.set(e,n),!((r=this.root)!=null&&r.isConnected)&&typeof document<"u"&&this.mount(),this.enforceLimit(),this.render(),(n.status==="confirmed"||n.status==="failed")&&this.scheduleDismiss(e)}enforceLimit(){const e=this.options.maxVisible??TP;[...this.toasts.entries()].sort((r,i)=>this.getTimestamp(i[1])-this.getTimestamp(r[1])).slice(e).forEach(([r])=>this.remove(r))}scheduleDismiss(e){const n=this.options.autoDismissMs??xP;if(n<=0)return;const r=this.dismissTimers.get(e);r&&window.clearTimeout(r);const i=window.setTimeout(()=>this.remove(e),n);this.dismissTimers.set(e,i)}remove(e){const n=this.dismissTimers.get(e);n&&window.clearTimeout(n),this.dismissTimers.delete(e),this.toasts.delete(e),this.render()}render(){if(!this.root)return;this.root.className=`xwk-toast-root xwk-toast-root--${this.position()}`,this.ensureStyles();const e=[...this.toasts.values()].sort((n,r)=>this.getTimestamp(n)-this.getTimestamp(r)).map(n=>this.renderToast(n)).join("");this.root.innerHTML=e,this.root.querySelectorAll("[data-xwk-toast-dismiss]").forEach(n=>{n.addEventListener("click",()=>{const r=n.dataset.xwkToastDismiss;r&&this.remove(r)})})}renderToast(e){var c;const n=this.messages(),r=e.hash,i=this.formatHash(r),s=e.status==="confirmed"?"Transaction confirmed":e.status==="failed"?"Transaction failed":e.status==="unknown"?"Transaction status unknown":"Transaction submitted",o=this.getExplorerUrl(r,(c=e.account)==null?void 0:c.network),a=o?`<a class="xwk-toast-link" href="${this.escapeHtml(o)}" target="_blank" rel="noopener">View ${this.externalIcon()}</a>`:"";return`<div class="xwk-toast xwk-toast--${e.status}" data-hash="${this.escapeHtml(r)}" role="status"><div class="xwk-toast-icon">${this.renderStatusIcon(e.status)}</div><div class="xwk-toast-body"><span class="xwk-toast-label">${this.escapeHtml(s)}</span><span class="xwk-toast-hash">${this.escapeHtml(i)}</span></div>${a}<button class="xwk-toast-dismiss" data-xwk-toast-dismiss="${this.escapeHtml(r)}" aria-label="${this.escapeHtml(n.close)}" type="button">&times;</button></div>`}renderStatusIcon(e){return e==="confirmed"?`<span class="xwk-toast-icon-mark" aria-hidden="true">${this.checkIcon()}</span>`:e==="failed"?`<span class="xwk-toast-icon-mark" aria-hidden="true">${this.closeIcon()}</span>`:e==="unknown"?'<span class="xwk-toast-icon-mark" aria-hidden="true">?</span>':'<span class="xwk-toast-spinner" aria-hidden="true"></span>'}renderStyles(){const e=this.resolveTheme();return`.xwk-toast-root{bottom:24px;display:flex;flex-direction:column-reverse;font-family:${e.fontFamily};gap:10px;pointer-events:none;position:fixed;z-index:2147483646}.xwk-toast-root--bottom-right{right:24px}.xwk-toast-root--bottom-left{left:24px}.xwk-toast-root--bottom-center{left:50%;transform:translateX(-50%)}.xwk-toast{align-items:center;animation:xwk-toast-in .18s ease-out both;background:${e.background};border:1px solid ${e.border};border-radius:${e.radius};box-shadow:none;box-sizing:border-box;color:${e.foreground};display:flex;gap:12px;max-width:420px;min-width:330px;padding:12px 12px 12px 16px;pointer-events:auto}.xwk-toast-icon{align-items:center;border-radius:999px;display:flex;flex:0 0 32px;height:32px;justify-content:center;width:32px}.xwk-toast-spinner{animation:xwk-spin .9s linear infinite;border:2px solid ${e.spinnerTrail};border-top-color:${e.accent};border-radius:999px;display:block;height:18px;width:18px}.xwk-toast--submitted .xwk-toast-icon{background:${e.surface};color:${e.accent}}.xwk-toast--confirmed .xwk-toast-icon{background:${e.surface};color:${e.success}}.xwk-toast--failed .xwk-toast-icon{background:${e.surface};color:${e.error}}.xwk-toast--unknown .xwk-toast-icon{background:${e.surface};color:${e.muted}}.xwk-toast-icon-mark{display:inline-flex}.xwk-toast-body{display:flex;flex:1 1 auto;flex-direction:column;gap:2px;min-width:0}.xwk-toast-label{color:${e.foreground};font-size:13px;font-weight:600;white-space:nowrap}.xwk-toast-hash{color:${e.muted};font-family:ui-monospace,"Cascadia Code",monospace;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.xwk-toast-link{-webkit-tap-highlight-color:transparent;align-items:center;border-radius:${e.walletRadius};box-sizing:border-box;color:${e.accent};display:inline-flex;flex:0 0 auto;font:inherit;font-size:12px;font-weight:600;gap:4px;line-height:1.2;min-height:32px;outline:none;overflow:hidden;padding:0 6px;text-decoration:none;touch-action:manipulation;transform:none;white-space:nowrap}.xwk-toast-link:hover{background:${e.surfaceHover};text-decoration:none}.xwk-toast-link svg{height:13px;width:13px}.xwk-toast-dismiss{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;align-items:center;appearance:none;background:transparent;border:1px solid ${e.border};border-radius:${e.walletRadius};box-shadow:none;box-sizing:border-box;color:${e.foreground};cursor:pointer;display:inline-flex;flex:0 0 44px;font:inherit;font-size:24px;font-weight:400;height:44px;justify-content:center;line-height:1;margin:0;min-height:0;outline:none;overflow:hidden;padding:0;touch-action:manipulation;transform:none;width:44px}.xwk-toast-dismiss:hover{background:${e.surfaceHover};border-color:${e.border};box-shadow:none;color:${e.foreground};transform:none}.xwk-toast-dismiss:focus-visible,.xwk-toast-link:focus-visible{outline:2px solid ${e.accent};outline-offset:2px}@keyframes xwk-toast-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes xwk-spin{to{transform:rotate(360deg)}}@media(max-width:480px){.xwk-toast-root{bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px;transform:none}.xwk-toast{max-width:100%;min-width:0;width:100%}}@media(prefers-reduced-motion:reduce){.xwk-toast,.xwk-toast-spinner{animation:none}}`}ensureStyles(){const e=this.renderStyles();tg(eg("xwk-toast",e),e)}getExplorerUrl(e,n){var i,s;const r=(s=(i=this.options).explorerUrl)==null?void 0:s.call(i,e,n);return r||np(n,e)}getTimestamp(e){return e.confirmedAt??e.failedAt??e.submittedAt}formatHash(e){return e.length>12?`${e.slice(0,6)}...${e.slice(-6)}`:e}position(){return this.options.position??"bottom-right"}messages(){return Xr(this.options.language,this.options.messages)}resolveTheme(){return yo({mode:this.resolveThemeMode(),themeName:this.options.themeName,theme:this.options.theme,customTheme:this.options.customTheme})}resolveThemeMode(){return this.options.themeMode==="auto"?this.getSystemThemeMode():this.options.themeMode??"light"}getSystemThemeMode(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}clearTimers(){this.dismissTimers.forEach(e=>window.clearTimeout(e)),this.dismissTimers.clear()}escapeHtml(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]??n)}checkIcon(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="m5 12 4 4 10-10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'}closeIcon(){return'<svg width="15" height="15" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>'}externalIcon(){return'<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M14 5h5v5M10 14 19 5M19 14v4a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}function _S(t){const e=new ag(t);return t.mount&&e.mount(t.mount),e}function _f(t){let e;const n=t.adapters??OP(t,r=>{e==null||e.emitQr(r.adapterId,r.uri,r.deeplink)});return e=new cE({...UP(t),adapters:n,storage:NP(t.storage)}),e}function xS(t){const e=_f(t),n=BP(t),r=t.modal===!1?void 0:mS({manager:e,...n.ui}),i=CP(t,n.ui),s=i?_S({manager:e,...i}):void 0;s==null||s.mount();const o=RP(t),a=r&&o?SS({manager:e,modal:r,...o}):void 0;return t.autoReconnect&&IP(e),r&&n.autoOpen&&r.autoOpen(),{manager:e,modal:r,button:a,openModal:()=>r==null?void 0:r.open(),closeModal:()=>r==null?void 0:r.close(),disconnect:()=>e.disconnect(),toast:s,refreshIdentity:()=>a==null?void 0:a.refreshIdentity(),refreshBalance:()=>a==null?void 0:a.refreshBalance(),refreshAccount:()=>a==null?void 0:a.refreshAccount(),getSession:()=>e.getSession(),signAndSubmit:e.signAndSubmit.bind(e),signTransaction:e.signTransaction.bind(e),signMessage:e.signMessage.bind(e)}}function IP(t){const e=()=>{(typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame.bind(globalThis):r=>globalThis.setTimeout(()=>r(Date.now()),16))(()=>{t.autoReconnect()})};if(typeof window<"u"&&typeof document<"u"&&document.readyState!=="complete"){window.addEventListener("load",e,{once:!0});return}e()}function CP(t,e){var s;const r=(typeof t.modal=="object"?t.modal:{}).toast??((s=t.ui)==null?void 0:s.toast);if(!r)return;const i=r===!0?{}:r;return{language:e.language,messages:e.messages,themeMode:e.themeMode,themeName:e.themeName,theme:e.theme,customTheme:e.customTheme,...i}}function OP(t,e){const n=t.wallets==="all"||!t.wallets?void 0:new Set(t.wallets),r=[];if(fl(n,"xaman")&&t.xamanClientId&&r.push(y2({apiKey:t.xamanClientId,onQr:e})),fl(n,"gemwallet")&&r.push(_A()),fl(n,"crossmark")&&r.push(fE()),fl(n,"dropfi")&&r.push(gE()),fl(n,"xrplsnap")&&r.push(v2()),t.walletConnectProjectId&&PP(n)){const i=kP(t);r.push(...jA({projectId:t.walletConnectProjectId,mode:i==="default"?"default":"details",wallets:LP(n),metadata:$A({name:t.appName,description:t.appDescription??`${t.appName} XRPL wallet connection`,url:t.appUrl??MP(),icons:t.appIcons??[]}),onQr:e,signMessageDestination:t.walletConnectSignMessageDestination,useModal:i==="default"?!0:void 0,modalMode:i==="default"?"always":void 0}))}return r}function NP(t){if(t==="localStorage")return Jc();if(t!=="memory")return t}function BP(t){var a,c,l,d,u,f,p,m;const e=typeof t.modal=="object"?t.modal:{},{autoOpen:n=!1,...r}=e,i=((c=(a=t.ui)==null?void 0:a.modal)==null?void 0:c.width)??((l=e.modal)==null?void 0:l.width),s=((u=(d=t.ui)==null?void 0:d.walletConnect)==null?void 0:u.mode)??((f=e.walletConnect)==null?void 0:f.mode)??"default",o={...t.ui,...r,modal:{...(p=t.ui)==null?void 0:p.modal,...e.modal,...i?{width:i}:{}},walletConnect:{...(m=t.ui)==null?void 0:m.walletConnect,...e.walletConnect,mode:s}};return{autoOpen:n,ui:S2(o)}}function RP(t){var p,m,h,g,w,E,y,b,S,v;if(!t.connectButton)return;const n=$P(t.connectButton)?{target:t.connectButton}:t.connectButton;if(!n.target)return;const{accountStatus:r,accountPanelMode:i,showBalance:s,target:o,...a}=n,c=t.identity??{},l=typeof t.modal=="object"?t.modal:{},d={...t.ui,...l,modal:{...(p=t.ui)==null?void 0:p.modal,...l.modal},accountPanel:{...(m=t.ui)==null?void 0:m.accountPanel,...l.accountPanel},connectButton:{...(h=t.ui)==null?void 0:h.connectButton,...l.connectButton},identity:{...(g=t.ui)==null?void 0:g.identity,...l.identity,enabled:((E=(w=t.ui)==null?void 0:w.identity)==null?void 0:E.enabled)??((y=l.identity)==null?void 0:y.enabled)??c.web3Name,fallbackToAddress:((S=(b=t.ui)==null?void 0:b.identity)==null?void 0:S.fallbackToAddress)??((v=l.identity)==null?void 0:v.fallbackToAddress)??c.fallbackToAddress}},u=DP(s),f={...a,...u===void 0?{}:{showBalance:u}};return{target:o,..._2(d,f)}}function DP(t){var n;return t==null||typeof t!="object"||!("smallScreen"in t||"largeScreen"in t)?t:typeof window<"u"&&((n=window.matchMedia)==null?void 0:n.call(window,"(max-width: 640px)").matches)?t.smallScreen??t.largeScreen:t.largeScreen??t.smallScreen}function kP(t){var e,n;return((n=(e=t.ui)==null?void 0:e.walletConnect)==null?void 0:n.mode)??"default"}function fl(t,e){return t?e==="xrplsnap"?t.has("xrplsnap")||t.has("xrpl-snap"):t.has(e):!0}function PP(t){return t?t.has("walletconnect")||["staticbit","bitget","joey","girin","bifrost"].some(e=>t.has(e)):!0}function LP(t){if(!t||t.has("walletconnect"))return"all";const e=["staticbit","bitget","joey","girin","bifrost"].filter(n=>t.has(n));return e.length?e:"all"}function MP(){return typeof window<"u"?window.location.origin:"https://xrpl.org"}function UP(t){const{adapters:e,storage:n,walletConnectProjectId:r,walletConnectSignMessageDestination:i,xamanClientId:s,wallets:o,ui:a,...c}=t;return c}const FP=_f;function $P(t){return typeof t=="string"?!0:typeof HTMLElement<"u"&&t instanceof HTMLElement}var Yr={},Ao={},cg={exports:{}},TS;function lg(){return TS||(TS=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function s(c,l,d,u,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,u||c,f),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],d,u;if(this._eventsCount===0)return l;for(u in d=this._events)e.call(d,u)&&l.push(n?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=n?n+l:l,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,p=u.length,m=new Array(p);f<p;f++)m[f]=u[f].fn;return m},a.prototype.listenerCount=function(l){var d=n?n+l:l,u=this._events[d];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,d,u,f,p,m){var h=n?n+l:l;if(!this._events[h])return!1;var g=this._events[h],w=arguments.length,E,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),w){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,u),!0;case 4:return g.fn.call(g.context,d,u,f),!0;case 5:return g.fn.call(g.context,d,u,f,p),!0;case 6:return g.fn.call(g.context,d,u,f,p,m),!0}for(y=1,E=new Array(w-1);y<w;y++)E[y-1]=arguments[y];g.fn.apply(g.context,E)}else{var b=g.length,S;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),w){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,d);break;case 3:g[y].fn.call(g[y].context,d,u);break;case 4:g[y].fn.call(g[y].context,d,u,f);break;default:if(!E)for(S=1,E=new Array(w-1);S<w;S++)E[S-1]=arguments[S];g[y].fn.apply(g[y].context,E)}}return!0},a.prototype.on=function(l,d,u){return s(this,l,d,u,!1)},a.prototype.once=function(l,d,u){return s(this,l,d,u,!0)},a.prototype.removeListener=function(l,d,u,f){var p=n?n+l:l;if(!this._events[p])return this;if(!d)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!f||m.once)&&(!u||m.context===u)&&o(this,p);else{for(var h=0,g=[],w=m.length;h<w;h++)(m[h].fn!==d||f&&!m[h].once||u&&m[h].context!==u)&&g.push(m[h]);g.length?this._events[p]=g.length===1?g[0]:g:o(this,p)}return this},a.prototype.removeAllListeners=function(l){var d;return l?(d=n?n+l:l,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(cg)),cg.exports}var We={},IS;function Ie(){if(IS)return We;IS=1,Object.defineProperty(We,"__esModule",{value:!0}),We.XRPLFaucetError=We.NotFoundError=We.ValidationError=We.ResponseFormatError=We.TimeoutError=We.RippledNotInitializedError=We.DisconnectedError=We.NotConnectedError=We.RippledError=We.ConnectionError=We.UnexpectedError=We.XrplError=void 0;class t extends Error{constructor(p="",m){super(p),this.name=this.constructor.name,this.message=p,this.data=m,Error.captureStackTrace!=null&&Error.captureStackTrace(this,this.constructor)}toString(){let p=`[${this.name}(${this.message}`;return this.data&&(p+=`, ${JSON.stringify(this.data)}`),p+=")]",p}inspect(){return this.toString()}}We.XrplError=t;class e extends t{}We.RippledError=e;class n extends t{}We.UnexpectedError=n;class r extends t{}We.ConnectionError=r;class i extends r{}We.NotConnectedError=i;class s extends r{}We.DisconnectedError=s;class o extends r{}We.RippledNotInitializedError=o;class a extends r{}We.TimeoutError=a;class c extends r{}We.ResponseFormatError=c;class l extends t{}We.ValidationError=l;class d extends t{}We.XRPLFaucetError=d;class u extends t{constructor(p="Not found"){super(p)}}return We.NotFoundError=u,We}var ug={},CS;function OS(){return CS||(CS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_API_VERSION=t.RIPPLED_API_V2=t.RIPPLED_API_V1=void 0,t.RIPPLED_API_V1=1,t.RIPPLED_API_V2=2,t.DEFAULT_API_VERSION=t.RIPPLED_API_V2})(ug)),ug}var So={},hl={},NS;function BS(){if(NS)return hl;NS=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.AccountRootFlags=void 0;var t;return(function(e){e[e.lsfPasswordSpent=65536]="lsfPasswordSpent",e[e.lsfRequireDestTag=131072]="lsfRequireDestTag",e[e.lsfRequireAuth=262144]="lsfRequireAuth",e[e.lsfDisallowXRP=524288]="lsfDisallowXRP",e[e.lsfDisableMaster=1048576]="lsfDisableMaster",e[e.lsfNoFreeze=2097152]="lsfNoFreeze",e[e.lsfGlobalFreeze=4194304]="lsfGlobalFreeze",e[e.lsfDefaultRipple=8388608]="lsfDefaultRipple",e[e.lsfDepositAuth=16777216]="lsfDepositAuth",e[e.lsfAMM=33554432]="lsfAMM",e[e.lsfDisallowIncomingNFTokenOffer=67108864]="lsfDisallowIncomingNFTokenOffer",e[e.lsfDisallowIncomingCheck=134217728]="lsfDisallowIncomingCheck",e[e.lsfDisallowIncomingPayChan=268435456]="lsfDisallowIncomingPayChan",e[e.lsfDisallowIncomingTrustline=536870912]="lsfDisallowIncomingTrustline",e[e.lsfAllowTrustLineClawback=2147483648]="lsfAllowTrustLineClawback"})(t||(hl.AccountRootFlags=t={})),hl}var Qr={},Qe={},dg={},_o={},fg={},pl={},RS;function jP(){return RS||(RS=1,Object.defineProperty(pl,"__esModule",{value:!0}),pl.crypto=void 0,pl.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),pl}var Hi={},DS;function hg(){if(DS)return Hi;DS=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.anumber=t,Hi.abytes=n,Hi.ahash=r,Hi.aexists=i,Hi.aoutput=s;function t(o){if(!Number.isSafeInteger(o)||o<0)throw new Error("positive integer expected, got "+o)}function e(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function n(o,...a){if(!e(o))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(o.length))throw new Error("Uint8Array expected of length "+a+", got length="+o.length)}function r(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(o.outputLen),t(o.blockLen)}function i(o,a=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(a&&o.finished)throw new Error("Hash#digest() has already been called")}function s(o,a){n(o);const c=a.outputLen;if(o.length<c)throw new Error("digestInto() expects output buffer of length at least "+c)}return Hi}var kS;function lr(){return kS||(kS=1,(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=r,t.byteSwap32=d,t.bytesToHex=f,t.hexToBytes=h,t.asyncLoop=w,t.utf8ToBytes=E,t.toBytes=y,t.concatBytes=b,t.checkOpts=v,t.wrapConstructor=B,t.wrapConstructorWithOpts=T,t.wrapXOFConstructorWithOpts=_,t.randomBytes=N;const e=jP(),n=hg();function r(D){return D instanceof Uint8Array||ArrayBuffer.isView(D)&&D.constructor.name==="Uint8Array"}const i=D=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength);t.u8=i;const s=D=>new Uint32Array(D.buffer,D.byteOffset,Math.floor(D.byteLength/4));t.u32=s;const o=D=>new DataView(D.buffer,D.byteOffset,D.byteLength);t.createView=o;const a=(D,U)=>D<<32-U|D>>>U;t.rotr=a;const c=(D,U)=>D<<U|D>>>32-U>>>0;t.rotl=c,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const l=D=>D<<24&4278190080|D<<8&16711680|D>>>8&65280|D>>>24&255;t.byteSwap=l,t.byteSwapIfBE=t.isLE?D=>D:D=>(0,t.byteSwap)(D);function d(D){for(let U=0;U<D.length;U++)D[U]=(0,t.byteSwap)(D[U])}const u=Array.from({length:256},(D,U)=>U.toString(16).padStart(2,"0"));function f(D){(0,n.abytes)(D);let U="";for(let L=0;L<D.length;L++)U+=u[D[L]];return U}const p={_0:48,_9:57,A:65,F:70,a:97,f:102};function m(D){if(D>=p._0&&D<=p._9)return D-p._0;if(D>=p.A&&D<=p.F)return D-(p.A-10);if(D>=p.a&&D<=p.f)return D-(p.a-10)}function h(D){if(typeof D!="string")throw new Error("hex string expected, got "+typeof D);const U=D.length,L=U/2;if(U%2)throw new Error("hex string expected, got unpadded hex of length "+U);const k=new Uint8Array(L);for(let C=0,P=0;C<L;C++,P+=2){const A=m(D.charCodeAt(P)),x=m(D.charCodeAt(P+1));if(A===void 0||x===void 0){const I=D[P]+D[P+1];throw new Error('hex string expected, got non-hex character "'+I+'" at index '+P)}k[C]=A*16+x}return k}const g=async()=>{};t.nextTick=g;async function w(D,U,L){let k=Date.now();for(let C=0;C<D;C++){L(C);const P=Date.now()-k;P>=0&&P<U||(await(0,t.nextTick)(),k+=P)}}function E(D){if(typeof D!="string")throw new Error("utf8ToBytes expected string, got "+typeof D);return new Uint8Array(new TextEncoder().encode(D))}function y(D){return typeof D=="string"&&(D=E(D)),(0,n.abytes)(D),D}function b(...D){let U=0;for(let k=0;k<D.length;k++){const C=D[k];(0,n.abytes)(C),U+=C.length}const L=new Uint8Array(U);for(let k=0,C=0;k<D.length;k++){const P=D[k];L.set(P,C),C+=P.length}return L}class S{clone(){return this._cloneInto()}}t.Hash=S;function v(D,U){if(U!==void 0&&{}.toString.call(U)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(D,U)}function B(D){const U=k=>D().update(y(k)).digest(),L=D();return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=()=>D(),U}function T(D){const U=(k,C)=>D(C).update(y(k)).digest(),L=D({});return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=k=>D(k),U}function _(D){const U=(k,C)=>D(C).update(y(k)).digest(),L=D({});return U.outputLen=L.outputLen,U.blockLen=L.blockLen,U.create=k=>D(k),U}function N(D=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(D));if(e.crypto&&typeof e.crypto.randomBytes=="function")return e.crypto.randomBytes(D);throw new Error("crypto.getRandomValues must be defined")}})(fg)),fg}var Jr={},PS;function LS(){if(PS)return Jr;PS=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.equal=Jr.concat=Jr.HEX_REGEX=void 0;const t=lr();Jr.HEX_REGEX=/^[A-F0-9]*$/iu;function e(r){return(0,t.concatBytes)(...r)}Jr.concat=e;function n(r,i){if(r.byteLength!==i.byteLength)return!1;const s=new Int8Array(r),o=new Int8Array(i);for(let a=0;a!==r.byteLength;a++)if(s[a]!==o[a])return!1;return!0}return Jr.equal=n,Jr}var MS;function $e(){return MS||(MS=1,(function(t){var e=_o&&_o.__createBinding||(Object.create?(function(l,d,u,f){f===void 0&&(f=u);var p=Object.getOwnPropertyDescriptor(d,u);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[u]}}),Object.defineProperty(l,f,p)}):(function(l,d,u,f){f===void 0&&(f=u),l[f]=d[u]})),n=_o&&_o.__exportStar||function(l,d){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(d,u)&&e(d,l,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.stringToHex=t.hexToString=t.hexToBytes=t.bytesToHex=void 0;const r=lr(),i=LS(),s=l=>(0,r.bytesToHex)(l instanceof Uint8Array?l:Uint8Array.from(l)).toUpperCase();t.bytesToHex=s;const o=l=>{const d=l.length,u=new Uint8Array(d/2);if(!i.HEX_REGEX.test(l))throw new Error("Invalid hex string");for(let f=0;f<u.length;f++){const p=f*2,m=l.slice(p,p+2),h=Number.parseInt(m,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");u[f]=h}return u};t.hexToBytes=o;const a=(l,d="utf8")=>new TextDecoder(d).decode((0,t.hexToBytes)(l));t.hexToString=a;const c=l=>(0,t.bytesToHex)(new TextEncoder().encode(l));t.stringToHex=c,t.randomBytes=r.randomBytes,n(LS(),t)})(_o)),_o}var Ke={},pg={},US;function gg(){return US||(US=1,(function(t){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hexnopad=t.base32hex=t.base32nopad=t.base32=t.base16=t.utils=void 0;function e($){return $ instanceof Uint8Array||ArrayBuffer.isView($)&&$.constructor.name==="Uint8Array"}function n($,...X){if(!e($))throw new Error("Uint8Array expected");if(X.length>0&&!X.includes($.length))throw new Error("Uint8Array expected of length "+X+", got length="+$.length)}function r($,X){return Array.isArray(X)?X.length===0?!0:$?X.every(ee=>typeof ee=="string"):X.every(ee=>Number.isSafeInteger(ee)):!1}function i($){if(typeof $!="function")throw new Error("function expected");return!0}function s($,X){if(typeof X!="string")throw new Error(`${$}: string expected`);return!0}function o($){if(!Number.isSafeInteger($))throw new Error(`invalid integer: ${$}`)}function a($){if(!Array.isArray($))throw new Error("array expected")}function c($,X){if(!r(!0,X))throw new Error(`${$}: array of strings expected`)}function l($,X){if(!r(!1,X))throw new Error(`${$}: array of numbers expected`)}function d(...$){const X=J=>J,ee=(J,q)=>K=>J(q(K)),ne=$.map(J=>J.encode).reduceRight(ee,X),Y=$.map(J=>J.decode).reduce(ee,X);return{encode:ne,decode:Y}}function u($){const X=typeof $=="string"?$.split(""):$,ee=X.length;c("alphabet",X);const ne=new Map(X.map((Y,J)=>[Y,J]));return{encode:Y=>(a(Y),Y.map(J=>{if(!Number.isSafeInteger(J)||J<0||J>=ee)throw new Error(`alphabet.encode: digit index outside alphabet "${J}". Allowed: ${$}`);return X[J]})),decode:Y=>(a(Y),Y.map(J=>{s("alphabet.decode",J);const q=ne.get(J);if(q===void 0)throw new Error(`Unknown letter: "${J}". Allowed: ${$}`);return q}))}}function f($=""){return s("join",$),{encode:X=>(c("join.decode",X),X.join($)),decode:X=>(s("join.decode",X),X.split($))}}function p($,X="="){return o($),s("padding",X),{encode(ee){for(c("padding.encode",ee);ee.length*$%8;)ee.push(X);return ee},decode(ee){c("padding.decode",ee);let ne=ee.length;if(ne*$%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;ne>0&&ee[ne-1]===X;ne--)if((ne-1)*$%8===0)throw new Error("padding: invalid, string has too much padding");return ee.slice(0,ne)}}}function m($){return i($),{encode:X=>X,decode:X=>$(X)}}function h($,X,ee){if(X<2)throw new Error(`convertRadix: invalid from=${X}, base cannot be less than 2`);if(ee<2)throw new Error(`convertRadix: invalid to=${ee}, base cannot be less than 2`);if(a($),!$.length)return[];let ne=0;const Y=[],J=Array.from($,K=>{if(o(K),K<0||K>=X)throw new Error(`invalid integer: ${K}`);return K}),q=J.length;for(;;){let K=0,W=!0;for(let H=ne;H<q;H++){const V=J[H],Q=X*K,te=Q+V;if(!Number.isSafeInteger(te)||Q/X!==K||te-V!==Q)throw new Error("convertRadix: carry overflow");const ie=te/ee;K=te%ee;const se=Math.floor(ie);if(J[H]=se,!Number.isSafeInteger(se)||se*ee+K!==te)throw new Error("convertRadix: carry overflow");if(W)se?W=!1:ne=H;else continue}if(Y.push(K),W)break}for(let K=0;K<$.length-1&&$[K]===0;K++)Y.push(0);return Y.reverse()}const g=($,X)=>X===0?$:g(X,$%X),w=($,X)=>$+(X-g($,X)),E=(()=>{let $=[];for(let X=0;X<40;X++)$.push(2**X);return $})();function y($,X,ee,ne){if(a($),X<=0||X>32)throw new Error(`convertRadix2: wrong from=${X}`);if(ee<=0||ee>32)throw new Error(`convertRadix2: wrong to=${ee}`);if(w(X,ee)>32)throw new Error(`convertRadix2: carry overflow from=${X} to=${ee} carryBits=${w(X,ee)}`);let Y=0,J=0;const q=E[X],K=E[ee]-1,W=[];for(const H of $){if(o(H),H>=q)throw new Error(`convertRadix2: invalid data word=${H} from=${X}`);if(Y=Y<<X|H,J+X>32)throw new Error(`convertRadix2: carry overflow pos=${J} from=${X}`);for(J+=X;J>=ee;J-=ee)W.push((Y>>J-ee&K)>>>0);const V=E[J];if(V===void 0)throw new Error("invalid carry");Y&=V-1}if(Y=Y<<ee-J&K,!ne&&J>=X)throw new Error("Excess padding");if(!ne&&Y>0)throw new Error(`Non-zero padding: ${Y}`);return ne&&J>0&&W.push(Y>>>0),W}function b($){o($);const X=2**8;return{encode:ee=>{if(!e(ee))throw new Error("radix.encode input should be Uint8Array");return h(Array.from(ee),X,$)},decode:ee=>(l("radix.decode",ee),Uint8Array.from(h(ee,$,X)))}}function S($,X=!1){if(o($),$<=0||$>32)throw new Error("radix2: bits should be in (0..32]");if(w(8,$)>32||w($,8)>32)throw new Error("radix2: carry overflow");return{encode:ee=>{if(!e(ee))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(ee),8,$,!X)},decode:ee=>(l("radix2.decode",ee),Uint8Array.from(y(ee,$,8,X)))}}function v($){return i($),function(...X){try{return $.apply(null,X)}catch{}}}function B($,X){return o($),i(X),{encode(ee){if(!e(ee))throw new Error("checksum.encode: input should be Uint8Array");const ne=X(ee).slice(0,$),Y=new Uint8Array(ee.length+$);return Y.set(ee),Y.set(ne,ee.length),Y},decode(ee){if(!e(ee))throw new Error("checksum.decode: input should be Uint8Array");const ne=ee.slice(0,-$),Y=ee.slice(-$),J=X(ne).slice(0,$);for(let q=0;q<$;q++)if(J[q]!==Y[q])throw new Error("Invalid checksum");return ne}}}t.utils={alphabet:u,chain:d,checksum:B,convertRadix:h,convertRadix2:y,radix:b,radix2:S,join:f,padding:p},t.base16=d(S(4),u("0123456789ABCDEF"),f("")),t.base32=d(S(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),p(5),f("")),t.base32nopad=d(S(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),t.base32hex=d(S(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),p(5),f("")),t.base32hexnopad=d(S(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),t.base32crockford=d(S(5),u("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),m($=>$.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const T=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",_=($,X)=>{s("base64",$);const ee=X?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,ne=X?"base64url":"base64";if($.length>0&&!ee.test($))throw new Error("invalid base64");return Uint8Array.fromBase64($,{alphabet:ne,lastChunkHandling:"strict"})};t.base64=T?{encode($){return n($),$.toBase64()},decode($){return _($,!1)}}:d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),p(6),f("")),t.base64nopad=d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),t.base64url=T?{encode($){return n($),$.toBase64({alphabet:"base64url"})},decode($){return _($,!0)}}:d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),p(6),f("")),t.base64urlnopad=d(S(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const N=$=>d(b(58),u($),f(""));t.base58=N("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=N("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=N("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const D=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode($){let X="";for(let ee=0;ee<$.length;ee+=8){const ne=$.subarray(ee,ee+8);X+=t.base58.encode(ne).padStart(D[ne.length],"1")}return X},decode($){let X=[];for(let ee=0;ee<$.length;ee+=11){const ne=$.slice(ee,ee+11),Y=D.indexOf(ne.length),J=t.base58.decode(ne);for(let q=0;q<J.length-Y;q++)if(J[q]!==0)throw new Error("base58xmr: wrong padding");X=X.concat(Array.from(J.slice(J.length-Y)))}return Uint8Array.from(X)}};const U=$=>d(B(4,X=>$($(X))),t.base58);t.createBase58check=U,t.base58check=t.createBase58check;const L=d(u("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),k=[996825010,642813549,513874426,1027748829,705979059];function C($){const X=$>>25;let ee=($&33554431)<<5;for(let ne=0;ne<k.length;ne++)(X>>ne&1)===1&&(ee^=k[ne]);return ee}function P($,X,ee=1){const ne=$.length;let Y=1;for(let J=0;J<ne;J++){const q=$.charCodeAt(J);if(q<33||q>126)throw new Error(`Invalid prefix (${$})`);Y=C(Y)^q>>5}Y=C(Y);for(let J=0;J<ne;J++)Y=C(Y)^$.charCodeAt(J)&31;for(let J of X)Y=C(Y)^J;for(let J=0;J<6;J++)Y=C(Y);return Y^=ee,L.encode(y([Y%E[30]],30,5,!1))}function A($){const X=$==="bech32"?1:734539939,ee=S(5),ne=ee.decode,Y=ee.encode,J=v(ne);function q(Q,te,ie=90){s("bech32.encode prefix",Q),e(te)&&(te=Array.from(te)),l("bech32.encode",te);const se=Q.length;if(se===0)throw new TypeError(`Invalid prefix length ${se}`);const ce=se+7+te.length;if(ie!==!1&&ce>ie)throw new TypeError(`Length ${ce} exceeds limit ${ie}`);const oe=Q.toLowerCase(),ue=P(oe,te,X);return`${oe}1${L.encode(te)}${ue}`}function K(Q,te=90){s("bech32.decode input",Q);const ie=Q.length;if(ie<8||te!==!1&&ie>te)throw new TypeError(`invalid string length: ${ie} (${Q}). Expected (8..${te})`);const se=Q.toLowerCase();if(Q!==se&&Q!==Q.toUpperCase())throw new Error("String must be lowercase or uppercase");const ce=se.lastIndexOf("1");if(ce===0||ce===-1)throw new Error('Letter "1" must be present between prefix and data only');const oe=se.slice(0,ce),ue=se.slice(ce+1);if(ue.length<6)throw new Error("Data must be at least 6 characters long");const we=L.decode(ue).slice(0,-6),me=P(oe,we,X);if(!ue.endsWith(me))throw new Error(`Invalid checksum in ${Q}: expected "${me}"`);return{prefix:oe,words:we}}const W=v(K);function H(Q){const{prefix:te,words:ie}=K(Q,!1);return{prefix:te,words:ie,bytes:ne(ie)}}function V(Q,te){return q(Q,Y(te))}return{encode:q,decode:K,encodeFromBytes:V,decodeToBytes:H,decodeUnsafe:W,fromWords:ne,fromWordsUnsafe:J,toWords:Y}}t.bech32=A("bech32"),t.bech32m=A("bech32m"),t.utf8={encode:$=>new TextDecoder().decode($),decode:$=>new TextEncoder().encode($)};const x=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",I={encode($){return n($),$.toHex()},decode($){return s("hex",$),Uint8Array.fromHex($)}};t.hex=x?I:d(S(4),u("0123456789abcdef"),f(""),m($=>{if(typeof $!="string"||$.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof $} with length ${$.length}`);return $.toLowerCase()}));const R={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},O="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",M=($,X)=>{if(typeof $!="string"||!R.hasOwnProperty($))throw new TypeError(O);if(!e(X))throw new TypeError("bytesToString() expects Uint8Array");return R[$].encode(X)};t.bytesToString=M,t.str=t.bytesToString;const z=($,X)=>{if(!R.hasOwnProperty($))throw new TypeError(O);if(typeof X!="string")throw new TypeError("stringToBytes() expects string");return R[$].decode(X)};t.stringToBytes=z,t.bytes=t.stringToBytes})(pg)),pg}var xo={},Zr={},ur={},FS;function mg(){if(FS)return ur;FS=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.HashMD=ur.Maj=ur.Chi=void 0,ur.setBigUint64=n;const t=hg(),e=lr();function n(o,a,c,l){if(typeof o.setBigUint64=="function")return o.setBigUint64(a,c,l);const d=BigInt(32),u=BigInt(4294967295),f=Number(c>>d&u),p=Number(c&u),m=l?4:0,h=l?0:4;o.setUint32(a+m,f,l),o.setUint32(a+h,p,l)}const r=(o,a,c)=>o&a^~o&c;ur.Chi=r;const i=(o,a,c)=>o&a^o&c^a&c;ur.Maj=i;class s extends e.Hash{constructor(a,c,l,d){super(),this.blockLen=a,this.outputLen=c,this.padOffset=l,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(a),this.view=(0,e.createView)(this.buffer)}update(a){(0,t.aexists)(this);const{view:c,buffer:l,blockLen:d}=this;a=(0,e.toBytes)(a);const u=a.length;for(let f=0;f<u;){const p=Math.min(d-this.pos,u-f);if(p===d){const m=(0,e.createView)(a);for(;d<=u-f;f+=d)this.process(m,f);continue}l.set(a.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===d&&(this.process(c,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){(0,t.aexists)(this),(0,t.aoutput)(a,this),this.finished=!0;const{buffer:c,view:l,blockLen:d,isLE:u}=this;let{pos:f}=this;c[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>d-f&&(this.process(l,0),f=0);for(let w=f;w<d;w++)c[w]=0;n(l,d-8,BigInt(this.length*8),u),this.process(l,0);const p=(0,e.createView)(a),m=this.outputLen;if(m%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=m/4,g=this.get();if(h>g.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<h;w++)p.setUint32(4*w,g[w],u)}digest(){const{buffer:a,outputLen:c}=this;this.digestInto(a);const l=a.slice(0,c);return this.destroy(),l}_cloneInto(a){a||(a=new this.constructor),a.set(...this.get());const{blockLen:c,buffer:l,length:d,finished:u,destroyed:f,pos:p}=this;return a.length=d,a.pos=p,a.finished=u,a.destroyed=f,d%c&&a.buffer.set(l),a}}return ur.HashMD=s,ur}var $S;function jS(){if($S)return Zr;$S=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.sha224=Zr.sha256=Zr.SHA256=void 0;const t=mg(),e=lr(),n=new Uint32Array([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]),r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class s extends t.HashMD{constructor(){super(64,32,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0,this.F=r[5]|0,this.G=r[6]|0,this.H=r[7]|0}get(){const{A:c,B:l,C:d,D:u,E:f,F:p,G:m,H:h}=this;return[c,l,d,u,f,p,m,h]}set(c,l,d,u,f,p,m,h){this.A=c|0,this.B=l|0,this.C=d|0,this.D=u|0,this.E=f|0,this.F=p|0,this.G=m|0,this.H=h|0}process(c,l){for(let E=0;E<16;E++,l+=4)i[E]=c.getUint32(l,!1);for(let E=16;E<64;E++){const y=i[E-15],b=i[E-2],S=(0,e.rotr)(y,7)^(0,e.rotr)(y,18)^y>>>3,v=(0,e.rotr)(b,17)^(0,e.rotr)(b,19)^b>>>10;i[E]=v+i[E-7]+S+i[E-16]|0}let{A:d,B:u,C:f,D:p,E:m,F:h,G:g,H:w}=this;for(let E=0;E<64;E++){const y=(0,e.rotr)(m,6)^(0,e.rotr)(m,11)^(0,e.rotr)(m,25),b=w+y+(0,t.Chi)(m,h,g)+n[E]+i[E]|0,v=((0,e.rotr)(d,2)^(0,e.rotr)(d,13)^(0,e.rotr)(d,22))+(0,t.Maj)(d,u,f)|0;w=g,g=h,h=m,m=p+b|0,p=f,f=u,u=d,d=b+v|0}d=d+this.A|0,u=u+this.B|0,f=f+this.C|0,p=p+this.D|0,m=m+this.E|0,h=h+this.F|0,g=g+this.G|0,w=w+this.H|0,this.set(d,u,f,p,m,h,g,w)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}Zr.SHA256=s;class o extends s{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return Zr.sha256=(0,e.wrapConstructor)(()=>new s),Zr.sha224=(0,e.wrapConstructor)(()=>new o),Zr}var Qa={},xf={},qS;function qP(){if(qS)return xf;qS=1,Object.defineProperty(xf,"__esModule",{value:!0});function t(e){return Array.isArray(e)?new Uint8Array(e):e}return xf.default=t,xf}var HS;function wg(){if(HS)return Qa;HS=1;var t=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});const e=t(qP());function n(r){function i(s){return r((0,e.default)(s))}return i.create=()=>{const s=r.create();return{update(o){return s.update((0,e.default)(o)),this},digest(){return s.digest()}}},i}return Qa.default=n,Qa}var VS;function zS(){if(VS)return xo;VS=1;var t=xo&&xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xo,"__esModule",{value:!0}),xo.sha256=void 0;const e=jS(),n=t(wg());return xo.sha256=(0,n.default)(e.sha256),xo}var To={},WS;function HP(){if(WS)return To;WS=1,Object.defineProperty(To,"__esModule",{value:!0}),To.concatArgs=To.arrayEqual=void 0;function t(r,i){return r.length!==i.length?!1:r.every((s,o)=>s===i[o])}To.arrayEqual=t;function e(r){return typeof r=="number"}function n(...r){return r.flatMap(i=>e(i)?[i]:Array.from(i))}return To.concatArgs=n,To}var KS;function VP(){if(KS)return Ke;KS=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.isValidClassicAddress=Ke.decodeAccountPublic=Ke.encodeAccountPublic=Ke.encodeNodePublic=Ke.decodeNodePublic=Ke.decodeAddress=Ke.decodeAccountID=Ke.encodeAddress=Ke.encodeAccountID=Ke.decodeSeed=Ke.encodeSeed=Ke.codec=void 0;const t=gg(),e=zS(),n=HP();class r{constructor(v){this._sha256=v.sha256,this._codec=t.base58xrp}encode(v,B){const T=B.versions;return this._encodeVersioned(v,T,B.expectedLength)}decode(v,B){var T;const _=B.versions,N=B.versionTypes,D=this.decodeChecked(v);if(_.length>1&&!B.expectedLength)throw new Error("expectedLength is required because there are >= 2 possible versions");const U=typeof _[0]=="number"?1:_[0].length,L=(T=B.expectedLength)!==null&&T!==void 0?T:D.length-U,k=D.slice(0,-L),C=D.slice(-L);for(let P=0;P<_.length;P++){const A=Array.isArray(_[P])?_[P]:[_[P]];if((0,n.arrayEqual)(k,A))return{version:A,bytes:C,type:N?N[P]:null}}throw new Error("version_invalid: version bytes do not match any of the provided version(s)")}encodeChecked(v){const B=this._sha256(this._sha256(v)).slice(0,4);return this._encodeRaw(Uint8Array.from((0,n.concatArgs)(v,B)))}decodeChecked(v){const B=this._decodeRaw(v);if(B.byteLength<5)throw new Error("invalid_input_size: decoded data must have length >= 5");if(!this._verifyCheckSum(B))throw new Error("checksum_invalid");return B.slice(0,-4)}_encodeVersioned(v,B,T){if(!b(v,T))throw new Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Uint8Array.");return this.encodeChecked((0,n.concatArgs)(B,v))}_encodeRaw(v){return this._codec.encode(Uint8Array.from(v))}_decodeRaw(v){return this._codec.decode(v)}_verifyCheckSum(v){const B=this._sha256(this._sha256(v.slice(0,-4))).slice(0,4),T=v.slice(-4);return(0,n.arrayEqual)(B,T)}}const i=0,s=35,o=33,a=28,c=[1,225,75],l={sha256:e.sha256},d=new r(l);Ke.codec=d;function u(S,v){if(!b(S,16))throw new Error("entropy must have length 16");const B={expectedLength:16,versions:v==="ed25519"?c:[o]};return d.encode(S,B)}Ke.encodeSeed=u;function f(S,v={versionTypes:["ed25519","secp256k1"],versions:[c,o],expectedLength:16}){return d.decode(S,v)}Ke.decodeSeed=f;function p(S){const v={versions:[i],expectedLength:20};return d.encode(S,v)}Ke.encodeAccountID=p,Ke.encodeAddress=p;function m(S){const v={versions:[i],expectedLength:20};return d.decode(S,v).bytes}Ke.decodeAccountID=m,Ke.decodeAddress=m;function h(S){const v={versions:[a],expectedLength:33};return d.decode(S,v).bytes}Ke.decodeNodePublic=h;function g(S){const v={versions:[a],expectedLength:33};return d.encode(S,v)}Ke.encodeNodePublic=g;function w(S){const v={versions:[s],expectedLength:33};return d.encode(S,v)}Ke.encodeAccountPublic=w;function E(S){const v={versions:[s],expectedLength:33};return d.decode(S,v).bytes}Ke.decodeAccountPublic=E;function y(S){try{m(S)}catch{return!1}return!0}Ke.isValidClassicAddress=y;function b(S,v){return"byteLength"in S?S.byteLength===v:S.length===v}return Ke}var GS;function yn(){return GS||(GS=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isValidXAddress=t.decodeXAddress=t.xAddressToClassicAddress=t.encodeXAddress=t.classicAddressToXAddress=t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.decodeNodePublic=t.encodeNodePublic=t.decodeAccountID=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const e=$e(),n=VP();Object.defineProperty(t,"codec",{enumerable:!0,get:function(){return n.codec}}),Object.defineProperty(t,"encodeSeed",{enumerable:!0,get:function(){return n.encodeSeed}}),Object.defineProperty(t,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}}),Object.defineProperty(t,"encodeAccountID",{enumerable:!0,get:function(){return n.encodeAccountID}}),Object.defineProperty(t,"decodeAccountID",{enumerable:!0,get:function(){return n.decodeAccountID}}),Object.defineProperty(t,"encodeNodePublic",{enumerable:!0,get:function(){return n.encodeNodePublic}}),Object.defineProperty(t,"decodeNodePublic",{enumerable:!0,get:function(){return n.decodeNodePublic}}),Object.defineProperty(t,"encodeAccountPublic",{enumerable:!0,get:function(){return n.encodeAccountPublic}}),Object.defineProperty(t,"decodeAccountPublic",{enumerable:!0,get:function(){return n.decodeAccountPublic}}),Object.defineProperty(t,"isValidClassicAddress",{enumerable:!0,get:function(){return n.isValidClassicAddress}});const r={main:Uint8Array.from([5,68]),test:Uint8Array.from([4,147])},i=4294967295;function s(f,p,m){const h=(0,n.decodeAccountID)(f);return o(h,p,m)}t.classicAddressToXAddress=s;function o(f,p,m){if(f.length!==20)throw new Error("Account ID must be 20 bytes");if(p!==!1&&p>i)throw new Error("Invalid tag");const h=p||0,g=p===!1||p==null?0:1,w=(0,e.concat)([m?r.test:r.main,f,Uint8Array.from([g,h&255,h>>8&255,h>>16&255,h>>24&255,0,0,0,0])]);return n.codec.encodeChecked(w)}t.encodeXAddress=o;function a(f){const{accountId:p,tag:m,test:h}=c(f);return{classicAddress:(0,n.encodeAccountID)(p),tag:m,test:h}}t.xAddressToClassicAddress=a;function c(f){const p=n.codec.decodeChecked(f),m=l(p),h=p.slice(2,22),g=d(p);return{accountId:h,tag:g,test:m}}t.decodeXAddress=c;function l(f){const p=f.slice(0,2);if((0,e.equal)(r.main,p))return!1;if((0,e.equal)(r.test,p))return!0;throw new Error("Invalid X-address: bad prefix")}function d(f){const p=f[22];if(p>=2)throw new Error("Unsupported X-address");if(p===1)return f[23]+f[24]*256+f[25]*65536+f[26]*16777216;if(p!==0)throw new Error("flag must be zero to indicate no tag");if(!(0,e.equal)((0,e.hexToBytes)("0000000000000000"),f.slice(23,31)))throw new Error("remaining bytes must be zero");return!1}function u(f){try{c(f)}catch{return!1}return!0}t.isValidXAddress=u})(dg)),dg}var yg={},ei={},gl={};const zP={FIELDS:JSON.parse('[["Generic",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":0,"type":"Unknown"}],["Invalid",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":-1,"type":"Unknown"}],["ObjectEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STObject"}],["ArrayEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STArray"}],["taker_gets_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Amount"}],["taker_pays_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":259,"type":"Amount"}],["LedgerEntryType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt16"}],["TransactionType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt16"}],["SignerWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt16"}],["TransferFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt16"}],["TradingFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt16"}],["DiscountedFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt16"}],["Version",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt16"}],["HookStateChangeCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt16"}],["HookEmitCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt16"}],["HookExecutionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt16"}],["HookApiVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt16"}],["LedgerFixType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt16"}],["ManagementFeeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt16"}],["NetworkID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt32"}],["Flags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt32"}],["SourceTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt32"}],["Sequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt32"}],["PreviousTxnLgrSeq",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt32"}],["LedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt32"}],["CloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt32"}],["ParentCloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt32"}],["SigningTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt32"}],["Expiration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt32"}],["TransferRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt32"}],["WalletSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt32"}],["OwnerCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt32"}],["DestinationTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"UInt32"}],["LastUpdateTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"UInt32"}],["HighQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt32"}],["HighQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt32"}],["LowQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt32"}],["LowQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt32"}],["QualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt32"}],["QualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt32"}],["StampEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt32"}],["BondAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt32"}],["LoadFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt32"}],["OfferSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt32"}],["FirstLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt32"}],["LastLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt32"}],["TransactionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt32"}],["OperationLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt32"}],["ReferenceFeeUnits",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt32"}],["ReserveBase",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt32"}],["ReserveIncrement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"UInt32"}],["SetFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"UInt32"}],["ClearFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"UInt32"}],["SignerQuorum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"UInt32"}],["CancelAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"UInt32"}],["FinishAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"UInt32"}],["SignerListID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"UInt32"}],["SettleDelay",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"UInt32"}],["TicketCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":40,"type":"UInt32"}],["TicketSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":41,"type":"UInt32"}],["NFTokenTaxon",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":42,"type":"UInt32"}],["MintedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":43,"type":"UInt32"}],["BurnedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":44,"type":"UInt32"}],["HookStateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":45,"type":"UInt32"}],["EmitGeneration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":46,"type":"UInt32"}],["VoteWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":48,"type":"UInt32"}],["FirstNFTokenSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":50,"type":"UInt32"}],["OracleDocumentID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":51,"type":"UInt32"}],["PermissionValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":52,"type":"UInt32"}],["MutableFlags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":53,"type":"UInt32"}],["StartDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":54,"type":"UInt32"}],["PaymentInterval",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":55,"type":"UInt32"}],["GracePeriod",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":56,"type":"UInt32"}],["PreviousPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":57,"type":"UInt32"}],["NextPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":58,"type":"UInt32"}],["PaymentRemaining",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":59,"type":"UInt32"}],["PaymentTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":60,"type":"UInt32"}],["LoanSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":61,"type":"UInt32"}],["CoverRateMinimum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":62,"type":"UInt32"}],["CoverRateLiquidation",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":63,"type":"UInt32"}],["OverpaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":64,"type":"UInt32"}],["InterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":65,"type":"UInt32"}],["LateInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":66,"type":"UInt32"}],["CloseInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":67,"type":"UInt32"}],["OverpaymentInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":68,"type":"UInt32"}],["IndexNext",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt64"}],["IndexPrevious",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt64"}],["BookNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt64"}],["OwnerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt64"}],["BaseFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt64"}],["ExchangeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt64"}],["LowNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt64"}],["HighNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt64"}],["DestinationNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt64"}],["Cookie",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt64"}],["ServerVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt64"}],["NFTokenOfferNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt64"}],["EmitBurden",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt64"}],["HookOn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt64"}],["HookInstructionCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt64"}],["HookReturnCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt64"}],["ReferenceCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt64"}],["XChainClaimID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt64"}],["XChainAccountCreateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt64"}],["XChainAccountClaimCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt64"}],["AssetPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt64"}],["MaximumAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt64"}],["OutstandingAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt64"}],["MPTAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt64"}],["IssuerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt64"}],["SubjectNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt64"}],["LockedAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt64"}],["VaultNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt64"}],["LoanBrokerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt64"}],["EmailHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash128"}],["LedgerHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash256"}],["ParentHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash256"}],["TransactionHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash256"}],["AccountHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash256"}],["PreviousTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Hash256"}],["LedgerIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Hash256"}],["WalletLocator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Hash256"}],["RootIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Hash256"}],["AccountTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Hash256"}],["NFTokenID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Hash256"}],["EmitParentTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Hash256"}],["EmitNonce",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Hash256"}],["EmitHookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Hash256"}],["AMMID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Hash256"}],["BookDirectory",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Hash256"}],["InvoiceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Hash256"}],["Nickname",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Hash256"}],["Amendment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Hash256"}],["Digest",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"Hash256"}],["Channel",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Hash256"}],["ConsensusHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Hash256"}],["CheckID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Hash256"}],["ValidatedHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Hash256"}],["PreviousPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Hash256"}],["NextPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Hash256"}],["NFTokenBuyOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Hash256"}],["NFTokenSellOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Hash256"}],["HookStateKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Hash256"}],["HookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Hash256"}],["HookNamespace",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"Hash256"}],["HookSetTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"Hash256"}],["DomainID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"Hash256"}],["VaultID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"Hash256"}],["ParentBatchID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"Hash256"}],["LoanBrokerID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"Hash256"}],["LoanID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"Hash256"}],["hash",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Hash256"}],["index",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Hash256"}],["Amount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Amount"}],["Balance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Amount"}],["LimitAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Amount"}],["TakerPays",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Amount"}],["TakerGets",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Amount"}],["LowLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Amount"}],["HighLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Amount"}],["Fee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Amount"}],["SendMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Amount"}],["DeliverMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Amount"}],["Amount2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Amount"}],["BidMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Amount"}],["BidMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Amount"}],["MinimumOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Amount"}],["RippleEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Amount"}],["DeliveredAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Amount"}],["NFTokenBrokerFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Amount"}],["BaseFeeDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Amount"}],["ReserveBaseDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Amount"}],["ReserveIncrementDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Amount"}],["LPTokenOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Amount"}],["LPTokenIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Amount"}],["EPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Amount"}],["Price",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Amount"}],["SignatureReward",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Amount"}],["MinAccountCreateAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Amount"}],["LPTokenBalance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Amount"}],["PublicKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Blob"}],["MessageKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Blob"}],["SigningPubKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Blob"}],["TxnSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":4,"type":"Blob"}],["URI",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Blob"}],["Signature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":6,"type":"Blob"}],["Domain",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":7,"type":"Blob"}],["FundCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"Blob"}],["RemoveCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"Blob"}],["ExpireCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"Blob"}],["CreateCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"Blob"}],["MemoType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"Blob"}],["MemoData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":13,"type":"Blob"}],["MemoFormat",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":14,"type":"Blob"}],["Fulfillment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"Blob"}],["Condition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":17,"type":"Blob"}],["MasterSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":18,"type":"Blob"}],["UNLModifyValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"Blob"}],["ValidatorToDisable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"Blob"}],["ValidatorToReEnable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"Blob"}],["HookStateData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"Blob"}],["HookReturnString",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"Blob"}],["HookParameterName",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"Blob"}],["HookParameterValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"Blob"}],["DIDDocument",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"Blob"}],["Data",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":27,"type":"Blob"}],["AssetClass",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":28,"type":"Blob"}],["Provider",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":29,"type":"Blob"}],["MPTokenMetadata",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":30,"type":"Blob"}],["CredentialType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":31,"type":"Blob"}],["Account",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"AccountID"}],["Owner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"AccountID"}],["Destination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"AccountID"}],["Issuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"AccountID"}],["Authorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"AccountID"}],["Unauthorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":6,"type":"AccountID"}],["RegularKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"AccountID"}],["NFTokenMinter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"AccountID"}],["EmitCallback",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"AccountID"}],["Holder",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"AccountID"}],["Delegate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"AccountID"}],["HookAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"AccountID"}],["OtherChainSource",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":18,"type":"AccountID"}],["OtherChainDestination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"AccountID"}],["AttestationSignerAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"AccountID"}],["AttestationRewardAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"AccountID"}],["LockingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"AccountID"}],["IssuingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"AccountID"}],["Subject",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"AccountID"}],["Borrower",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"AccountID"}],["Counterparty",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"AccountID"}],["Number",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Number"}],["AssetsAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Number"}],["AssetsMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Number"}],["AssetsTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Number"}],["LossUnrealized",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Number"}],["DebtTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Number"}],["DebtMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Number"}],["CoverAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Number"}],["LoanOriginationFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Number"}],["LoanServiceFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Number"}],["LatePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Number"}],["ClosePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Number"}],["PrincipalOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Number"}],["PrincipalRequested",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Number"}],["TotalValueOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"Number"}],["PeriodicPayment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Number"}],["ManagementFeeOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Number"}],["LoanScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Int32"}],["TransactionMetaData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"STObject"}],["CreatedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"STObject"}],["DeletedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STObject"}],["ModifiedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STObject"}],["PreviousFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STObject"}],["FinalFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STObject"}],["NewFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STObject"}],["TemplateEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STObject"}],["Memo",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STObject"}],["SignerEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STObject"}],["NFToken",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STObject"}],["EmitDetails",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STObject"}],["Hook",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"STObject"}],["Permission",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"STObject"}],["Signer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STObject"}],["Majority",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STObject"}],["DisabledValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STObject"}],["EmittedTxn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STObject"}],["HookExecution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STObject"}],["HookDefinition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STObject"}],["HookParameter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"STObject"}],["HookGrant",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STObject"}],["VoteEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STObject"}],["AuctionSlot",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STObject"}],["AuthAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STObject"}],["XChainClaimProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STObject"}],["XChainCreateAccountProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STObject"}],["XChainClaimAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STObject"}],["XChainCreateAccountAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"STObject"}],["PriceData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"STObject"}],["Credential",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"STObject"}],["RawTransaction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"STObject"}],["BatchSigner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"STObject"}],["Book",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"STObject"}],["CounterpartySignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":37,"type":"STObject"}],["Signers",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":3,"type":"STArray"}],["SignerEntries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STArray"}],["Template",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STArray"}],["Necessary",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STArray"}],["Sufficient",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STArray"}],["AffectedNodes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STArray"}],["Memos",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STArray"}],["NFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STArray"}],["Hooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STArray"}],["VoteSlots",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STArray"}],["AdditionalBooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STArray"}],["Majorities",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STArray"}],["DisabledValidators",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"STArray"}],["HookExecutions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STArray"}],["HookParameters",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STArray"}],["HookGrants",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STArray"}],["XChainClaimAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STArray"}],["XChainCreateAccountAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STArray"}],["PriceDataSeries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STArray"}],["AuthAccounts",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STArray"}],["AuthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STArray"}],["UnauthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STArray"}],["AcceptedCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STArray"}],["Permissions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STArray"}],["RawTransactions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STArray"}],["BatchSigners",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":31,"type":"STArray"}],["CloseResolution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt8"}],["Method",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt8"}],["TransactionResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt8"}],["Scale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt8"}],["AssetScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt8"}],["TickSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt8"}],["UNLModifyDisabling",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt8"}],["HookResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt8"}],["WasLockingChainSend",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt8"}],["WithdrawalPolicy",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt8"}],["TakerPaysCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash160"}],["TakerPaysIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash160"}],["TakerGetsCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash160"}],["TakerGetsIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash160"}],["Paths",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"PathSet"}],["Indexes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Vector256"}],["Hashes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Vector256"}],["Amendments",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Vector256"}],["NFTokenOffers",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"Vector256"}],["CredentialIDs",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Vector256"}],["MPTokenIssuanceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash192"}],["ShareMPTID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash192"}],["LockingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Issue"}],["IssuingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Issue"}],["Asset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Issue"}],["Asset2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Issue"}],["XChainBridge",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"XChainBridge"}],["BaseAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Currency"}],["QuoteAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Currency"}],["Transaction",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Transaction"}],["LedgerEntry",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"LedgerEntry"}],["Validation",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Validation"}],["Metadata",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Metadata"}]]'),LEDGER_ENTRY_TYPES:{AMM:121,AccountRoot:97,Amendments:102,Bridge:105,Check:67,Credential:129,DID:73,Delegate:131,DepositPreauth:112,DirectoryNode:100,Escrow:117,FeeSettings:115,Invalid:-1,LedgerHashes:104,Loan:137,LoanBroker:136,MPToken:127,MPTokenIssuance:126,NFTokenOffer:55,NFTokenPage:80,NegativeUNL:78,Offer:111,Oracle:128,PayChannel:120,PermissionedDomain:130,RippleState:114,SignerList:83,Ticket:84,Vault:132,XChainOwnedClaimID:113,XChainOwnedCreateAccountClaimID:116},TRANSACTION_RESULTS:{tecAMM_ACCOUNT:168,tecAMM_BALANCE:163,tecAMM_EMPTY:166,tecAMM_FAILED:164,tecAMM_INVALID_TOKENS:165,tecAMM_NOT_EMPTY:167,tecARRAY_EMPTY:190,tecARRAY_TOO_LARGE:191,tecBAD_CREDENTIALS:193,tecCANT_ACCEPT_OWN_NFTOKEN_OFFER:158,tecCLAIM:100,tecCRYPTOCONDITION_ERROR:146,tecDIR_FULL:121,tecDST_TAG_NEEDED:143,tecDUPLICATE:149,tecEMPTY_DID:187,tecEXPIRED:148,tecFAILED_PROCESSING:105,tecFROZEN:137,tecHAS_OBLIGATIONS:151,tecHOOK_REJECTED:153,tecINCOMPLETE:169,tecINSUFFICIENT_FUNDS:159,tecINSUFFICIENT_PAYMENT:161,tecINSUFFICIENT_RESERVE:141,tecINSUFF_FEE:136,tecINSUF_RESERVE_LINE:122,tecINSUF_RESERVE_OFFER:123,tecINTERNAL:144,tecINVALID_UPDATE_TIME:188,tecINVARIANT_FAILED:147,tecKILLED:150,tecLIMIT_EXCEEDED:195,tecLOCKED:192,tecMAX_SEQUENCE_REACHED:154,tecNEED_MASTER_KEY:142,tecNFTOKEN_BUY_SELL_MISMATCH:156,tecNFTOKEN_OFFER_TYPE_MISMATCH:157,tecNO_ALTERNATIVE_KEY:130,tecNO_AUTH:134,tecNO_DELEGATE_PERMISSION:198,tecNO_DST:124,tecNO_DST_INSUF_XRP:125,tecNO_ENTRY:140,tecNO_ISSUER:133,tecNO_LINE:135,tecNO_LINE_INSUF_RESERVE:126,tecNO_LINE_REDUNDANT:127,tecNO_PERMISSION:139,tecNO_REGULAR_KEY:131,tecNO_SUITABLE_NFTOKEN_PAGE:155,tecNO_TARGET:138,tecOBJECT_NOT_FOUND:160,tecOVERSIZE:145,tecOWNERS:132,tecPATH_DRY:128,tecPATH_PARTIAL:101,tecPRECISION_LOSS:197,tecPSEUDO_ACCOUNT:196,tecTOKEN_PAIR_NOT_FOUND:189,tecTOO_SOON:152,tecUNFUNDED:129,tecUNFUNDED_ADD:102,tecUNFUNDED_AMM:162,tecUNFUNDED_OFFER:103,tecUNFUNDED_PAYMENT:104,tecWRONG_ASSET:194,tecXCHAIN_ACCOUNT_CREATE_PAST:181,tecXCHAIN_ACCOUNT_CREATE_TOO_MANY:182,tecXCHAIN_BAD_CLAIM_ID:172,tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR:185,tecXCHAIN_BAD_TRANSFER_ISSUE:170,tecXCHAIN_CLAIM_NO_QUORUM:173,tecXCHAIN_CREATE_ACCOUNT_DISABLED:186,tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE:175,tecXCHAIN_INSUFF_CREATE_AMOUNT:180,tecXCHAIN_NO_CLAIM_ID:171,tecXCHAIN_NO_SIGNERS_LIST:178,tecXCHAIN_PAYMENT_FAILED:183,tecXCHAIN_PROOF_UNKNOWN_KEY:174,tecXCHAIN_REWARD_MISMATCH:177,tecXCHAIN_SELF_COMMIT:184,tecXCHAIN_SENDING_ACCOUNT_MISMATCH:179,tecXCHAIN_WRONG_CHAIN:176,tefALREADY:-198,tefBAD_ADD_AUTH:-197,tefBAD_AUTH:-196,tefBAD_AUTH_MASTER:-183,tefBAD_LEDGER:-195,tefBAD_QUORUM:-185,tefBAD_SIGNATURE:-186,tefCREATED:-194,tefEXCEPTION:-193,tefFAILURE:-199,tefINTERNAL:-192,tefINVALID_LEDGER_FIX_TYPE:-178,tefINVARIANT_FAILED:-182,tefMASTER_DISABLED:-188,tefMAX_LEDGER:-187,tefNFTOKEN_IS_NOT_TRANSFERABLE:-179,tefNOT_MULTI_SIGNING:-184,tefNO_AUTH_REQUIRED:-191,tefNO_TICKET:-180,tefPAST_SEQ:-190,tefTOO_BIG:-181,tefWRONG_PRIOR:-189,telBAD_DOMAIN:-398,telBAD_PATH_COUNT:-397,telBAD_PUBLIC_KEY:-396,telCAN_NOT_QUEUE:-392,telCAN_NOT_QUEUE_BALANCE:-391,telCAN_NOT_QUEUE_BLOCKED:-389,telCAN_NOT_QUEUE_BLOCKS:-390,telCAN_NOT_QUEUE_FEE:-388,telCAN_NOT_QUEUE_FULL:-387,telENV_RPC_FAILED:-383,telFAILED_PROCESSING:-395,telINSUF_FEE_P:-394,telLOCAL_ERROR:-399,telNETWORK_ID_MAKES_TX_NON_CANONICAL:-384,telNO_DST_PARTIAL:-393,telREQUIRES_NETWORK_ID:-385,telWRONG_NETWORK:-386,temARRAY_EMPTY:-253,temARRAY_TOO_LARGE:-252,temBAD_AMM_TOKENS:-261,temBAD_AMOUNT:-298,temBAD_CURRENCY:-297,temBAD_EXPIRATION:-296,temBAD_FEE:-295,temBAD_ISSUER:-294,temBAD_LIMIT:-293,temBAD_NFTOKEN_TRANSFER_FEE:-262,temBAD_OFFER:-292,temBAD_PATH:-291,temBAD_PATH_LOOP:-290,temBAD_QUORUM:-271,temBAD_REGKEY:-289,temBAD_SEND_XRP_LIMIT:-288,temBAD_SEND_XRP_MAX:-287,temBAD_SEND_XRP_NO_DIRECT:-286,temBAD_SEND_XRP_PARTIAL:-285,temBAD_SEND_XRP_PATHS:-284,temBAD_SEQUENCE:-283,temBAD_SIGNATURE:-282,temBAD_SIGNER:-272,temBAD_SRC_ACCOUNT:-281,temBAD_TICK_SIZE:-269,temBAD_TRANSFER_FEE:-251,temBAD_TRANSFER_RATE:-280,temBAD_WEIGHT:-270,temCANNOT_PREAUTH_SELF:-267,temDISABLED:-273,temDST_IS_SRC:-279,temDST_NEEDED:-278,temEMPTY_DID:-254,temINVALID:-277,temINVALID_ACCOUNT_ID:-268,temINVALID_COUNT:-266,temINVALID_FLAG:-276,temINVALID_INNER_BATCH:-250,temMALFORMED:-299,temREDUNDANT:-275,temRIPPLE_EMPTY:-274,temSEQ_AND_TICKET:-263,temUNCERTAIN:-265,temUNKNOWN:-264,temXCHAIN_BAD_PROOF:-259,temXCHAIN_BRIDGE_BAD_ISSUES:-258,temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT:-256,temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT:-255,temXCHAIN_BRIDGE_NONDOOR_OWNER:-257,temXCHAIN_EQUAL_DOOR_ACCOUNTS:-260,terADDRESS_COLLISION:-86,terFUNDS_SPENT:-98,terINSUF_FEE_B:-97,terLAST:-91,terNO_ACCOUNT:-96,terNO_AMM:-87,terNO_AUTH:-95,terNO_DELEGATE_PERMISSION:-85,terNO_LINE:-94,terNO_RIPPLE:-90,terOWNERS:-93,terPRE_SEQ:-92,terPRE_TICKET:-88,terQUEUED:-89,terRETRY:-99,tesSUCCESS:0},TRANSACTION_TYPES:{AMMBid:39,AMMClawback:31,AMMCreate:35,AMMDelete:40,AMMDeposit:36,AMMVote:38,AMMWithdraw:37,AccountDelete:21,AccountSet:3,Batch:71,CheckCancel:18,CheckCash:17,CheckCreate:16,Clawback:30,CredentialAccept:59,CredentialCreate:58,CredentialDelete:60,DIDDelete:50,DIDSet:49,DelegateSet:64,DepositPreauth:19,EnableAmendment:100,EscrowCancel:4,EscrowCreate:1,EscrowFinish:2,Invalid:-1,LedgerStateFix:53,LoanBrokerCoverClawback:78,LoanBrokerCoverDeposit:76,LoanBrokerCoverWithdraw:77,LoanBrokerDelete:75,LoanBrokerSet:74,LoanDelete:81,LoanManage:82,LoanPay:84,LoanSet:80,MPTokenAuthorize:57,MPTokenIssuanceCreate:54,MPTokenIssuanceDestroy:55,MPTokenIssuanceSet:56,NFTokenAcceptOffer:29,NFTokenBurn:26,NFTokenCancelOffer:28,NFTokenCreateOffer:27,NFTokenMint:25,NFTokenModify:61,OfferCancel:8,OfferCreate:7,OracleDelete:52,OracleSet:51,Payment:0,PaymentChannelClaim:15,PaymentChannelCreate:13,PaymentChannelFund:14,PermissionedDomainDelete:63,PermissionedDomainSet:62,SetFee:101,SetRegularKey:5,SignerListSet:12,TicketCreate:10,TrustSet:20,UNLModify:102,VaultClawback:70,VaultCreate:65,VaultDelete:67,VaultDeposit:68,VaultSet:66,VaultWithdraw:69,XChainAccountCreateCommit:44,XChainAddAccountCreateAttestation:46,XChainAddClaimAttestation:45,XChainClaim:43,XChainCommit:42,XChainCreateBridge:48,XChainCreateClaimID:41,XChainModifyBridge:47},TYPES:{AccountID:8,Amount:6,Blob:7,Currency:26,Done:-1,Hash128:4,Hash160:17,Hash192:21,Hash256:5,Int32:10,Int64:11,Issue:24,LedgerEntry:10002,Metadata:10004,NotPresent:0,Number:9,PathSet:18,STArray:15,STObject:14,Transaction:10001,UInt16:1,UInt32:2,UInt384:22,UInt512:23,UInt64:3,UInt8:16,UInt96:20,Unknown:-2,Validation:10003,Vector256:19,XChainBridge:25}};var bg={},Io={},XS;function YS(){if(XS)return Io;XS=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.BytesLookup=Io.Bytes=void 0;class t{constructor(r,i,s){this.name=r,this.ordinal=i,this.ordinalWidth=s,this.bytes=new Uint8Array(s);for(let o=0;o<s;o++)this.bytes[s-o-1]=i>>>o*8&255}toJSON(){return this.name}toBytesSink(r){r.put(this.bytes)}toBytes(){return this.bytes}}Io.Bytes=t;class e{constructor(r,i){this.ordinalWidth=i,Object.entries(r).forEach(([s,o])=>{this.add(s,o)})}add(r,i){if(this[r])throw new SyntaxError(`Attempted to add a value with a duplicate name "${r}". This is not allowed because it is unclear how to decode.`);if(this[i.toString()])throw new SyntaxError(`Attempted to add a duplicate value under a different name (Given name: "${r}" and previous name: "${this[i.toString()]}. This is not allowed because it is unclear how to decode.
22
22
  Given value: ${i.toString()}`);this[r]=new t(r,i,this.ordinalWidth),this[i.toString()]=this[r]}from(r){return r instanceof t?r:this[r]}fromParser(r){return this.from(r.readUIntN(this.ordinalWidth).toString())}}return Io.BytesLookup=e,Io}var ml={},Co={},Oo={},QS;function wl(){if(QS)return Oo;QS=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.BinarySerializer=Oo.BytesList=void 0;const t=$e();class e{constructor(){this.bytesArray=[]}getLength(){return(0,t.concat)(this.bytesArray).byteLength}put(i){const s=Uint8Array.from(i);return this.bytesArray.push(s),this}toBytesSink(i){i.put(this.toBytes())}toBytes(){return(0,t.concat)(this.bytesArray)}toHex(){return(0,t.bytesToHex)(this.toBytes())}}Oo.BytesList=e;class n{constructor(i){this.sink=new e,this.sink=i}write(i){i.toBytesSink(this.sink)}put(i){this.sink.put(i)}writeType(i,s){this.write(i.from(s))}writeBytesList(i){i.toBytesSink(this.sink)}encodeVariableLength(i){const s=new Uint8Array(3);if(i<=192)return s[0]=i,s.slice(0,1);if(i<=12480)return i-=193,s[0]=193+(i>>>8),s[1]=i&255,s.slice(0,2);if(i<=918744)return i-=12481,s[0]=241+(i>>>16),s[1]=i>>8&255,s[2]=i&255,s.slice(0,3);throw new Error("Overflow error")}writeFieldAndValue(i,s,o=!1){const a=i.associatedType.from(s);if(a.toBytesSink===void 0||i.name===void 0)throw new Error;this.sink.put(i.header),i.isVariableLengthEncoded?this.writeLengthEncoded(a,o):a.toBytesSink(this.sink)}writeLengthEncoded(i,s=!1){const o=new e;s||i.toBytesSink(o),this.put(this.encodeVariableLength(o.getLength())),this.writeBytesList(o)}}return Oo.BinarySerializer=n,Oo}var JS;function bn(){if(JS)return Co;JS=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.Comparable=Co.SerializedType=void 0;const t=wl(),e=$e();class n{constructor(s){this.bytes=new Uint8Array(0),this.bytes=s??new Uint8Array(0)}static fromParser(s,o){throw new Error("fromParser not implemented")}static from(s){throw new Error("from not implemented")}toBytesSink(s){s.put(this.bytes)}toHex(){return(0,e.bytesToHex)(this.toBytes())}toBytes(){if(this.bytes)return this.bytes;const s=new t.BytesList;return this.toBytesSink(s),s.toBytes()}toJSON(s,o){return this.toHex()}toString(){return this.toHex()}}Co.SerializedType=n;class r extends n{lt(s){return this.compareTo(s)<0}eq(s){return this.compareTo(s)===0}gt(s){return this.compareTo(s)>0}gte(s){return this.compareTo(s)>-1}lte(s){return this.compareTo(s)<1}compareTo(s){throw new Error(`cannot compare ${this.toString()} and ${s.toString()}`)}}return Co.Comparable=r,Co}var vn={},ZS;function e_(){return ZS||(ZS=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.DELEGATABLE_PERMISSIONS_WIDTH=vn.TRANSACTION_RESULT_WIDTH=vn.TRANSACTION_TYPE_WIDTH=vn.LEDGER_ENTRY_WIDTH=vn.TYPE_WIDTH=void 0,vn.TYPE_WIDTH=2,vn.LEDGER_ENTRY_WIDTH=2,vn.TRANSACTION_TYPE_WIDTH=2,vn.TRANSACTION_RESULT_WIDTH=1,vn.DELEGATABLE_PERMISSIONS_WIDTH=4),vn}var t_;function WP(){if(t_)return ml;t_=1,Object.defineProperty(ml,"__esModule",{value:!0}),ml.FieldLookup=void 0;const t=YS(),e=bn(),n=e_();function r(o,a){const c=[];return o<16?a<16?c.push(o<<4|a):c.push(o<<4,a):a<16?c.push(a,o):c.push(0,o,a),Uint8Array.from(c)}function i([o,a],c){const l=r(c,a.nth);return{name:o,nth:a.nth,isVariableLengthEncoded:a.isVLEncoded,isSerialized:a.isSerialized,isSigningField:a.isSigningField,ordinal:c<<16|a.nth,type:new t.Bytes(a.type,c,n.TYPE_WIDTH),header:l,associatedType:e.SerializedType}}class s{constructor(a,c){a.forEach(([l,d])=>{const u=c[d.type];this[l]=i([l,d],u),this[this[l].ordinal.toString()]=this[l]})}fromString(a){return this[a]}}return ml.FieldLookup=s,ml}var n_;function r_(){return n_||(n_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BytesLookup=t.Bytes=t.FieldLookup=t.XrplDefinitionsBase=void 0;const e=YS();Object.defineProperty(t,"Bytes",{enumerable:!0,get:function(){return e.Bytes}}),Object.defineProperty(t,"BytesLookup",{enumerable:!0,get:function(){return e.BytesLookup}});const n=WP();Object.defineProperty(t,"FieldLookup",{enumerable:!0,get:function(){return n.FieldLookup}});const r=e_();class i{constructor(o,a){this.type=new e.BytesLookup(o.TYPES,r.TYPE_WIDTH),this.ledgerEntryType=new e.BytesLookup(o.LEDGER_ENTRY_TYPES,r.LEDGER_ENTRY_WIDTH),this.transactionType=new e.BytesLookup(o.TRANSACTION_TYPES,r.TRANSACTION_TYPE_WIDTH),this.transactionResult=new e.BytesLookup(o.TRANSACTION_RESULTS,r.TRANSACTION_RESULT_WIDTH),this.field=new n.FieldLookup(o.FIELDS,o.TYPES),this.transactionNames=Object.entries(o.TRANSACTION_TYPES).filter(([d,u])=>u>=0).map(([d,u])=>d),this.dataTypes={},this.associateTypes(a),this.granularPermissions={TrustlineAuthorize:65537,TrustlineFreeze:65538,TrustlineUnfreeze:65539,AccountDomainSet:65540,AccountEmailHashSet:65541,AccountMessageKeySet:65542,AccountTransferRateSet:65543,AccountTickSizeSet:65544,PaymentMint:65545,PaymentBurn:65546,MPTokenIssuanceLock:65547,MPTokenIssuanceUnlock:65548};const c=Object.fromEntries(Object.entries(o.TRANSACTION_TYPES).map(([d,u])=>[d,u+1])),l=Object.assign(Object.assign({},this.granularPermissions),c);this.delegatablePermissions=new e.BytesLookup(l,r.DELEGATABLE_PERMISSIONS_WIDTH)}associateTypes(o){this.dataTypes=Object.assign({},this.dataTypes,o),Object.values(this.field).forEach(a=>{a.associatedType=this.dataTypes[a.type.name]}),this.field.TransactionType.associatedType=this.transactionType,this.field.TransactionResult.associatedType=this.transactionResult,this.field.LedgerEntryType.associatedType=this.ledgerEntryType,this.field.PermissionValue&&(this.field.PermissionValue.associatedType=this.delegatablePermissions)}getAssociatedTypes(){return this.dataTypes}}t.XrplDefinitionsBase=i})(bg)),bg}var i_;function Vi(){return i_||(i_=1,(function(t){var e=gl&&gl.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSACTION_TYPES=t.TransactionType=t.TransactionResult=t.LedgerEntryType=t.Type=t.Field=t.DEFAULT_DEFINITIONS=t.XrplDefinitionsBase=t.Bytes=void 0;const n=e(zP),r=r_();Object.defineProperty(t,"XrplDefinitionsBase",{enumerable:!0,get:function(){return r.XrplDefinitionsBase}}),Object.defineProperty(t,"Bytes",{enumerable:!0,get:function(){return r.Bytes}});const i=new r.XrplDefinitionsBase(n.default,{});t.DEFAULT_DEFINITIONS=i;const s=i.type;t.Type=s;const o=i.ledgerEntryType;t.LedgerEntryType=o;const a=i.transactionType;t.TransactionType=a;const c=i.transactionResult;t.TransactionResult=c;const l=i.field;t.Field=l;const d=i.transactionNames;t.TRANSACTION_TYPES=d})(gl)),gl}var vg={},yl={},bl={},vl={},Je={},s_;function dr(){if(s_)return Je;s_=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.compare=Je.equal=Je.readInt64BE=Je.readInt32BE=Je.readUInt32BE=Je.readUInt16BE=Je.writeInt64BE=Je.writeInt32BE=Je.writeUInt32BE=Je.writeUInt16BE=Je.writeUInt8=void 0;function t(g,w,E){w=Number(w),g[E]=w}Je.writeUInt8=t;function e(g,w,E){w=Number(w),g[E]=w>>>8,g[E+1]=w}Je.writeUInt16BE=e;function n(g,w,E){g[E]=w>>>24&255,g[E+1]=w>>>16&255,g[E+2]=w>>>8&255,g[E+3]=w&255}Je.writeUInt32BE=n;function r(g,w,E){new DataView(g.buffer,g.byteOffset,g.byteLength).setInt32(E,w,!1)}Je.writeInt32BE=r;function i(g,w,E){new DataView(g.buffer,g.byteOffset,g.byteLength).setBigInt64(E,w,!1)}Je.writeInt64BE=i;function s(g,w){return new DataView(g.buffer).getUint16(w,!1).toString(10)}Je.readUInt16BE=s;function o(g,w){return new DataView(g.buffer).getUint32(w,!1).toString(10)}Je.readUInt32BE=o;function a(g,w){return new DataView(g.buffer,g.byteOffset,g.byteLength).getInt32(w,!1)}Je.readInt32BE=a;function c(g,w){return new DataView(g.buffer,g.byteOffset,g.byteLength).getBigInt64(w,!1)}Je.readInt64BE=c;function l(g,w){const E=g instanceof ArrayBuffer?new Uint8Array(g,0):g,y=w instanceof ArrayBuffer?new Uint8Array(w,0):w;return E.byteLength!=y.byteLength?!1:h(E)&&h(y)?f(E,y)===0:m(E)&&m(y)?u(E,y)===0:d(E,y)===0}Je.equal=l;function d(g,w){const E=new Uint8Array(g.buffer,g.byteOffset,g.byteLength),y=new Uint8Array(w.buffer,w.byteOffset,w.byteLength);return p(E,y)}function u(g,w){const E=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2),y=new Uint16Array(w.buffer,w.byteOffset,w.byteLength/2);return p(E,y)}function f(g,w){const E=new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4),y=new Uint32Array(w.buffer,w.byteOffset,w.byteLength/4);return p(E,y)}function p(g,w){if(g.byteLength!==w.byteLength)throw new Error("Cannot compare arrays of different length");for(let E=0;E<g.length-1;E+=1){if(g[E]>w[E])return 1;if(g[E]<w[E])return-1}return 0}Je.compare=p;function m(g){return g.byteOffset%2===0&&g.byteLength%2===0}function h(g){return g.byteOffset%4===0&&g.byteLength%4===0}return Je}var o_;function Tf(){if(o_)return vl;o_=1,Object.defineProperty(vl,"__esModule",{value:!0}),vl.Hash=void 0;const t=bn(),e=$e(),n=dr();class r extends t.Comparable{constructor(s){if(super(s),this.bytes.length!==this.constructor.width)throw new Error(`Invalid Hash length ${this.bytes.byteLength}`)}static from(s){if(s instanceof this)return s;if(typeof s=="string"){if(!e.HEX_REGEX.test(s))throw new Error(`Invalid hash string ${s}`);return new this((0,e.hexToBytes)(s))}throw new Error("Cannot construct Hash from given value")}static fromParser(s,o){return new this(s.read(o??this.width))}compareTo(s){return(0,n.compare)(this.bytes,this.constructor.from(s).bytes)}toString(){return this.toHex()}nibblet(s){const o=s>0?s/2|0:0;let a=this.bytes[o];return s%2===0?a=(a&240)>>>4:a=a&15,a}}return vl.Hash=r,vl}var a_;function Eg(){if(a_)return bl;a_=1,Object.defineProperty(bl,"__esModule",{value:!0}),bl.Hash160=void 0;const t=Tf();class e extends t.Hash{constructor(r){(r==null?void 0:r.byteLength)===0&&(r=e.ZERO_160.bytes),super(r??e.ZERO_160.bytes)}}return bl.Hash160=e,e.width=20,e.ZERO_160=new e(new Uint8Array(e.width)),bl}var c_;function El(){if(c_)return yl;c_=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.AccountID=void 0;const t=yn(),e=Eg(),n=$e(),r=/^[A-F0-9]{40}$/;class i extends e.Hash160{constructor(o){super(o??i.defaultAccountID.bytes)}static from(o){if(o instanceof i)return o;if(typeof o=="string")return o===""?new i:r.test(o)?new i((0,n.hexToBytes)(o)):this.fromBase58(o);throw new Error("Cannot construct AccountID from value given")}static fromBase58(o){if((0,t.isValidXAddress)(o)){const a=(0,t.xAddressToClassicAddress)(o);if(a.tag!==!1)throw new Error("Only allowed to have tag on Account or Destination");o=a.classicAddress}return new i(Uint8Array.from((0,t.decodeAccountID)(o)))}toJSON(){return this.toBase58()}toBase58(){return(0,t.encodeAccountID)(this.bytes)}}return yl.AccountID=i,i.defaultAccountID=new i(new Uint8Array(20)),yl}var No={},Al={},l_;function zi(){if(l_)return Al;l_=1,Object.defineProperty(Al,"__esModule",{value:!0}),Al.BinaryParser=void 0;const t=Vi(),e=$e();class n{constructor(i,s=t.DEFAULT_DEFINITIONS){this.bytes=(0,e.hexToBytes)(i),this.definitions=s}peek(){if(this.bytes.byteLength===0)throw new Error;return this.bytes[0]}skip(i){if(i>this.bytes.byteLength)throw new Error;this.bytes=this.bytes.slice(i)}read(i){if(i>this.bytes.byteLength)throw new Error;const s=this.bytes.slice(0,i);return this.skip(i),s}readUIntN(i){if(0>=i||i>4)throw new Error("invalid n");return this.read(i).reduce((s,o)=>s<<8|o)>>>0}readUInt8(){return this.readUIntN(1)}readUInt16(){return this.readUIntN(2)}readUInt32(){return this.readUIntN(4)}size(){return this.bytes.byteLength}end(i){const s=this.bytes.byteLength;return s===0||i!==void 0&&s<=i}readVariableLength(){return this.read(this.readVariableLengthLength())}readVariableLengthLength(){const i=this.readUInt8();if(i<=192)return i;if(i<=240){const s=this.readUInt8();return 193+(i-193)*256+s}else if(i<=254){const s=this.readUInt8(),o=this.readUInt8();return 12481+(i-241)*65536+s*256+o}throw new Error("Invalid variable length indicator")}readFieldOrdinal(){let i=this.readUInt8(),s=i&15;if(i>>=4,i===0&&(i=this.readUInt8(),i===0||i<16))throw new Error(`Cannot read FieldOrdinal, type_code ${i} out of range`);if(s===0&&(s=this.readUInt8(),s===0||s<16))throw new Error(`Cannot read FieldOrdinal, field_code ${s} out of range`);return i<<16|s}readField(){return this.definitions.field.fromString(this.readFieldOrdinal().toString())}readType(i){return i.fromParser(this)}typeForField(i){return i.associatedType}readFieldValue(i){const s=this.typeForField(i);if(!s)throw new Error(`unsupported: (${i.name}, ${i.type.name})`);const o=i.isVariableLengthEncoded?this.readVariableLengthLength():void 0,a=s.fromParser(this,o);if(a===void 0)throw new Error(`fromParser for (${i.name}, ${i.type.name}) -> undefined `);return a}readFieldAndValue(){const i=this.readField();return[i,this.readFieldValue(i)]}}return Al.BinaryParser=n,Al}var Sl={},u_;function If(){if(u_)return Sl;u_=1,Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.Currency=void 0;const t=Eg(),e=$e(),n=/^0{40}$/,r=/^[A-Z0-9a-z?!@#$%^&*(){}[\]|]{3}$/,i=/^[A-F0-9]{40}$/,s=/^0{24}[\x00-\x7F]{6}0{10}$/;function o(h){const g=new Uint8Array(20);if(h!=="XRP"){const w=h.split("").map(E=>E.charCodeAt(0));g.set(w,12)}return g}function a(h){return r.test(h)}function c(h){const g=(0,e.hexToString)((0,e.bytesToHex)(h));return g==="XRP"?null:a(g)?g:null}function l(h){return i.test(h)}function d(h){return h.length===3||l(h)}function u(h){return h.byteLength===20}function f(h){return h instanceof Uint8Array?u(h):d(h)}function p(h){if(!f(h))throw new Error(`Unsupported Currency representation: ${h}`);return h.length===3?o(h):(0,e.hexToBytes)(h)}class m extends t.Hash160{constructor(g){super(g??m.XRP.bytes);const w=(0,e.bytesToHex)(this.bytes);n.test(w)?this._iso="XRP":s.test(w)?this._iso=c(this.bytes.slice(12,15)):this._iso=null}iso(){return this._iso}static from(g){if(g instanceof m)return g;if(typeof g=="string")return new m(p(g));throw new Error("Cannot construct Currency from value given")}toJSON(){const g=this.iso();return g!==null?g:(0,e.bytesToHex)(this.bytes)}}return Sl.Currency=m,m.XRP=new m(new Uint8Array(20)),Sl}var Cf={exports:{}},KP=Cf.exports,d_;function on(){return d_||(d_=1,(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,d=9007199254740991,u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,p=1e9;function m(v){var B,T,_,N=$.prototype={constructor:$,toString:null,valueOf:null},D=new $(1),U=20,L=4,k=-7,C=21,P=-1e7,A=1e7,x=!1,I=1,R=0,O={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",z=!0;function $(q,K){var W,H,V,Q,te,ie,se,ce,oe=this;if(!(oe instanceof $))return new $(q,K);if(K==null){if(q&&q._isBigNumber===!0){oe.s=q.s,!q.c||q.e>A?oe.c=oe.e=null:q.e<P?oe.c=[oe.e=0]:(oe.e=q.e,oe.c=q.c.slice());return}if((ie=typeof q=="number")&&q*0==0){if(oe.s=1/q<0?(q=-q,-1):1,q===~~q){for(Q=0,te=q;te>=10;te/=10,Q++);Q>A?oe.c=oe.e=null:(oe.e=Q,oe.c=[q]);return}ce=String(q)}else{if(!r.test(ce=String(q)))return _(oe,ce,ie);oe.s=ce.charCodeAt(0)==45?(ce=ce.slice(1),-1):1}(Q=ce.indexOf("."))>-1&&(ce=ce.replace(".","")),(te=ce.search(/e/i))>0?(Q<0&&(Q=te),Q+=+ce.slice(te+1),ce=ce.substring(0,te)):Q<0&&(Q=ce.length)}else{if(E(K,2,M.length,"Base"),K==10&&z)return oe=new $(q),Y(oe,U+oe.e+1,L);if(ce=String(q),ie=typeof q=="number"){if(q*0!=0)return _(oe,ce,ie,K);if(oe.s=1/q<0?(ce=ce.slice(1),-1):1,$.DEBUG&&ce.replace(/^0\.0*|\./,"").length>15)throw Error(a+q)}else oe.s=ce.charCodeAt(0)===45?(ce=ce.slice(1),-1):1;for(W=M.slice(0,K),Q=te=0,se=ce.length;te<se;te++)if(W.indexOf(H=ce.charAt(te))<0){if(H=="."){if(te>Q){Q=se;continue}}else if(!V&&(ce==ce.toUpperCase()&&(ce=ce.toLowerCase())||ce==ce.toLowerCase()&&(ce=ce.toUpperCase()))){V=!0,te=-1,Q=0;continue}return _(oe,String(q),ie,K)}ie=!1,ce=T(ce,K,10,oe.s),(Q=ce.indexOf("."))>-1?ce=ce.replace(".",""):Q=ce.length}for(te=0;ce.charCodeAt(te)===48;te++);for(se=ce.length;ce.charCodeAt(--se)===48;);if(ce=ce.slice(te,++se)){if(se-=te,ie&&$.DEBUG&&se>15&&(q>d||q!==s(q)))throw Error(a+oe.s*q);if((Q=Q-te-1)>A)oe.c=oe.e=null;else if(Q<P)oe.c=[oe.e=0];else{if(oe.e=Q,oe.c=[],te=(Q+1)%l,Q<0&&(te+=l),te<se){for(te&&oe.c.push(+ce.slice(0,te)),se-=l;te<se;)oe.c.push(+ce.slice(te,te+=l));te=l-(ce=ce.slice(te)).length}else te-=se;for(;te--;ce+="0");oe.c.push(+ce)}}else oe.c=[oe.e=0]}$.clone=m,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(q){var K,W;if(q!=null)if(typeof q=="object"){if(q.hasOwnProperty(K="DECIMAL_PLACES")&&(W=q[K],E(W,0,p,K),U=W),q.hasOwnProperty(K="ROUNDING_MODE")&&(W=q[K],E(W,0,8,K),L=W),q.hasOwnProperty(K="EXPONENTIAL_AT")&&(W=q[K],W&&W.pop?(E(W[0],-p,0,K),E(W[1],0,p,K),k=W[0],C=W[1]):(E(W,-p,p,K),k=-(C=W<0?-W:W))),q.hasOwnProperty(K="RANGE"))if(W=q[K],W&&W.pop)E(W[0],-p,-1,K),E(W[1],1,p,K),P=W[0],A=W[1];else if(E(W,-p,p,K),W)P=-(A=W<0?-W:W);else throw Error(o+K+" cannot be zero: "+W);if(q.hasOwnProperty(K="CRYPTO"))if(W=q[K],W===!!W)if(W)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))x=W;else throw x=!W,Error(o+"crypto unavailable");else x=W;else throw Error(o+K+" not true or false: "+W);if(q.hasOwnProperty(K="MODULO_MODE")&&(W=q[K],E(W,0,9,K),I=W),q.hasOwnProperty(K="POW_PRECISION")&&(W=q[K],E(W,0,p,K),R=W),q.hasOwnProperty(K="FORMAT"))if(W=q[K],typeof W=="object")O=W;else throw Error(o+K+" not an object: "+W);if(q.hasOwnProperty(K="ALPHABET"))if(W=q[K],typeof W=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(W))z=W.slice(0,10)=="0123456789",M=W;else throw Error(o+K+" invalid: "+W)}else throw Error(o+"Object expected: "+q);return{DECIMAL_PLACES:U,ROUNDING_MODE:L,EXPONENTIAL_AT:[k,C],RANGE:[P,A],CRYPTO:x,MODULO_MODE:I,POW_PRECISION:R,FORMAT:O,ALPHABET:M}},$.isBigNumber=function(q){if(!q||q._isBigNumber!==!0)return!1;if(!$.DEBUG)return!0;var K,W,H=q.c,V=q.e,Q=q.s;e:if({}.toString.call(H)=="[object Array]"){if((Q===1||Q===-1)&&V>=-p&&V<=p&&V===s(V)){if(H[0]===0){if(V===0&&H.length===1)return!0;break e}if(K=(V+1)%l,K<1&&(K+=l),String(H[0]).length==K){for(K=0;K<H.length;K++)if(W=H[K],W<0||W>=c||W!==s(W))break e;if(W!==0)return!0}}}else if(H===null&&V===null&&(Q===null||Q===1||Q===-1))return!0;throw Error(o+"Invalid BigNumber: "+q)},$.maximum=$.max=function(){return ee(arguments,-1)},$.minimum=$.min=function(){return ee(arguments,1)},$.random=(function(){var q=9007199254740992,K=Math.random()*q&2097151?function(){return s(Math.random()*q)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(W){var H,V,Q,te,ie,se=0,ce=[],oe=new $(D);if(W==null?W=U:E(W,0,p),te=i(W/l),x)if(crypto.getRandomValues){for(H=crypto.getRandomValues(new Uint32Array(te*=2));se<te;)ie=H[se]*131072+(H[se+1]>>>11),ie>=9e15?(V=crypto.getRandomValues(new Uint32Array(2)),H[se]=V[0],H[se+1]=V[1]):(ce.push(ie%1e14),se+=2);se=te/2}else if(crypto.randomBytes){for(H=crypto.randomBytes(te*=7);se<te;)ie=(H[se]&31)*281474976710656+H[se+1]*1099511627776+H[se+2]*4294967296+H[se+3]*16777216+(H[se+4]<<16)+(H[se+5]<<8)+H[se+6],ie>=9e15?crypto.randomBytes(7).copy(H,se):(ce.push(ie%1e14),se+=7);se=te/7}else throw x=!1,Error(o+"crypto unavailable");if(!x)for(;se<te;)ie=K(),ie<9e15&&(ce[se++]=ie%1e14);for(te=ce[--se],W%=l,te&&W&&(ie=u[l-W],ce[se]=s(te/ie)*ie);ce[se]===0;ce.pop(),se--);if(se<0)ce=[Q=0];else{for(Q=-1;ce[0]===0;ce.splice(0,1),Q-=l);for(se=1,ie=ce[0];ie>=10;ie/=10,se++);se<l&&(Q-=l-se)}return oe.e=Q,oe.c=ce,oe}})(),$.sum=function(){for(var q=1,K=arguments,W=new $(K[0]);q<K.length;)W=W.plus(K[q++]);return W},T=(function(){var q="0123456789";function K(W,H,V,Q){for(var te,ie=[0],se,ce=0,oe=W.length;ce<oe;){for(se=ie.length;se--;ie[se]*=H);for(ie[0]+=Q.indexOf(W.charAt(ce++)),te=0;te<ie.length;te++)ie[te]>V-1&&(ie[te+1]==null&&(ie[te+1]=0),ie[te+1]+=ie[te]/V|0,ie[te]%=V)}return ie.reverse()}return function(W,H,V,Q,te){var ie,se,ce,oe,ue,we,me,he,ge=W.indexOf("."),pe=U,G=L;for(ge>=0&&(oe=R,R=0,W=W.replace(".",""),he=new $(H),we=he.pow(W.length-ge),R=oe,he.c=K(S(g(we.c),we.e,"0"),10,V,q),he.e=he.c.length),me=K(W,H,V,te?(ie=M,q):(ie=q,M)),ce=oe=me.length;me[--oe]==0;me.pop());if(!me[0])return ie.charAt(0);if(ge<0?--ce:(we.c=me,we.e=ce,we.s=Q,we=B(we,he,pe,G,V),me=we.c,ue=we.r,ce=we.e),se=ce+pe+1,ge=me[se],oe=V/2,ue=ue||se<0||me[se+1]!=null,ue=G<4?(ge!=null||ue)&&(G==0||G==(we.s<0?3:2)):ge>oe||ge==oe&&(G==4||ue||G==6&&me[se-1]&1||G==(we.s<0?8:7)),se<1||!me[0])W=ue?S(ie.charAt(1),-pe,ie.charAt(0)):ie.charAt(0);else{if(me.length=se,ue)for(--V;++me[--se]>V;)me[se]=0,se||(++ce,me=[1].concat(me));for(oe=me.length;!me[--oe];);for(ge=0,W="";ge<=oe;W+=ie.charAt(me[ge++]));W=S(W,ce,ie.charAt(0))}return W}})(),B=(function(){function q(H,V,Q){var te,ie,se,ce,oe=0,ue=H.length,we=V%f,me=V/f|0;for(H=H.slice();ue--;)se=H[ue]%f,ce=H[ue]/f|0,te=me*se+ce*we,ie=we*se+te%f*f+oe,oe=(ie/Q|0)+(te/f|0)+me*ce,H[ue]=ie%Q;return oe&&(H=[oe].concat(H)),H}function K(H,V,Q,te){var ie,se;if(Q!=te)se=Q>te?1:-1;else for(ie=se=0;ie<Q;ie++)if(H[ie]!=V[ie]){se=H[ie]>V[ie]?1:-1;break}return se}function W(H,V,Q,te){for(var ie=0;Q--;)H[Q]-=ie,ie=H[Q]<V[Q]?1:0,H[Q]=ie*te+H[Q]-V[Q];for(;!H[0]&&H.length>1;H.splice(0,1));}return function(H,V,Q,te,ie){var se,ce,oe,ue,we,me,he,ge,pe,G,F,j,re,ae,le,de,Ae,Se=H.s==V.s?1:-1,be=H.c,xe=V.c;if(!be||!be[0]||!xe||!xe[0])return new $(!H.s||!V.s||(be?xe&&be[0]==xe[0]:!xe)?NaN:be&&be[0]==0||!xe?Se*0:Se/0);for(ge=new $(Se),pe=ge.c=[],ce=H.e-V.e,Se=Q+ce+1,ie||(ie=c,ce=h(H.e/l)-h(V.e/l),Se=Se/l|0),oe=0;xe[oe]==(be[oe]||0);oe++);if(xe[oe]>(be[oe]||0)&&ce--,Se<0)pe.push(1),ue=!0;else{for(ae=be.length,de=xe.length,oe=0,Se+=2,we=s(ie/(xe[0]+1)),we>1&&(xe=q(xe,we,ie),be=q(be,we,ie),de=xe.length,ae=be.length),re=de,G=be.slice(0,de),F=G.length;F<de;G[F++]=0);Ae=xe.slice(),Ae=[0].concat(Ae),le=xe[0],xe[1]>=ie/2&&le++;do{if(we=0,se=K(xe,G,de,F),se<0){if(j=G[0],de!=F&&(j=j*ie+(G[1]||0)),we=s(j/le),we>1)for(we>=ie&&(we=ie-1),me=q(xe,we,ie),he=me.length,F=G.length;K(me,G,he,F)==1;)we--,W(me,de<he?Ae:xe,he,ie),he=me.length,se=1;else we==0&&(se=we=1),me=xe.slice(),he=me.length;if(he<F&&(me=[0].concat(me)),W(G,me,F,ie),F=G.length,se==-1)for(;K(xe,G,de,F)<1;)we++,W(G,de<F?Ae:xe,F,ie),F=G.length}else se===0&&(we++,G=[0]);pe[oe++]=we,G[0]?G[F++]=be[re]||0:(G=[be[re]],F=1)}while((re++<ae||G[0]!=null)&&Se--);ue=G[0]!=null,pe[0]||pe.splice(0,1)}if(ie==c){for(oe=1,Se=pe[0];Se>=10;Se/=10,oe++);Y(ge,Q+(ge.e=oe+ce*l-1)+1,te,ue)}else ge.e=ce,ge.r=+ue;return ge}})();function X(q,K,W,H){var V,Q,te,ie,se;if(W==null?W=L:E(W,0,8),!q.c)return q.toString();if(V=q.c[0],te=q.e,K==null)se=g(q.c),se=H==1||H==2&&(te<=k||te>=C)?b(se,te):S(se,te,"0");else if(q=Y(new $(q),K,W),Q=q.e,se=g(q.c),ie=se.length,H==1||H==2&&(K<=Q||Q<=k)){for(;ie<K;se+="0",ie++);se=b(se,Q)}else if(K-=te+(H===2&&Q>te),se=S(se,Q,"0"),Q+1>ie){if(--K>0)for(se+=".";K--;se+="0");}else if(K+=Q-ie,K>0)for(Q+1==ie&&(se+=".");K--;se+="0");return q.s<0&&V?"-"+se:se}function ee(q,K){for(var W,H,V=1,Q=new $(q[0]);V<q.length;V++)H=new $(q[V]),(!H.s||(W=w(Q,H))===K||W===0&&Q.s===K)&&(Q=H);return Q}function ne(q,K,W){for(var H=1,V=K.length;!K[--V];K.pop());for(V=K[0];V>=10;V/=10,H++);return(W=H+W*l-1)>A?q.c=q.e=null:W<P?q.c=[q.e=0]:(q.e=W,q.c=K),q}_=(function(){var q=/^(-?)0([xbo])(?=\w[\w.]*$)/i,K=/^([^.]+)\.$/,W=/^\.([^.]+)$/,H=/^-?(Infinity|NaN)$/,V=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Q,te,ie,se){var ce,oe=ie?te:te.replace(V,"");if(H.test(oe))Q.s=isNaN(oe)?null:oe<0?-1:1;else{if(!ie&&(oe=oe.replace(q,function(ue,we,me){return ce=(me=me.toLowerCase())=="x"?16:me=="b"?2:8,!se||se==ce?we:ue}),se&&(ce=se,oe=oe.replace(K,"$1").replace(W,"0.$1")),te!=oe))return new $(oe,ce);if($.DEBUG)throw Error(o+"Not a"+(se?" base "+se:"")+" number: "+te);Q.s=null}Q.c=Q.e=null}})();function Y(q,K,W,H){var V,Q,te,ie,se,ce,oe,ue=q.c,we=u;if(ue){e:{for(V=1,ie=ue[0];ie>=10;ie/=10,V++);if(Q=K-V,Q<0)Q+=l,te=K,se=ue[ce=0],oe=s(se/we[V-te-1]%10);else if(ce=i((Q+1)/l),ce>=ue.length)if(H){for(;ue.length<=ce;ue.push(0));se=oe=0,V=1,Q%=l,te=Q-l+1}else break e;else{for(se=ie=ue[ce],V=1;ie>=10;ie/=10,V++);Q%=l,te=Q-l+V,oe=te<0?0:s(se/we[V-te-1]%10)}if(H=H||K<0||ue[ce+1]!=null||(te<0?se:se%we[V-te-1]),H=W<4?(oe||H)&&(W==0||W==(q.s<0?3:2)):oe>5||oe==5&&(W==4||H||W==6&&(Q>0?te>0?se/we[V-te]:0:ue[ce-1])%10&1||W==(q.s<0?8:7)),K<1||!ue[0])return ue.length=0,H?(K-=q.e+1,ue[0]=we[(l-K%l)%l],q.e=-K||0):ue[0]=q.e=0,q;if(Q==0?(ue.length=ce,ie=1,ce--):(ue.length=ce+1,ie=we[l-Q],ue[ce]=te>0?s(se/we[V-te]%we[te])*ie:0),H)for(;;)if(ce==0){for(Q=1,te=ue[0];te>=10;te/=10,Q++);for(te=ue[0]+=ie,ie=1;te>=10;te/=10,ie++);Q!=ie&&(q.e++,ue[0]==c&&(ue[0]=1));break}else{if(ue[ce]+=ie,ue[ce]!=c)break;ue[ce--]=0,ie=1}for(Q=ue.length;ue[--Q]===0;ue.pop());}q.e>A?q.c=q.e=null:q.e<P&&(q.c=[q.e=0])}return q}function J(q){var K,W=q.e;return W===null?q.toString():(K=g(q.c),K=W<=k||W>=C?b(K,W):S(K,W,"0"),q.s<0?"-"+K:K)}return N.absoluteValue=N.abs=function(){var q=new $(this);return q.s<0&&(q.s=1),q},N.comparedTo=function(q,K){return w(this,new $(q,K))},N.decimalPlaces=N.dp=function(q,K){var W,H,V,Q=this;if(q!=null)return E(q,0,p),K==null?K=L:E(K,0,8),Y(new $(Q),q+Q.e+1,K);if(!(W=Q.c))return null;if(H=((V=W.length-1)-h(this.e/l))*l,V=W[V])for(;V%10==0;V/=10,H--);return H<0&&(H=0),H},N.dividedBy=N.div=function(q,K){return B(this,new $(q,K),U,L)},N.dividedToIntegerBy=N.idiv=function(q,K){return B(this,new $(q,K),0,1)},N.exponentiatedBy=N.pow=function(q,K){var W,H,V,Q,te,ie,se,ce,oe,ue=this;if(q=new $(q),q.c&&!q.isInteger())throw Error(o+"Exponent not an integer: "+J(q));if(K!=null&&(K=new $(K)),ie=q.e>14,!ue.c||!ue.c[0]||ue.c[0]==1&&!ue.e&&ue.c.length==1||!q.c||!q.c[0])return oe=new $(Math.pow(+J(ue),ie?q.s*(2-y(q)):+J(q))),K?oe.mod(K):oe;if(se=q.s<0,K){if(K.c?!K.c[0]:!K.s)return new $(NaN);H=!se&&ue.isInteger()&&K.isInteger(),H&&(ue=ue.mod(K))}else{if(q.e>9&&(ue.e>0||ue.e<-1||(ue.e==0?ue.c[0]>1||ie&&ue.c[1]>=24e7:ue.c[0]<8e13||ie&&ue.c[0]<=9999975e7)))return Q=ue.s<0&&y(q)?-0:0,ue.e>-1&&(Q=1/Q),new $(se?1/Q:Q);R&&(Q=i(R/l+2))}for(ie?(W=new $(.5),se&&(q.s=1),ce=y(q)):(V=Math.abs(+J(q)),ce=V%2),oe=new $(D);;){if(ce){if(oe=oe.times(ue),!oe.c)break;Q?oe.c.length>Q&&(oe.c.length=Q):H&&(oe=oe.mod(K))}if(V){if(V=s(V/2),V===0)break;ce=V%2}else if(q=q.times(W),Y(q,q.e+1,1),q.e>14)ce=y(q);else{if(V=+J(q),V===0)break;ce=V%2}ue=ue.times(ue),Q?ue.c&&ue.c.length>Q&&(ue.c.length=Q):H&&(ue=ue.mod(K))}return H?oe:(se&&(oe=D.div(oe)),K?oe.mod(K):Q?Y(oe,R,L,te):oe)},N.integerValue=function(q){var K=new $(this);return q==null?q=L:E(q,0,8),Y(K,K.e+1,q)},N.isEqualTo=N.eq=function(q,K){return w(this,new $(q,K))===0},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(q,K){return w(this,new $(q,K))>0},N.isGreaterThanOrEqualTo=N.gte=function(q,K){return(K=w(this,new $(q,K)))===1||K===0},N.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},N.isLessThan=N.lt=function(q,K){return w(this,new $(q,K))<0},N.isLessThanOrEqualTo=N.lte=function(q,K){return(K=w(this,new $(q,K)))===-1||K===0},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&this.c[0]==0},N.minus=function(q,K){var W,H,V,Q,te=this,ie=te.s;if(q=new $(q,K),K=q.s,!ie||!K)return new $(NaN);if(ie!=K)return q.s=-K,te.plus(q);var se=te.e/l,ce=q.e/l,oe=te.c,ue=q.c;if(!se||!ce){if(!oe||!ue)return oe?(q.s=-K,q):new $(ue?te:NaN);if(!oe[0]||!ue[0])return ue[0]?(q.s=-K,q):new $(oe[0]?te:L==3?-0:0)}if(se=h(se),ce=h(ce),oe=oe.slice(),ie=se-ce){for((Q=ie<0)?(ie=-ie,V=oe):(ce=se,V=ue),V.reverse(),K=ie;K--;V.push(0));V.reverse()}else for(H=(Q=(ie=oe.length)<(K=ue.length))?ie:K,ie=K=0;K<H;K++)if(oe[K]!=ue[K]){Q=oe[K]<ue[K];break}if(Q&&(V=oe,oe=ue,ue=V,q.s=-q.s),K=(H=ue.length)-(W=oe.length),K>0)for(;K--;oe[W++]=0);for(K=c-1;H>ie;){if(oe[--H]<ue[H]){for(W=H;W&&!oe[--W];oe[W]=K);--oe[W],oe[H]+=c}oe[H]-=ue[H]}for(;oe[0]==0;oe.splice(0,1),--ce);return oe[0]?ne(q,oe,ce):(q.s=L==3?-1:1,q.c=[q.e=0],q)},N.modulo=N.mod=function(q,K){var W,H,V=this;return q=new $(q,K),!V.c||!q.s||q.c&&!q.c[0]?new $(NaN):!q.c||V.c&&!V.c[0]?new $(V):(I==9?(H=q.s,q.s=1,W=B(V,q,0,3),q.s=H,W.s*=H):W=B(V,q,0,I),q=V.minus(W.times(q)),!q.c[0]&&I==1&&(q.s=V.s),q)},N.multipliedBy=N.times=function(q,K){var W,H,V,Q,te,ie,se,ce,oe,ue,we,me,he,ge,pe,G=this,F=G.c,j=(q=new $(q,K)).c;if(!F||!j||!F[0]||!j[0])return!G.s||!q.s||F&&!F[0]&&!j||j&&!j[0]&&!F?q.c=q.e=q.s=null:(q.s*=G.s,!F||!j?q.c=q.e=null:(q.c=[0],q.e=0)),q;for(H=h(G.e/l)+h(q.e/l),q.s*=G.s,se=F.length,ue=j.length,se<ue&&(he=F,F=j,j=he,V=se,se=ue,ue=V),V=se+ue,he=[];V--;he.push(0));for(ge=c,pe=f,V=ue;--V>=0;){for(W=0,we=j[V]%pe,me=j[V]/pe|0,te=se,Q=V+te;Q>V;)ce=F[--te]%pe,oe=F[te]/pe|0,ie=me*ce+oe*we,ce=we*ce+ie%pe*pe+he[Q]+W,W=(ce/ge|0)+(ie/pe|0)+me*oe,he[Q--]=ce%ge;he[Q]=W}return W?++H:he.splice(0,1),ne(q,he,H)},N.negated=function(){var q=new $(this);return q.s=-q.s||null,q},N.plus=function(q,K){var W,H=this,V=H.s;if(q=new $(q,K),K=q.s,!V||!K)return new $(NaN);if(V!=K)return q.s=-K,H.minus(q);var Q=H.e/l,te=q.e/l,ie=H.c,se=q.c;if(!Q||!te){if(!ie||!se)return new $(V/0);if(!ie[0]||!se[0])return se[0]?q:new $(ie[0]?H:V*0)}if(Q=h(Q),te=h(te),ie=ie.slice(),V=Q-te){for(V>0?(te=Q,W=se):(V=-V,W=ie),W.reverse();V--;W.push(0));W.reverse()}for(V=ie.length,K=se.length,V-K<0&&(W=se,se=ie,ie=W,K=V),V=0;K;)V=(ie[--K]=ie[K]+se[K]+V)/c|0,ie[K]=c===ie[K]?0:ie[K]%c;return V&&(ie=[V].concat(ie),++te),ne(q,ie,te)},N.precision=N.sd=function(q,K){var W,H,V,Q=this;if(q!=null&&q!==!!q)return E(q,1,p),K==null?K=L:E(K,0,8),Y(new $(Q),q,K);if(!(W=Q.c))return null;if(V=W.length-1,H=V*l+1,V=W[V]){for(;V%10==0;V/=10,H--);for(V=W[0];V>=10;V/=10,H++);}return q&&Q.e+1>H&&(H=Q.e+1),H},N.shiftedBy=function(q){return E(q,-d,d),this.times("1e"+q)},N.squareRoot=N.sqrt=function(){var q,K,W,H,V,Q=this,te=Q.c,ie=Q.s,se=Q.e,ce=U+4,oe=new $("0.5");if(ie!==1||!te||!te[0])return new $(!ie||ie<0&&(!te||te[0])?NaN:te?Q:1/0);if(ie=Math.sqrt(+J(Q)),ie==0||ie==1/0?(K=g(te),(K.length+se)%2==0&&(K+="0"),ie=Math.sqrt(+K),se=h((se+1)/2)-(se<0||se%2),ie==1/0?K="5e"+se:(K=ie.toExponential(),K=K.slice(0,K.indexOf("e")+1)+se),W=new $(K)):W=new $(ie+""),W.c[0]){for(se=W.e,ie=se+ce,ie<3&&(ie=0);;)if(V=W,W=oe.times(V.plus(B(Q,V,ce,1))),g(V.c).slice(0,ie)===(K=g(W.c)).slice(0,ie))if(W.e<se&&--ie,K=K.slice(ie-3,ie+1),K=="9999"||!H&&K=="4999"){if(!H&&(Y(V,V.e+U+2,0),V.times(V).eq(Q))){W=V;break}ce+=4,ie+=4,H=1}else{(!+K||!+K.slice(1)&&K.charAt(0)=="5")&&(Y(W,W.e+U+2,1),q=!W.times(W).eq(Q));break}}return Y(W,W.e+U+1,L,q)},N.toExponential=function(q,K){return q!=null&&(E(q,0,p),q++),X(this,q,K,1)},N.toFixed=function(q,K){return q!=null&&(E(q,0,p),q=q+this.e+1),X(this,q,K)},N.toFormat=function(q,K,W){var H,V=this;if(W==null)q!=null&&K&&typeof K=="object"?(W=K,K=null):q&&typeof q=="object"?(W=q,q=K=null):W=O;else if(typeof W!="object")throw Error(o+"Argument not an object: "+W);if(H=V.toFixed(q,K),V.c){var Q,te=H.split("."),ie=+W.groupSize,se=+W.secondaryGroupSize,ce=W.groupSeparator||"",oe=te[0],ue=te[1],we=V.s<0,me=we?oe.slice(1):oe,he=me.length;if(se&&(Q=ie,ie=se,se=Q,he-=Q),ie>0&&he>0){for(Q=he%ie||ie,oe=me.substr(0,Q);Q<he;Q+=ie)oe+=ce+me.substr(Q,ie);se>0&&(oe+=ce+me.slice(Q)),we&&(oe="-"+oe)}H=ue?oe+(W.decimalSeparator||"")+((se=+W.fractionGroupSize)?ue.replace(new RegExp("\\d{"+se+"}\\B","g"),"$&"+(W.fractionGroupSeparator||"")):ue):oe}return(W.prefix||"")+H+(W.suffix||"")},N.toFraction=function(q){var K,W,H,V,Q,te,ie,se,ce,oe,ue,we,me=this,he=me.c;if(q!=null&&(ie=new $(q),!ie.isInteger()&&(ie.c||ie.s!==1)||ie.lt(D)))throw Error(o+"Argument "+(ie.isInteger()?"out of range: ":"not an integer: ")+J(ie));if(!he)return new $(me);for(K=new $(D),ce=W=new $(D),H=se=new $(D),we=g(he),Q=K.e=we.length-me.e-1,K.c[0]=u[(te=Q%l)<0?l+te:te],q=!q||ie.comparedTo(K)>0?Q>0?K:ce:ie,te=A,A=1/0,ie=new $(we),se.c[0]=0;oe=B(ie,K,0,1),V=W.plus(oe.times(H)),V.comparedTo(q)!=1;)W=H,H=V,ce=se.plus(oe.times(V=ce)),se=V,K=ie.minus(oe.times(V=K)),ie=V;return V=B(q.minus(W),H,0,1),se=se.plus(V.times(ce)),W=W.plus(V.times(H)),se.s=ce.s=me.s,Q=Q*2,ue=B(ce,H,Q,L).minus(me).abs().comparedTo(B(se,W,Q,L).minus(me).abs())<1?[ce,H]:[se,W],A=te,ue},N.toNumber=function(){return+J(this)},N.toPrecision=function(q,K){return q!=null&&E(q,1,p),X(this,q,K,2)},N.toString=function(q){var K,W=this,H=W.s,V=W.e;return V===null?H?(K="Infinity",H<0&&(K="-"+K)):K="NaN":(q==null?K=V<=k||V>=C?b(g(W.c),V):S(g(W.c),V,"0"):q===10&&z?(W=Y(new $(W),U+V+1,L),K=S(g(W.c),W.e,"0")):(E(q,2,M.length,"Base"),K=T(S(g(W.c),V,"0"),10,q,H,!0)),H<0&&W.c[0]&&(K="-"+K)),K},N.valueOf=N.toJSON=function(){return J(this)},N._isBigNumber=!0,v!=null&&$.set(v),$}function h(v){var B=v|0;return v>0||v===B?B:B-1}function g(v){for(var B,T,_=1,N=v.length,D=v[0]+"";_<N;){for(B=v[_++]+"",T=l-B.length;T--;B="0"+B);D+=B}for(N=D.length;D.charCodeAt(--N)===48;);return D.slice(0,N+1||1)}function w(v,B){var T,_,N=v.c,D=B.c,U=v.s,L=B.s,k=v.e,C=B.e;if(!U||!L)return null;if(T=N&&!N[0],_=D&&!D[0],T||_)return T?_?0:-L:U;if(U!=L)return U;if(T=U<0,_=k==C,!N||!D)return _?0:!N^T?1:-1;if(!_)return k>C^T?1:-1;for(L=(k=N.length)<(C=D.length)?k:C,U=0;U<L;U++)if(N[U]!=D[U])return N[U]>D[U]^T?1:-1;return k==C?0:k>C^T?1:-1}function E(v,B,T,_){if(v<B||v>T||v!==s(v))throw Error(o+(_||"Argument")+(typeof v=="number"?v<B||v>T?" out of range: ":" not an integer: ":" not a primitive number: ")+String(v))}function y(v){var B=v.c.length-1;return h(v.e/l)==B&&v.c[B]%2!=0}function b(v,B){return(v.length>1?v.charAt(0)+"."+v.slice(1):v)+(B<0?"e":"e+")+B}function S(v,B,T){var _,N;if(B<0){for(N=T+".";++B;N+=T);v=N+v}else if(_=v.length,++B>_){for(N=T,B-=_;--B;N+=T);v+=N}else B<_&&(v=v.slice(0,B)+"."+v.slice(B));return v}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(KP)})(Cf)),Cf.exports}var _l={},f_;function Ag(){if(f_)return _l;f_=1,Object.defineProperty(_l,"__esModule",{value:!0}),_l.Hash192=void 0;const t=Tf();class e extends t.Hash{constructor(r){(r==null?void 0:r.byteLength)===0&&(r=e.ZERO_192.bytes),super(r??e.ZERO_192.bytes)}}return _l.Hash192=e,e.width=24,e.ZERO_192=new e(new Uint8Array(e.width)),_l}var h_;function GP(){if(h_)return No;h_=1;var t=No&&No.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(No,"__esModule",{value:!0}),No.Amount=void 0;const e=zi(),n=El(),r=If(),i=bn(),s=t(on()),o=$e(),a=dr(),c=Ag(),l=-96,d=80,u=16,f=new s.default("1e17"),p=new s.default("1e-6"),m=BigInt(4294967295),h=BigInt(9223372036854776e3);s.default.config({EXPONENTIAL_AT:[l-u,d+u]});function g(y){const b=Object.keys(y).sort();return b.length===3&&b[0]==="currency"&&b[1]==="issuer"&&b[2]==="value"}function w(y){const b=Object.keys(y).sort();return b.length===2&&b[0]==="mpt_issuance_id"&&b[1]==="value"}class E extends i.SerializedType{constructor(b){super(b??E.defaultAmount.bytes)}static from(b){if(b instanceof E)return b;let S=new Uint8Array(8);if(typeof b=="string"){E.assertXrpIsValid(b);const v=BigInt(b),B=[new Uint8Array(4),new Uint8Array(4)];return(0,a.writeUInt32BE)(B[0],Number(v>>BigInt(32)),0),(0,a.writeUInt32BE)(B[1],Number(v&BigInt(m)),0),S=(0,o.concat)(B),S[0]|=64,new E(S)}if(g(b)){const v=new s.default(b.value);if(E.assertIouIsValid(v),v.isZero())S[0]|=128;else{const _=v.times(`1e${-((v.e||0)-15)}`).abs().toString(),N=BigInt(_),D=[new Uint8Array(4),new Uint8Array(4)];(0,a.writeUInt32BE)(D[0],Number(N>>BigInt(32)),0),(0,a.writeUInt32BE)(D[1],Number(N&BigInt(m)),0),S=(0,o.concat)(D),S[0]|=128,v.gt(new s.default(0))&&(S[0]|=64);const L=97+((v.e||0)-15);S[0]|=L>>>2,S[1]|=(L&3)<<6}const B=r.Currency.from(b.currency).toBytes(),T=n.AccountID.from(b.issuer).toBytes();return new E((0,o.concat)([S,B,T]))}if(w(b)){E.assertMptIsValid(b.value);let v=new Uint8Array(1);v[0]|=96;const B=BigInt(b.value),T=[new Uint8Array(4),new Uint8Array(4)];(0,a.writeUInt32BE)(T[0],Number(B>>BigInt(32)),0),(0,a.writeUInt32BE)(T[1],Number(B&BigInt(m)),0),S=(0,o.concat)(T);const _=c.Hash192.from(b.mpt_issuance_id).toBytes();return new E((0,o.concat)([v,S,_]))}throw new Error("Invalid type to construct an Amount")}static fromParser(b){if(b.peek()&128)return new E(b.read(48));const B=b.peek()&32?33:8;return new E(b.read(B))}toJSON(){if(this.isNative()){const b=this.bytes,v=b[0]&64?"":"-";b[0]&=63;const B=BigInt((0,a.readUInt32BE)(b.slice(0,4),0)),T=BigInt((0,a.readUInt32BE)(b.slice(4),0)),_=B<<BigInt(32)|T;return`${v}${_.toString()}`}if(this.isIOU()){const b=new e.BinaryParser(this.toString()),S=b.read(8),v=r.Currency.fromParser(b),B=n.AccountID.fromParser(b),T=S[0],_=S[1],D=T&64?"":"-",U=((T&63)<<2)+((_&255)>>6)-97;S[0]=0,S[1]&=63;const L=new s.default(`${D}0x${(0,o.bytesToHex)(S)}`).times(`1e${U}`);return E.assertIouIsValid(L),{value:L.toString(),currency:v.toJSON(),issuer:B.toJSON()}}if(this.isMPT()){const b=new e.BinaryParser(this.toString()),S=b.read(1),v=b.read(8),B=c.Hash192.fromParser(b),_=S[0]&64?"":"-",N=BigInt((0,a.readUInt32BE)(v.slice(0,4),0)),D=BigInt((0,a.readUInt32BE)(v.slice(4),0)),U=N<<BigInt(32)|D;return{value:`${_}${U.toString()}`,mpt_issuance_id:B.toString()}}throw new Error("Invalid amount to construct JSON")}static assertXrpIsValid(b){if(b.indexOf(".")!==-1)throw new Error(`${b.toString()} is an illegal amount`);const S=new s.default(b);if(!S.isZero()&&(S.lt(p)||S.gt(f)))throw new Error(`${b.toString()} is an illegal amount`)}static assertIouIsValid(b){if(!b.isZero()){const S=b.precision(),v=(b.e||0)-15;if(S>u||v>d||v<l)throw new Error("Decimal precision out of range");this.verifyNoDecimal(b)}}static assertMptIsValid(b){if(b.indexOf(".")!==-1)throw new Error(`${b.toString()} is an illegal amount`);const S=new s.default(b);if(!S.isZero()){if(S<(0,s.default)(0))throw new Error(`${b.toString()} is an illegal amount`);if(Number(BigInt(b)&BigInt(h))!=0)throw new Error(`${b.toString()} is an illegal amount`)}}static verifyNoDecimal(b){if(b.times(`1e${-((b.e||0)-15)}`).abs().toString().indexOf(".")!==-1)throw new Error("Decimal place found in integerNumberString")}isNative(){return(this.bytes[0]&128)===0&&(this.bytes[0]&32)===0}isMPT(){return(this.bytes[0]&128)===0&&(this.bytes[0]&32)!==0}isIOU(){return(this.bytes[0]&128)!==0}}return No.Amount=E,E.defaultAmount=new E((0,o.hexToBytes)("4000000000000000")),No}var xl={},p_;function XP(){if(p_)return xl;p_=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.Blob=void 0;const t=bn(),e=$e();class n extends t.SerializedType{constructor(i){super(i)}static fromParser(i,s){return new n(i.read(s))}static from(i){if(i instanceof n)return i;if(typeof i=="string"){if(!/^[A-F0-9]*$/iu.test(i))throw new Error("Cannot construct Blob from a non-hex string");return new n((0,e.hexToBytes)(i))}throw new Error("Cannot construct Blob from value given")}}return xl.Blob=n,xl}var Tl={},g_;function YP(){if(g_)return Tl;g_=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.Hash128=void 0;const t=Tf(),e=$e();class n extends t.Hash{constructor(i){(i==null?void 0:i.byteLength)===0&&(i=n.ZERO_128.bytes),super(i??n.ZERO_128.bytes)}toHex(){const i=(0,e.bytesToHex)(this.toBytes());return/^0+$/.exec(i)?"":i}}return Tl.Hash128=n,n.width=16,n.ZERO_128=new n(new Uint8Array(n.width)),Tl}var Il={},m_;function Sg(){if(m_)return Il;m_=1,Object.defineProperty(Il,"__esModule",{value:!0}),Il.Hash256=void 0;const t=Tf();class e extends t.Hash{constructor(r){super(r??e.ZERO_256.bytes)}}return Il.Hash256=e,e.width=32,e.ZERO_256=new e(new Uint8Array(e.width)),Il}var Cl={},Ol={},w_;function QP(){if(w_)return Ol;w_=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.Int=void 0;const t=bn();function e(r,i){return r<i?-1:r==i?0:1}class n extends t.Comparable{constructor(i){super(i)}compareTo(i){return e(this.valueOf(),i.valueOf())}toJSON(){const i=this.valueOf();return typeof i=="number"?i:i.toString()}static checkIntRange(i,s,o,a){if(s<o||s>a)throw new Error(`Invalid ${i}: ${s} must be >= ${o} and <= ${a}`)}}return Ol.Int=n,Ol}var y_;function JP(){if(y_)return Cl;y_=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.Int32=void 0;const t=QP(),e=dr();class n extends t.Int{constructor(i){super(i??n.defaultInt32.bytes)}static fromParser(i){return new n(i.read(n.width))}static from(i){if(i instanceof n)return i;const s=new Uint8Array(n.width);if(typeof i=="string"){const o=Number(i);if(!Number.isFinite(o)||!Number.isInteger(o))throw new Error(`Cannot construct Int32 from string: ${i}`);return n.checkIntRange("Int32",o,n.MIN_VALUE,n.MAX_VALUE),(0,e.writeInt32BE)(s,o,0),new n(s)}if(typeof i=="number"&&Number.isInteger(i))return n.checkIntRange("Int32",i,n.MIN_VALUE,n.MAX_VALUE),(0,e.writeInt32BE)(s,i,0),new n(s);throw new Error("Cannot construct Int32 from given value")}valueOf(){return(0,e.readInt32BE)(this.bytes,0)}}return Cl.Int32=n,n.width=32/8,n.defaultInt32=new n(new Uint8Array(n.width)),n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647,Cl}var Nl={},b_;function v_(){if(b_)return Nl;b_=1,Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.Issue=void 0;const t=$e(),e=zi(),n=El(),r=If(),i=bn(),s=Ag(),o=dr();function a(u){const f=Object.keys(u).sort(),p=f.length===1&&f[0]==="currency",m=f.length===2&&f[0]==="currency"&&f[1]==="issuer",h=f.length===1&&f[0]==="mpt_issuance_id";return p||m||h}const c=44,l=n.AccountID.from("0000000000000000000000000000000000000001");class d extends i.SerializedType{constructor(f){super(f??d.XRP_ISSUE.bytes)}static from(f){if(f instanceof d)return f;if(a(f)){if(f.currency){const p=r.Currency.from(f.currency.toString()).toBytes();if(f.issuer){const m=n.AccountID.from(f.issuer.toString()).toBytes();return new d((0,t.concat)([p,m]))}return new d(p)}if(f.mpt_issuance_id){const p=s.Hash192.from(f.mpt_issuance_id.toString()).toBytes(),m=p.slice(4),h=Number((0,o.readUInt32BE)(p.slice(0,4),0)),g=new Uint8Array(4);return new DataView(g.buffer).setUint32(0,h,!0),new d((0,t.concat)([m,l.toBytes(),g]))}}throw new Error("Invalid type to construct an Issue")}static fromParser(f){const p=f.read(20);if(new r.Currency(p).toJSON()==="XRP")return new d(p);const m=new n.AccountID(f.read(20));if(l.toHex()===m.toHex()){const h=f.read(4);return new d((0,t.concat)([p,l.toBytes(),h]))}return new d((0,t.concat)([p,m.toBytes()]))}toJSON(){if(this.toBytes().length===c){const h=this.toBytes().slice(0,20),g=new DataView(this.toBytes().slice(40).buffer).getUint32(0,!0),w=new Uint8Array(4);return(0,o.writeUInt32BE)(w,g,0),{mpt_issuance_id:(0,t.bytesToHex)((0,t.concat)([w,h]))}}const f=new e.BinaryParser(this.toString()),p=r.Currency.fromParser(f);if(p.toJSON()==="XRP")return{currency:p.toJSON()};const m=n.AccountID.fromParser(f);return{currency:p.toJSON(),issuer:m.toJSON()}}}return Nl.Issue=d,d.XRP_ISSUE=new d(new Uint8Array(20)),Nl}var Bl={},E_;function ZP(){if(E_)return Bl;E_=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.STNumber=void 0;const t=bn(),e=dr(),n=BigInt("1000000000000000000"),r=BigInt("9999999999999999999"),i=BigInt("9223372036854775807"),s=-32768,o=32768,a=-2147483648;function c(u){const p=/^([-+]?)([0-9]+)(?:\.([0-9]+))?(?:[eE]([+-]?[0-9]+))?$/.exec(u);if(!p)throw new Error(`Unable to parse number from string: ${u}`);const[,m,h,g,w]=p;let y=h.replace(/^0+(?=\d)/,"")||"0",b=0;for(g&&(y+=g,b-=g.length),w&&(b+=parseInt(w,10));y.length>1&&y.endsWith("0");)y=y.slice(0,-1),b+=1;let S=BigInt(y);m==="-"&&(S=-S);const v=S<BigInt(0);return{mantissa:S,exponent:b,isNegative:v}}function l(u,f){let p=u<BigInt(0)?-u:u;const m=u<BigInt(0);if(p===BigInt(0))return{mantissa:BigInt(0),exponent:a};for(;p<n&&f>s;)f-=1,p*=BigInt(10);let h=null;for(;p>r;){if(f>=o)throw new Error("Mantissa and exponent are too large");f+=1,h=p%BigInt(10),p/=BigInt(10)}if(f<s||p<n)throw new Error("Underflow: value too small to represent");if(f>o)throw new Error("Exponent overflow: value too large to represent");if(p>i){if(f>=o)throw new Error("Exponent overflow: value too large to represent");f+=1,h=p%BigInt(10),p/=BigInt(10)}if(h!=null&&h>=BigInt(5)&&(p+=BigInt(1),p>i)){if(f>=o)throw new Error("Exponent overflow: value too large to represent");h=p%BigInt(10),f+=1,p/=BigInt(10),h>=BigInt(5)&&(p+=BigInt(1))}return m&&(p=-p),{mantissa:p,exponent:f}}class d extends t.SerializedType{constructor(f){const p=f??d.defaultBytes;if(!(p instanceof Uint8Array)||p.length!==12)throw new Error(`STNumber must be constructed from a 12-byte Uint8Array, got ${p==null?void 0:p.length}`);super(p)}static from(f){if(f instanceof d)return f;if(typeof f=="string")return d.fromValue(f);throw new Error("STNumber.from: Only string or STNumber instance is supported")}static fromValue(f){const{mantissa:p,exponent:m}=c(f),{mantissa:h,exponent:g}=l(p,m),w=new Uint8Array(12);return(0,e.writeInt64BE)(w,h,0),(0,e.writeInt32BE)(w,g,8),new d(w)}static fromParser(f){return new d(f.read(12))}toJSON(){const f=this.bytes;if(!f||(f==null?void 0:f.length)!==12)throw new Error("STNumber internal bytes not set or wrong length");const p=(0,e.readInt64BE)(f,0);let m=(0,e.readInt32BE)(f,8);if(p===BigInt(0)&&m===a)return"0";const h=p<BigInt(0);let g=h?-p:p;g!==BigInt(0)&&g<n&&(g*=BigInt(10),m-=1);const w=18;if(m!==0&&(m<-28||m>-8)){let _=m;for(;g!==BigInt(0)&&g%BigInt(10)===BigInt(0)&&_<o;)g/=BigInt(10),_+=1;return`${h?"-":""}${g}e${_}`}const E=w+12,y=w+8,b=g.toString(),S="0".repeat(E)+b+"0".repeat(y),v=m+E+w+1,B=S.slice(0,v).replace(/^0+/,"")||"0",T=S.slice(v).replace(/0+$/,"");return`${h?"-":""}${B}${T?"."+T:""}`}}return Bl.STNumber=d,d.defaultBytes=new Uint8Array(12),Bl}var Rl={},A_;function eL(){if(A_)return Rl;A_=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.PathSet=void 0;const t=El(),e=If(),n=zi(),r=bn(),i=$e(),s=0,o=255,a=1,c=16,l=32;function d(h){return h.issuer!==void 0||h.account!==void 0||h.currency!==void 0}function u(h){return Array.isArray(h)&&h.length===0||Array.isArray(h)&&Array.isArray(h[0])&&h[0].length===0||Array.isArray(h)&&Array.isArray(h[0])&&d(h[0][0])}class f extends r.SerializedType{static from(g){if(g instanceof f)return g;const w=[Uint8Array.from([0])];return g.account&&(w.push(t.AccountID.from(g.account).toBytes()),w[0][0]|=a),g.currency&&(w.push(e.Currency.from(g.currency).toBytes()),w[0][0]|=c),g.issuer&&(w.push(t.AccountID.from(g.issuer).toBytes()),w[0][0]|=l),new f((0,i.concat)(w))}static fromParser(g){const w=g.readUInt8(),E=[Uint8Array.from([w])];return w&a&&E.push(g.read(t.AccountID.width)),w&c&&E.push(g.read(e.Currency.width)),w&l&&E.push(g.read(t.AccountID.width)),new f((0,i.concat)(E))}toJSON(){const g=new n.BinaryParser((0,i.bytesToHex)(this.bytes)),w=g.readUInt8();let E,y,b;w&a&&(E=t.AccountID.fromParser(g).toJSON()),w&c&&(y=e.Currency.fromParser(g).toJSON()),w&l&&(b=t.AccountID.fromParser(g).toJSON());const S={};return E&&(S.account=E),b&&(S.issuer=b),y&&(S.currency=y),S}type(){return this.bytes[0]}}class p extends r.SerializedType{static from(g){if(g instanceof p)return g;const w=[];return g.forEach(E=>{w.push(f.from(E).toBytes())}),new p((0,i.concat)(w))}static fromParser(g){const w=[];for(;!g.end()&&(w.push(f.fromParser(g).toBytes()),!(g.peek()===s||g.peek()===o)););return new p((0,i.concat)(w))}toJSON(){const g=[],w=new n.BinaryParser(this.toString());for(;!w.end();)g.push(f.fromParser(w).toJSON());return g}}class m extends r.SerializedType{static from(g){if(g instanceof m)return g;if(u(g)){const w=[];return g.forEach(E=>{w.push(p.from(E).toBytes()),w.push(Uint8Array.from([o]))}),w[w.length-1]=Uint8Array.from([s]),new m((0,i.concat)(w))}throw new Error("Cannot construct PathSet from given value")}static fromParser(g){const w=[];for(;!g.end()&&(w.push(p.fromParser(g).toBytes()),w.push(g.read(1)),w[w.length-1][0]!=s););return new m((0,i.concat)(w))}toJSON(){const g=[],w=new n.BinaryParser(this.toString());for(;!w.end();)g.push(p.fromParser(w).toJSON()),w.skip(1);return g}}return Rl.PathSet=m,Rl}var Dl={},kl={},Pl={},Ll={},S_;function Of(){if(S_)return Ll;S_=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.UInt=void 0;const t=bn();function e(r,i){return r<i?-1:r==i?0:1}class n extends t.Comparable{constructor(i){super(i)}compareTo(i){return e(this.valueOf(),i.valueOf())}toJSON(){const i=this.valueOf();return typeof i=="number"?i:i.toString()}static checkUintRange(i,s,o){if(i<s||i>o)throw new Error(`Invalid ${this.constructor.name}: ${i} must be >= ${s} and <= ${o}`)}}return Ll.UInt=n,Ll}var __;function _g(){if(__)return Pl;__=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.UInt64=void 0;const t=Of(),e=$e(),n=dr(),r=Vi(),i=/^[a-fA-F0-9]{1,16}$/,s=/^[0-9]{1,20}$/,o=BigInt(4294967295),a=new Set(["MaximumAmount","OutstandingAmount","MPTAmount","LockedAmount"]);function c(d){return a.has(d)}class l extends t.UInt{constructor(u){super(u??l.defaultUInt64.bytes)}static fromParser(u){return new l(u.read(l.width))}static from(u,f=""){if(u instanceof l)return u;let p=new Uint8Array(l.width);if(typeof u=="number"&&Number.isInteger(u)){if(u<0)throw new Error("value must be an unsigned integer");const m=BigInt(u),h=[new Uint8Array(4),new Uint8Array(4)];return(0,n.writeUInt32BE)(h[0],Number(m>>BigInt(32)),0),(0,n.writeUInt32BE)(h[1],Number(m&BigInt(o)),0),new l((0,e.concat)(h))}if(typeof u=="string"){if(c(f)){if(!s.test(u))throw new Error(`${f} ${u} is not a valid base 10 string`);u=BigInt(u).toString(16)}if(typeof u=="string"&&!i.test(u))throw new Error(`${u} is not a valid hex-string`);const m=u.padStart(16,"0");return p=(0,e.hexToBytes)(m),new l(p)}if(typeof u=="bigint"){const m=[new Uint8Array(4),new Uint8Array(4)];return(0,n.writeUInt32BE)(m[0],Number(Number(u>>BigInt(32))),0),(0,n.writeUInt32BE)(m[1],Number(u&BigInt(o)),0),new l((0,e.concat)(m))}throw new Error("Cannot construct UInt64 from given value")}toJSON(u=r.DEFAULT_DEFINITIONS,f=""){const p=(0,e.bytesToHex)(this.bytes);return c(f)?BigInt("0x"+p).toString(10):p}valueOf(){const u=BigInt((0,n.readUInt32BE)(this.bytes.slice(0,4),0)),f=BigInt((0,n.readUInt32BE)(this.bytes.slice(4),0));return u<<BigInt(32)|f}toBytes(){return this.bytes}}return Pl.UInt64=l,l.width=64/8,l.defaultUInt64=new l(new Uint8Array(l.width)),Pl}var x_;function xg(){if(x_)return kl;x_=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.STObject=void 0;const t=Vi(),e=bn(),n=yn(),r=zi(),i=wl(),s=I_(),o=_g(),a=Uint8Array.from([225]),c="ObjectEndMarker",l="STObject",d="Destination",u="Account",f="SourceTag",p="DestinationTag";function m(w,E){const y=(0,n.xAddressToClassicAddress)(E);let b;if(w===d)b=p;else if(w===u)b=f;else if(y.tag!==!1)throw new Error(`${w} cannot have an associated tag`);return y.tag!==!1?{[w]:y.classicAddress,[b]:y.tag}:{[w]:y.classicAddress}}function h(w,E){if(!(w[f]===void 0||E[f]===void 0))throw new Error("Cannot have Account X-Address and SourceTag");if(!(w[p]===void 0||E[p]===void 0))throw new Error("Cannot have Destination X-Address and DestinationTag")}class g extends e.SerializedType{static fromParser(E){const y=new i.BytesList,b=new i.BinarySerializer(y);for(;!E.end();){const S=E.readField();if(S.name===c)break;const v=E.readFieldValue(S);b.writeFieldAndValue(S,v),S.type.name===l&&b.put(a)}return new g(y.toBytes())}static from(E,y,b=t.DEFAULT_DEFINITIONS){if(E instanceof g)return E;const S=new i.BytesList,v=new i.BinarySerializer(S);let B=!1;const T=Object.entries(E).reduce((D,[U,L])=>{let k;return L&&(0,n.isValidXAddress)(L.toString())&&(k=m(U,L.toString()),h(k,E)),Object.assign(D,k??{[U]:L})},{});function _(D){return D!==void 0&&T[D.name]!==void 0&&D.isSerialized}let N=Object.keys(T).map(D=>{if(!(D in b.field)){if(D[0]===D[0].toLowerCase())return;throw new Error(`Field ${D} is not defined in the definitions`)}return b.field[D]}).filter(_).sort((D,U)=>D.ordinal-U.ordinal);return y!==void 0&&(N=N.filter(y)),N.forEach(D=>{const U=D.type.name===l?this.from(T[D.name],void 0,b):D.type.name==="STArray"?s.STArray.from(T[D.name],b):D.type.name==="UInt64"?o.UInt64.from(T[D.name],D.name):D.associatedType.from(T[D.name]);if(U==null)throw new TypeError(`Unable to interpret "${D.name}: ${T[D.name]}".`);U.name==="UNLModify"&&(B=!0);const L=D.name=="Account"&&B;v.writeFieldAndValue(D,U,L),D.type.name===l&&v.put(a)}),new g(S.toBytes())}toJSON(E){const y=new r.BinaryParser(this.toString(),E),b={};for(;!y.end();){const S=y.readField();if(S.name===c)break;b[S.name]=y.readFieldValue(S).toJSON(E,S.name)}return b}}return kl.STObject=g,kl}var T_;function I_(){if(T_)return Dl;T_=1,Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.STArray=void 0;const t=Vi(),e=bn(),n=xg(),r=zi(),i=$e(),s=Uint8Array.from([241]),o="ArrayEndMarker",a=Uint8Array.from([225]);function c(d){return Array.isArray(d)&&d.every(u=>typeof u=="object"&&Object.keys(u).length===1&&typeof Object.values(u)[0]=="object")}class l extends e.SerializedType{static fromParser(u){const f=[];for(;!u.end();){const p=u.readField();if(p.name===o)break;f.push(p.header,u.readFieldValue(p).toBytes(),a)}return f.push(s),new l((0,i.concat)(f))}static from(u,f=t.DEFAULT_DEFINITIONS){if(u instanceof l)return u;if(c(u)){const p=[];return u.forEach(m=>{p.push(n.STObject.from(m,void 0,f).toBytes())}),p.push(s),new l((0,i.concat)(p))}throw new Error("Cannot construct STArray from value given")}toJSON(u=t.DEFAULT_DEFINITIONS){const f=[],p=new r.BinaryParser(this.toString(),u);for(;!p.end();){const m=p.readField();if(m.name===o)break;const h={};h[m.name]=n.STObject.fromParser(p).toJSON(u),f.push(h)}return f}}return Dl.STArray=l,Dl}var Ml={},C_;function tL(){if(C_)return Ml;C_=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.UInt16=void 0;const t=Of(),e=dr();class n extends t.UInt{constructor(i){super(i??n.defaultUInt16.bytes)}static fromParser(i){return new n(i.read(n.width))}static from(i){if(i instanceof n)return i;if(typeof i=="number"&&Number.isInteger(i)){n.checkUintRange(i,0,65535);const s=new Uint8Array(n.width);return(0,e.writeUInt16BE)(s,i,0),new n(s)}throw new Error("Cannot construct UInt16 from given value")}valueOf(){return parseInt((0,e.readUInt16BE)(this.bytes,0))}}return Ml.UInt16=n,n.width=16/8,n.defaultUInt16=new n(new Uint8Array(n.width)),Ml}var Ul={},O_;function N_(){if(O_)return Ul;O_=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.UInt32=void 0;const t=Of(),e=dr();class n extends t.UInt{constructor(i){super(i??n.defaultUInt32.bytes)}static fromParser(i){return new n(i.read(n.width))}static from(i){if(i instanceof n)return i;const s=new Uint8Array(n.width);if(typeof i=="string"){const o=Number.parseInt(i);return(0,e.writeUInt32BE)(s,o,0),new n(s)}if(typeof i=="number"&&Number.isInteger(i))return n.checkUintRange(i,0,4294967295),(0,e.writeUInt32BE)(s,i,0),new n(s);throw new Error("Cannot construct UInt32 from given value")}valueOf(){return parseInt((0,e.readUInt32BE)(this.bytes,0),10)}}return Ul.UInt32=n,n.width=32/8,n.defaultUInt32=new n(new Uint8Array(n.width)),Ul}var Fl={},B_;function R_(){if(B_)return Fl;B_=1,Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.UInt8=void 0;const t=Of(),e=$e(),n=dr();class r extends t.UInt{constructor(s){super(s??r.defaultUInt8.bytes)}static fromParser(s){return new r(s.read(r.width))}static from(s){if(s instanceof r)return s;if(typeof s=="number"&&Number.isInteger(s)){r.checkUintRange(s,0,255);const o=new Uint8Array(r.width);return(0,n.writeUInt8)(o,s,0),new r(o)}throw new Error("Cannot construct UInt8 from given value")}valueOf(){return parseInt((0,e.bytesToHex)(this.bytes),16)}}return Fl.UInt8=r,r.width=8/8,r.defaultUInt8=new r(new Uint8Array(r.width)),Fl}var $l={},D_;function nL(){if(D_)return $l;D_=1,Object.defineProperty($l,"__esModule",{value:!0}),$l.Vector256=void 0;const t=bn(),e=Sg(),n=wl(),r=$e();function i(o){return Array.isArray(o)&&(o.length===0||typeof o[0]=="string")}class s extends t.SerializedType{constructor(a){super(a)}static fromParser(a,c){const l=new n.BytesList,u=(c??a.size())/32;for(let f=0;f<u;f++)e.Hash256.fromParser(a).toBytesSink(l);return new s(l.toBytes())}static from(a){if(a instanceof s)return a;if(i(a)){const c=new n.BytesList;return a.forEach(l=>{e.Hash256.from(l).toBytesSink(c)}),new s(c.toBytes())}throw new Error("Cannot construct Vector256 from given value")}toJSON(){if(this.bytes.byteLength%32!==0)throw new Error("Invalid bytes for Vector256");const a=[];for(let c=0;c<this.bytes.byteLength;c+=32)a.push((0,r.bytesToHex)(this.bytes.slice(c,c+32)));return a}}return $l.Vector256=s,$l}var jl={},k_;function rL(){if(k_)return jl;k_=1,Object.defineProperty(jl,"__esModule",{value:!0}),jl.XChainBridge=void 0;const t=zi(),e=El(),n=bn(),r=v_(),i=$e();function s(a){const c=Object.keys(a).sort();return c.length===4&&c[0]==="IssuingChainDoor"&&c[1]==="IssuingChainIssue"&&c[2]==="LockingChainDoor"&&c[3]==="LockingChainIssue"}class o extends n.SerializedType{constructor(c){super(c??o.ZERO_XCHAIN_BRIDGE.bytes)}static from(c){if(c instanceof o)return c;if(!s(c))throw new Error("Invalid type to construct an XChainBridge");const l=[];return this.TYPE_ORDER.forEach(d=>{const{name:u,type:f}=d;f===e.AccountID&&l.push(Uint8Array.from([20]));const p=f.from(c[u]);l.push(p.toBytes())}),new o((0,i.concat)(l))}static fromParser(c){const l=[];return this.TYPE_ORDER.forEach(d=>{const{type:u}=d;u===e.AccountID&&(c.skip(1),l.push(Uint8Array.from([20])));const f=u.fromParser(c);l.push(f.toBytes())}),new o((0,i.concat)(l))}toJSON(){const c=new t.BinaryParser(this.toString()),l={};return o.TYPE_ORDER.forEach(d=>{const{name:u,type:f}=d;f===e.AccountID&&c.skip(1);const p=f.fromParser(c).toJSON();l[u]=p}),l}}return jl.XChainBridge=o,o.ZERO_XCHAIN_BRIDGE=new o((0,i.concat)([Uint8Array.from([20]),new Uint8Array(40),Uint8Array.from([20]),new Uint8Array(40)])),o.TYPE_ORDER=[{name:"LockingChainDoor",type:e.AccountID},{name:"LockingChainIssue",type:r.Issue},{name:"IssuingChainDoor",type:e.AccountID},{name:"IssuingChainIssue",type:r.Issue}],jl}var P_;function Bo(){return P_||(P_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Vector256=t.UInt64=t.UInt32=t.UInt16=t.UInt8=t.STObject=t.STArray=t.PathSet=t.Int32=t.Hash256=t.Hash192=t.Hash160=t.Hash128=t.Currency=t.Blob=t.Amount=t.AccountID=t.coreTypes=void 0;const e=El();Object.defineProperty(t,"AccountID",{enumerable:!0,get:function(){return e.AccountID}});const n=GP();Object.defineProperty(t,"Amount",{enumerable:!0,get:function(){return n.Amount}});const r=XP();Object.defineProperty(t,"Blob",{enumerable:!0,get:function(){return r.Blob}});const i=If();Object.defineProperty(t,"Currency",{enumerable:!0,get:function(){return i.Currency}});const s=YP();Object.defineProperty(t,"Hash128",{enumerable:!0,get:function(){return s.Hash128}});const o=Eg();Object.defineProperty(t,"Hash160",{enumerable:!0,get:function(){return o.Hash160}});const a=Ag();Object.defineProperty(t,"Hash192",{enumerable:!0,get:function(){return a.Hash192}});const c=Sg();Object.defineProperty(t,"Hash256",{enumerable:!0,get:function(){return c.Hash256}});const l=JP();Object.defineProperty(t,"Int32",{enumerable:!0,get:function(){return l.Int32}});const d=v_(),u=ZP(),f=eL();Object.defineProperty(t,"PathSet",{enumerable:!0,get:function(){return f.PathSet}});const p=I_();Object.defineProperty(t,"STArray",{enumerable:!0,get:function(){return p.STArray}});const m=xg();Object.defineProperty(t,"STObject",{enumerable:!0,get:function(){return m.STObject}});const h=tL();Object.defineProperty(t,"UInt16",{enumerable:!0,get:function(){return h.UInt16}});const g=N_();Object.defineProperty(t,"UInt32",{enumerable:!0,get:function(){return g.UInt32}});const w=_g();Object.defineProperty(t,"UInt64",{enumerable:!0,get:function(){return w.UInt64}});const E=R_();Object.defineProperty(t,"UInt8",{enumerable:!0,get:function(){return E.UInt8}});const y=nL();Object.defineProperty(t,"Vector256",{enumerable:!0,get:function(){return y.Vector256}});const b=rL(),S=Vi(),v={AccountID:e.AccountID,Amount:n.Amount,Blob:r.Blob,Currency:i.Currency,Hash128:s.Hash128,Hash160:o.Hash160,Hash192:a.Hash192,Hash256:c.Hash256,Int32:l.Int32,Issue:d.Issue,Number:u.STNumber,PathSet:f.PathSet,STArray:p.STArray,STObject:m.STObject,UInt8:E.UInt8,UInt16:h.UInt16,UInt32:g.UInt32,UInt64:w.UInt64,Vector256:y.Vector256,XChainBridge:b.XChainBridge};t.coreTypes=v,S.DEFAULT_DEFINITIONS.associateTypes(v)})(vg)),vg}var Tg={},ql={},L_;function Hl(){if(L_)return ql;L_=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.HashPrefix=void 0;const t=dr();function e(r){const i=new Uint8Array(4);return(0,t.writeUInt32BE)(i,r,0),i}const n={transactionID:e(1415073280),transaction:e(1397638144),accountStateEntry:e(1296846336),innerNode:e(1296649728),ledgerHeader:e(1280791040),transactionSig:e(1398036480),transactionMultiSig:e(1397576704),validation:e(1447119872),proposal:e(1347571712),paymentChannelClaim:e(1129073920),batch:e(1111705600)};return ql.HashPrefix=n,ql}var ti={},Ro={},Et={},Oe={},M_;function iL(){if(M_)return Oe;M_=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.add5L=Oe.add5H=Oe.add4H=Oe.add4L=Oe.add3H=Oe.add3L=Oe.rotlBL=Oe.rotlBH=Oe.rotlSL=Oe.rotlSH=Oe.rotr32L=Oe.rotr32H=Oe.rotrBL=Oe.rotrBH=Oe.rotrSL=Oe.rotrSH=Oe.shrSL=Oe.shrSH=Oe.toBig=void 0,Oe.fromBig=n,Oe.split=r,Oe.add=w;const t=BigInt(2**32-1),e=BigInt(32);function n(_,N=!1){return N?{h:Number(_&t),l:Number(_>>e&t)}:{h:Number(_>>e&t)|0,l:Number(_&t)|0}}function r(_,N=!1){let D=new Uint32Array(_.length),U=new Uint32Array(_.length);for(let L=0;L<_.length;L++){const{h:k,l:C}=n(_[L],N);[D[L],U[L]]=[k,C]}return[D,U]}const i=(_,N)=>BigInt(_>>>0)<<e|BigInt(N>>>0);Oe.toBig=i;const s=(_,N,D)=>_>>>D;Oe.shrSH=s;const o=(_,N,D)=>_<<32-D|N>>>D;Oe.shrSL=o;const a=(_,N,D)=>_>>>D|N<<32-D;Oe.rotrSH=a;const c=(_,N,D)=>_<<32-D|N>>>D;Oe.rotrSL=c;const l=(_,N,D)=>_<<64-D|N>>>D-32;Oe.rotrBH=l;const d=(_,N,D)=>_>>>D-32|N<<64-D;Oe.rotrBL=d;const u=(_,N)=>N;Oe.rotr32H=u;const f=(_,N)=>_;Oe.rotr32L=f;const p=(_,N,D)=>_<<D|N>>>32-D;Oe.rotlSH=p;const m=(_,N,D)=>N<<D|_>>>32-D;Oe.rotlSL=m;const h=(_,N,D)=>N<<D-32|_>>>64-D;Oe.rotlBH=h;const g=(_,N,D)=>_<<D-32|N>>>64-D;Oe.rotlBL=g;function w(_,N,D,U){const L=(N>>>0)+(U>>>0);return{h:_+D+(L/2**32|0)|0,l:L|0}}const E=(_,N,D)=>(_>>>0)+(N>>>0)+(D>>>0);Oe.add3L=E;const y=(_,N,D,U)=>N+D+U+(_/2**32|0)|0;Oe.add3H=y;const b=(_,N,D,U)=>(_>>>0)+(N>>>0)+(D>>>0)+(U>>>0);Oe.add4L=b;const S=(_,N,D,U,L)=>N+D+U+L+(_/2**32|0)|0;Oe.add4H=S;const v=(_,N,D,U,L)=>(_>>>0)+(N>>>0)+(D>>>0)+(U>>>0)+(L>>>0);Oe.add5L=v;const B=(_,N,D,U,L,k)=>N+D+U+L+k+(_/2**32|0)|0;Oe.add5H=B;const T={fromBig:n,split:r,toBig:i,shrSH:s,shrSL:o,rotrSH:a,rotrSL:c,rotrBH:l,rotrBL:d,rotr32H:u,rotr32L:f,rotlSH:p,rotlSL:m,rotlBH:h,rotlBL:g,add:w,add3L:E,add3H:y,add4L:b,add4H:S,add5H:B,add5L:v};return Oe.default=T,Oe}var U_;function F_(){if(U_)return Et;U_=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.sha384=Et.sha512_256=Et.sha512_224=Et.sha512=Et.SHA384=Et.SHA512_256=Et.SHA512_224=Et.SHA512=void 0;const t=mg(),e=iL(),n=lr(),[r,i]=e.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(u=>BigInt(u))),s=new Uint32Array(80),o=new Uint32Array(80);class a extends t.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:f,Al:p,Bh:m,Bl:h,Ch:g,Cl:w,Dh:E,Dl:y,Eh:b,El:S,Fh:v,Fl:B,Gh:T,Gl:_,Hh:N,Hl:D}=this;return[f,p,m,h,g,w,E,y,b,S,v,B,T,_,N,D]}set(f,p,m,h,g,w,E,y,b,S,v,B,T,_,N,D){this.Ah=f|0,this.Al=p|0,this.Bh=m|0,this.Bl=h|0,this.Ch=g|0,this.Cl=w|0,this.Dh=E|0,this.Dl=y|0,this.Eh=b|0,this.El=S|0,this.Fh=v|0,this.Fl=B|0,this.Gh=T|0,this.Gl=_|0,this.Hh=N|0,this.Hl=D|0}process(f,p){for(let k=0;k<16;k++,p+=4)s[k]=f.getUint32(p),o[k]=f.getUint32(p+=4);for(let k=16;k<80;k++){const C=s[k-15]|0,P=o[k-15]|0,A=e.default.rotrSH(C,P,1)^e.default.rotrSH(C,P,8)^e.default.shrSH(C,P,7),x=e.default.rotrSL(C,P,1)^e.default.rotrSL(C,P,8)^e.default.shrSL(C,P,7),I=s[k-2]|0,R=o[k-2]|0,O=e.default.rotrSH(I,R,19)^e.default.rotrBH(I,R,61)^e.default.shrSH(I,R,6),M=e.default.rotrSL(I,R,19)^e.default.rotrBL(I,R,61)^e.default.shrSL(I,R,6),z=e.default.add4L(x,M,o[k-7],o[k-16]),$=e.default.add4H(z,A,O,s[k-7],s[k-16]);s[k]=$|0,o[k]=z|0}let{Ah:m,Al:h,Bh:g,Bl:w,Ch:E,Cl:y,Dh:b,Dl:S,Eh:v,El:B,Fh:T,Fl:_,Gh:N,Gl:D,Hh:U,Hl:L}=this;for(let k=0;k<80;k++){const C=e.default.rotrSH(v,B,14)^e.default.rotrSH(v,B,18)^e.default.rotrBH(v,B,41),P=e.default.rotrSL(v,B,14)^e.default.rotrSL(v,B,18)^e.default.rotrBL(v,B,41),A=v&T^~v&N,x=B&_^~B&D,I=e.default.add5L(L,P,x,i[k],o[k]),R=e.default.add5H(I,U,C,A,r[k],s[k]),O=I|0,M=e.default.rotrSH(m,h,28)^e.default.rotrBH(m,h,34)^e.default.rotrBH(m,h,39),z=e.default.rotrSL(m,h,28)^e.default.rotrBL(m,h,34)^e.default.rotrBL(m,h,39),$=m&g^m&E^g&E,X=h&w^h&y^w&y;U=N|0,L=D|0,N=T|0,D=_|0,T=v|0,_=B|0,{h:v,l:B}=e.default.add(b|0,S|0,R|0,O|0),b=E|0,S=y|0,E=g|0,y=w|0,g=m|0,w=h|0;const ee=e.default.add3L(O,z,X);m=e.default.add3H(ee,R,M,$),h=ee|0}({h:m,l:h}=e.default.add(this.Ah|0,this.Al|0,m|0,h|0)),{h:g,l:w}=e.default.add(this.Bh|0,this.Bl|0,g|0,w|0),{h:E,l:y}=e.default.add(this.Ch|0,this.Cl|0,E|0,y|0),{h:b,l:S}=e.default.add(this.Dh|0,this.Dl|0,b|0,S|0),{h:v,l:B}=e.default.add(this.Eh|0,this.El|0,v|0,B|0),{h:T,l:_}=e.default.add(this.Fh|0,this.Fl|0,T|0,_|0),{h:N,l:D}=e.default.add(this.Gh|0,this.Gl|0,N|0,D|0),{h:U,l:L}=e.default.add(this.Hh|0,this.Hl|0,U|0,L|0),this.set(m,h,g,w,E,y,b,S,v,B,T,_,N,D,U,L)}roundClean(){s.fill(0),o.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Et.SHA512=a;class c extends a{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Et.SHA512_224=c;class l extends a{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Et.SHA512_256=l;class d extends a{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Et.SHA384=d,Et.sha512=(0,n.wrapConstructor)(()=>new a),Et.sha512_224=(0,n.wrapConstructor)(()=>new c),Et.sha512_256=(0,n.wrapConstructor)(()=>new l),Et.sha384=(0,n.wrapConstructor)(()=>new d),Et}var $_;function Ig(){if($_)return Ro;$_=1;var t=Ro&&Ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.sha512=void 0;const e=F_(),n=t(wg());return Ro.sha512=(0,n.default)(e.sha512),Ro}var j_;function Nf(){if(j_)return ti;j_=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.transactionID=ti.sha512Half=ti.Sha512Half=void 0;const t=Hl(),e=Bo(),n=wl(),r=Ig();class i extends n.BytesList{constructor(){super(...arguments),this.hash=r.sha512.create()}static put(c){return new i().put(c)}put(c){return this.hash.update(c),this}finish256(){return Uint8Array.from(this.hash.digest().slice(0,32))}finish(){return new e.Hash256(this.finish256())}}ti.Sha512Half=i;function s(...a){const c=new i;return a.forEach(l=>c.put(l)),c.finish256()}ti.sha512Half=s;function o(a){return new e.Hash256(s(t.HashPrefix.transactionID,a))}return ti.transactionID=o,ti}var q_;function H_(){return q_||(q_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.signingBatchData=t.transactionID=t.sha512Half=t.binaryToJSON=t.signingClaimData=t.signingData=t.multiSigningData=t.readJSON=t.serializeObject=t.makeParser=t.BytesList=t.BinarySerializer=t.BinaryParser=void 0;const e=$e(),n=Bo(),r=zi();Object.defineProperty(t,"BinaryParser",{enumerable:!0,get:function(){return r.BinaryParser}});const i=Hl(),s=wl();Object.defineProperty(t,"BinarySerializer",{enumerable:!0,get:function(){return s.BinarySerializer}}),Object.defineProperty(t,"BytesList",{enumerable:!0,get:function(){return s.BytesList}});const o=Nf();Object.defineProperty(t,"sha512Half",{enumerable:!0,get:function(){return o.sha512Half}}),Object.defineProperty(t,"transactionID",{enumerable:!0,get:function(){return o.transactionID}});const a=Vi(),c=(g,w)=>new r.BinaryParser(g instanceof Uint8Array?(0,e.bytesToHex)(g):g,w);t.makeParser=c;const l=(g,w=a.DEFAULT_DEFINITIONS)=>g.readType(n.coreTypes.STObject).toJSON(w);t.readJSON=l;const d=(g,w)=>l(c(g,w),w);t.binaryToJSON=d;function u(g,w={}){const{prefix:E,suffix:y,signingFieldsOnly:b=!1,definitions:S}=w,v=new s.BytesList;E&&v.put(E);const B=b?T=>T.isSigningField:void 0;return n.coreTypes.STObject.from(g,B,S).toBytesSink(v),y&&v.put(y),v.toBytes()}t.serializeObject=u;function f(g,w=i.HashPrefix.transactionSig,E={}){return u(g,{prefix:w,signingFieldsOnly:!0,definitions:E.definitions})}t.signingData=f;function p(g){const w=BigInt(String(g.amount)),E=i.HashPrefix.paymentChannelClaim,y=n.coreTypes.Hash256.from(g.channel).toBytes(),b=n.coreTypes.UInt64.from(w).toBytes(),S=new s.BytesList;return S.put(E),S.put(y),S.put(b),S.toBytes()}t.signingClaimData=p;function m(g,w,E={definitions:a.DEFAULT_DEFINITIONS}){const y=i.HashPrefix.transactionMultiSig,b=n.coreTypes.AccountID.from(w).toBytes();return u(g,{prefix:y,suffix:b,signingFieldsOnly:!0,definitions:E.definitions})}t.multiSigningData=m;function h(g){if(g.flags==null)throw Error("No field `flags'");if(g.txIDs==null)throw Error("No field `txIDs`");const w=i.HashPrefix.batch,E=n.coreTypes.UInt32.from(g.flags).toBytes(),y=n.coreTypes.UInt32.from(g.txIDs.length).toBytes(),b=new s.BytesList;return b.put(w),b.put(E),b.put(y),g.txIDs.forEach(S=>{b.put(n.coreTypes.Hash256.from(S).toBytes())}),b.toBytes()}t.signingBatchData=h})(Tg)),Tg}var ni={},V_;function z_(){if(V_)return ni;V_=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.ShaMapLeaf=ni.ShaMapNode=ni.ShaMap=void 0;const t=Bo(),e=Hl(),n=Nf();class r{}ni.ShaMapNode=r;class i extends r{constructor(c,l){super(),this.index=c,this.item=l}isLeaf(){return!0}isInner(){return!1}hashPrefix(){return this.item===void 0?new Uint8Array(0):this.item.hashPrefix()}hash(){const c=n.Sha512Half.put(this.hashPrefix());return this.toBytesSink(c),c.finish()}toBytesSink(c){this.item!==void 0&&this.item.toBytesSink(c),this.index.toBytesSink(c)}}ni.ShaMapLeaf=i;class s extends r{constructor(c=0){super(),this.depth=c,this.slotBits=0,this.branches=Array(16)}isInner(){return!0}isLeaf(){return!1}hashPrefix(){return e.HashPrefix.innerNode}setBranch(c,l){this.slotBits=this.slotBits|1<<c,this.branches[c]=l}empty(){return this.slotBits===0}hash(){if(this.empty())return t.coreTypes.Hash256.ZERO_256;const c=n.Sha512Half.put(this.hashPrefix());return this.toBytesSink(c),c.finish()}toBytesSink(c){for(let l=0;l<this.branches.length;l++){const d=this.branches[l];(d?d.hash():t.coreTypes.Hash256.ZERO_256).toBytesSink(c)}}addItem(c,l,d){if(c===void 0)throw new Error;if(c!==void 0){const u=c.nibblet(this.depth),f=this.branches[u];if(f===void 0)this.setBranch(u,d||new i(c,l));else if(f instanceof i){const p=new s(this.depth+1);p.addItem(f.index,void 0,f),p.addItem(c,l,d),this.setBranch(u,p)}else if(f instanceof s)f.addItem(c,l,d);else throw new Error("invalid ShaMap.addItem call")}}}class o extends s{}return ni.ShaMap=o,ni}var $n={},W_;function K_(){if(W_)return $n;W_=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.decodeLedgerData=$n.ledgerHash=$n.transactionTreeHash=$n.accountStateHash=void 0;const t=z_(),e=Hl(),n=Nf(),r=H_(),i=Sg(),s=xg(),o=_g(),a=N_(),c=R_(),l=zi();function d(w,E){const y=new t.ShaMap;return E.forEach(b=>y.addItem(...w(b))),y.hash()}function u(w){if(!w.hash)throw new Error;return[i.Hash256.from(w.hash),{hashPrefix(){return e.HashPrefix.transaction},toBytesSink(b){const S=new r.BinarySerializer(b);S.writeLengthEncoded(s.STObject.from(w)),S.writeLengthEncoded(s.STObject.from(w.metaData))}},void 0]}function f(w){const E=i.Hash256.from(w.index),y=(0,r.serializeObject)(w);return[E,{hashPrefix(){return e.HashPrefix.accountStateEntry},toBytesSink(S){S.put(y)}},void 0]}function p(w){return d(u,w)}$n.transactionTreeHash=p;function m(w){return d(f,w)}$n.accountStateHash=m;function h(w){const E=new n.Sha512Half;if(E.put(e.HashPrefix.ledgerHeader),w.parent_close_time===void 0||w.close_flags===void 0)throw new Error;return a.UInt32.from(w.ledger_index).toBytesSink(E),o.UInt64.from(BigInt(String(w.total_coins))).toBytesSink(E),i.Hash256.from(w.parent_hash).toBytesSink(E),i.Hash256.from(w.transaction_hash).toBytesSink(E),i.Hash256.from(w.account_hash).toBytesSink(E),a.UInt32.from(w.parent_close_time).toBytesSink(E),a.UInt32.from(w.close_time).toBytesSink(E),c.UInt8.from(w.close_time_resolution).toBytesSink(E),c.UInt8.from(w.close_flags).toBytesSink(E),E.finish()}$n.ledgerHash=h;function g(w,E){if(typeof w!="string")throw new Error("binary must be a hex string");const y=new l.BinaryParser(w,E);return{ledger_index:y.readUInt32(),total_coins:y.readType(o.UInt64).valueOf().toString(),parent_hash:y.readType(i.Hash256).toHex(),transaction_hash:y.readType(i.Hash256).toHex(),account_hash:y.readType(i.Hash256).toHex(),parent_close_time:y.readUInt32(),close_time:y.readUInt32(),close_time_resolution:y.readUInt8(),close_flags:y.readUInt8()}}return $n.decodeLedgerData=g,$n}var Do={},G_;function sL(){if(G_)return Do;G_=1;var t=Do&&Do.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Do,"__esModule",{value:!0}),Do.quality=void 0;const e=Bo(),n=t(on()),r=$e();class i{static encode(o){const a=(0,n.default)(o),c=((a==null?void 0:a.e)||0)-15,l=a.times(`1e${-c}`).abs().toString(),d=e.coreTypes.UInt64.from(BigInt(l)).toBytes();return d[0]=c+100,d}static decode(o){const a=(0,r.hexToBytes)(o).slice(-8),c=a[0]-100;return new n.default(`0x${(0,r.bytesToHex)(a.slice(1))}`).times(`1e${c}`)}}return Do.quality=i,Do}var X_;function oL(){return X_||(X_=1,(function(t){var e=ei&&ei.__createBinding||(Object.create?(function(f,p,m,h){h===void 0&&(h=m);var g=Object.getOwnPropertyDescriptor(p,m);(!g||("get"in g?!p.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return p[m]}}),Object.defineProperty(f,h,g)}):(function(f,p,m,h){h===void 0&&(h=m),f[h]=p[m]})),n=ei&&ei.__setModuleDefault||(Object.create?(function(f,p){Object.defineProperty(f,"default",{enumerable:!0,value:p})}):function(f,p){f.default=p}),r=ei&&ei.__importStar||function(f){if(f&&f.__esModule)return f;var p={};if(f!=null)for(var m in f)m!=="default"&&Object.prototype.hasOwnProperty.call(f,m)&&e(p,f,m);return n(p,f),p};Object.defineProperty(t,"__esModule",{value:!0}),t.types=t.ShaMap=t.HashPrefix=t.quality=t.TransactionResult=t.Type=t.LedgerEntryType=t.TransactionType=t.Field=t.DEFAULT_DEFINITIONS=t.ledgerHashes=t.binary=t.hashes=void 0;const i=Vi();Object.defineProperty(t,"DEFAULT_DEFINITIONS",{enumerable:!0,get:function(){return i.DEFAULT_DEFINITIONS}}),Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return i.Field}}),Object.defineProperty(t,"TransactionType",{enumerable:!0,get:function(){return i.TransactionType}}),Object.defineProperty(t,"LedgerEntryType",{enumerable:!0,get:function(){return i.LedgerEntryType}}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return i.Type}}),Object.defineProperty(t,"TransactionResult",{enumerable:!0,get:function(){return i.TransactionResult}});const s=r(Bo());t.types=s;const o=r(H_());t.binary=o;const a=z_();Object.defineProperty(t,"ShaMap",{enumerable:!0,get:function(){return a.ShaMap}});const c=r(K_());t.ledgerHashes=c;const l=r(Nf());t.hashes=l;const d=sL();Object.defineProperty(t,"quality",{enumerable:!0,get:function(){return d.quality}});const u=Hl();Object.defineProperty(t,"HashPrefix",{enumerable:!0,get:function(){return u.HashPrefix}})})(ei)),ei}var Vl={},Y_;function aL(){if(Y_)return Vl;Y_=1,Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.XrplDefinitions=void 0;const t=r_(),e=Bo();class n extends t.XrplDefinitionsBase{constructor(i,s){const o=Object.assign({},e.coreTypes,s);super(i,o)}}return Vl.XrplDefinitions=n,Vl}var Q_;function jn(){return Q_||(Q_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.coreTypes=t.DEFAULT_DEFINITIONS=t.XrplDefinitionsBase=t.XrplDefinitions=t.TRANSACTION_TYPES=t.decodeLedgerData=t.decodeQuality=t.encodeQuality=t.encodeForSigningBatch=t.encodeForMultisigning=t.encodeForSigningClaim=t.encodeForSigning=t.encode=t.decode=void 0;const e=oL(),n=K_();Object.defineProperty(t,"decodeLedgerData",{enumerable:!0,get:function(){return n.decodeLedgerData}});const r=Vi();Object.defineProperty(t,"XrplDefinitionsBase",{enumerable:!0,get:function(){return r.XrplDefinitionsBase}}),Object.defineProperty(t,"TRANSACTION_TYPES",{enumerable:!0,get:function(){return r.TRANSACTION_TYPES}}),Object.defineProperty(t,"DEFAULT_DEFINITIONS",{enumerable:!0,get:function(){return r.DEFAULT_DEFINITIONS}});const i=aL();Object.defineProperty(t,"XrplDefinitions",{enumerable:!0,get:function(){return i.XrplDefinitions}});const s=Bo();Object.defineProperty(t,"coreTypes",{enumerable:!0,get:function(){return s.coreTypes}});const o=$e(),{signingData:a,signingClaimData:c,multiSigningData:l,signingBatchData:d,binaryToJSON:u,serializeObject:f}=e.binary;function p(S,v){if(typeof S!="string")throw new Error("binary must be a hex string");return u(S,v)}t.decode=p;function m(S,v){if(typeof S!="object")throw new Error;return(0,o.bytesToHex)(f(S,{definitions:v}))}t.encode=m;function h(S,v){if(typeof S!="object")throw new Error;return(0,o.bytesToHex)(a(S,e.HashPrefix.transactionSig,{definitions:v}))}t.encodeForSigning=h;function g(S){if(typeof S!="object")throw new Error;return(0,o.bytesToHex)(c(S))}t.encodeForSigningClaim=g;function w(S,v,B){if(typeof S!="object")throw new Error;const T=B?{definitions:B}:void 0;return(0,o.bytesToHex)(l(S,v,T))}t.encodeForMultisigning=w;function E(S){if(typeof S!="object")throw new Error("Need an object to encode a Batch transaction");return(0,o.bytesToHex)(d(S))}t.encodeForSigningBatch=E;function y(S){if(typeof S!="string")throw new Error;return(0,o.bytesToHex)(e.quality.encode(S))}t.encodeQuality=y;function b(S){if(typeof S!="string")throw new Error;return e.quality.decode(S).toString()}t.decodeQuality=b})(yg)),yg}var ri={},J_;function ko(){if(J_)return ri;J_=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.isHex=ri.isFlagEnabled=ri.onlyHasFields=void 0;const t=/^[0-9A-Fa-f]+$/u;function e(i,s){return Object.keys(i).every(o=>s.includes(o))}ri.onlyHasFields=e;function n(i,s){return(BigInt(s)&BigInt(i))===BigInt(s)}ri.isFlagEnabled=n;function r(i){return t.test(i)}return ri.isHex=r,ri}var Z_;function Re(){if(Z_)return Qe;Z_=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.parseAmountValue=Qe.validateBaseTransaction=Qe.validateOptionalField=Qe.validateRequiredField=Qe.isXChainBridge=Qe.isAmount=Qe.isAccount=Qe.isIssuedCurrency=Qe.isCurrency=Qe.isNumber=Qe.isString=void 0;const t=yn(),e=jn(),n=Ie(),r=ko(),i=3;function s(T){if(T.Memo==null)return!1;const _=T.Memo,N=Object.keys(_).length,D=_.MemoData==null||typeof _.MemoData=="string",U=_.MemoFormat==null||typeof _.MemoFormat=="string",L=_.MemoType==null||typeof _.MemoType=="string";return N>=1&&N<=i&&D&&U&&L&&(0,r.onlyHasFields)(_,["MemoFormat","MemoData","MemoType"])}const o=3;function a(T){const _=T;if(_.Signer==null)return!1;const N=_.Signer;return Object.keys(N).length===o&&typeof N.Account=="string"&&typeof N.TxnSignature=="string"&&typeof N.SigningPubKey=="string"}const c=1,l=2,d=3,u=4;function f(T){return T!==null&&typeof T=="object"}function p(T){return typeof T=="string"}Qe.isString=p;function m(T){return typeof T=="number"}Qe.isNumber=m;function h(T){return f(T)&&(Object.keys(T).length===l&&typeof T.issuer=="string"&&typeof T.currency=="string"||Object.keys(T).length===c&&T.currency==="XRP")}Qe.isCurrency=h;function g(T){return f(T)&&Object.keys(T).length===d&&typeof T.value=="string"&&typeof T.issuer=="string"&&typeof T.currency=="string"}Qe.isIssuedCurrency=g;function w(T){return typeof T=="string"&&((0,t.isValidClassicAddress)(T)||(0,t.isValidXAddress)(T))}Qe.isAccount=w;function E(T){return typeof T=="string"||g(T)}Qe.isAmount=E;function y(T){return f(T)&&Object.keys(T).length===u&&typeof T.LockingChainDoor=="string"&&h(T.LockingChainIssue)&&typeof T.IssuingChainDoor=="string"&&h(T.IssuingChainIssue)}Qe.isXChainBridge=y;function b(T,_,N){if(T[_]==null)throw new n.ValidationError(`${T.TransactionType}: missing field ${_}`);if(!N(T[_]))throw new n.ValidationError(`${T.TransactionType}: invalid field ${_}`)}Qe.validateRequiredField=b;function S(T,_,N){if(T[_]!==void 0&&!N(T[_]))throw new n.ValidationError(`${T.TransactionType}: invalid field ${_}`)}Qe.validateOptionalField=S;function v(T){if(T.TransactionType===void 0)throw new n.ValidationError("BaseTransaction: missing field TransactionType");if(typeof T.TransactionType!="string")throw new n.ValidationError("BaseTransaction: TransactionType not string");if(!e.TRANSACTION_TYPES.includes(T.TransactionType))throw new n.ValidationError("BaseTransaction: Unknown TransactionType");b(T,"Account",p),S(T,"Fee",p),S(T,"Sequence",m),S(T,"AccountTxnID",p),S(T,"LastLedgerSequence",m);const _=T.Memos;if(_!==void 0&&!_.every(s))throw new n.ValidationError("BaseTransaction: invalid Memos");const N=T.Signers;if(N!==void 0&&(N.length===0||!N.every(a)))throw new n.ValidationError("BaseTransaction: invalid Signers");S(T,"SourceTag",m),S(T,"SigningPubKey",p),S(T,"TicketSequence",m),S(T,"TxnSignature",p),S(T,"NetworkID",m)}Qe.validateBaseTransaction=v;function B(T){return E(T)?parseFloat(typeof T=="string"?T:T.value):NaN}return Qe.parseAmountValue=B,Qe}var ex;function Cg(){if(ex)return Qr;ex=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.validateAccountSet=Qr.AccountSetTfFlags=Qr.AccountSetAsfFlags=void 0;const t=Ie(),e=Re();var n;(function(a){a[a.asfRequireDest=1]="asfRequireDest",a[a.asfRequireAuth=2]="asfRequireAuth",a[a.asfDisallowXRP=3]="asfDisallowXRP",a[a.asfDisableMaster=4]="asfDisableMaster",a[a.asfAccountTxnID=5]="asfAccountTxnID",a[a.asfNoFreeze=6]="asfNoFreeze",a[a.asfGlobalFreeze=7]="asfGlobalFreeze",a[a.asfDefaultRipple=8]="asfDefaultRipple",a[a.asfDepositAuth=9]="asfDepositAuth",a[a.asfAuthorizedNFTokenMinter=10]="asfAuthorizedNFTokenMinter",a[a.asfDisallowIncomingNFTokenOffer=12]="asfDisallowIncomingNFTokenOffer",a[a.asfDisallowIncomingCheck=13]="asfDisallowIncomingCheck",a[a.asfDisallowIncomingPayChan=14]="asfDisallowIncomingPayChan",a[a.asfDisallowIncomingTrustline=15]="asfDisallowIncomingTrustline",a[a.asfAllowTrustLineClawback=16]="asfAllowTrustLineClawback"})(n||(Qr.AccountSetAsfFlags=n={}));var r;(function(a){a[a.tfRequireDestTag=65536]="tfRequireDestTag",a[a.tfOptionalDestTag=131072]="tfOptionalDestTag",a[a.tfRequireAuth=262144]="tfRequireAuth",a[a.tfOptionalAuth=524288]="tfOptionalAuth",a[a.tfDisallowXRP=1048576]="tfDisallowXRP",a[a.tfAllowXRP=2097152]="tfAllowXRP"})(r||(Qr.AccountSetTfFlags=r={}));const i=3,s=15;function o(a){if((0,e.validateBaseTransaction)(a),(0,e.validateOptionalField)(a,"NFTokenMinter",e.isAccount),a.ClearFlag!==void 0){if(typeof a.ClearFlag!="number")throw new t.ValidationError("AccountSet: invalid ClearFlag");if(!Object.values(n).includes(a.ClearFlag))throw new t.ValidationError("AccountSet: invalid ClearFlag")}if(a.Domain!==void 0&&typeof a.Domain!="string")throw new t.ValidationError("AccountSet: invalid Domain");if(a.EmailHash!==void 0&&typeof a.EmailHash!="string")throw new t.ValidationError("AccountSet: invalid EmailHash");if(a.MessageKey!==void 0&&typeof a.MessageKey!="string")throw new t.ValidationError("AccountSet: invalid MessageKey");if(a.SetFlag!==void 0){if(typeof a.SetFlag!="number")throw new t.ValidationError("AccountSet: invalid SetFlag");if(!Object.values(n).includes(a.SetFlag))throw new t.ValidationError("AccountSet: invalid SetFlag")}if(a.TransferRate!==void 0&&typeof a.TransferRate!="number")throw new t.ValidationError("AccountSet: invalid TransferRate");if(a.TickSize!==void 0){if(typeof a.TickSize!="number")throw new t.ValidationError("AccountSet: invalid TickSize");if(a.TickSize!==0&&(a.TickSize<i||a.TickSize>s))throw new t.ValidationError("AccountSet: invalid TickSize")}}return Qr.validateAccountSet=o,Qr}var Po={},tx;function Og(){if(tx)return Po;tx=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.validateAMMDeposit=Po.AMMDepositFlags=void 0;const t=Ie(),e=Re();var n;(function(i){i[i.tfLPToken=65536]="tfLPToken",i[i.tfSingleAsset=524288]="tfSingleAsset",i[i.tfTwoAsset=1048576]="tfTwoAsset",i[i.tfOneAssetLPToken=2097152]="tfOneAssetLPToken",i[i.tfLimitLPToken=4194304]="tfLimitLPToken",i[i.tfTwoAssetIfEmpty=8388608]="tfTwoAssetIfEmpty"})(n||(Po.AMMDepositFlags=n={}));function r(i){if((0,e.validateBaseTransaction)(i),i.Asset==null)throw new t.ValidationError("AMMDeposit: missing field Asset");if(!(0,e.isCurrency)(i.Asset))throw new t.ValidationError("AMMDeposit: Asset must be a Currency");if(i.Asset2==null)throw new t.ValidationError("AMMDeposit: missing field Asset2");if(!(0,e.isCurrency)(i.Asset2))throw new t.ValidationError("AMMDeposit: Asset2 must be a Currency");if(i.Amount2!=null&&i.Amount==null)throw new t.ValidationError("AMMDeposit: must set Amount with Amount2");if(i.EPrice!=null&&i.Amount==null)throw new t.ValidationError("AMMDeposit: must set Amount with EPrice");if(i.LPTokenOut==null&&i.Amount==null)throw new t.ValidationError("AMMDeposit: must set at least LPTokenOut or Amount");if(i.LPTokenOut!=null&&!(0,e.isIssuedCurrency)(i.LPTokenOut))throw new t.ValidationError("AMMDeposit: LPTokenOut must be an IssuedCurrencyAmount");if(i.Amount!=null&&!(0,e.isAmount)(i.Amount))throw new t.ValidationError("AMMDeposit: Amount must be an Amount");if(i.Amount2!=null&&!(0,e.isAmount)(i.Amount2))throw new t.ValidationError("AMMDeposit: Amount2 must be an Amount");if(i.EPrice!=null&&!(0,e.isAmount)(i.EPrice))throw new t.ValidationError("AMMDeposit: EPrice must be an Amount")}return Po.validateAMMDeposit=r,Po}var Lo={},nx;function Ng(){if(nx)return Lo;nx=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.validateAMMWithdraw=Lo.AMMWithdrawFlags=void 0;const t=Ie(),e=Re();var n;(function(i){i[i.tfLPToken=65536]="tfLPToken",i[i.tfWithdrawAll=131072]="tfWithdrawAll",i[i.tfOneAssetWithdrawAll=262144]="tfOneAssetWithdrawAll",i[i.tfSingleAsset=524288]="tfSingleAsset",i[i.tfTwoAsset=1048576]="tfTwoAsset",i[i.tfOneAssetLPToken=2097152]="tfOneAssetLPToken",i[i.tfLimitLPToken=4194304]="tfLimitLPToken"})(n||(Lo.AMMWithdrawFlags=n={}));function r(i){if((0,e.validateBaseTransaction)(i),i.Asset==null)throw new t.ValidationError("AMMWithdraw: missing field Asset");if(!(0,e.isCurrency)(i.Asset))throw new t.ValidationError("AMMWithdraw: Asset must be a Currency");if(i.Asset2==null)throw new t.ValidationError("AMMWithdraw: missing field Asset2");if(!(0,e.isCurrency)(i.Asset2))throw new t.ValidationError("AMMWithdraw: Asset2 must be a Currency");if(i.Amount2!=null&&i.Amount==null)throw new t.ValidationError("AMMWithdraw: must set Amount with Amount2");if(i.EPrice!=null&&i.Amount==null)throw new t.ValidationError("AMMWithdraw: must set Amount with EPrice");if(i.LPTokenIn!=null&&!(0,e.isIssuedCurrency)(i.LPTokenIn))throw new t.ValidationError("AMMWithdraw: LPTokenIn must be an IssuedCurrencyAmount");if(i.Amount!=null&&!(0,e.isAmount)(i.Amount))throw new t.ValidationError("AMMWithdraw: Amount must be an Amount");if(i.Amount2!=null&&!(0,e.isAmount)(i.Amount2))throw new t.ValidationError("AMMWithdraw: Amount2 must be an Amount");if(i.EPrice!=null&&!(0,e.isAmount)(i.EPrice))throw new t.ValidationError("AMMWithdraw: EPrice must be an Amount")}return Lo.validateAMMWithdraw=r,Lo}var Mo={},rx;function Bg(){if(rx)return Mo;rx=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.validateNFTokenCreateOffer=Mo.NFTokenCreateOfferFlags=void 0;const t=Ie(),e=ko(),n=Re();var r;(function(a){a[a.tfSellNFToken=1]="tfSellNFToken"})(r||(Mo.NFTokenCreateOfferFlags=r={}));function i(a){if(a.Owner!=null)throw new t.ValidationError("NFTokenCreateOffer: Owner must not be present for sell offers")}function s(a){if(a.Owner==null)throw new t.ValidationError("NFTokenCreateOffer: Owner must be present for buy offers");if((0,n.parseAmountValue)(a.Amount)<=0)throw new t.ValidationError("NFTokenCreateOffer: Amount must be greater than 0 for buy offers")}function o(a){if((0,n.validateBaseTransaction)(a),a.Account===a.Owner)throw new t.ValidationError("NFTokenCreateOffer: Owner and Account must not be equal");if(a.Account===a.Destination)throw new t.ValidationError("NFTokenCreateOffer: Destination and Account must not be equal");if((0,n.validateOptionalField)(a,"Destination",n.isAccount),(0,n.validateOptionalField)(a,"Owner",n.isAccount),a.NFTokenID==null)throw new t.ValidationError("NFTokenCreateOffer: missing field NFTokenID");if(!(0,n.isAmount)(a.Amount))throw new t.ValidationError("NFTokenCreateOffer: invalid Amount");typeof a.Flags=="number"&&(0,e.isFlagEnabled)(a.Flags,r.tfSellNFToken)?i(a):s(a)}return Mo.validateNFTokenCreateOffer=o,Mo}var Uo={},ix;function Rg(){if(ix)return Uo;ix=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.validateNFTokenMint=Uo.NFTokenMintFlags=void 0;const t=Ie(),e=ko(),n=Re();var r;(function(s){s[s.tfBurnable=1]="tfBurnable",s[s.tfOnlyXRP=2]="tfOnlyXRP",s[s.tfTrustLine=4]="tfTrustLine",s[s.tfTransferable=8]="tfTransferable"})(r||(Uo.NFTokenMintFlags=r={}));function i(s){if((0,n.validateBaseTransaction)(s),s.Account===s.Issuer)throw new t.ValidationError("NFTokenMint: Issuer must not be equal to Account");if((0,n.validateOptionalField)(s,"Issuer",n.isAccount),typeof s.URI=="string"&&s.URI==="")throw new t.ValidationError("NFTokenMint: URI must not be empty string");if(typeof s.URI=="string"&&!(0,e.isHex)(s.URI))throw new t.ValidationError("NFTokenMint: URI must be in hex format");if(s.NFTokenTaxon==null)throw new t.ValidationError("NFTokenMint: missing field NFTokenTaxon")}return Uo.validateNFTokenMint=i,Uo}var Fo={},sx;function Dg(){if(sx)return Fo;sx=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.validateOfferCreate=Fo.OfferCreateFlags=void 0;const t=Ie(),e=Re();var n;(function(i){i[i.tfPassive=65536]="tfPassive",i[i.tfImmediateOrCancel=131072]="tfImmediateOrCancel",i[i.tfFillOrKill=262144]="tfFillOrKill",i[i.tfSell=524288]="tfSell"})(n||(Fo.OfferCreateFlags=n={}));function r(i){if((0,e.validateBaseTransaction)(i),i.TakerGets===void 0)throw new t.ValidationError("OfferCreate: missing field TakerGets");if(i.TakerPays===void 0)throw new t.ValidationError("OfferCreate: missing field TakerPays");if(typeof i.TakerGets!="string"&&!(0,e.isAmount)(i.TakerGets))throw new t.ValidationError("OfferCreate: invalid TakerGets");if(typeof i.TakerPays!="string"&&!(0,e.isAmount)(i.TakerPays))throw new t.ValidationError("OfferCreate: invalid TakerPays");if(i.Expiration!==void 0&&typeof i.Expiration!="number")throw new t.ValidationError("OfferCreate: invalid Expiration");if(i.OfferSequence!==void 0&&typeof i.OfferSequence!="number")throw new t.ValidationError("OfferCreate: invalid OfferSequence")}return Fo.validateOfferCreate=r,Fo}var $o={},ox;function kg(){if(ox)return $o;ox=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.validatePayment=$o.PaymentFlags=void 0;const t=Ie(),e=ko(),n=Re();var r;(function(l){l[l.tfNoRippleDirect=65536]="tfNoRippleDirect",l[l.tfPartialPayment=131072]="tfPartialPayment",l[l.tfLimitQuality=262144]="tfLimitQuality"})(r||($o.PaymentFlags=r={}));function i(l){if((0,n.validateBaseTransaction)(l),l.Amount===void 0)throw new t.ValidationError("PaymentTransaction: missing field Amount");if(!(0,n.isAmount)(l.Amount))throw new t.ValidationError("PaymentTransaction: invalid Amount");if((0,n.validateRequiredField)(l,"Destination",n.isAccount),(0,n.validateOptionalField)(l,"DestinationTag",n.isNumber),l.InvoiceID!==void 0&&typeof l.InvoiceID!="string")throw new t.ValidationError("PaymentTransaction: InvoiceID must be a string");if(l.Paths!==void 0&&!c(l.Paths))throw new t.ValidationError("PaymentTransaction: invalid Paths");if(l.SendMax!==void 0&&!(0,n.isAmount)(l.SendMax))throw new t.ValidationError("PaymentTransaction: invalid SendMax");s(l)}$o.validatePayment=i;function s(l){var d;if(l.DeliverMin!=null){if(l.Flags==null)throw new t.ValidationError("PaymentTransaction: tfPartialPayment flag required with DeliverMin");const u=l.Flags;if(!(typeof u=="number"?(0,e.isFlagEnabled)(u,r.tfPartialPayment):(d=u.tfPartialPayment)!==null&&d!==void 0?d:!1))throw new t.ValidationError("PaymentTransaction: tfPartialPayment flag required with DeliverMin");if(!(0,n.isAmount)(l.DeliverMin))throw new t.ValidationError("PaymentTransaction: invalid DeliverMin")}}function o(l){return l.account!==void 0&&typeof l.account!="string"||l.currency!==void 0&&typeof l.currency!="string"||l.issuer!==void 0&&typeof l.issuer!="string"?!1:l.account!==void 0&&l.currency===void 0&&l.issuer===void 0||l.currency!==void 0||l.issuer!==void 0}function a(l){for(const d of l)if(!o(d))return!1;return!0}function c(l){if(!Array.isArray(l)||l.length===0)return!1;for(const d of l)if(!Array.isArray(d)||d.length===0||!a(d))return!1;return!0}return $o}var jo={},ax;function Pg(){if(ax)return jo;ax=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.validatePaymentChannelClaim=jo.PaymentChannelClaimFlags=void 0;const t=Ie(),e=Re();var n;(function(i){i[i.tfRenew=65536]="tfRenew",i[i.tfClose=131072]="tfClose"})(n||(jo.PaymentChannelClaimFlags=n={}));function r(i){if((0,e.validateBaseTransaction)(i),i.Channel===void 0)throw new t.ValidationError("PaymentChannelClaim: missing Channel");if(typeof i.Channel!="string")throw new t.ValidationError("PaymentChannelClaim: Channel must be a string");if(i.Balance!==void 0&&typeof i.Balance!="string")throw new t.ValidationError("PaymentChannelClaim: Balance must be a string");if(i.Amount!==void 0&&typeof i.Amount!="string")throw new t.ValidationError("PaymentChannelClaim: Amount must be a string");if(i.Signature!==void 0&&typeof i.Signature!="string")throw new t.ValidationError("PaymentChannelClaim: Signature must be a string");if(i.PublicKey!==void 0&&typeof i.PublicKey!="string")throw new t.ValidationError("PaymentChannelClaim: PublicKey must be a string")}return jo.validatePaymentChannelClaim=r,jo}var qo={},cx;function Lg(){if(cx)return qo;cx=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.validateTrustSet=qo.TrustSetFlags=void 0;const t=Ie(),e=Re();var n;(function(i){i[i.tfSetfAuth=65536]="tfSetfAuth",i[i.tfSetNoRipple=131072]="tfSetNoRipple",i[i.tfClearNoRipple=262144]="tfClearNoRipple",i[i.tfSetFreeze=1048576]="tfSetFreeze",i[i.tfClearFreeze=2097152]="tfClearFreeze"})(n||(qo.TrustSetFlags=n={}));function r(i){(0,e.validateBaseTransaction)(i);const{LimitAmount:s,QualityIn:o,QualityOut:a}=i;if(s===void 0)throw new t.ValidationError("TrustSet: missing field LimitAmount");if(!(0,e.isAmount)(s))throw new t.ValidationError("TrustSet: invalid LimitAmount");if(o!==void 0&&typeof o!="number")throw new t.ValidationError("TrustSet: QualityIn must be a number");if(a!==void 0&&typeof a!="number")throw new t.ValidationError("TrustSet: QualityOut must be a number")}return qo.validateTrustSet=r,qo}var Ho={},lx;function Mg(){if(lx)return Ho;lx=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.validateXChainModifyBridge=Ho.XChainModifyBridgeFlags=void 0;const t=Re();var e;(function(r){r[r.tfClearAccountCreateAmount=65536]="tfClearAccountCreateAmount"})(e||(Ho.XChainModifyBridgeFlags=e={}));function n(r){(0,t.validateBaseTransaction)(r),(0,t.validateRequiredField)(r,"XChainBridge",t.isXChainBridge),(0,t.validateOptionalField)(r,"SignatureReward",t.isAmount),(0,t.validateOptionalField)(r,"MinAccountCreateAmount",t.isAmount)}return Ho.validateXChainModifyBridge=n,Ho}var ux;function Ug(){if(ux)return So;ux=1,Object.defineProperty(So,"__esModule",{value:!0}),So.setTransactionFlagsToNumber=So.parseAccountRootFlags=void 0;const t=Ie(),e=BS(),n=Cg(),r=Og(),i=Ng(),s=Bg(),o=Rg(),a=Dg(),c=kg(),l=Pg(),d=Lg(),u=Mg(),f=ko();function p(w){const E={};return Object.values(e.AccountRootFlags).forEach(y=>{typeof y=="string"&&(0,f.isFlagEnabled)(w,e.AccountRootFlags[y])&&(E[y]=!0)}),E}So.parseAccountRootFlags=p;const m={AccountSet:n.AccountSetTfFlags,AMMDeposit:r.AMMDepositFlags,AMMWithdraw:i.AMMWithdrawFlags,NFTokenCreateOffer:s.NFTokenCreateOfferFlags,NFTokenMint:o.NFTokenMintFlags,OfferCreate:a.OfferCreateFlags,PaymentChannelClaim:l.PaymentChannelClaimFlags,Payment:c.PaymentFlags,TrustSet:d.TrustSetFlags,XChainModifyBridge:u.XChainModifyBridgeFlags};function h(w){if(w.Flags==null){w.Flags=0;return}typeof w.Flags!="number"&&(w.Flags=m[w.TransactionType]?g(w.Flags,m[w.TransactionType]):0)}So.setTransactionFlagsToNumber=h;function g(w,E){return Object.keys(w).reduce((y,b)=>{if(E[b]==null)throw new t.ValidationError(`flag ${b} doesn't exist in flagEnum: ${JSON.stringify(E)}`);return w[b]?y|E[b]:y},0)}return So}var Vo={},En={},dx;function cL(){if(dx)return En;dx=1;var t=En&&En.__awaiter||function(u,f,p,m){function h(g){return g instanceof p?g:new p(function(w){w(g)})}return new(p||(p=Promise))(function(g,w){function E(S){try{b(m.next(S))}catch(v){w(v)}}function y(S){try{b(m.throw(S))}catch(v){w(v)}}function b(S){S.done?g(S.value):h(S.value).then(E,y)}b((m=m.apply(u,f||[])).next())})};Object.defineProperty(En,"__esModule",{value:!0}),En.getLastLedgerSequence=En.getSignedTx=En.waitForFinalTransactionOutcome=En.submitRequest=void 0;const e=jn(),n=Ie(),r=1e3;function i(u){return t(this,void 0,void 0,function*(){return new Promise(f=>{setTimeout(f,u)})})}function s(u,f,p=!1){return t(this,void 0,void 0,function*(){if(!a(f))throw new n.ValidationError("Transaction must be signed");const h={command:"submit",tx_blob:typeof f=="string"?f:(0,e.encode)(f),fail_hard:d(f)||p};return u.request(h)})}En.submitRequest=s;function o(u,f,p,m){return t(this,void 0,void 0,function*(){yield i(r);const h=yield u.getLedgerIndex();if(p<h)throw new n.XrplError(`The latest ledger sequence ${h} is greater than the transaction's LastLedgerSequence (${p}).
23
23
  Preliminary result: ${m}`);const g=yield u.request({command:"tx",transaction:f}).catch(w=>t(this,void 0,void 0,function*(){var E;const y=(E=w==null?void 0:w.data)===null||E===void 0?void 0:E.error;if(y==="txnNotFound")return o(u,f,p,m);throw new Error(`${y}
24
24
  Preliminary result: ${m}.