{"snapId":"npm:@metamask/solana-wallet-snap","manifest":{"version":"2.8.0","description":"Manage Solana using MetaMask","proposedName":"Solana","repository":{"type":"git","url":"https://github.com/MetaMask/snap-solana-wallet.git"},"source":{"shasum":"hFc9PK6QCElAWB+pnkHVzW3JQVj8UNub9NozdKIxAOQ=","location":{"npm":{"filePath":"dist/bundle.js","iconPath":"images/icon.svg","packageName":"@metamask/solana-wallet-snap","registry":"https://registry.npmjs.org/"}},"locales":["locales/en.json"]},"initialConnections":{"https://portfolio.metamask.io":{}},"initialPermissions":{"endowment:rpc":{"dapps":true,"snaps":false},"endowment:keyring":{"allowedOrigins":["https://portfolio.metamask.io"]},"snap_getBip32Entropy":[{"path":["m","44'","501'"],"curve":"ed25519"}],"endowment:lifecycle-hooks":{},"endowment:network-access":{},"endowment:cronjob":{"jobs":[]},"endowment:protocol":{"scopes":{"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":{"methods":["getGenesisHash","getLatestBlockhash","getMinimumBalanceForRentExemption"]},"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":{"methods":["getGenesisHash","getLatestBlockhash","getMinimumBalanceForRentExemption"]}}},"endowment:assets":{"scopes":["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"]},"endowment:name-lookup":{"chains":["solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"]},"snap_manageAccounts":{},"snap_manageState":{},"snap_dialog":{},"snap_getPreferences":{}},"platformVersion":"10.3.0","manifestVersion":"0.1"},"files":[{"path":"images/icon.svg","value":"<svg width=\"101\" height=\"101\" viewBox=\"0 0 101 101\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M100.48 69.3817L83.8068 86.8015C83.4444 87.1799 83.0058 87.4816 82.5185 87.6878C82.0312 87.894 81.5055 88.0003 80.9743 88H1.93563C1.55849 88 1.18957 87.8926 0.874202 87.6912C0.558829 87.4897 0.31074 87.2029 0.160416 86.8659C0.0100923 86.529 -0.0359181 86.1566 0.0280382 85.7945C0.0919944 85.4324 0.263131 85.0964 0.520422 84.8278L17.2061 67.408C17.5676 67.0306 18.0047 66.7295 18.4904 66.5234C18.9762 66.3172 19.5002 66.2104 20.0301 66.2095H99.0644C99.4415 66.2095 99.8104 66.3169 100.126 66.5183C100.441 66.7198 100.689 67.0067 100.84 67.3436C100.99 67.6806 101.036 68.0529 100.972 68.415C100.908 68.7771 100.737 69.1131 100.48 69.3817ZM83.8068 34.3032C83.4444 33.9248 83.0058 33.6231 82.5185 33.4169C82.0312 33.2108 81.5055 33.1045 80.9743 33.1048H1.93563C1.55849 33.1048 1.18957 33.2121 0.874202 33.4136C0.558829 33.6151 0.31074 33.9019 0.160416 34.2388C0.0100923 34.5758 -0.0359181 34.9482 0.0280382 35.3103C0.0919944 35.6723 0.263131 36.0083 0.520422 36.277L17.2061 53.6968C17.5676 54.0742 18.0047 54.3752 18.4904 54.5814C18.9762 54.7875 19.5002 54.8944 20.0301 54.8952H99.0644C99.4415 54.8952 99.8104 54.7879 100.126 54.5864C100.441 54.3849 100.689 54.0981 100.84 53.7612C100.99 53.4242 101.036 53.0518 100.972 52.6897C100.908 52.3277 100.737 51.9917 100.48 51.723L83.8068 34.3032ZM1.93563 21.7905H80.9743C81.5055 21.7907 82.0312 21.6845 82.5185 21.4783C83.0058 21.2721 83.4444 20.9704 83.8068 20.592L100.48 3.17219C100.737 2.90357 100.908 2.56758 100.972 2.2055C101.036 1.84342 100.99 1.47103 100.84 1.13408C100.689 0.79713 100.441 0.510296 100.126 0.308823C99.8104 0.107349 99.4415 1.24074e-05 99.0644 0L20.0301 0C19.5002 0.000878397 18.9762 0.107699 18.4904 0.313848C18.0047 0.519998 17.5676 0.821087 17.2061 1.19848L0.524723 18.6183C0.267681 18.8866 0.0966198 19.2223 0.0325185 19.5839C-0.0315829 19.9456 0.0140624 20.3177 0.163856 20.6545C0.31365 20.9913 0.561081 21.2781 0.875804 21.4799C1.19053 21.6817 1.55886 21.7896 1.93563 21.7905Z\" fill=\"url(#paint0_linear_174_4403)\"/>\n<defs>\n<linearGradient id=\"paint0_linear_174_4403\" x1=\"8.52558\" y1=\"90.0973\" x2=\"88.9933\" y2=\"-3.01622\" gradientUnits=\"userSpaceOnUse\">\n<stop offset=\"0.08\" stop-color=\"#9945FF\"/>\n<stop offset=\"0.3\" stop-color=\"#8752F3\"/>\n<stop offset=\"0.5\" stop-color=\"#5497D5\"/>\n<stop offset=\"0.6\" stop-color=\"#43B4CA\"/>\n<stop offset=\"0.72\" stop-color=\"#28E0B9\"/>\n<stop offset=\"0.97\" stop-color=\"#19FB9B\"/>\n</linearGradient>\n</defs>\n</svg>\n"},{"path":"dist/bundle.js","value":"(()=>{var e={33:(e,t,n)=>{var r=n(9968),o=n(9756),i=[[\"ary\",128],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",16],[\"flip\",512],[\"partial\",32],[\"partialRight\",64],[\"rearg\",256]];e.exports=function(e,t){return r(i,(function(n){var r=\"_.\"+n[0];t&n[1]&&!o(e,r)&&e.push(r)})),e.sort()}},88:(e,t,n)=>{var r=n(4700);e.exports=function(e){return r(this,e).get(e)}},125:(e,t,n)=>{var r=n(9032),o=n(5288);e.exports=function(e,t){return e&&r(t,o(t),e)}},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},195:(e,t,n)=>{var r=n(4882),o=n(8121),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}},282:e=>{e.exports=a,a.default=a,a.stable=l,a.stableStringify=l;var t=\"[...]\",n=\"[Circular]\",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,\"\",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,f(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,u,l){var d;if(u+=1,\"object\"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===e)return void s(n,e,r,a);if(void 0!==l.depthLimit&&u>l.depthLimit)return void s(t,e,r,a);if(void 0!==l.edgesLimit&&o+1>l.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(d=0;d<e.length;d++)c(e[d],d,d,i,e,u,l);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var h=f[d];c(e[h],h,d,i,e,u,l)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,n,a){void 0===a&&(a=i());var s,c=d(e,\"\",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,f(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function d(e,o,i,a,c,l,f){var h;if(l+=1,\"object\"==typeof e&&null!==e){for(h=0;h<a.length;h++)if(a[h]===e)return void s(n,e,o,c);try{if(\"function\"==typeof e.toJSON)return}catch(e){return}if(void 0!==f.depthLimit&&l>f.depthLimit)return void s(t,e,o,c);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(h=0;h<e.length;h++)d(e[h],h,h,a,e,l,f);else{var p={},g=Object.keys(e).sort(u);for(h=0;h<g.length;h++){var m=g[h];d(e[m],m,h,a,e,l,f),p[m]=e[m]}if(void 0===c)return p;r.push([c,o,e]),c[o]=p}a.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},313:(e,t,n)=>{var r=n(1129),o=n(714);e.exports=function e(t,n,i,a,s){var c=-1,u=t.length;for(i||(i=o),s||(s=[]);++c<u;){var l=t[c];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},353:(e,t,n)=>{var r=n(1340),o=n(3934),i=n(8861),a=n(1182),s=n(8486),c=n(3142),u=n(5853),l=n(8666),d=\"[object Arguments]\",f=\"[object Array]\",h=\"[object Object]\",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var w=c(e),v=c(t),b=w?f:s(e),A=v?f:s(t),S=(b=b==d?h:b)==h,E=(A=A==d?h:A)==h,x=b==A;if(x&&u(e)){if(!u(t))return!1;w=!0,S=!1}if(x&&!S)return y||(y=new r),w||l(e)?o(e,t,n,g,m,y):i(e,t,b,n,g,m,y);if(!(1&n)){var k=S&&p.call(e,\"__wrapped__\"),I=E&&p.call(t,\"__wrapped__\");if(k||I){var T=k?e.value():e,_=I?t.value():t;return y||(y=new r),m(T,_,n,g,y)}}return!!x&&(y||(y=new r),a(e,t,n,g,m,y))}},358:(e,t,n)=>{var r=n(6137),o=n(3283),i=n(3142),a=n(5853),s=n(9632),c=n(8666),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),d=!n&&!l&&a(e),f=!n&&!l&&!d&&c(e),h=n||l||d||f,p=h?r(e.length,String):[],g=p.length;for(var m in e)!t&&!u.call(e,m)||h&&(\"length\"==m||d&&(\"offset\"==m||\"parent\"==m)||f&&(\"buffer\"==m||\"byteLength\"==m||\"byteOffset\"==m)||s(m,g))||p.push(m);return p}},393:(e,t,n)=>{var r=n(8244),o=n(7979),i=n(1211);e.exports=function(e){return r(e,i,o)}},424:(e,t,n)=>{var r=n(8898),o=n(2480),i=n(8340),a=n(8069),s=n(2264);e.exports=function(e,t,n){var c=e.constructor;switch(t){case\"[object ArrayBuffer]\":return r(e);case\"[object Boolean]\":case\"[object Date]\":return new c(+e);case\"[object DataView]\":return o(e,n);case\"[object Float32Array]\":case\"[object Float64Array]\":case\"[object Int8Array]\":case\"[object Int16Array]\":case\"[object Int32Array]\":case\"[object Uint8Array]\":case\"[object Uint8ClampedArray]\":case\"[object Uint16Array]\":case\"[object Uint32Array]\":return s(e,n);case\"[object Map]\":case\"[object Set]\":return new c;case\"[object Number]\":case\"[object String]\":return new c(e);case\"[object RegExp]\":return i(e);case\"[object Symbol]\":return a(e)}}},441:(e,t,n)=>{var r=n(7379),o=n(547),i=n(8360);e.exports=function(e){if(!o(e))return!1;var t=r(e);return\"[object Error]\"==t||\"[object DOMException]\"==t||\"string\"==typeof e.message&&\"string\"==typeof e.name&&!i(e)}},486:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const r=n(9648),o=n(4832),i=n(3654);function a(e,t,n,a){(0,r.hash)(e);const s=(0,i.checkOpts)({dkLen:32,asyncTick:10},a),{c,dkLen:u,asyncTick:l}=s;if((0,r.number)(c),(0,r.number)(u),(0,r.number)(l),c<1)throw new Error(\"PBKDF2: iterations (c) should be >= 1\");const d=(0,i.toBytes)(t),f=(0,i.toBytes)(n),h=new Uint8Array(u),p=o.hmac.create(e,d),g=p._cloneInto().update(f);return{c,dkLen:u,asyncTick:l,DK:h,PRF:p,PRFSalt:g}}function s(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),o.fill(0),n}t.pbkdf2=function(e,t,n,r){const{c:o,dkLen:c,DK:u,PRF:l,PRFSalt:d}=a(e,t,n,r);let f;const h=new Uint8Array(4),p=(0,i.createView)(h),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const n=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(f=d._cloneInto(f)).update(h).digestInto(g),n.set(g.subarray(0,n.length));for(let e=1;e<o;e++){l._cloneInto(f).update(g).digestInto(g);for(let e=0;e<n.length;e++)n[e]^=g[e]}}return s(l,d,u,f,g)},t.pbkdf2Async=async function(e,t,n,r){const{c:o,dkLen:c,asyncTick:u,DK:l,PRF:d,PRFSalt:f}=a(e,t,n,r);let h;const p=new Uint8Array(4),g=(0,i.createView)(p),m=new Uint8Array(d.outputLen);for(let e=1,t=0;t<c;e++,t+=d.outputLen){const n=l.subarray(t,t+d.outputLen);g.setInt32(0,e,!1),(h=f._cloneInto(h)).update(p).digestInto(m),n.set(m.subarray(0,n.length)),await(0,i.asyncLoop)(o-1,u,(()=>{d._cloneInto(h).update(m).digestInto(m);for(let e=0;e<n.length;e++)n[e]^=m[e]}))}return s(d,f,l,h,m)}},528:(e,t,n)=>{var r=n(9747),o=n(5962);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},547:e=>{e.exports=function(e){return null!=e&&\"object\"==typeof e}},674:(e,t,n)=>{var r=n(7379),o=n(5387),i=n(547),a={};a[\"[object Float32Array]\"]=a[\"[object Float64Array]\"]=a[\"[object Int8Array]\"]=a[\"[object Int16Array]\"]=a[\"[object Int32Array]\"]=a[\"[object Uint8Array]\"]=a[\"[object Uint8ClampedArray]\"]=a[\"[object Uint16Array]\"]=a[\"[object Uint32Array]\"]=!0,a[\"[object Arguments]\"]=a[\"[object Array]\"]=a[\"[object ArrayBuffer]\"]=a[\"[object Boolean]\"]=a[\"[object DataView]\"]=a[\"[object Date]\"]=a[\"[object Error]\"]=a[\"[object Function]\"]=a[\"[object Map]\"]=a[\"[object Number]\"]=a[\"[object Object]\"]=a[\"[object RegExp]\"]=a[\"[object Set]\"]=a[\"[object String]\"]=a[\"[object WeakMap]\"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},714:(e,t,n)=>{var r=n(5650),o=n(3283),i=n(3142),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},777:(e,t,n)=>{var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object Map]\"==r(e)}},796:(e,t,n)=>{var r=n(7403),o=n(3316)(r);e.exports=o},864:(e,t,n)=>{var r=n(8638),o=n(1439),i=o((function(e,t){return r(e,256,void 0,void 0,void 0,t)}));e.exports=i},961:(e,t,n)=>{var r=n(3476),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+\"\",n=r[t],i=o.call(r,t)?n.length:0;i--;){var a=n[i],s=a.func;if(null==s||s==e)return a.name}return t}},1048:(e,t,n)=>{\"use strict\";const r=n(7991),o=n(9318),i=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.hp=c,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if(\"string\"==typeof e)return function(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|g(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return\"number\"!=typeof e.length||J(e.length)?s(0):f(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function l(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function d(e){return l(e),s(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function p(e){if(e>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return H(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return V(e).length;default:if(o)return r?-1:H(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,n);case\"utf8\":case\"utf-8\":return I(this,t,n);case\"ascii\":return _(this,t,n);case\"latin1\":case\"binary\":return C(this,t,n);case\"base64\":return k(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function v(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function b(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(J(r))return a;e[n+a]=r}return a}function A(e,t,n,r){return G(H(t,e.length-n),e,n,r)}function S(e,t,n,r){return G(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return G(V(t),e,n,r)}function x(e,t,n,r){return G(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}(r)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(c.prototype,\"parent\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,\"offset\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?s(e):void 0!==t?\"string\"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(Z(t,Uint8Array))o+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?I(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e=\"\";const n=t.IS;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return b(this,e,t,n);case\"utf8\":case\"utf-8\":return A(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return S(this,e,t,n);case\"base64\":return E(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return x(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function _(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=Y[e[r]];return o}function P(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function N(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function O(e,t,n,r,o){$(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){$(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function z(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q((function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))})),c.prototype.readBigUInt64BE=Q((function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)})),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q((function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Q((function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q((function(e,t=0){return O(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),c.prototype.writeBigUInt64BE=Q((function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Q((function(e,t=0){return O(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),c.prototype.writeBigInt64BE=Q((function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},c.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!c.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const j={};function F(e,t,n){j[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function $(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){K(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,o,i)}function K(e,t){if(\"number\"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function q(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new j.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}F(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),F(\"ERR_INVALID_ARG_TYPE\",(function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`}),TypeError),F(\"ERR_OUT_OF_RANGE\",(function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=D(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function H(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function V(e){return r.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(W,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function G(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function Q(e){return\"undefined\"==typeof BigInt?X:e}function X(){throw new Error(\"BigInt not supported\")}},1112:(e,t,n)=>{var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return\"__lodash_hash_undefined__\"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},1129:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},1182:(e,t,n)=>{var r=n(393),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var d=l;d--;){var f=u[d];if(!(c?f in t:o.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=c;++d<l;){var y=e[f=u[d]],w=t[f];if(i)var v=c?i(w,y,f,t,e,s):i(y,w,f,e,t,s);if(!(void 0===v?y===w||a(y,w,n,i,s):v)){g=!1;break}m||(m=\"constructor\"==f)}if(g&&!m){var b=e.constructor,A=t.constructor;b==A||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof b&&b instanceof b&&\"function\"==typeof A&&A instanceof A||(g=!1)}return s.delete(e),s.delete(t),g}},1187:(e,t,n)=>{var r=n(7379),o=n(547);e.exports=function(e){return\"symbol\"==typeof e||o(e)&&\"[object Symbol]\"==r(e)}},1211:(e,t,n)=>{var r=n(358),o=n(195),i=n(6529);e.exports=function(e){return i(e)?r(e):o(e)}},1340:(e,t,n)=>{var r=n(1386),o=n(4103),i=n(1779),a=n(4162),s=n(7462),c=n(6638);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},1386:(e,t,n)=>{var r=n(2393),o=n(2049),i=n(7144),a=n(7452),s=n(3964);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},1439:(e,t,n)=>{var r=n(5857),o=n(5234),i=n(796);e.exports=function(e){return i(o(e,void 0,r),e+\"\")}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}},1623:(e,t,n)=>{var r=n(8942).Uint8Array;e.exports=r},1779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},1877:e=>{e.exports=function(e){return this.__data__.set(e,\"__lodash_hash_undefined__\"),this}},1935:(e,t,n)=>{var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object Set]\"==r(e)}},1942:(e,t,n)=>{var r=n(528),o=n(1439),i=n(5196),a=n(961),s=n(3142),c=n(6648);e.exports=function(e){return o((function(t){var n=t.length,o=n,u=r.prototype.thru;for(e&&t.reverse();o--;){var l=t[o];if(\"function\"!=typeof l)throw new TypeError(\"Expected a function\");if(u&&!d&&\"wrapper\"==a(l))var d=new r([],!0)}for(o=d?o:n;++o<n;){l=t[o];var f=a(l),h=\"wrapper\"==f?i(l):void 0;d=h&&c(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?d[a(h[0])].apply(d,h[3]):1==l.length&&c(l)?d[f]():d.thru(l)}return function(){var e=arguments,r=e[0];if(d&&1==e.length&&s(r))return d.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}},1950:(e,t,n)=>{var r=n(8942)[\"__core-js_shared__\"];e.exports=r},2049:(e,t,n)=>{var r=n(7034),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},2053:e=>{e.exports=function(e){return e}},2091:(e,t,n)=>{\"use strict\";t.nl=t.x2=void 0;const r=n(9648),o=n(486),i=n(7004),a=n(2249),s=n(3654),c=n(9450);function u(e){if(\"string\"!=typeof e)throw new TypeError(\"Invalid mnemonic type: \"+typeof e);return e.normalize(\"NFKD\")}function l(e){const t=u(e),n=t.split(\" \");if(![12,15,18,21,24].includes(n.length))throw new Error(\"Invalid mnemonic\");return{nfkd:t,words:n}}function d(e){r.default.bytes(e,16,20,24,28,32)}const f=e=>{const t=8-e.length/4;return new Uint8Array([(0,i.sha256)(e)[0]>>t<<t])};function h(e){if(!Array.isArray(e)||2048!==e.length||\"string\"!=typeof e[0])throw new Error(\"Worlist: expected array of 2048 strings\");return e.forEach((e=>{if(\"string\"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)})),c.utils.chain(c.utils.checksum(1,f),c.utils.radix2(11,!0),c.utils.alphabet(e))}function p(e,t){let n;if(\"string\"==typeof e){const{words:r}=l(e);n=h(t).decode(r)}else n=h(t).decode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])));return d(n),n}function g(e,t){d(e);const n=h(t).encode(e).map((e=>t.indexOf(e)));return new Uint8Array(new Uint16Array(n).buffer)}t.x2=p;const m=e=>u(`mnemonic${e}`);function y(e,t){let n;return n=\"string\"==typeof e?(new TextEncoder).encode(l(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])).join(\" \")),n}t.nl=function(e,t,n=\"\"){const r=y(e,t);return(0,o.pbkdf2Async)(a.sha512,r,m(n),{c:2048,dkLen:64})}},2249:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const r=n(3134),o=n(3109),i=n(3654),[a,s]=o.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((e=>BigInt(e)))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends r.SHA2{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:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g]}set(e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t),u[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],n=0|u[e-15],r=o.default.rotrSH(t,n,1)^o.default.rotrSH(t,n,8)^o.default.shrSH(t,n,7),i=o.default.rotrSL(t,n,1)^o.default.rotrSL(t,n,8)^o.default.shrSL(t,n,7),a=0|c[e-2],s=0|u[e-2],l=o.default.rotrSH(a,s,19)^o.default.rotrBH(a,s,61)^o.default.shrSH(a,s,6),d=o.default.rotrSL(a,s,19)^o.default.rotrBL(a,s,61)^o.default.shrSL(a,s,6),f=o.default.add4L(i,d,u[e-7],u[e-16]),h=o.default.add4H(f,r,l,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:n,Al:r,Bh:i,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:g,El:m,Fh:y,Fl:w,Gh:v,Gl:b,Hh:A,Hl:S}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(g,m,14)^o.default.rotrSH(g,m,18)^o.default.rotrBH(g,m,41),E=o.default.rotrSL(g,m,14)^o.default.rotrSL(g,m,18)^o.default.rotrBL(g,m,41),x=g&y^~g&v,k=m&w^~m&b,I=o.default.add5L(S,E,k,s[e],u[e]),T=o.default.add5H(I,A,t,x,a[e],c[e]),_=0|I,C=o.default.rotrSH(n,r,28)^o.default.rotrBH(n,r,34)^o.default.rotrBH(n,r,39),B=o.default.rotrSL(n,r,28)^o.default.rotrBL(n,r,34)^o.default.rotrBL(n,r,39),P=n&i^n&d^i&d,R=r&l^r&f^l&f;A=0|v,S=0|b,v=0|y,b=0|w,y=0|g,w=0|m,({h:g,l:m}=o.default.add(0|h,0|p,0|T,0|_)),h=0|d,p=0|f,d=0|i,f=0|l,i=0|n,l=0|r;const N=o.default.add3L(_,B,R);n=o.default.add3H(N,T,C,P),r=0|N}({h:n,l:r}=o.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|l)),({h:d,l:f}=o.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h,l:p}=o.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:g,l:m}=o.default.add(0|this.Eh,0|this.El,0|g,0|m)),({h:y,l:w}=o.default.add(0|this.Fh,0|this.Fl,0|y,0|w)),({h:v,l:b}=o.default.add(0|this.Gh,0|this.Gl,0|v,0|b)),({h:A,l:S}=o.default.add(0|this.Hh,0|this.Hl,0|A,0|S)),this.set(n,r,i,l,d,f,h,p,g,m,y,w,v,b,A,S)}roundClean(){c.fill(0),u.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)}}t.SHA512=l;class d extends l{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}}class f extends l{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}}class h extends l{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}}t.sha512=(0,i.wrapConstructor)((()=>new l)),t.sha512_224=(0,i.wrapConstructor)((()=>new d)),t.sha512_256=(0,i.wrapConstructor)((()=>new f)),t.sha384=(0,i.wrapConstructor)((()=>new h))},2264:(e,t,n)=>{var r=n(8898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},2291:(e,t,n)=>{var r=n(5650),o=n(5111),i=n(3142),a=n(1187),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if(\"string\"==typeof t)return t;if(i(t))return o(t,e)+\"\";if(a(t))return c?c.call(t):\"\";var n=t+\"\";return\"0\"==n&&1/t==-1/0?\"-0\":n}},2306:(e,t,n)=>{e=n.nmd(e);var r=n(4967),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require(\"util\").types;return e||a&&a.binding&&a.binding(\"util\")}catch(e){}}();e.exports=s},2343:(e,t,n)=>{var r=n(4687),o=n(6123),i=n(7276),a=n(5187),s=n(7267),c=n(3904),u=n(6040);e.exports=function(e,t){return a(e)&&s(t)?c(u(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,3)}}},2393:e=>{e.exports=function(){this.__data__=[],this.size=0}},2443:(e,t,n)=>{var r=n(6912),o=n(4364),i=n(3504),a=n(4216),s=n(6850),c=n(8813),u=n(8942);e.exports=function(e,t,n){var l=o(e);return function o(){for(var d=arguments.length,f=Array(d),h=d,p=s(o);h--;)f[h]=arguments[h];var g=d<3&&f[0]!==p&&f[d-1]!==p?[]:c(f,p);return(d-=g.length)<n?a(e,t,i,o.placeholder,void 0,f,g,void 0,void 0,n-d):r(this&&this!==u&&this instanceof o?l:e,this,f)}}},2478:(e,t,n)=>{var r=n(7250),o=n(9454),i=n(7706);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},2480:(e,t,n)=>{var r=n(8898);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},2532:(e,t,n)=>{var r=n(4715),o=function(){try{var e=r(Object,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}();e.exports=o},2590:(e,t,n)=>{var r=n(9334),o=n(3334);e.exports=function(e){return o(\"function\"==typeof e?e:r(e,1))}},2613:(e,t,n)=>{var r=n(5111),o=n(4354),i=n(3142),a=n(1187),s=n(6493),c=n(6040),u=n(5243);e.exports=function(e){return i(e)?r(e,c):a(e)?[e]:o(s(u(e)))}},2619:e=>{e.exports=function(e){return function(){return e}}},2673:(e,t,n)=>{var r=n(3579),o=n(8055);e.exports=function(e,t,n){return r(o,e,t,n)}},2762:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},2784:(e,t,n)=>{var r=n(1580),o=n(4495),i=n(6131),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,u,l,d,f,h,p=0,g=!1,m=!1,y=!0;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");function w(t){var n=c,r=u;return c=u=void 0,p=t,d=e.apply(r,n)}function v(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-p>=l}function b(){var e=o();if(v(e))return A(e);f=setTimeout(b,function(e){var n=t-(e-h);return m?s(n,l-(e-p)):n}(e))}function A(e){return f=void 0,y&&c?w(e):(c=u=void 0,d)}function S(){var e=o(),n=v(e);if(c=arguments,u=this,h=e,n){if(void 0===f)return function(e){return p=e,f=setTimeout(b,t),g?w(e):d}(h);if(m)return clearTimeout(f),f=setTimeout(b,t),w(h)}return void 0===f&&(f=setTimeout(b,t)),d}return t=i(t)||0,r(n)&&(g=!!n.leading,l=(m=\"maxWait\"in n)?a(i(n.maxWait)||0,t):l,y=\"trailing\"in n?!!n.trailing:y),S.cancel=function(){void 0!==f&&clearTimeout(f),p=0,c=h=u=f=void 0},S.flush=function(){return void 0===f?d:A(o())},S}},2846:(e,t,n)=>{var r=n(9334);e.exports=function(e){return r(e,4)}},2879:(e,t,n)=>{var r=n(1942)();e.exports=r},2945:e=>{var t=/\\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},2991:e=>{e.exports={}},3092:(e,t,n)=>{var r=n(2673)(\"flow\",n(2879));r.placeholder=n(2991),e.exports=r},3103:(e,t,n)=>{var r=n(4715)(n(8942),\"DataView\");e.exports=r},3109:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function i(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:s}=o(e[i],t);[n[i],r[i]]=[a,s]}return[n,r]}t.fromBig=o,t.split=i;const a=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);t.toBig=a;const s=(e,t,n)=>e>>>n;t.shrSH=s;const c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;const u=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=u;const l=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=l;const d=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=d;const f=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=f;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const g=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=g;const m=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=m;const y=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=y;const w=(e,t,n)=>e<<n-32|t>>>64-n;function v(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.rotlBL=w,t.add=v;const b=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=b;const A=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;t.add3H=A;const S=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=S;const E=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;t.add4H=E;const x=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);t.add5L=x;const k=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0;t.add5H=k;const I={fromBig:o,split:i,toBig:a,shrSH:s,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:g,rotlSL:m,rotlBH:y,rotlBL:w,add:v,add3L:b,add3H:A,add4L:S,add4H:E,add5H:k,add5L:x};t.default=I},3134:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SHA2=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){(0,r.exists)(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;r<a;){const s=Math.min(i-this.pos,a-r);if(s!==i)n.set(e.subarray(r,r+s),this.pos),this.pos+=s,r+=s,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,o.createView)(e);for(;i<=a-r;r+=i)this.process(t,r)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.exists)(this),(0,r.output)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const c=(0,o.createView)(e),u=this.outputLen;if(u%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const l=u/4,d=this.get();if(l>d.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.length=r,e.pos=a,e.finished=o,e.destroyed=i,r%t&&e.buffer.set(n),e}}t.SHA2=i},3142:e=>{var t=Array.isArray;e.exports=t},3212:(e,t,n)=>{var r=n(8250),o=n(1877),i=n(8006);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},3282:(e,t,n)=>{var r=n(2762),o=n(8880),i=n(5187),a=n(6040);e.exports=function(e){return i(e)?r(a(e)):o(e)}},3283:(e,t,n)=>{var r=n(6027),o=n(547),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=c},3301:(e,t,n)=>{var r=n(6131),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},3305:(e,t,n)=>{var r=n(4497);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3316:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},3321:(e,t,n)=>{var r=n(7553),o=n(528),i=n(5962),a=n(3142),s=n(547),c=n(3410),u=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof r)){if(e instanceof o)return e;if(u.call(e,\"__wrapped__\"))return c(e)}return new o(e)}l.prototype=i.prototype,l.prototype.constructor=l,e.exports=l},3334:(e,t,n)=>{var r=n(6526),o=n(2343),i=n(2053),a=n(3142),s=n(3282);e.exports=function(e){return\"function\"==typeof e?e:null==e?i:\"object\"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},3410:(e,t,n)=>{var r=n(7553),o=n(528),i=n(4354);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},3422:(e,t,n)=>{var r=n(7073),o=n(6285),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},3476:e=>{e.exports={}},3504:(e,t,n)=>{var r=n(4977),o=n(5755),i=n(3816),a=n(4364),s=n(4216),c=n(6850),u=n(6591),l=n(8813),d=n(8942);e.exports=function e(t,n,f,h,p,g,m,y,w,v){var b=128&n,A=1&n,S=2&n,E=24&n,x=512&n,k=S?void 0:a(t);return function I(){for(var T=arguments.length,_=Array(T),C=T;C--;)_[C]=arguments[C];if(E)var B=c(I),P=i(_,B);if(h&&(_=r(_,h,p,E)),g&&(_=o(_,g,m,E)),T-=P,E&&T<v){var R=l(_,B);return s(t,n,e,I.placeholder,f,_,R,y,w,v-T)}var N=A?f:this,O=S?N[t]:t;return T=_.length,y?_=u(_,y):x&&T>1&&_.reverse(),b&&w<T&&(_.length=w),this&&this!==d&&this instanceof I&&(O=k||a(O)),O.apply(N,_)}}},3526:(e,t,n)=>{var r=n(3142),o=n(5187),i=n(6493),a=n(5243);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},3546:(e,t,n)=>{var r=n(9032),o=n(7979);e.exports=function(e,t){return r(e,o(e),t)}},3565:(e,t)=>{t.aliasToReal={each:\"forEach\",eachRight:\"forEachRight\",entries:\"toPairs\",entriesIn:\"toPairsIn\",extend:\"assignIn\",extendAll:\"assignInAll\",extendAllWith:\"assignInAllWith\",extendWith:\"assignInWith\",first:\"head\",conforms:\"conformsTo\",matches:\"isMatch\",property:\"get\",__:\"placeholder\",F:\"stubFalse\",T:\"stubTrue\",all:\"every\",allPass:\"overEvery\",always:\"constant\",any:\"some\",anyPass:\"overSome\",apply:\"spread\",assoc:\"set\",assocPath:\"set\",complement:\"negate\",compose:\"flowRight\",contains:\"includes\",dissoc:\"unset\",dissocPath:\"unset\",dropLast:\"dropRight\",dropLastWhile:\"dropRightWhile\",equals:\"isEqual\",identical:\"eq\",indexBy:\"keyBy\",init:\"initial\",invertObj:\"invert\",juxt:\"over\",omitAll:\"omit\",nAry:\"ary\",path:\"get\",pathEq:\"matchesProperty\",pathOr:\"getOr\",paths:\"at\",pickAll:\"pick\",pipe:\"flow\",pluck:\"map\",prop:\"get\",propEq:\"matchesProperty\",propOr:\"getOr\",props:\"at\",symmetricDifference:\"xor\",symmetricDifferenceBy:\"xorBy\",symmetricDifferenceWith:\"xorWith\",takeLast:\"takeRight\",takeLastWhile:\"takeRightWhile\",unapply:\"rest\",unnest:\"flatten\",useWith:\"overArgs\",where:\"conformsTo\",whereEq:\"isMatch\",zipObj:\"zipObject\"},t.aryMethod={1:[\"assignAll\",\"assignInAll\",\"attempt\",\"castArray\",\"ceil\",\"create\",\"curry\",\"curryRight\",\"defaultsAll\",\"defaultsDeepAll\",\"floor\",\"flow\",\"flowRight\",\"fromPairs\",\"invert\",\"iteratee\",\"memoize\",\"method\",\"mergeAll\",\"methodOf\",\"mixin\",\"nthArg\",\"over\",\"overEvery\",\"overSome\",\"rest\",\"reverse\",\"round\",\"runInContext\",\"spread\",\"template\",\"trim\",\"trimEnd\",\"trimStart\",\"uniqueId\",\"words\",\"zipAll\"],2:[\"add\",\"after\",\"ary\",\"assign\",\"assignAllWith\",\"assignIn\",\"assignInAllWith\",\"at\",\"before\",\"bind\",\"bindAll\",\"bindKey\",\"chunk\",\"cloneDeepWith\",\"cloneWith\",\"concat\",\"conformsTo\",\"countBy\",\"curryN\",\"curryRightN\",\"debounce\",\"defaults\",\"defaultsDeep\",\"defaultTo\",\"delay\",\"difference\",\"divide\",\"drop\",\"dropRight\",\"dropRightWhile\",\"dropWhile\",\"endsWith\",\"eq\",\"every\",\"filter\",\"find\",\"findIndex\",\"findKey\",\"findLast\",\"findLastIndex\",\"findLastKey\",\"flatMap\",\"flatMapDeep\",\"flattenDepth\",\"forEach\",\"forEachRight\",\"forIn\",\"forInRight\",\"forOwn\",\"forOwnRight\",\"get\",\"groupBy\",\"gt\",\"gte\",\"has\",\"hasIn\",\"includes\",\"indexOf\",\"intersection\",\"invertBy\",\"invoke\",\"invokeMap\",\"isEqual\",\"isMatch\",\"join\",\"keyBy\",\"lastIndexOf\",\"lt\",\"lte\",\"map\",\"mapKeys\",\"mapValues\",\"matchesProperty\",\"maxBy\",\"meanBy\",\"merge\",\"mergeAllWith\",\"minBy\",\"multiply\",\"nth\",\"omit\",\"omitBy\",\"overArgs\",\"pad\",\"padEnd\",\"padStart\",\"parseInt\",\"partial\",\"partialRight\",\"partition\",\"pick\",\"pickBy\",\"propertyOf\",\"pull\",\"pullAll\",\"pullAt\",\"random\",\"range\",\"rangeRight\",\"rearg\",\"reject\",\"remove\",\"repeat\",\"restFrom\",\"result\",\"sampleSize\",\"some\",\"sortBy\",\"sortedIndex\",\"sortedIndexOf\",\"sortedLastIndex\",\"sortedLastIndexOf\",\"sortedUniqBy\",\"split\",\"spreadFrom\",\"startsWith\",\"subtract\",\"sumBy\",\"take\",\"takeRight\",\"takeRightWhile\",\"takeWhile\",\"tap\",\"throttle\",\"thru\",\"times\",\"trimChars\",\"trimCharsEnd\",\"trimCharsStart\",\"truncate\",\"union\",\"uniqBy\",\"uniqWith\",\"unset\",\"unzipWith\",\"without\",\"wrap\",\"xor\",\"zip\",\"zipObject\",\"zipObjectDeep\"],3:[\"assignInWith\",\"assignWith\",\"clamp\",\"differenceBy\",\"differenceWith\",\"findFrom\",\"findIndexFrom\",\"findLastFrom\",\"findLastIndexFrom\",\"getOr\",\"includesFrom\",\"indexOfFrom\",\"inRange\",\"intersectionBy\",\"intersectionWith\",\"invokeArgs\",\"invokeArgsMap\",\"isEqualWith\",\"isMatchWith\",\"flatMapDepth\",\"lastIndexOfFrom\",\"mergeWith\",\"orderBy\",\"padChars\",\"padCharsEnd\",\"padCharsStart\",\"pullAllBy\",\"pullAllWith\",\"rangeStep\",\"rangeStepRight\",\"reduce\",\"reduceRight\",\"replace\",\"set\",\"slice\",\"sortedIndexBy\",\"sortedLastIndexBy\",\"transform\",\"unionBy\",\"unionWith\",\"update\",\"xorBy\",\"xorWith\",\"zipWith\"],4:[\"fill\",\"setWith\",\"updateWith\"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var i=n[o];e.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),t.remap={assignAll:\"assign\",assignAllWith:\"assignWith\",assignInAll:\"assignIn\",assignInAllWith:\"assignInWith\",curryN:\"curry\",curryRightN:\"curryRight\",defaultsAll:\"defaults\",defaultsDeepAll:\"defaultsDeep\",findFrom:\"find\",findIndexFrom:\"findIndex\",findLastFrom:\"findLast\",findLastIndexFrom:\"findLastIndex\",getOr:\"get\",includesFrom:\"includes\",indexOfFrom:\"indexOf\",invokeArgs:\"invoke\",invokeArgsMap:\"invokeMap\",lastIndexOfFrom:\"lastIndexOf\",mergeAll:\"merge\",mergeAllWith:\"mergeWith\",padChars:\"pad\",padCharsEnd:\"padEnd\",padCharsStart:\"padStart\",propertyOf:\"get\",rangeStep:\"range\",rangeStepRight:\"rangeRight\",restFrom:\"rest\",spreadFrom:\"spread\",trimChars:\"trim\",trimCharsEnd:\"trimEnd\",trimCharsStart:\"trimStart\",zipAll:\"zip\"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},3579:(e,t,n)=>{var r=n(3565),o=n(2991),i=Array.prototype.push;function a(e,t){return 2==t?function(t,n){return e(t,n)}:function(t){return e(t)}}function s(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function c(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=t.apply(void 0,r);return e.apply(void 0,r),o}}}e.exports=function e(t,n,u,l){var d=\"function\"==typeof n,f=n===Object(n);if(f&&(l=u,u=n,n=void 0),null==u)throw new TypeError;l||(l={});var h=!(\"cap\"in l)||l.cap,p=!(\"curry\"in l)||l.curry,g=!(\"fixed\"in l)||l.fixed,m=!(\"immutable\"in l)||l.immutable,y=!(\"rearg\"in l)||l.rearg,w=d?u:o,v=\"curry\"in l&&l.curry,b=\"fixed\"in l&&l.fixed,A=\"rearg\"in l&&l.rearg,S=d?u.runInContext():void 0,E=d?u:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},x=E.ary,k=E.assign,I=E.clone,T=E.curry,_=E.forEach,C=E.isArray,B=E.isError,P=E.isFunction,R=E.isWeakMap,N=E.keys,O=E.rearg,U=E.toInteger,M=E.toPath,z=N(r.aryMethod),L={castArray:function(e){return function(){var t=arguments[0];return C(t)?e(s(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[1],n=e(arguments[0],t),r=n.length;return h&&\"number\"==typeof t?(t=t>2?t-2:1,r&&r<=t?n:a(n,t)):n}},mixin:function(e){return function(t){var n=this;if(!P(n))return e(n,Object(t));var r=[];return _(N(t),(function(e){P(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),_(r,(function(e){var t=e[1];P(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:U(t)+1;return T(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return T(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),l)}}};function j(e,t){if(h){var n=r.iterateeRearg[e];if(n)return function(e,t){return q(e,(function(e){var n=t.length;return function(e,t){return 2==t?function(t,n){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}(O(a(e,n),t),n)}))}(t,n);var o=!d&&r.iterateeAry[e];if(o)return function(e,t){return q(e,(function(e){return\"function\"==typeof e?a(e,t):e}))}(t,o)}return t}function F(e,t,n){if(g&&(b||!r.skipFixed[e])){var o=r.methodSpread[e],a=o&&o.start;return void 0===a?x(t,n):function(e,t){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var a=o[t],s=o.slice(0,t);return a&&i.apply(s,a),t!=r&&i.apply(s,o.slice(t+1)),e.apply(this,s)}}(t,a)}return t}function D(e,t,n){return y&&n>1&&(A||!r.skipRearg[e])?O(t,r.methodRearg[e]||r.aryRearg[n]):t}function $(e,t){for(var n=-1,r=(t=M(t)).length,o=r-1,i=I(Object(e)),a=i;null!=a&&++n<r;){var s=t[n],c=a[s];null==c||P(c)||B(c)||R(c)||(a[s]=I(n==o?c:Object(c))),a=a[s]}return i}function K(t,n){var o=r.aliasToReal[t]||t,i=r.remap[o]||o,a=l;return function(t){var r=d?S:E,s=d?S[i]:n,c=k(k({},a),t);return e(r,o,s,c)}}function q(e,t){return function(){var n=arguments.length;if(!n)return e();for(var r=Array(n);n--;)r[n]=arguments[n];var o=y?0:n-1;return r[o]=t(r[o]),e.apply(void 0,r)}}function W(e,t,n){var o,i=r.aliasToReal[e]||e,a=t,u=L[i];return u?a=u(t):m&&(r.mutate.array[i]?a=c(t,s):r.mutate.object[i]?a=c(t,function(e){return function(t){return e({},t)}}(t)):r.mutate.set[i]&&(a=c(t,$))),_(z,(function(e){return _(r.aryMethod[e],(function(t){if(i==t){var n=r.methodSpread[i],s=n&&n.afterRearg;return o=s?F(i,D(i,a,e),e):D(i,F(i,a,e),e),o=function(e,t,n){return v||p&&n>1?T(t,n):t}(0,o=j(i,o),e),!1}})),!o})),o||(o=a),o==t&&(o=v?T(o,1):function(){return t.apply(this,arguments)}),o.convert=K(i,t),o.placeholder=t.placeholder=n,o}if(!f)return W(n,u,w);var H=u,V=[];return _(z,(function(e){_(r.aryMethod[e],(function(e){var t=H[r.remap[e]||e];t&&V.push([e,W(e,t,H)])}))})),_(N(H),(function(e){var t=H[e];if(\"function\"==typeof t){for(var n=V.length;n--;)if(V[n][0]==e)return;t.convert=K(e,t),V.push([e,t])}})),_(V,(function(e){H[e[0]]=e[1]})),H.convert=function(e){return H.runInContext.convert(e)(void 0)},H.placeholder=H,_(N(H),(function(e){_(r.realToAlias[e]||[],(function(t){H[t]=H[e]}))})),H}},3636:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},3650:(e,t,n)=>{var r=n(8244),o=n(5832),i=n(5288);e.exports=function(e){return r(e,i,o)}},3654:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const r=n(4610);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);function o(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error(\"Non little-endian hardware is not supported\");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,\"0\")));t.bytesToHex=function(e){if(!o(e))throw new Error(\"Uint8Array expected\");let t=\"\";for(let n=0;n<e.length;n++)t+=i[e[n]];return t};const a=48,s=57,c=65,u=70,l=97,d=102;function f(e){return e>=a&&e<=s?e-a:e>=c&&e<=u?e-(c-10):e>=l&&e<=d?e-(l-10):void 0}t.hexToBytes=function(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error(\"padded hex string expected, got unpadded hex of length \"+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=f(e.charCodeAt(o)),i=f(e.charCodeAt(o+1));if(void 0===n||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+o)}r[t]=16*n+i}return r};function h(e){if(\"string\"!=typeof e)throw new Error(\"utf8ToBytes expected string, got \"+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function p(e){if(\"string\"==typeof e&&(e=h(e)),!o(e))throw new Error(\"expected Uint8Array, got \"+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let i=0;i<e;i++){r(i);const e=Date.now()-o;e>=0&&e<n||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=h,t.toBytes=p,t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(!o(r))throw new Error(\"Uint8Array expected\");t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n};t.Hash=class{clone(){return this._cloneInto()}};const g={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&\"[object Object]\"!==g.call(t))throw new Error(\"Options should be object or undefined\");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto&&\"function\"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error(\"crypto.getRandomValues must be defined\")}},3655:(e,t,n)=>{var r=n(7379),o=n(1580);e.exports=function(e){if(!o(e))return!1;var t=r(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}},3766:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},3804:(e,t,n)=>{e.exports=n(3092)},3816:e=>{e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},3904:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},3934:(e,t,n)=>{var r=n(3212),o=n(6465),i=n(5568);e.exports=function(e,t,n,a,s,c){var u=1&n,l=e.length,d=t.length;if(l!=d&&!(u&&d>l))return!1;var f=c.get(e),h=c.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<l;){var y=e[p],w=t[p];if(a)var v=u?a(w,y,p,t,e,c):a(y,w,p,e,t,c);if(void 0!==v){if(v)continue;g=!1;break}if(m){if(!o(t,(function(e,t){if(!i(m,t)&&(y===e||s(y,e,n,a,c)))return m.push(t)}))){g=!1;break}}else if(y!==w&&!s(y,w,n,a,c)){g=!1;break}}return c.delete(e),c.delete(t),g}},3943:(e,t,n)=>{var r=n(1935),o=n(9460),i=n(2306),a=i&&i.isSet,s=a?o(a):r;e.exports=s},3964:(e,t,n)=>{var r=n(7034);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}},4103:(e,t,n)=>{var r=n(1386);e.exports=function(){this.__data__=new r,this.size=0}},4162:e=>{e.exports=function(e){return this.__data__.get(e)}},4216:(e,t,n)=>{var r=n(6648),o=n(5512),i=n(5620);e.exports=function(e,t,n,a,s,c,u,l,d,f){var h=8&t;t|=h?32:64,4&(t&=~(h?64:32))||(t&=-4);var p=[e,t,s,h?c:void 0,h?u:void 0,h?void 0:c,h?void 0:u,l,d,f],g=n.apply(void 0,p);return r(e)&&o(g,p),g.placeholder=a,i(g,e,t)}},4255:(e,t,n)=>{var r=n(2673)(\"debounce\",n(2784));r.placeholder=n(2991),e.exports=r},4354:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},4364:(e,t,n)=>{var r=n(9747),o=n(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),i=e.apply(n,t);return o(i)?i:n}}},4367:(e,t,n)=>{var r=n(7267),o=n(1211);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},4495:(e,t,n)=>{var r=n(8942);e.exports=function(){return r.Date.now()}},4497:(e,t,n)=>{var r=n(4715)(Object,\"create\");e.exports=r},4512:(e,t,n)=>{var r=n(4715)(n(8942),\"Set\");e.exports=r},4610:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.crypto=void 0,t.crypto=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0},4687:(e,t,n)=>{var r=n(353),o=n(547);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},4700:(e,t,n)=>{var r=n(9067);e.exports=function(e,t){var n=e.__data__;return r(t)?n[\"string\"==typeof t?\"string\":\"hash\"]:n.map}},4715:(e,t,n)=>{var r=n(9624),o=n(155);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},4732:(e,t,n)=>{var r=n(4700);e.exports=function(e){return r(this,e).has(e)}},4733:(e,t,n)=>{var r=n(9032),o=n(5832);e.exports=function(e,t){return r(e,o(e),t)}},4759:(e,t,n)=>{var r,o=n(1950),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+r:\"\";e.exports=function(e){return!!i&&i in e}},4772:e=>{e.exports=function(){return!1}},4784:(e,t,n)=>{var r=n(3766)(Object.getPrototypeOf,Object);e.exports=r},4832:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.hmac=t.HMAC=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.hash)(e);const n=(0,o.toBytes)(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,r.exists)(this),this.iHash.update(e),this}digestInto(e){(0,r.exists)(this),(0,r.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=i;t.hmac=(e,t,n)=>new i(e,t).update(n).digest(),t.hmac.create=(e,t)=>new i(e,t)},4882:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===(\"function\"==typeof n&&n.prototype||t)}},4943:(e,t,n)=>{var r=n(2053),o=n(6065),i=o?function(e,t){return o.set(e,t),e}:r;e.exports=i},4967:(e,t,n)=>{var r=\"object\"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4977:e=>{var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=r.length,c=-1,u=n.length,l=t(a-s,0),d=Array(u+l),f=!o;++c<u;)d[c]=n[c];for(;++i<s;)(f||i<a)&&(d[r[i]]=e[i]);for(;l--;)d[c++]=e[i++];return d}},5071:(e,t,n)=>{var r=n(4497);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?\"__lodash_hash_undefined__\":t,this}},5098:(e,t,n)=>{var r=n(3305),o=n(9361),i=n(1112),a=n(5276),s=n(5071);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},5111:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},5187:(e,t,n)=>{var r=n(3142),o=n(1187),i=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,a=/^\\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},5196:(e,t,n)=>{var r=n(6065),o=n(9071),i=r?function(e){return r.get(e)}:o;e.exports=i},5234:(e,t,n)=>{var r=n(6912),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),c=Array(s);++a<s;)c[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(c),r(e,this,u)}}},5243:(e,t,n)=>{var r=n(2291);e.exports=function(e){return null==e?\"\":r(e)}},5250:function(e,t,n){var r;e=n.nmd(e),function(){var o,i=\"Expected a function\",a=\"__lodash_hash_undefined__\",s=\"__lodash_placeholder__\",c=16,u=32,l=64,d=128,f=256,h=1/0,p=9007199254740991,g=NaN,m=4294967295,y=[[\"ary\",d],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",c],[\"flip\",512],[\"partial\",u],[\"partialRight\",l],[\"rearg\",f]],w=\"[object Arguments]\",v=\"[object Array]\",b=\"[object Boolean]\",A=\"[object Date]\",S=\"[object Error]\",E=\"[object Function]\",x=\"[object GeneratorFunction]\",k=\"[object Map]\",I=\"[object Number]\",T=\"[object Object]\",_=\"[object Promise]\",C=\"[object RegExp]\",B=\"[object Set]\",P=\"[object String]\",R=\"[object Symbol]\",N=\"[object WeakMap]\",O=\"[object ArrayBuffer]\",U=\"[object DataView]\",M=\"[object Float32Array]\",z=\"[object Float64Array]\",L=\"[object Int8Array]\",j=\"[object Int16Array]\",F=\"[object Int32Array]\",D=\"[object Uint8Array]\",$=\"[object Uint8ClampedArray]\",K=\"[object Uint16Array]\",q=\"[object Uint32Array]\",W=/\\b__p \\+= '';/g,H=/\\b(__p \\+=) '' \\+/g,V=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>\"']/g,J=RegExp(G.source),Y=RegExp(Z.source),Q=/<%-([\\s\\S]+?)%>/g,X=/<%([\\s\\S]+?)%>/g,ee=/<%=([\\s\\S]+?)%>/g,te=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ne=/^\\w*$/,re=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,oe=/[\\\\^$.*+?()[\\]{}|]/g,ie=RegExp(oe.source),ae=/^\\s+/,se=/\\s/,ce=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ue=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,le=/,? & /,de=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,fe=/[()=,{}\\[\\]\\/\\s]/,he=/\\\\(\\\\)?/g,pe=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,ge=/\\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,we=/^\\[object .+?Constructor\\]$/,ve=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\\d*)$/,Ae=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Se=/($^)/,Ee=/['\\n\\r\\u2028\\u2029\\\\]/g,xe=\"\\\\ud800-\\\\udfff\",ke=\"\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\",Ie=\"\\\\u2700-\\\\u27bf\",Te=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",_e=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",Ce=\"\\\\ufe0e\\\\ufe0f\",Be=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",Pe=\"['’]\",Re=\"[\"+xe+\"]\",Ne=\"[\"+Be+\"]\",Oe=\"[\"+ke+\"]\",Ue=\"\\\\d+\",Me=\"[\"+Ie+\"]\",ze=\"[\"+Te+\"]\",Le=\"[^\"+xe+Be+Ue+Ie+Te+_e+\"]\",je=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Fe=\"[^\"+xe+\"]\",De=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",$e=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",Ke=\"[\"+_e+\"]\",qe=\"\\\\u200d\",We=\"(?:\"+ze+\"|\"+Le+\")\",He=\"(?:\"+Ke+\"|\"+Le+\")\",Ve=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",Ge=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",Ze=\"(?:\"+Oe+\"|\"+je+\")\"+\"?\",Je=\"[\"+Ce+\"]?\",Ye=Je+Ze+(\"(?:\"+qe+\"(?:\"+[Fe,De,$e].join(\"|\")+\")\"+Je+Ze+\")*\"),Qe=\"(?:\"+[Me,De,$e].join(\"|\")+\")\"+Ye,Xe=\"(?:\"+[Fe+Oe+\"?\",Oe,De,$e,Re].join(\"|\")+\")\",et=RegExp(Pe,\"g\"),tt=RegExp(Oe,\"g\"),nt=RegExp(je+\"(?=\"+je+\")|\"+Xe+Ye,\"g\"),rt=RegExp([Ke+\"?\"+ze+\"+\"+Ve+\"(?=\"+[Ne,Ke,\"$\"].join(\"|\")+\")\",He+\"+\"+Ge+\"(?=\"+[Ne,Ke+We,\"$\"].join(\"|\")+\")\",Ke+\"?\"+We+\"+\"+Ve,Ke+\"+\"+Ge,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",Ue,Qe].join(\"|\"),\"g\"),ot=RegExp(\"[\"+qe+xe+ke+Ce+\"]\"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=[\"Array\",\"Buffer\",\"DataView\",\"Date\",\"Error\",\"Float32Array\",\"Float64Array\",\"Function\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Map\",\"Math\",\"Object\",\"Promise\",\"RegExp\",\"Set\",\"String\",\"Symbol\",\"TypeError\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"WeakMap\",\"_\",\"clearTimeout\",\"isFinite\",\"parseInt\",\"setTimeout\"],st=-1,ct={};ct[M]=ct[z]=ct[L]=ct[j]=ct[F]=ct[D]=ct[$]=ct[K]=ct[q]=!0,ct[w]=ct[v]=ct[O]=ct[b]=ct[U]=ct[A]=ct[S]=ct[E]=ct[k]=ct[I]=ct[T]=ct[C]=ct[B]=ct[P]=ct[N]=!1;var ut={};ut[w]=ut[v]=ut[O]=ut[U]=ut[b]=ut[A]=ut[M]=ut[z]=ut[L]=ut[j]=ut[F]=ut[k]=ut[I]=ut[T]=ut[C]=ut[B]=ut[P]=ut[R]=ut[D]=ut[$]=ut[K]=ut[q]=!0,ut[S]=ut[E]=ut[N]=!1;var lt={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},dt=parseFloat,ft=parseInt,ht=\"object\"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pt=\"object\"==typeof self&&self&&self.Object===Object&&self,gt=ht||pt||Function(\"return this\")(),mt=t&&!t.nodeType&&t,yt=mt&&e&&!e.nodeType&&e,wt=yt&&yt.exports===mt,vt=wt&&ht.process,bt=function(){try{var e=yt&&yt.require&&yt.require(\"util\").types;return e||vt&&vt.binding&&vt.binding(\"util\")}catch(e){}}(),At=bt&&bt.isArrayBuffer,St=bt&&bt.isDate,Et=bt&&bt.isMap,xt=bt&&bt.isRegExp,kt=bt&&bt.isSet,It=bt&&bt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Bt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Pt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Rt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Nt(e,t){return!!(null==e?0:e.length)&&Kt(e,t,0)>-1}function Ot(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function Mt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function zt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Lt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ft=Vt(\"length\");function Dt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function $t(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Kt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):$t(e,Wt,n)}function qt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Wt(e){return e!=e}function Ht(e,t){var n=null==e?0:e.length;return n?Jt(e,t)/n:g}function Vt(e){return function(t){return null==t?o:t[e]}}function Gt(e){return function(t){return null==e?o:e[t]}}function Zt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Jt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function Yt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Qt(e){return e?e.slice(0,mn(e)+1).replace(ae,\"\"):e}function Xt(e){return function(t){return e(t)}}function en(e,t){return Ut(t,(function(t){return e[t]}))}function tn(e,t){return e.has(t)}function nn(e,t){for(var n=-1,r=e.length;++n<r&&Kt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length;n--&&Kt(t,e[n],0)>-1;);return n}var on=Gt({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"}),an=Gt({\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"});function sn(e){return\"\\\\\"+lt[e]}function cn(e){return ot.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ln(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,i[o++]=n)}return i}function fn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return cn(e)?function(e){var t=nt.lastIndex=0;for(;nt.test(e);)++t;return t}(e):Ft(e)}function gn(e){return cn(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.split(\"\")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var yn=Gt({\"&amp;\":\"&\",\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&#39;\":\"'\"});var wn=function e(t){var n,r=(t=null==t?gt:wn.defaults(gt.Object(),t,wn.pick(gt,at))).Array,se=t.Date,xe=t.Error,ke=t.Function,Ie=t.Math,Te=t.Object,_e=t.RegExp,Ce=t.String,Be=t.TypeError,Pe=r.prototype,Re=ke.prototype,Ne=Te.prototype,Oe=t[\"__core-js_shared__\"],Ue=Re.toString,Me=Ne.hasOwnProperty,ze=0,Le=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+n:\"\",je=Ne.toString,Fe=Ue.call(Te),De=gt._,$e=_e(\"^\"+Ue.call(Me).replace(oe,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),Ke=wt?t.Buffer:o,qe=t.Symbol,We=t.Uint8Array,He=Ke?Ke.allocUnsafe:o,Ve=ln(Te.getPrototypeOf,Te),Ge=Te.create,Ze=Ne.propertyIsEnumerable,Je=Pe.splice,Ye=qe?qe.isConcatSpreadable:o,Qe=qe?qe.iterator:o,Xe=qe?qe.toStringTag:o,nt=function(){try{var e=hi(Te,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}(),ot=t.clearTimeout!==gt.clearTimeout&&t.clearTimeout,lt=se&&se.now!==gt.Date.now&&se.now,ht=t.setTimeout!==gt.setTimeout&&t.setTimeout,pt=Ie.ceil,mt=Ie.floor,yt=Te.getOwnPropertySymbols,vt=Ke?Ke.isBuffer:o,bt=t.isFinite,Ft=Pe.join,Gt=ln(Te.keys,Te),vn=Ie.max,bn=Ie.min,An=se.now,Sn=t.parseInt,En=Ie.random,xn=Pe.reverse,kn=hi(t,\"DataView\"),In=hi(t,\"Map\"),Tn=hi(t,\"Promise\"),_n=hi(t,\"Set\"),Cn=hi(t,\"WeakMap\"),Bn=hi(Te,\"create\"),Pn=Cn&&new Cn,Rn={},Nn=ji(kn),On=ji(In),Un=ji(Tn),Mn=ji(_n),zn=ji(Cn),Ln=qe?qe.prototype:o,jn=Ln?Ln.valueOf:o,Fn=Ln?Ln.toString:o;function Dn(e){if(ns(e)&&!Wa(e)&&!(e instanceof Wn)){if(e instanceof qn)return e;if(Me.call(e,\"__wrapped__\"))return Fi(e)}return new qn(e)}var $n=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Kn(){}function qn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function Jn(e){var t=this.__data__=new Vn(e);this.size=t.size}function Yn(e,t){var n=Wa(e),r=!n&&qa(e),o=!n&&!r&&Za(e),i=!n&&!r&&!o&&ls(e),a=n||r||o||i,s=a?Yt(e.length,Ce):[],c=s.length;for(var u in e)!t&&!Me.call(e,u)||a&&(\"length\"==u||o&&(\"offset\"==u||\"parent\"==u)||i&&(\"buffer\"==u||\"byteLength\"==u||\"byteOffset\"==u)||bi(u,c))||s.push(u);return s}function Qn(e){var t=e.length;return t?e[Zr(0,t-1)]:o}function Xn(e,t){return Mi(Po(e),cr(t,0,e.length))}function er(e){return Mi(Po(e))}function tr(e,t,n){(n!==o&&!Da(e[t],n)||n===o&&!(t in e))&&ar(e,t,n)}function nr(e,t,n){var r=e[t];Me.call(e,t)&&Da(r,n)&&(n!==o||t in e)||ar(e,t,n)}function rr(e,t){for(var n=e.length;n--;)if(Da(e[n][0],t))return n;return-1}function or(e,t,n,r){return hr(e,(function(e,o,i){t(r,e,n(e),i)})),r}function ir(e,t){return e&&Ro(t,Rs(t),e)}function ar(e,t,n){\"__proto__\"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var n=-1,i=t.length,a=r(i),s=null==e;++n<i;)a[n]=s?o:Ts(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!ts(e))return e;var d=Wa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&\"string\"==typeof e[0]&&Me.call(e,\"index\")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Po(e,s)}else{var f=mi(e),h=f==E||f==x;if(Za(e))return ko(e,c);if(f==T||f==w||h&&!i){if(s=u||h?{}:wi(e),!c)return u?function(e,t){return Ro(e,gi(e),t)}(e,function(e,t){return e&&Ro(t,Ns(t),e)}(s,e)):function(e,t){return Ro(e,pi(e),t)}(e,ir(s,e))}else{if(!ut[f])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case O:return Io(e);case b:case A:return new r(+e);case U:return function(e,t){var n=t?Io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case z:case L:case j:case F:case D:case $:case K:case q:return To(e,n);case k:return new r;case I:case P:return new r(e);case C:return function(e){var t=new e.constructor(e.source,ge.exec(e));return t.lastIndex=e.lastIndex,t}(e);case B:return new r;case R:return o=e,jn?Te(jn.call(o)):{}}var o}(e,f,c)}}a||(a=new Jn);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(ur(r,t,n,r,e,a))})):rs(e)&&e.forEach((function(r,o){s.set(o,ur(r,t,n,o,e,a))}));var g=d?o:(l?u?ai:ii:u?Ns:Rs)(e);return Ct(g||e,(function(r,o){g&&(r=e[o=r]),nr(s,o,ur(r,t,n,o,e,a))})),s}function lr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Te(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function dr(e,t,n){if(\"function\"!=typeof e)throw new Be(i);return Ri((function(){e.apply(o,n)}),t)}function fr(e,t,n,r){var o=-1,i=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=Ut(t,Xt(n))),r?(i=Ot,a=!1):t.length>=200&&(i=tn,a=!1,t=new Zn(t));e:for(;++o<s;){var l=e[o],d=null==n?l:n(l);if(l=r||0!==l?l:0,a&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;c.push(l)}else i(t,d,r)||c.push(l)}return c}Dn.templateSettings={escape:Q,evaluate:X,interpolate:ee,variable:\"\",imports:{_:Dn}},Dn.prototype=Kn.prototype,Dn.prototype.constructor=Dn,qn.prototype=$n(Kn.prototype),qn.prototype.constructor=qn,Wn.prototype=$n(Kn.prototype),Wn.prototype.constructor=Wn,Hn.prototype.clear=function(){this.__data__=Bn?Bn(null):{},this.size=0},Hn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hn.prototype.get=function(e){var t=this.__data__;if(Bn){var n=t[e];return n===a?o:n}return Me.call(t,e)?t[e]:o},Hn.prototype.has=function(e){var t=this.__data__;return Bn?t[e]!==o:Me.call(t,e)},Hn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bn&&t===o?a:t,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=rr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Je.call(t,n,1),--this.size,!0)},Vn.prototype.get=function(e){var t=this.__data__,n=rr(t,e);return n<0?o:t[n][1]},Vn.prototype.has=function(e){return rr(this.__data__,e)>-1},Vn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(In||Vn),string:new Hn}},Gn.prototype.delete=function(e){var t=di(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return di(this,e).get(e)},Gn.prototype.has=function(e){return di(this,e).has(e)},Gn.prototype.set=function(e,t){var n=di(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(e){return this.__data__.set(e,a),this},Zn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new Vn,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!In||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var hr=Uo(Ar),pr=Uo(Sr,!0);function gr(e,t){var n=!0;return hr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function mr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(null!=s&&(c===o?s==s&&!us(s):n(s,c)))var c=s,u=a}return u}function yr(e,t){var n=[];return hr(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function wr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=vi),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?wr(s,t-1,n,r,o):Mt(o,s):r||(o[o.length]=s)}return o}var vr=Mo(),br=Mo(!0);function Ar(e,t){return e&&vr(e,t,Rs)}function Sr(e,t){return e&&br(e,t,Rs)}function Er(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function xr(e,t){for(var n=0,r=(t=Ao(t,e)).length;null!=e&&n<r;)e=e[Li(t[n++])];return n&&n==r?e:o}function kr(e,t,n){var r=t(e);return Wa(e)?r:Mt(r,n(e))}function Ir(e){return null==e?e===o?\"[object Undefined]\":\"[object Null]\":Xe&&Xe in Te(e)?function(e){var t=Me.call(e,Xe),n=e[Xe];try{e[Xe]=o;var r=!0}catch(e){}var i=je.call(e);r&&(t?e[Xe]=n:delete e[Xe]);return i}(e):function(e){return je.call(e)}(e)}function Tr(e,t){return e>t}function _r(e,t){return null!=e&&Me.call(e,t)}function Cr(e,t){return null!=e&&t in Te(e)}function Br(e,t,n){for(var i=n?Ot:Nt,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Ut(f,Xt(t))),l=bn(f.length,l),u[c]=!n&&(t||a>=120&&f.length>=120)?new Zn(c&&f):o}f=e[0];var h=-1,p=u[0];e:for(;++h<a&&d.length<l;){var g=f[h],m=t?t(g):g;if(g=n||0!==g?g:0,!(p?tn(p,m):i(d,m,n))){for(c=s;--c;){var y=u[c];if(!(y?tn(y,m):i(e[c],m,n)))continue e}p&&p.push(m),d.push(g)}}return d}function Pr(e,t,n){var r=null==(e=Ci(e,t=Ao(t,e)))?e:e[Li(Yi(t))];return null==r?o:Tt(r,e,n)}function Rr(e){return ns(e)&&Ir(e)==w}function Nr(e,t,n,r,i){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var s=Wa(e),c=Wa(t),u=s?v:mi(e),l=c?v:mi(t),d=(u=u==w?T:u)==T,f=(l=l==w?T:l)==T,h=u==l;if(h&&Za(e)){if(!Za(t))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new Jn),s||ls(e)?ri(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case U:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!i(new We(e),new We(t)));case b:case A:case I:return Da(+e,+t);case S:return e.name==t.name&&e.message==t.message;case C:case P:return e==t+\"\";case k:var s=un;case B:var c=1&r;if(s||(s=fn),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ri(s(e),s(t),r,o,i,a);return a.delete(e),l;case R:if(jn)return jn.call(e)==jn.call(t)}return!1}(e,t,u,n,r,i,a);if(!(1&n)){var p=d&&Me.call(e,\"__wrapped__\"),g=f&&Me.call(t,\"__wrapped__\");if(p||g){var m=p?e.value():e,y=g?t.value():t;return a||(a=new Jn),i(m,y,n,r,a)}}if(!h)return!1;return a||(a=new Jn),function(e,t,n,r,i,a){var s=1&n,c=ii(e),u=c.length,l=ii(t),d=l.length;if(u!=d&&!s)return!1;var f=u;for(;f--;){var h=c[f];if(!(s?h in t:Me.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var y=s;for(;++f<u;){var w=e[h=c[f]],v=t[h];if(r)var b=s?r(v,w,h,t,e,a):r(w,v,h,e,t,a);if(!(b===o?w===v||i(w,v,n,r,a):b)){m=!1;break}y||(y=\"constructor\"==h)}if(m&&!y){var A=e.constructor,S=t.constructor;A==S||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof A&&A instanceof A&&\"function\"==typeof S&&S instanceof S||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,i,a)}(e,t,n,r,Nr,i))}function Or(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=Te(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<a;){var u=(c=n[i])[0],l=e[u],d=c[1];if(s&&c[2]){if(l===o&&!(u in e))return!1}else{var f=new Jn;if(r)var h=r(l,d,u,e,t,f);if(!(h===o?Nr(d,l,3,r,f):h))return!1}}return!0}function Ur(e){return!(!ts(e)||(t=e,Le&&Le in t))&&(Qa(e)?$e:we).test(ji(e));var t}function Mr(e){return\"function\"==typeof e?e:null==e?oc:\"object\"==typeof e?Wa(e)?$r(e[0],e[1]):Dr(e):hc(e)}function zr(e){if(!ki(e))return Gt(e);var t=[];for(var n in Te(e))Me.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}function Lr(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Te(e))t.push(n);return t}(e);var t=ki(e),n=[];for(var r in e)(\"constructor\"!=r||!t&&Me.call(e,r))&&n.push(r);return n}function jr(e,t){return e<t}function Fr(e,t){var n=-1,o=Va(e)?r(e.length):[];return hr(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Dr(e){var t=fi(e);return 1==t.length&&t[0][2]?Ti(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function $r(e,t){return Si(e)&&Ii(t)?Ti(Li(e),t):function(n){var r=Ts(n,e);return r===o&&r===t?_s(n,e):Nr(t,r,3)}}function Kr(e,t,n,r,i){e!==t&&vr(t,(function(a,s){if(i||(i=new Jn),ts(a))!function(e,t,n,r,i,a,s){var c=Bi(e,n),u=Bi(t,n),l=s.get(u);if(l)return void tr(e,n,l);var d=a?a(c,u,n+\"\",e,t,s):o,f=d===o;if(f){var h=Wa(u),p=!h&&Za(u),g=!h&&!p&&ls(u);d=u,h||p||g?Wa(c)?d=c:Ga(c)?d=Po(c):p?(f=!1,d=ko(u,!0)):g?(f=!1,d=To(u,!0)):d=[]:is(u)||qa(u)?(d=c,qa(c)?d=ws(c):ts(c)&&!Qa(c)||(d=wi(u))):f=!1}f&&(s.set(u,d),i(d,u,r,a,s),s.delete(u));tr(e,n,d)}(e,t,s,n,Kr,r,i);else{var c=r?r(Bi(e,s),a,s+\"\",e,t,i):o;c===o&&(c=a),tr(e,s,c)}}),Ns)}function qr(e,t){var n=e.length;if(n)return bi(t+=t<0?n:0,n)?e[t]:o}function Wr(e,t,n){t=t.length?Ut(t,(function(e){return Wa(e)?function(t){return xr(t,1===e.length?e[0]:e)}:e})):[oc];var r=-1;t=Ut(t,Xt(li()));var o=Fr(e,(function(e,n,o){var i=Ut(t,(function(t){return t(e)}));return{criteria:i,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(o,(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;for(;++r<a;){var c=_o(o[r],i[r]);if(c)return r>=s?c:c*(\"desc\"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Hr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],s=xr(e,a);n(s,a)&&eo(i,Ao(a,e),s)}return i}function Vr(e,t,n,r){var o=r?qt:Kt,i=-1,a=t.length,s=e;for(e===t&&(t=Po(t)),n&&(s=Ut(e,Xt(n)));++i<a;)for(var c=0,u=t[i],l=n?n(u):u;(c=o(s,l,c,r))>-1;)s!==e&&Je.call(s,c,1),Je.call(e,c,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;bi(o)?Je.call(e,o,1):ho(e,o)}}return e}function Zr(e,t){return e+mt(En()*(t-e+1))}function Jr(e,t){var n=\"\";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Yr(e,t){return Ni(_i(e,t,oc),e+\"\")}function Qr(e){return Qn(Ds(e))}function Xr(e,t){var n=Ds(e);return Mi(n,cr(t,0,n.length))}function eo(e,t,n,r){if(!ts(e))return e;for(var i=-1,a=(t=Ao(t,e)).length,s=a-1,c=e;null!=c&&++i<a;){var u=Li(t[i]),l=n;if(\"__proto__\"===u||\"constructor\"===u||\"prototype\"===u)return e;if(i!=s){var d=c[u];(l=r?r(d,u,c):o)===o&&(l=ts(d)?d:bi(t[i+1])?[]:{})}nr(c,u,l),c=c[u]}return e}var to=Pn?function(e,t){return Pn.set(e,t),e}:oc,no=nt?function(e,t){return nt(e,\"toString\",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(e){return Mi(Ds(e))}function oo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function io(e,t){var n;return hr(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function ao(e,t,n){var r=0,o=null==e?r:e.length;if(\"number\"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!us(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return so(e,t,oc,n)}function so(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=us(t),l=t===o;i<a;){var d=mt((i+a)/2),f=n(e[d]),h=f!==o,p=null===f,g=f==f,m=us(f);if(s)var y=r||g;else y=l?g&&(r||h):c?g&&h&&(r||!p):u?g&&h&&!p&&(r||!m):!p&&!m&&(r?f<=t:f<t);y?i=d+1:a=d}return bn(a,4294967294)}function co(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Da(s,c)){var c=s;i[o++]=0===a?0:a}}return i}function uo(e){return\"number\"==typeof e?e:us(e)?g:+e}function lo(e){if(\"string\"==typeof e)return e;if(Wa(e))return Ut(e,lo)+\"\";if(us(e))return Fn?Fn.call(e):\"\";var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function fo(e,t,n){var r=-1,o=Nt,i=e.length,a=!0,s=[],c=s;if(n)a=!1,o=Ot;else if(i>=200){var u=t?null:Yo(e);if(u)return fn(u);a=!1,o=tn,c=new Zn}else c=t?[]:s;e:for(;++r<i;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,a&&d==d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),s.push(l)}else o(c,d,n)||(c!==s&&c.push(d),s.push(l))}return s}function ho(e,t){return null==(e=Ci(e,t=Ao(t,e)))||delete e[Li(Yi(t))]}function po(e,t,n,r){return eo(e,t,n(xr(e,t)),r)}function go(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?oo(e,r?0:i,r?i+1:o):oo(e,r?i+1:0,r?o:i)}function mo(e,t){var n=e;return n instanceof Wn&&(n=n.value()),zt(t,(function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))}),n)}function yo(e,t,n){var o=e.length;if(o<2)return o?fo(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var s=e[i],c=-1;++c<o;)c!=i&&(a[i]=fr(a[i]||s,e[c],t,n));return fo(wr(a,1),t,n)}function wo(e,t,n){for(var r=-1,i=e.length,a=t.length,s={};++r<i;){var c=r<a?t[r]:o;n(s,e[r],c)}return s}function vo(e){return Ga(e)?e:[]}function bo(e){return\"function\"==typeof e?e:oc}function Ao(e,t){return Wa(e)?e:Si(e,t)?[e]:zi(vs(e))}var So=Yr;function Eo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:oo(e,t,n)}var xo=ot||function(e){return gt.clearTimeout(e)};function ko(e,t){if(t)return e.slice();var n=e.length,r=He?He(n):new e.constructor(n);return e.copy(r),r}function Io(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function To(e,t){var n=t?Io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _o(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=us(e),s=t!==o,c=null===t,u=t==t,l=us(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}function Co(e,t,n,o){for(var i=-1,a=e.length,s=n.length,c=-1,u=t.length,l=vn(a-s,0),d=r(u+l),f=!o;++c<u;)d[c]=t[c];for(;++i<s;)(f||i<a)&&(d[n[i]]=e[i]);for(;l--;)d[c++]=e[i++];return d}function Bo(e,t,n,o){for(var i=-1,a=e.length,s=-1,c=n.length,u=-1,l=t.length,d=vn(a-c,0),f=r(d+l),h=!o;++i<d;)f[i]=e[i];for(var p=i;++u<l;)f[p+u]=t[u];for(;++s<c;)(h||i<a)&&(f[p+n[s]]=e[i++]);return f}function Po(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Ro(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=r?r(n[c],e[c],c,n,e):o;u===o&&(u=e[c]),i?ar(n,c,u):nr(n,c,u)}return n}function No(e,t){return function(n,r){var o=Wa(n)?_t:or,i=t?t():{};return o(n,e,li(r,2),i)}}function Oo(e){return Yr((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&\"function\"==typeof a?(i--,a):o,s&&Ai(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=Te(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t}))}function Uo(e,t){return function(n,r){if(null==n)return n;if(!Va(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Te(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Mo(e){return function(t,n,r){for(var o=-1,i=Te(t),a=r(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===n(i[c],c,i))break}return t}}function zo(e){return function(t){var n=cn(t=vs(t))?gn(t):o,r=n?n[0]:t.charAt(0),i=n?Eo(n,1).join(\"\"):t.slice(1);return r[e]()+i}}function Lo(e){return function(t){return zt(Qs(qs(t).replace(et,\"\")),e,\"\")}}function jo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=$n(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function Fo(e){return function(t,n,r){var i=Te(t);if(!Va(t)){var a=li(n,3);t=Rs(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:o}}function Do(e){return oi((function(t){var n=t.length,r=n,a=qn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if(\"function\"!=typeof s)throw new Be(i);if(a&&!c&&\"wrapper\"==ci(s))var c=new qn([],!0)}for(r=c?r:n;++r<n;){var u=ci(s=t[r]),l=\"wrapper\"==u?si(s):o;c=l&&Ei(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[ci(l[0])].apply(c,l[3]):1==s.length&&Ei(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Wa(r))return c.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function $o(e,t,n,i,a,s,c,u,l,f){var h=t&d,p=1&t,g=2&t,m=24&t,y=512&t,w=g?o:jo(e);return function d(){for(var v=arguments.length,b=r(v),A=v;A--;)b[A]=arguments[A];if(m)var S=ui(d),E=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(i&&(b=Co(b,i,a,m)),s&&(b=Bo(b,s,c,m)),v-=E,m&&v<f){var x=dn(b,S);return Zo(e,t,$o,d.placeholder,n,b,x,u,l,f-v)}var k=p?n:this,I=g?k[e]:e;return v=b.length,u?b=function(e,t){var n=e.length,r=bn(t.length,n),i=Po(e);for(;r--;){var a=t[r];e[r]=bi(a,n)?i[a]:o}return e}(b,u):y&&v>1&&b.reverse(),h&&l<v&&(b.length=l),this&&this!==gt&&this instanceof d&&(I=w||jo(I)),I.apply(k,b)}}function Ko(e,t){return function(n,r){return function(e,t,n,r){return Ar(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function qo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;\"string\"==typeof n||\"string\"==typeof r?(n=lo(n),r=lo(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Wo(e){return oi((function(t){return t=Ut(t,Xt(li())),Yr((function(n){var r=this;return e(t,(function(e){return Tt(e,r,n)}))}))}))}function Ho(e,t){var n=(t=t===o?\" \":lo(t)).length;if(n<2)return n?Jr(t,e):t;var r=Jr(t,pt(e/pn(t)));return cn(t)?Eo(gn(r),0,e).join(\"\"):r.slice(0,e)}function Vo(e){return function(t,n,i){return i&&\"number\"!=typeof i&&Ai(t,n,i)&&(n=i=o),t=ps(t),n===o?(n=t,t=0):n=ps(n),function(e,t,n,o){for(var i=-1,a=vn(pt((t-e)/(n||1)),0),s=r(a);a--;)s[o?a:++i]=e,e+=n;return s}(t,n,i=i===o?t<n?1:-1:ps(i),e)}}function Go(e){return function(t,n){return\"string\"==typeof t&&\"string\"==typeof n||(t=ys(t),n=ys(n)),e(t,n)}}function Zo(e,t,n,r,i,a,s,c,d,f){var h=8&t;t|=h?u:l,4&(t&=~(h?l:u))||(t&=-4);var p=[e,t,i,h?a:o,h?s:o,h?o:a,h?o:s,c,d,f],g=n.apply(o,p);return Ei(e)&&Pi(g,p),g.placeholder=r,Oi(g,e,t)}function Jo(e){var t=Ie[e];return function(e,n){if(e=ys(e),(n=null==n?0:bn(gs(n),292))&&bt(e)){var r=(vs(e)+\"e\").split(\"e\");return+((r=(vs(t(r[0]+\"e\"+(+r[1]+n)))+\"e\").split(\"e\"))[0]+\"e\"+(+r[1]-n))}return t(e)}}var Yo=_n&&1/fn(new _n([,-0]))[1]==h?function(e){return new _n(e)}:uc;function Qo(e){return function(t){var n=mi(t);return n==k?un(t):n==B?hn(t):function(e,t){return Ut(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Xo(e,t,n,a,h,p,g,m){var y=2&t;if(!y&&\"function\"!=typeof e)throw new Be(i);var w=a?a.length:0;if(w||(t&=-97,a=h=o),g=g===o?g:vn(gs(g),0),m=m===o?m:gs(m),w-=h?h.length:0,t&l){var v=a,b=h;a=h=o}var A=y?o:si(e),S=[e,t,n,a,h,v,b,p,g,m];if(A&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==d&&8==n||r==d&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?Co(u,c,t[4]):c,e[4]=u?dn(e[3],s):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Bo(u,c,t[6]):c,e[6]=u?dn(e[5],s):t[6]);(c=t[7])&&(e[7]=c);r&d&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(S,A),e=S[0],t=S[1],n=S[2],a=S[3],h=S[4],!(m=S[9]=S[9]===o?y?0:e.length:vn(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||t==c?function(e,t,n){var i=jo(e);return function a(){for(var s=arguments.length,c=r(s),u=s,l=ui(a);u--;)c[u]=arguments[u];var d=s<3&&c[0]!==l&&c[s-1]!==l?[]:dn(c,l);return(s-=d.length)<n?Zo(e,t,$o,a.placeholder,o,c,d,o,o,n-s):Tt(this&&this!==gt&&this instanceof a?i:e,this,c)}}(e,t,m):t!=u&&33!=t||h.length?$o.apply(o,S):function(e,t,n,o){var i=1&t,a=jo(e);return function t(){for(var s=-1,c=arguments.length,u=-1,l=o.length,d=r(l+c),f=this&&this!==gt&&this instanceof t?a:e;++u<l;)d[u]=o[u];for(;c--;)d[u++]=arguments[++s];return Tt(f,i?n:this,d)}}(e,t,n,a);else var E=function(e,t,n){var r=1&t,o=jo(e);return function t(){return(this&&this!==gt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return Oi((A?to:Pi)(E,S),e,t)}function ei(e,t,n,r){return e===o||Da(e,Ne[n])&&!Me.call(r,n)?t:e}function ti(e,t,n,r,i,a){return ts(e)&&ts(t)&&(a.set(t,e),Kr(e,t,o,ti,a),a.delete(t)),e}function ni(e){return is(e)?o:e}function ri(e,t,n,r,i,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(e),d=a.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new Zn:o;for(a.set(e,t),a.set(t,e);++f<c;){var g=e[f],m=t[f];if(r)var y=s?r(m,g,f,t,e,a):r(g,m,f,e,t,a);if(y!==o){if(y)continue;h=!1;break}if(p){if(!jt(t,(function(e,t){if(!tn(p,t)&&(g===e||i(g,e,n,r,a)))return p.push(t)}))){h=!1;break}}else if(g!==m&&!i(g,m,n,r,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function oi(e){return Ni(_i(e,o,Hi),e+\"\")}function ii(e){return kr(e,Rs,pi)}function ai(e){return kr(e,Ns,gi)}var si=Pn?function(e){return Pn.get(e)}:uc;function ci(e){for(var t=e.name+\"\",n=Rn[t],r=Me.call(Rn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(Me.call(Dn,\"placeholder\")?Dn:e).placeholder}function li(){var e=Dn.iteratee||ic;return e=e===ic?Mr:e,arguments.length?e(arguments[0],arguments[1]):e}function di(e,t){var n=e.__data__;return function(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}(t)?n[\"string\"==typeof t?\"string\":\"hash\"]:n.map}function fi(e){for(var t=Rs(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ii(o)]}return t}function hi(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Ur(n)?n:o}var pi=yt?function(e){return null==e?[]:(e=Te(e),Rt(yt(e),(function(t){return Ze.call(e,t)})))}:mc,gi=yt?function(e){for(var t=[];e;)Mt(t,pi(e)),e=Ve(e);return t}:mc,mi=Ir;function yi(e,t,n){for(var r=-1,o=(t=Ao(t,e)).length,i=!1;++r<o;){var a=Li(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&es(o)&&bi(a,o)&&(Wa(e)||qa(e))}function wi(e){return\"function\"!=typeof e.constructor||ki(e)?{}:$n(Ve(e))}function vi(e){return Wa(e)||qa(e)||!!(Ye&&e&&e[Ye])}function bi(e,t){var n=typeof e;return!!(t=null==t?p:t)&&(\"number\"==n||\"symbol\"!=n&&be.test(e))&&e>-1&&e%1==0&&e<t}function Ai(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!(\"number\"==r?Va(n)&&bi(t,n.length):\"string\"==r&&t in n)&&Da(n[t],e)}function Si(e,t){if(Wa(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in Te(t))}function Ei(e){var t=ci(e),n=Dn[t];if(\"function\"!=typeof n||!(t in Wn.prototype))return!1;if(e===n)return!0;var r=si(n);return!!r&&e===r[0]}(kn&&mi(new kn(new ArrayBuffer(1)))!=U||In&&mi(new In)!=k||Tn&&mi(Tn.resolve())!=_||_n&&mi(new _n)!=B||Cn&&mi(new Cn)!=N)&&(mi=function(e){var t=Ir(e),n=t==T?e.constructor:o,r=n?ji(n):\"\";if(r)switch(r){case Nn:return U;case On:return k;case Un:return _;case Mn:return B;case zn:return N}return t});var xi=Oe?Qa:yc;function ki(e){var t=e&&e.constructor;return e===(\"function\"==typeof t&&t.prototype||Ne)}function Ii(e){return e==e&&!ts(e)}function Ti(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in Te(n)))}}function _i(e,t,n){return t=vn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=vn(o.length-t,0),s=r(a);++i<a;)s[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(s),Tt(e,this,c)}}function Ci(e,t){return t.length<2?e:xr(e,oo(t,0,-1))}function Bi(e,t){if((\"constructor\"!==t||\"function\"!=typeof e[t])&&\"__proto__\"!=t)return e[t]}var Pi=Ui(to),Ri=ht||function(e,t){return gt.setTimeout(e,t)},Ni=Ui(no);function Oi(e,t,n){var r=t+\"\";return Ni(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?\"& \":\"\")+t[r],t=t.join(n>2?\", \":\" \"),e.replace(ce,\"{\\n/* [wrapped with \"+t+\"] */\\n\")}(r,function(e,t){return Ct(y,(function(n){var r=\"_.\"+n[0];t&n[1]&&!Nt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function Ui(e){var t=0,n=0;return function(){var r=An(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Mi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Zr(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var zi=function(e){var t=Ua(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(re,(function(e,n,r,o){t.push(r?o.replace(he,\"$1\"):n||e)})),t}));function Li(e){if(\"string\"==typeof e||us(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function ji(e){if(null!=e){try{return Ue.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}function Fi(e){if(e instanceof Wn)return e.clone();var t=new qn(e.__wrapped__,e.__chain__);return t.__actions__=Po(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=Yr((function(e,t){return Ga(e)?fr(e,wr(t,1,Ga,!0)):[]})),$i=Yr((function(e,t){var n=Yi(t);return Ga(n)&&(n=o),Ga(e)?fr(e,wr(t,1,Ga,!0),li(n,2)):[]})),Ki=Yr((function(e,t){var n=Yi(t);return Ga(n)&&(n=o),Ga(e)?fr(e,wr(t,1,Ga,!0),o,n):[]}));function qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:gs(n);return o<0&&(o=vn(r+o,0)),$t(e,li(t,3),o)}function Wi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=gs(n),i=n<0?vn(r+i,0):bn(i,r-1)),$t(e,li(t,3),i,!0)}function Hi(e){return(null==e?0:e.length)?wr(e,1):[]}function Vi(e){return e&&e.length?e[0]:o}var Gi=Yr((function(e){var t=Ut(e,vo);return t.length&&t[0]===e[0]?Br(t):[]})),Zi=Yr((function(e){var t=Yi(e),n=Ut(e,vo);return t===Yi(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Br(n,li(t,2)):[]})),Ji=Yr((function(e){var t=Yi(e),n=Ut(e,vo);return(t=\"function\"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Br(n,o,t):[]}));function Yi(e){var t=null==e?0:e.length;return t?e[t-1]:o}var Qi=Yr(Xi);function Xi(e,t){return e&&e.length&&t&&t.length?Vr(e,t):e}var ea=oi((function(e,t){var n=null==e?0:e.length,r=sr(e,t);return Gr(e,Ut(t,(function(e){return bi(e,n)?+e:e})).sort(_o)),r}));function ta(e){return null==e?e:xn.call(e)}var na=Yr((function(e){return fo(wr(e,1,Ga,!0))})),ra=Yr((function(e){var t=Yi(e);return Ga(t)&&(t=o),fo(wr(e,1,Ga,!0),li(t,2))})),oa=Yr((function(e){var t=Yi(e);return t=\"function\"==typeof t?t:o,fo(wr(e,1,Ga,!0),o,t)}));function ia(e){if(!e||!e.length)return[];var t=0;return e=Rt(e,(function(e){if(Ga(e))return t=vn(e.length,t),!0})),Yt(t,(function(t){return Ut(e,Vt(t))}))}function aa(e,t){if(!e||!e.length)return[];var n=ia(e);return null==t?n:Ut(n,(function(e){return Tt(t,o,e)}))}var sa=Yr((function(e,t){return Ga(e)?fr(e,t):[]})),ca=Yr((function(e){return yo(Rt(e,Ga))})),ua=Yr((function(e){var t=Yi(e);return Ga(t)&&(t=o),yo(Rt(e,Ga),li(t,2))})),la=Yr((function(e){var t=Yi(e);return t=\"function\"==typeof t?t:o,yo(Rt(e,Ga),o,t)})),da=Yr(ia);var fa=Yr((function(e){var t=e.length,n=t>1?e[t-1]:o;return n=\"function\"==typeof n?(e.pop(),n):o,aa(e,n)}));function ha(e){var t=Dn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ga=oi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Wn&&bi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[i],thisArg:o}),new qn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var ma=No((function(e,t,n){Me.call(e,n)?++e[n]:ar(e,n,1)}));var ya=Fo(qi),wa=Fo(Wi);function va(e,t){return(Wa(e)?Ct:hr)(e,li(t,3))}function ba(e,t){return(Wa(e)?Bt:pr)(e,li(t,3))}var Aa=No((function(e,t,n){Me.call(e,n)?e[n].push(t):ar(e,n,[t])}));var Sa=Yr((function(e,t,n){var o=-1,i=\"function\"==typeof t,a=Va(e)?r(e.length):[];return hr(e,(function(e){a[++o]=i?Tt(t,e,n):Pr(e,t,n)})),a})),Ea=No((function(e,t,n){ar(e,n,t)}));function xa(e,t){return(Wa(e)?Ut:Fr)(e,li(t,3))}var ka=No((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Yr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ai(e,t[0],t[1])?t=[]:n>2&&Ai(t[0],t[1],t[2])&&(t=[t[0]]),Wr(e,wr(t,1),[])})),Ta=lt||function(){return gt.Date.now()};function _a(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Xo(e,d,o,o,o,o,t)}function Ca(e,t){var n;if(\"function\"!=typeof t)throw new Be(i);return e=gs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Ba=Yr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Ba));r|=u}return Xo(e,r,t,n,o)})),Pa=Yr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Pa));r|=u}return Xo(t,r,e,n,o)}));function Ra(e,t,n){var r,a,s,c,u,l,d=0,f=!1,h=!1,p=!0;if(\"function\"!=typeof e)throw new Be(i);function g(t){var n=r,i=a;return r=a=o,d=t,c=e.apply(i,n)}function m(e){var n=e-l;return l===o||n>=t||n<0||h&&e-d>=s}function y(){var e=Ta();if(m(e))return w(e);u=Ri(y,function(e){var n=t-(e-l);return h?bn(n,s-(e-d)):n}(e))}function w(e){return u=o,p&&r?g(e):(r=a=o,c)}function v(){var e=Ta(),n=m(e);if(r=arguments,a=this,l=e,n){if(u===o)return function(e){return d=e,u=Ri(y,t),f?g(e):c}(l);if(h)return xo(u),u=Ri(y,t),g(l)}return u===o&&(u=Ri(y,t)),c}return t=ys(t)||0,ts(n)&&(f=!!n.leading,s=(h=\"maxWait\"in n)?vn(ys(n.maxWait)||0,t):s,p=\"trailing\"in n?!!n.trailing:p),v.cancel=function(){u!==o&&xo(u),d=0,r=l=a=u=o},v.flush=function(){return u===o?c:w(Ta())},v}var Na=Yr((function(e,t){return dr(e,1,t)})),Oa=Yr((function(e,t,n){return dr(e,ys(t)||0,n)}));function Ua(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new Be(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ua.Cache||Gn),n}function Ma(e){if(\"function\"!=typeof e)throw new Be(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ua.Cache=Gn;var za=So((function(e,t){var n=(t=1==t.length&&Wa(t[0])?Ut(t[0],Xt(li())):Ut(wr(t,1),Xt(li()))).length;return Yr((function(r){for(var o=-1,i=bn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Tt(e,this,r)}))})),La=Yr((function(e,t){var n=dn(t,ui(La));return Xo(e,u,o,t,n)})),ja=Yr((function(e,t){var n=dn(t,ui(ja));return Xo(e,l,o,t,n)})),Fa=oi((function(e,t){return Xo(e,f,o,o,o,t)}));function Da(e,t){return e===t||e!=e&&t!=t}var $a=Go(Tr),Ka=Go((function(e,t){return e>=t})),qa=Rr(function(){return arguments}())?Rr:function(e){return ns(e)&&Me.call(e,\"callee\")&&!Ze.call(e,\"callee\")},Wa=r.isArray,Ha=At?Xt(At):function(e){return ns(e)&&Ir(e)==O};function Va(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return ns(e)&&Va(e)}var Za=vt||yc,Ja=St?Xt(St):function(e){return ns(e)&&Ir(e)==A};function Ya(e){if(!ns(e))return!1;var t=Ir(e);return t==S||\"[object DOMException]\"==t||\"string\"==typeof e.message&&\"string\"==typeof e.name&&!is(e)}function Qa(e){if(!ts(e))return!1;var t=Ir(e);return t==E||t==x||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}function Xa(e){return\"number\"==typeof e&&e==gs(e)}function es(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=p}function ts(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}function ns(e){return null!=e&&\"object\"==typeof e}var rs=Et?Xt(Et):function(e){return ns(e)&&mi(e)==k};function os(e){return\"number\"==typeof e||ns(e)&&Ir(e)==I}function is(e){if(!ns(e)||Ir(e)!=T)return!1;var t=Ve(e);if(null===t)return!0;var n=Me.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&Ue.call(n)==Fe}var as=xt?Xt(xt):function(e){return ns(e)&&Ir(e)==C};var ss=kt?Xt(kt):function(e){return ns(e)&&mi(e)==B};function cs(e){return\"string\"==typeof e||!Wa(e)&&ns(e)&&Ir(e)==P}function us(e){return\"symbol\"==typeof e||ns(e)&&Ir(e)==R}var ls=It?Xt(It):function(e){return ns(e)&&es(e.length)&&!!ct[Ir(e)]};var ds=Go(jr),fs=Go((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Va(e))return cs(e)?gn(e):Po(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=mi(e);return(t==k?un:t==B?fn:Ds)(e)}function ps(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=ps(e),n=t%1;return t==t?n?t-n:t:0}function ms(e){return e?cr(gs(e),0,m):0}function ys(e){if(\"number\"==typeof e)return e;if(us(e))return g;if(ts(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=Qt(e);var n=ye.test(e);return n||ve.test(e)?ft(e.slice(2),n?2:8):me.test(e)?g:+e}function ws(e){return Ro(e,Ns(e))}function vs(e){return null==e?\"\":lo(e)}var bs=Oo((function(e,t){if(ki(t)||Va(t))Ro(t,Rs(t),e);else for(var n in t)Me.call(t,n)&&nr(e,n,t[n])})),As=Oo((function(e,t){Ro(t,Ns(t),e)})),Ss=Oo((function(e,t,n,r){Ro(t,Ns(t),e,r)})),Es=Oo((function(e,t,n,r){Ro(t,Rs(t),e,r)})),xs=oi(sr);var ks=Yr((function(e,t){e=Te(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&Ai(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=Ns(a),c=-1,u=s.length;++c<u;){var l=s[c],d=e[l];(d===o||Da(d,Ne[l])&&!Me.call(e,l))&&(e[l]=a[l])}return e})),Is=Yr((function(e){return e.push(o,ti),Tt(Us,o,e)}));function Ts(e,t,n){var r=null==e?o:xr(e,t);return r===o?n:r}function _s(e,t){return null!=e&&yi(e,t,Cr)}var Cs=Ko((function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=je.call(t)),e[t]=n}),tc(oc)),Bs=Ko((function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=je.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]}),li),Ps=Yr(Pr);function Rs(e){return Va(e)?Yn(e):zr(e)}function Ns(e){return Va(e)?Yn(e,!0):Lr(e)}var Os=Oo((function(e,t,n){Kr(e,t,n)})),Us=Oo((function(e,t,n,r){Kr(e,t,n,r)})),Ms=oi((function(e,t){var n={};if(null==e)return n;var r=!1;t=Ut(t,(function(t){return t=Ao(t,e),r||(r=t.length>1),t})),Ro(e,ai(e),n),r&&(n=ur(n,7,ni));for(var o=t.length;o--;)ho(n,t[o]);return n}));var zs=oi((function(e,t){return null==e?{}:function(e,t){return Hr(e,t,(function(t,n){return _s(e,n)}))}(e,t)}));function Ls(e,t){if(null==e)return{};var n=Ut(ai(e),(function(e){return[e]}));return t=li(t),Hr(e,n,(function(e,n){return t(e,n[0])}))}var js=Qo(Rs),Fs=Qo(Ns);function Ds(e){return null==e?[]:en(e,Rs(e))}var $s=Lo((function(e,t,n){return t=t.toLowerCase(),e+(n?Ks(t):t)}));function Ks(e){return Ys(vs(e).toLowerCase())}function qs(e){return(e=vs(e))&&e.replace(Ae,on).replace(tt,\"\")}var Ws=Lo((function(e,t,n){return e+(n?\"-\":\"\")+t.toLowerCase()})),Hs=Lo((function(e,t,n){return e+(n?\" \":\"\")+t.toLowerCase()})),Vs=zo(\"toLowerCase\");var Gs=Lo((function(e,t,n){return e+(n?\"_\":\"\")+t.toLowerCase()}));var Zs=Lo((function(e,t,n){return e+(n?\" \":\"\")+Ys(t)}));var Js=Lo((function(e,t,n){return e+(n?\" \":\"\")+t.toUpperCase()})),Ys=zo(\"toUpperCase\");function Qs(e,t,n){return e=vs(e),(t=n?o:t)===o?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Xs=Yr((function(e,t){try{return Tt(e,o,t)}catch(e){return Ya(e)?e:new xe(e)}})),ec=oi((function(e,t){return Ct(t,(function(t){t=Li(t),ar(e,t,Ba(e[t],e))})),e}));function tc(e){return function(){return e}}var nc=Do(),rc=Do(!0);function oc(e){return e}function ic(e){return Mr(\"function\"==typeof e?e:ur(e,1))}var ac=Yr((function(e,t){return function(n){return Pr(n,e,t)}})),sc=Yr((function(e,t){return function(n){return Pr(e,n,t)}}));function cc(e,t,n){var r=Rs(t),o=Er(t,r);null!=n||ts(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Er(t,Rs(t)));var i=!(ts(n)&&\"chain\"in n&&!n.chain),a=Qa(e);return Ct(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Po(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function uc(){}var lc=Wo(Ut),dc=Wo(Pt),fc=Wo(jt);function hc(e){return Si(e)?Vt(Li(e)):function(e){return function(t){return xr(t,e)}}(e)}var pc=Vo(),gc=Vo(!0);function mc(){return[]}function yc(){return!1}var wc=qo((function(e,t){return e+t}),0),vc=Jo(\"ceil\"),bc=qo((function(e,t){return e/t}),1),Ac=Jo(\"floor\");var Sc,Ec=qo((function(e,t){return e*t}),1),xc=Jo(\"round\"),kc=qo((function(e,t){return e-t}),0);return Dn.after=function(e,t){if(\"function\"!=typeof t)throw new Be(i);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=_a,Dn.assign=bs,Dn.assignIn=As,Dn.assignInWith=Ss,Dn.assignWith=Es,Dn.at=xs,Dn.before=Ca,Dn.bind=Ba,Dn.bindAll=ec,Dn.bindKey=Pa,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},Dn.chain=ha,Dn.chunk=function(e,t,n){t=(n?Ai(e,t,n):t===o)?1:vn(gs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=r(pt(i/t));a<i;)c[s++]=oo(e,a,a+=t);return c},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Mt(Wa(n)?Po(n):[n],wr(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,n=li();return e=t?Ut(e,(function(e){if(\"function\"!=typeof e[1])throw new Be(i);return[n(e[0]),e[1]]})):[],Yr((function(n){for(var r=-1;++r<t;){var o=e[r];if(Tt(o[0],this,n))return Tt(o[1],this,n)}}))},Dn.conforms=function(e){return function(e){var t=Rs(e);return function(n){return lr(n,e,t)}}(ur(e,1))},Dn.constant=tc,Dn.countBy=ma,Dn.create=function(e,t){var n=$n(e);return null==t?n:ir(n,t)},Dn.curry=function e(t,n,r){var i=Xo(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Dn.curryRight=function e(t,n,r){var i=Xo(t,c,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Dn.debounce=Ra,Dn.defaults=ks,Dn.defaultsDeep=Is,Dn.defer=Na,Dn.delay=Oa,Dn.difference=Di,Dn.differenceBy=$i,Dn.differenceWith=Ki,Dn.drop=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=n||t===o?1:gs(t))<0?0:t,r):[]},Dn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,0,(t=r-(t=n||t===o?1:gs(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?go(e,li(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?go(e,li(t,3),!0):[]},Dn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&\"number\"!=typeof n&&Ai(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=gs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:gs(r))<0&&(r+=i),r=n>r?0:ms(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Dn.filter=function(e,t){return(Wa(e)?Rt:yr)(e,li(t,3))},Dn.flatMap=function(e,t){return wr(xa(e,t),1)},Dn.flatMapDeep=function(e,t){return wr(xa(e,t),h)},Dn.flatMapDepth=function(e,t,n){return n=n===o?1:gs(n),wr(xa(e,t),n)},Dn.flatten=Hi,Dn.flattenDeep=function(e){return(null==e?0:e.length)?wr(e,h):[]},Dn.flattenDepth=function(e,t){return(null==e?0:e.length)?wr(e,t=t===o?1:gs(t)):[]},Dn.flip=function(e){return Xo(e,512)},Dn.flow=nc,Dn.flowRight=rc,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Dn.functions=function(e){return null==e?[]:Er(e,Rs(e))},Dn.functionsIn=function(e){return null==e?[]:Er(e,Ns(e))},Dn.groupBy=Aa,Dn.initial=function(e){return(null==e?0:e.length)?oo(e,0,-1):[]},Dn.intersection=Gi,Dn.intersectionBy=Zi,Dn.intersectionWith=Ji,Dn.invert=Cs,Dn.invertBy=Bs,Dn.invokeMap=Sa,Dn.iteratee=ic,Dn.keyBy=Ea,Dn.keys=Rs,Dn.keysIn=Ns,Dn.map=xa,Dn.mapKeys=function(e,t){var n={};return t=li(t,3),Ar(e,(function(e,r,o){ar(n,t(e,r,o),e)})),n},Dn.mapValues=function(e,t){var n={};return t=li(t,3),Ar(e,(function(e,r,o){ar(n,r,t(e,r,o))})),n},Dn.matches=function(e){return Dr(ur(e,1))},Dn.matchesProperty=function(e,t){return $r(e,ur(t,1))},Dn.memoize=Ua,Dn.merge=Os,Dn.mergeWith=Us,Dn.method=ac,Dn.methodOf=sc,Dn.mixin=cc,Dn.negate=Ma,Dn.nthArg=function(e){return e=gs(e),Yr((function(t){return qr(t,e)}))},Dn.omit=Ms,Dn.omitBy=function(e,t){return Ls(e,Ma(li(t)))},Dn.once=function(e){return Ca(2,e)},Dn.orderBy=function(e,t,n,r){return null==e?[]:(Wa(t)||(t=null==t?[]:[t]),Wa(n=r?o:n)||(n=null==n?[]:[n]),Wr(e,t,n))},Dn.over=lc,Dn.overArgs=za,Dn.overEvery=dc,Dn.overSome=fc,Dn.partial=La,Dn.partialRight=ja,Dn.partition=ka,Dn.pick=zs,Dn.pickBy=Ls,Dn.property=hc,Dn.propertyOf=function(e){return function(t){return null==e?o:xr(e,t)}},Dn.pull=Qi,Dn.pullAll=Xi,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Vr(e,t,li(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Vr(e,t,o,n):e},Dn.pullAt=ea,Dn.range=pc,Dn.rangeRight=gc,Dn.rearg=Fa,Dn.reject=function(e,t){return(Wa(e)?Rt:yr)(e,Ma(li(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=li(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Gr(e,o),n},Dn.rest=function(e,t){if(\"function\"!=typeof e)throw new Be(i);return Yr(e,t=t===o?t:gs(t))},Dn.reverse=ta,Dn.sampleSize=function(e,t,n){return t=(n?Ai(e,t,n):t===o)?1:gs(t),(Wa(e)?Xn:Xr)(e,t)},Dn.set=function(e,t,n){return null==e?e:eo(e,t,n)},Dn.setWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:eo(e,t,n,r)},Dn.shuffle=function(e){return(Wa(e)?er:ro)(e)},Dn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&\"number\"!=typeof n&&Ai(e,t,n)?(t=0,n=r):(t=null==t?0:gs(t),n=n===o?r:gs(n)),oo(e,t,n)):[]},Dn.sortBy=Ia,Dn.sortedUniq=function(e){return e&&e.length?co(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?co(e,li(t,2)):[]},Dn.split=function(e,t,n){return n&&\"number\"!=typeof n&&Ai(e,t,n)&&(t=n=o),(n=n===o?m:n>>>0)?(e=vs(e))&&(\"string\"==typeof t||null!=t&&!as(t))&&!(t=lo(t))&&cn(e)?Eo(gn(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if(\"function\"!=typeof e)throw new Be(i);return t=null==t?0:vn(gs(t),0),Yr((function(n){var r=n[t],o=Eo(n,0,t);return r&&Mt(o,r),Tt(e,this,o)}))},Dn.tail=function(e){var t=null==e?0:e.length;return t?oo(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?oo(e,0,(t=n||t===o?1:gs(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=r-(t=n||t===o?1:gs(t)))<0?0:t,r):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?go(e,li(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?go(e,li(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,n){var r=!0,o=!0;if(\"function\"!=typeof e)throw new Be(i);return ts(n)&&(r=\"leading\"in n?!!n.leading:r,o=\"trailing\"in n?!!n.trailing:o),Ra(e,t,{leading:r,maxWait:t,trailing:o})},Dn.thru=pa,Dn.toArray=hs,Dn.toPairs=js,Dn.toPairsIn=Fs,Dn.toPath=function(e){return Wa(e)?Ut(e,Li):us(e)?[e]:Po(zi(vs(e)))},Dn.toPlainObject=ws,Dn.transform=function(e,t,n){var r=Wa(e),o=r||Za(e)||ls(e);if(t=li(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:ts(e)&&Qa(i)?$n(Ve(e)):{}}return(o?Ct:Ar)(e,(function(e,r,o){return t(n,e,r,o)})),n},Dn.unary=function(e){return _a(e,1)},Dn.union=na,Dn.unionBy=ra,Dn.unionWith=oa,Dn.uniq=function(e){return e&&e.length?fo(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?fo(e,li(t,2)):[]},Dn.uniqWith=function(e,t){return t=\"function\"==typeof t?t:o,e&&e.length?fo(e,o,t):[]},Dn.unset=function(e,t){return null==e||ho(e,t)},Dn.unzip=ia,Dn.unzipWith=aa,Dn.update=function(e,t,n){return null==e?e:po(e,t,bo(n))},Dn.updateWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:po(e,t,bo(n),r)},Dn.values=Ds,Dn.valuesIn=function(e){return null==e?[]:en(e,Ns(e))},Dn.without=sa,Dn.words=Qs,Dn.wrap=function(e,t){return La(bo(t),e)},Dn.xor=ca,Dn.xorBy=ua,Dn.xorWith=la,Dn.zip=da,Dn.zipObject=function(e,t){return wo(e||[],t||[],nr)},Dn.zipObjectDeep=function(e,t){return wo(e||[],t||[],eo)},Dn.zipWith=fa,Dn.entries=js,Dn.entriesIn=Fs,Dn.extend=As,Dn.extendWith=Ss,cc(Dn,Dn),Dn.add=wc,Dn.attempt=Xs,Dn.camelCase=$s,Dn.capitalize=Ks,Dn.ceil=vc,Dn.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=ys(n))==n?n:0),t!==o&&(t=(t=ys(t))==t?t:0),cr(ys(e),t,n)},Dn.clone=function(e){return ur(e,4)},Dn.cloneDeep=function(e){return ur(e,5)},Dn.cloneDeepWith=function(e,t){return ur(e,5,t=\"function\"==typeof t?t:o)},Dn.cloneWith=function(e,t){return ur(e,4,t=\"function\"==typeof t?t:o)},Dn.conformsTo=function(e,t){return null==t||lr(e,t,Rs(t))},Dn.deburr=qs,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=bc,Dn.endsWith=function(e,t,n){e=vs(e),t=lo(t);var r=e.length,i=n=n===o?r:cr(gs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Dn.eq=Da,Dn.escape=function(e){return(e=vs(e))&&Y.test(e)?e.replace(Z,an):e},Dn.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(oe,\"\\\\$&\"):e},Dn.every=function(e,t,n){var r=Wa(e)?Pt:gr;return n&&Ai(e,t,n)&&(t=o),r(e,li(t,3))},Dn.find=ya,Dn.findIndex=qi,Dn.findKey=function(e,t){return Dt(e,li(t,3),Ar)},Dn.findLast=wa,Dn.findLastIndex=Wi,Dn.findLastKey=function(e,t){return Dt(e,li(t,3),Sr)},Dn.floor=Ac,Dn.forEach=va,Dn.forEachRight=ba,Dn.forIn=function(e,t){return null==e?e:vr(e,li(t,3),Ns)},Dn.forInRight=function(e,t){return null==e?e:br(e,li(t,3),Ns)},Dn.forOwn=function(e,t){return e&&Ar(e,li(t,3))},Dn.forOwnRight=function(e,t){return e&&Sr(e,li(t,3))},Dn.get=Ts,Dn.gt=$a,Dn.gte=Ka,Dn.has=function(e,t){return null!=e&&yi(e,t,_r)},Dn.hasIn=_s,Dn.head=Vi,Dn.identity=oc,Dn.includes=function(e,t,n,r){e=Va(e)?e:Ds(e),n=n&&!r?gs(n):0;var o=e.length;return n<0&&(n=vn(o+n,0)),cs(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Kt(e,t,n)>-1},Dn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:gs(n);return o<0&&(o=vn(r+o,0)),Kt(e,t,o)},Dn.inRange=function(e,t,n){return t=ps(t),n===o?(n=t,t=0):n=ps(n),function(e,t,n){return e>=bn(t,n)&&e<vn(t,n)}(e=ys(e),t,n)},Dn.invoke=Ps,Dn.isArguments=qa,Dn.isArray=Wa,Dn.isArrayBuffer=Ha,Dn.isArrayLike=Va,Dn.isArrayLikeObject=Ga,Dn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Ir(e)==b},Dn.isBuffer=Za,Dn.isDate=Ja,Dn.isElement=function(e){return ns(e)&&1===e.nodeType&&!is(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(Va(e)&&(Wa(e)||\"string\"==typeof e||\"function\"==typeof e.splice||Za(e)||ls(e)||qa(e)))return!e.length;var t=mi(e);if(t==k||t==B)return!e.size;if(ki(e))return!zr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return Nr(e,t)},Dn.isEqualWith=function(e,t,n){var r=(n=\"function\"==typeof n?n:o)?n(e,t):o;return r===o?Nr(e,t,o,n):!!r},Dn.isError=Ya,Dn.isFinite=function(e){return\"number\"==typeof e&&bt(e)},Dn.isFunction=Qa,Dn.isInteger=Xa,Dn.isLength=es,Dn.isMap=rs,Dn.isMatch=function(e,t){return e===t||Or(e,t,fi(t))},Dn.isMatchWith=function(e,t,n){return n=\"function\"==typeof n?n:o,Or(e,t,fi(t),n)},Dn.isNaN=function(e){return os(e)&&e!=+e},Dn.isNative=function(e){if(xi(e))throw new xe(\"Unsupported core-js use. Try https://npms.io/search?q=ponyfill.\");return Ur(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=os,Dn.isObject=ts,Dn.isObjectLike=ns,Dn.isPlainObject=is,Dn.isRegExp=as,Dn.isSafeInteger=function(e){return Xa(e)&&e>=-9007199254740991&&e<=p},Dn.isSet=ss,Dn.isString=cs,Dn.isSymbol=us,Dn.isTypedArray=ls,Dn.isUndefined=function(e){return e===o},Dn.isWeakMap=function(e){return ns(e)&&mi(e)==N},Dn.isWeakSet=function(e){return ns(e)&&\"[object WeakSet]\"==Ir(e)},Dn.join=function(e,t){return null==e?\"\":Ft.call(e,t)},Dn.kebabCase=Ws,Dn.last=Yi,Dn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=gs(n))<0?vn(r+i,0):bn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):$t(e,Wt,i,!0)},Dn.lowerCase=Hs,Dn.lowerFirst=Vs,Dn.lt=ds,Dn.lte=fs,Dn.max=function(e){return e&&e.length?mr(e,oc,Tr):o},Dn.maxBy=function(e,t){return e&&e.length?mr(e,li(t,2),Tr):o},Dn.mean=function(e){return Ht(e,oc)},Dn.meanBy=function(e,t){return Ht(e,li(t,2))},Dn.min=function(e){return e&&e.length?mr(e,oc,jr):o},Dn.minBy=function(e,t){return e&&e.length?mr(e,li(t,2),jr):o},Dn.stubArray=mc,Dn.stubFalse=yc,Dn.stubObject=function(){return{}},Dn.stubString=function(){return\"\"},Dn.stubTrue=function(){return!0},Dn.multiply=Ec,Dn.nth=function(e,t){return e&&e.length?qr(e,gs(t)):o},Dn.noConflict=function(){return gt._===this&&(gt._=De),this},Dn.noop=uc,Dn.now=Ta,Dn.pad=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Ho(mt(o),n)+e+Ho(pt(o),n)},Dn.padEnd=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?e+Ho(t-r,n):e},Dn.padStart=function(e,t,n){e=vs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?Ho(t-r,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Sn(vs(e).replace(ae,\"\"),t||0)},Dn.random=function(e,t,n){if(n&&\"boolean\"!=typeof n&&Ai(e,t,n)&&(t=n=o),n===o&&(\"boolean\"==typeof t?(n=t,t=o):\"boolean\"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=ps(e),t===o?(t=e,e=0):t=ps(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=En();return bn(e+i*(t-e+dt(\"1e-\"+((i+\"\").length-1))),t)}return Zr(e,t)},Dn.reduce=function(e,t,n){var r=Wa(e)?zt:Zt,o=arguments.length<3;return r(e,li(t,4),n,o,hr)},Dn.reduceRight=function(e,t,n){var r=Wa(e)?Lt:Zt,o=arguments.length<3;return r(e,li(t,4),n,o,pr)},Dn.repeat=function(e,t,n){return t=(n?Ai(e,t,n):t===o)?1:gs(t),Jr(vs(e),t)},Dn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var r=-1,i=(t=Ao(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Li(t[r])];a===o&&(r=i,a=n),e=Qa(a)?a.call(e):a}return e},Dn.round=xc,Dn.runInContext=e,Dn.sample=function(e){return(Wa(e)?Qn:Qr)(e)},Dn.size=function(e){if(null==e)return 0;if(Va(e))return cs(e)?pn(e):e.length;var t=mi(e);return t==k||t==B?e.size:zr(e).length},Dn.snakeCase=Gs,Dn.some=function(e,t,n){var r=Wa(e)?jt:io;return n&&Ai(e,t,n)&&(t=o),r(e,li(t,3))},Dn.sortedIndex=function(e,t){return ao(e,t)},Dn.sortedIndexBy=function(e,t,n){return so(e,t,li(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ao(e,t);if(r<n&&Da(e[r],t))return r}return-1},Dn.sortedLastIndex=function(e,t){return ao(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return so(e,t,li(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ao(e,t,!0)-1;if(Da(e[n],t))return n}return-1},Dn.startCase=Zs,Dn.startsWith=function(e,t,n){return e=vs(e),n=null==n?0:cr(gs(n),0,e.length),t=lo(t),e.slice(n,n+t.length)==t},Dn.subtract=kc,Dn.sum=function(e){return e&&e.length?Jt(e,oc):0},Dn.sumBy=function(e,t){return e&&e.length?Jt(e,li(t,2)):0},Dn.template=function(e,t,n){var r=Dn.templateSettings;n&&Ai(e,t,n)&&(t=o),e=vs(e),t=Ss({},t,r,ei);var i,a,s=Ss({},t.imports,r.imports,ei),c=Rs(s),u=en(s,c),l=0,d=t.interpolate||Se,f=\"__p += '\",h=_e((t.escape||Se).source+\"|\"+d.source+\"|\"+(d===ee?pe:Se).source+\"|\"+(t.evaluate||Se).source+\"|$\",\"g\"),p=\"//# sourceURL=\"+(Me.call(t,\"sourceURL\")?(t.sourceURL+\"\").replace(/\\s/g,\" \"):\"lodash.templateSources[\"+ ++st+\"]\")+\"\\n\";e.replace(h,(function(t,n,r,o,s,c){return r||(r=o),f+=e.slice(l,c).replace(Ee,sn),n&&(i=!0,f+=\"' +\\n__e(\"+n+\") +\\n'\"),s&&(a=!0,f+=\"';\\n\"+s+\";\\n__p += '\"),r&&(f+=\"' +\\n((__t = (\"+r+\")) == null ? '' : __t) +\\n'\"),l=c+t.length,t})),f+=\"';\\n\";var g=Me.call(t,\"variable\")&&t.variable;if(g){if(fe.test(g))throw new xe(\"Invalid `variable` option passed into `_.template`\")}else f=\"with (obj) {\\n\"+f+\"\\n}\\n\";f=(a?f.replace(W,\"\"):f).replace(H,\"$1\").replace(V,\"$1;\"),f=\"function(\"+(g||\"obj\")+\") {\\n\"+(g?\"\":\"obj || (obj = {});\\n\")+\"var __t, __p = ''\"+(i?\", __e = _.escape\":\"\")+(a?\", __j = Array.prototype.join;\\nfunction print() { __p += __j.call(arguments, '') }\\n\":\";\\n\")+f+\"return __p\\n}\";var m=Xs((function(){return ke(c,p+\"return \"+f).apply(o,u)}));if(m.source=f,Ya(m))throw m;return m},Dn.times=function(e,t){if((e=gs(e))<1||e>p)return[];var n=m,r=bn(e,m);t=li(t),e-=m;for(var o=Yt(r,t);++n<e;)t(n);return o},Dn.toFinite=ps,Dn.toInteger=gs,Dn.toLength=ms,Dn.toLower=function(e){return vs(e).toLowerCase()},Dn.toNumber=ys,Dn.toSafeInteger=function(e){return e?cr(gs(e),-9007199254740991,p):0===e?e:0},Dn.toString=vs,Dn.toUpper=function(e){return vs(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=vs(e))&&(n||t===o))return Qt(e);if(!e||!(t=lo(t)))return e;var r=gn(e),i=gn(t);return Eo(r,nn(r,i),rn(r,i)+1).join(\"\")},Dn.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===o))return e.slice(0,mn(e)+1);if(!e||!(t=lo(t)))return e;var r=gn(e);return Eo(r,0,rn(r,gn(t))+1).join(\"\")},Dn.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===o))return e.replace(ae,\"\");if(!e||!(t=lo(t)))return e;var r=gn(e);return Eo(r,nn(r,gn(t))).join(\"\")},Dn.truncate=function(e,t){var n=30,r=\"...\";if(ts(t)){var i=\"separator\"in t?t.separator:i;n=\"length\"in t?gs(t.length):n,r=\"omission\"in t?lo(t.omission):r}var a=(e=vs(e)).length;if(cn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var c=n-pn(r);if(c<1)return r;var u=s?Eo(s,0,c).join(\"\"):e.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),as(i)){if(e.slice(c).search(i)){var l,d=u;for(i.global||(i=_e(i.source,vs(ge.exec(i))+\"g\")),i.lastIndex=0;l=i.exec(d);)var f=l.index;u=u.slice(0,f===o?c:f)}}else if(e.indexOf(lo(i),c)!=c){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r},Dn.unescape=function(e){return(e=vs(e))&&J.test(e)?e.replace(G,yn):e},Dn.uniqueId=function(e){var t=++ze;return vs(e)+t},Dn.upperCase=Js,Dn.upperFirst=Ys,Dn.each=va,Dn.eachRight=ba,Dn.first=Vi,cc(Dn,(Sc={},Ar(Dn,(function(e,t){Me.call(Dn.prototype,t)||(Sc[t]=e)})),Sc),{chain:!1}),Dn.VERSION=\"4.17.21\",Ct([\"bind\",\"bindKey\",\"curry\",\"curryRight\",\"partial\",\"partialRight\"],(function(e){Dn[e].placeholder=Dn})),Ct([\"drop\",\"take\"],(function(e,t){Wn.prototype[e]=function(n){n=n===o?1:vn(gs(n),0);var r=this.__filtered__&&!t?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=bn(n,r.__takeCount__):r.__views__.push({size:bn(n,m),type:e+(r.__dir__<0?\"Right\":\"\")}),r},Wn.prototype[e+\"Right\"]=function(t){return this.reverse()[e](t).reverse()}})),Ct([\"filter\",\"map\",\"takeWhile\"],(function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:li(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct([\"head\",\"last\"],(function(e,t){var n=\"take\"+(t?\"Right\":\"\");Wn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct([\"initial\",\"tail\"],(function(e,t){var n=\"drop\"+(t?\"\":\"Right\");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(oc)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Yr((function(e,t){return\"function\"==typeof e?new Wn(this):this.map((function(n){return Pr(n,e,t)}))})),Wn.prototype.reject=function(e){return this.filter(Ma(li(e)))},Wn.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(m)},Ar(Wn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Dn[r?\"take\"+(\"last\"==t?\"Right\":\"\"):t],a=r||/^find/.test(t);i&&(Dn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof Wn,u=s[0],l=c||Wa(t),d=function(e){var t=i.apply(Dn,Mt([e],s));return r&&f?t[0]:t};l&&n&&\"function\"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,g=c&&!h;if(!a&&l){t=g?t:new Wn(this);var m=e.apply(t,s);return m.__actions__.push({func:pa,args:[d],thisArg:o}),new qn(m,f)}return p&&g?e.apply(this,s):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})})),Ct([\"pop\",\"push\",\"shift\",\"sort\",\"splice\",\"unshift\"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?\"tap\":\"thru\",r=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Wa(o)?o:[],e)}return this[n]((function(n){return t.apply(Wa(n)?n:[],e)}))}})),Ar(Wn.prototype,(function(e,t){var n=Dn[t];if(n){var r=n.name+\"\";Me.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}})),Rn[$o(o,2).name]=[{name:\"wrapper\",func:o}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=Po(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Po(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Po(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case\"drop\":e+=a;break;case\"dropRight\":t-=a;break;case\"take\":t=bn(t,e+a);break;case\"takeRight\":e=vn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,c=s-a,u=r?s:a-1,l=this.__iteratees__,d=l.length,f=0,h=bn(c,this.__takeCount__);if(!n||!r&&o==c&&h==c)return mo(e,this.__actions__);var p=[];e:for(;c--&&f<h;){for(var g=-1,m=e[u+=t];++g<d;){var y=l[g],w=y.iteratee,v=y.type,b=w(m);if(2==v)m=b;else if(!b){if(1==v)continue e;break e}}p[f++]=m}return p},Dn.prototype.at=ga,Dn.prototype.chain=function(){return ha(this)},Dn.prototype.commit=function(){return new qn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===o&&(this.__values__=hs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof Kn;){var r=Fi(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var t=e;return this.__actions__.length&&(t=new Wn(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:o}),new qn(t,this.__chain__)}return this.thru(ta)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return mo(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Qe&&(Dn.prototype[Qe]=function(){return this}),Dn}();gt._=wn,(r=function(){return wn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},5276:(e,t,n)=>{var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},5288:(e,t,n)=>{var r=n(358),o=n(7200),i=n(6529);e.exports=function(e){return i(e)?r(e,!0):o(e)}},5353:(e,t,n)=>{var r=n(8638);e.exports=function(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,r(e,128,void 0,void 0,void 0,void 0,t)}},5387:e=>{e.exports=function(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},5512:(e,t,n)=>{var r=n(4943),o=n(3316)(r);e.exports=o},5568:e=>{e.exports=function(e,t){return e.has(t)}},5620:(e,t,n)=>{var r=n(8788),o=n(9141),i=n(796),a=n(33);e.exports=function(e,t,n){var s=t+\"\";return i(e,o(s,a(r(s),n)))}},5650:(e,t,n)=>{var r=n(8942).Symbol;e.exports=r},5681:(e,t,n)=>{var r=n(4700);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},5755:e=>{var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=-1,c=r.length,u=-1,l=n.length,d=t(a-c,0),f=Array(d+l),h=!o;++i<d;)f[i]=e[i];for(var p=i;++u<l;)f[p+u]=n[u];for(;++s<c;)(h||i<a)&&(f[p+r[s]]=e[i++]);return f}},5832:(e,t,n)=>{var r=n(1129),o=n(4784),i=n(7979),a=n(9306),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},5853:(e,t,n)=>{e=n.nmd(e);var r=n(8942),o=n(4772),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},5857:(e,t,n)=>{var r=n(313);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},5894:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},5899:(e,t,n)=>{var r=n(3526),o=n(3283),i=n(3142),a=n(9632),s=n(5387),c=n(6040);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,d=!1;++u<l;){var f=c(t[u]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++u!=l?d:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(i(e)||o(e))}},5962:e=>{e.exports=function(){}},5964:(e,t,n)=>{var r=n(9747),o=n(4784),i=n(4882);e.exports=function(e){return\"function\"!=typeof e.constructor||i(e)?{}:r(o(e))}},6027:(e,t,n)=>{var r=n(7379),o=n(547);e.exports=function(e){return o(e)&&\"[object Arguments]\"==r(e)}},6040:(e,t,n)=>{var r=n(1187);e.exports=function(e){if(\"string\"==typeof e||r(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}},6065:(e,t,n)=>{var r=n(9270),o=r&&new r;e.exports=o},6123:(e,t,n)=>{var r=n(7923);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},6131:(e,t,n)=>{var r=n(6403),o=n(1580),i=n(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if(\"number\"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},6137:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},6285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6341:(e,t,n)=>{var r=n(6912),o=n(4364),i=n(8942);e.exports=function(e,t,n,a){var s=1&t,c=o(e);return function t(){for(var o=-1,u=arguments.length,l=-1,d=a.length,f=Array(d+u),h=this&&this!==i&&this instanceof t?c:e;++l<d;)f[l]=a[l];for(;u--;)f[l++]=arguments[++o];return r(h,s?n:this,f)}}},6403:(e,t,n)=>{var r=n(2945),o=/^\\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,\"\"):e}},6465:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},6493:(e,t,n)=>{var r=n(6853),o=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,i=/\\\\(\\\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,\"$1\"):n||e)})),t}));e.exports=a},6526:(e,t,n)=>{var r=n(8330),o=n(4367),i=n(3904);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},6529:(e,t,n)=>{var r=n(3655),o=n(5387);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},6591:(e,t,n)=>{var r=n(4354),o=n(9632),i=Math.min;e.exports=function(e,t){for(var n=e.length,a=i(t.length,n),s=r(e);a--;){var c=t[a];e[a]=o(c,n)?s[c]:void 0}return e}},6638:(e,t,n)=>{var r=n(1386),o=n(9770),i=n(8250);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},6648:(e,t,n)=>{var r=n(7553),o=n(5196),i=n(961),a=n(3321);e.exports=function(e){var t=i(e),n=a[t];if(\"function\"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var s=o(n);return!!s&&e===s[0]}},6713:(e,t,n)=>{var r=n(4364),o=n(8942);e.exports=function(e,t,n){var i=1&t,a=r(e);return function t(){return(this&&this!==o&&this instanceof t?a:e).apply(i?n:this,arguments)}}},6850:e=>{e.exports=function(e){return e.placeholder}},6853:(e,t,n)=>{var r=n(9011);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},6912:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},6925:(e,t)=>{\"use strict\";t.p=void 0,t.p=\"abandon\\nability\\nable\\nabout\\nabove\\nabsent\\nabsorb\\nabstract\\nabsurd\\nabuse\\naccess\\naccident\\naccount\\naccuse\\nachieve\\nacid\\nacoustic\\nacquire\\nacross\\nact\\naction\\nactor\\nactress\\nactual\\nadapt\\nadd\\naddict\\naddress\\nadjust\\nadmit\\nadult\\nadvance\\nadvice\\naerobic\\naffair\\nafford\\nafraid\\nagain\\nage\\nagent\\nagree\\nahead\\naim\\nair\\nairport\\naisle\\nalarm\\nalbum\\nalcohol\\nalert\\nalien\\nall\\nalley\\nallow\\nalmost\\nalone\\nalpha\\nalready\\nalso\\nalter\\nalways\\namateur\\namazing\\namong\\namount\\namused\\nanalyst\\nanchor\\nancient\\nanger\\nangle\\nangry\\nanimal\\nankle\\nannounce\\nannual\\nanother\\nanswer\\nantenna\\nantique\\nanxiety\\nany\\napart\\napology\\nappear\\napple\\napprove\\napril\\narch\\narctic\\narea\\narena\\nargue\\narm\\narmed\\narmor\\narmy\\naround\\narrange\\narrest\\narrive\\narrow\\nart\\nartefact\\nartist\\nartwork\\nask\\naspect\\nassault\\nasset\\nassist\\nassume\\nasthma\\nathlete\\natom\\nattack\\nattend\\nattitude\\nattract\\nauction\\naudit\\naugust\\naunt\\nauthor\\nauto\\nautumn\\naverage\\navocado\\navoid\\nawake\\naware\\naway\\nawesome\\nawful\\nawkward\\naxis\\nbaby\\nbachelor\\nbacon\\nbadge\\nbag\\nbalance\\nbalcony\\nball\\nbamboo\\nbanana\\nbanner\\nbar\\nbarely\\nbargain\\nbarrel\\nbase\\nbasic\\nbasket\\nbattle\\nbeach\\nbean\\nbeauty\\nbecause\\nbecome\\nbeef\\nbefore\\nbegin\\nbehave\\nbehind\\nbelieve\\nbelow\\nbelt\\nbench\\nbenefit\\nbest\\nbetray\\nbetter\\nbetween\\nbeyond\\nbicycle\\nbid\\nbike\\nbind\\nbiology\\nbird\\nbirth\\nbitter\\nblack\\nblade\\nblame\\nblanket\\nblast\\nbleak\\nbless\\nblind\\nblood\\nblossom\\nblouse\\nblue\\nblur\\nblush\\nboard\\nboat\\nbody\\nboil\\nbomb\\nbone\\nbonus\\nbook\\nboost\\nborder\\nboring\\nborrow\\nboss\\nbottom\\nbounce\\nbox\\nboy\\nbracket\\nbrain\\nbrand\\nbrass\\nbrave\\nbread\\nbreeze\\nbrick\\nbridge\\nbrief\\nbright\\nbring\\nbrisk\\nbroccoli\\nbroken\\nbronze\\nbroom\\nbrother\\nbrown\\nbrush\\nbubble\\nbuddy\\nbudget\\nbuffalo\\nbuild\\nbulb\\nbulk\\nbullet\\nbundle\\nbunker\\nburden\\nburger\\nburst\\nbus\\nbusiness\\nbusy\\nbutter\\nbuyer\\nbuzz\\ncabbage\\ncabin\\ncable\\ncactus\\ncage\\ncake\\ncall\\ncalm\\ncamera\\ncamp\\ncan\\ncanal\\ncancel\\ncandy\\ncannon\\ncanoe\\ncanvas\\ncanyon\\ncapable\\ncapital\\ncaptain\\ncar\\ncarbon\\ncard\\ncargo\\ncarpet\\ncarry\\ncart\\ncase\\ncash\\ncasino\\ncastle\\ncasual\\ncat\\ncatalog\\ncatch\\ncategory\\ncattle\\ncaught\\ncause\\ncaution\\ncave\\nceiling\\ncelery\\ncement\\ncensus\\ncentury\\ncereal\\ncertain\\nchair\\nchalk\\nchampion\\nchange\\nchaos\\nchapter\\ncharge\\nchase\\nchat\\ncheap\\ncheck\\ncheese\\nchef\\ncherry\\nchest\\nchicken\\nchief\\nchild\\nchimney\\nchoice\\nchoose\\nchronic\\nchuckle\\nchunk\\nchurn\\ncigar\\ncinnamon\\ncircle\\ncitizen\\ncity\\ncivil\\nclaim\\nclap\\nclarify\\nclaw\\nclay\\nclean\\nclerk\\nclever\\nclick\\nclient\\ncliff\\nclimb\\nclinic\\nclip\\nclock\\nclog\\nclose\\ncloth\\ncloud\\nclown\\nclub\\nclump\\ncluster\\nclutch\\ncoach\\ncoast\\ncoconut\\ncode\\ncoffee\\ncoil\\ncoin\\ncollect\\ncolor\\ncolumn\\ncombine\\ncome\\ncomfort\\ncomic\\ncommon\\ncompany\\nconcert\\nconduct\\nconfirm\\ncongress\\nconnect\\nconsider\\ncontrol\\nconvince\\ncook\\ncool\\ncopper\\ncopy\\ncoral\\ncore\\ncorn\\ncorrect\\ncost\\ncotton\\ncouch\\ncountry\\ncouple\\ncourse\\ncousin\\ncover\\ncoyote\\ncrack\\ncradle\\ncraft\\ncram\\ncrane\\ncrash\\ncrater\\ncrawl\\ncrazy\\ncream\\ncredit\\ncreek\\ncrew\\ncricket\\ncrime\\ncrisp\\ncritic\\ncrop\\ncross\\ncrouch\\ncrowd\\ncrucial\\ncruel\\ncruise\\ncrumble\\ncrunch\\ncrush\\ncry\\ncrystal\\ncube\\nculture\\ncup\\ncupboard\\ncurious\\ncurrent\\ncurtain\\ncurve\\ncushion\\ncustom\\ncute\\ncycle\\ndad\\ndamage\\ndamp\\ndance\\ndanger\\ndaring\\ndash\\ndaughter\\ndawn\\nday\\ndeal\\ndebate\\ndebris\\ndecade\\ndecember\\ndecide\\ndecline\\ndecorate\\ndecrease\\ndeer\\ndefense\\ndefine\\ndefy\\ndegree\\ndelay\\ndeliver\\ndemand\\ndemise\\ndenial\\ndentist\\ndeny\\ndepart\\ndepend\\ndeposit\\ndepth\\ndeputy\\nderive\\ndescribe\\ndesert\\ndesign\\ndesk\\ndespair\\ndestroy\\ndetail\\ndetect\\ndevelop\\ndevice\\ndevote\\ndiagram\\ndial\\ndiamond\\ndiary\\ndice\\ndiesel\\ndiet\\ndiffer\\ndigital\\ndignity\\ndilemma\\ndinner\\ndinosaur\\ndirect\\ndirt\\ndisagree\\ndiscover\\ndisease\\ndish\\ndismiss\\ndisorder\\ndisplay\\ndistance\\ndivert\\ndivide\\ndivorce\\ndizzy\\ndoctor\\ndocument\\ndog\\ndoll\\ndolphin\\ndomain\\ndonate\\ndonkey\\ndonor\\ndoor\\ndose\\ndouble\\ndove\\ndraft\\ndragon\\ndrama\\ndrastic\\ndraw\\ndream\\ndress\\ndrift\\ndrill\\ndrink\\ndrip\\ndrive\\ndrop\\ndrum\\ndry\\nduck\\ndumb\\ndune\\nduring\\ndust\\ndutch\\nduty\\ndwarf\\ndynamic\\neager\\neagle\\nearly\\nearn\\nearth\\neasily\\neast\\neasy\\necho\\necology\\neconomy\\nedge\\nedit\\neducate\\neffort\\negg\\neight\\neither\\nelbow\\nelder\\nelectric\\nelegant\\nelement\\nelephant\\nelevator\\nelite\\nelse\\nembark\\nembody\\nembrace\\nemerge\\nemotion\\nemploy\\nempower\\nempty\\nenable\\nenact\\nend\\nendless\\nendorse\\nenemy\\nenergy\\nenforce\\nengage\\nengine\\nenhance\\nenjoy\\nenlist\\nenough\\nenrich\\nenroll\\nensure\\nenter\\nentire\\nentry\\nenvelope\\nepisode\\nequal\\nequip\\nera\\nerase\\nerode\\nerosion\\nerror\\nerupt\\nescape\\nessay\\nessence\\nestate\\neternal\\nethics\\nevidence\\nevil\\nevoke\\nevolve\\nexact\\nexample\\nexcess\\nexchange\\nexcite\\nexclude\\nexcuse\\nexecute\\nexercise\\nexhaust\\nexhibit\\nexile\\nexist\\nexit\\nexotic\\nexpand\\nexpect\\nexpire\\nexplain\\nexpose\\nexpress\\nextend\\nextra\\neye\\neyebrow\\nfabric\\nface\\nfaculty\\nfade\\nfaint\\nfaith\\nfall\\nfalse\\nfame\\nfamily\\nfamous\\nfan\\nfancy\\nfantasy\\nfarm\\nfashion\\nfat\\nfatal\\nfather\\nfatigue\\nfault\\nfavorite\\nfeature\\nfebruary\\nfederal\\nfee\\nfeed\\nfeel\\nfemale\\nfence\\nfestival\\nfetch\\nfever\\nfew\\nfiber\\nfiction\\nfield\\nfigure\\nfile\\nfilm\\nfilter\\nfinal\\nfind\\nfine\\nfinger\\nfinish\\nfire\\nfirm\\nfirst\\nfiscal\\nfish\\nfit\\nfitness\\nfix\\nflag\\nflame\\nflash\\nflat\\nflavor\\nflee\\nflight\\nflip\\nfloat\\nflock\\nfloor\\nflower\\nfluid\\nflush\\nfly\\nfoam\\nfocus\\nfog\\nfoil\\nfold\\nfollow\\nfood\\nfoot\\nforce\\nforest\\nforget\\nfork\\nfortune\\nforum\\nforward\\nfossil\\nfoster\\nfound\\nfox\\nfragile\\nframe\\nfrequent\\nfresh\\nfriend\\nfringe\\nfrog\\nfront\\nfrost\\nfrown\\nfrozen\\nfruit\\nfuel\\nfun\\nfunny\\nfurnace\\nfury\\nfuture\\ngadget\\ngain\\ngalaxy\\ngallery\\ngame\\ngap\\ngarage\\ngarbage\\ngarden\\ngarlic\\ngarment\\ngas\\ngasp\\ngate\\ngather\\ngauge\\ngaze\\ngeneral\\ngenius\\ngenre\\ngentle\\ngenuine\\ngesture\\nghost\\ngiant\\ngift\\ngiggle\\nginger\\ngiraffe\\ngirl\\ngive\\nglad\\nglance\\nglare\\nglass\\nglide\\nglimpse\\nglobe\\ngloom\\nglory\\nglove\\nglow\\nglue\\ngoat\\ngoddess\\ngold\\ngood\\ngoose\\ngorilla\\ngospel\\ngossip\\ngovern\\ngown\\ngrab\\ngrace\\ngrain\\ngrant\\ngrape\\ngrass\\ngravity\\ngreat\\ngreen\\ngrid\\ngrief\\ngrit\\ngrocery\\ngroup\\ngrow\\ngrunt\\nguard\\nguess\\nguide\\nguilt\\nguitar\\ngun\\ngym\\nhabit\\nhair\\nhalf\\nhammer\\nhamster\\nhand\\nhappy\\nharbor\\nhard\\nharsh\\nharvest\\nhat\\nhave\\nhawk\\nhazard\\nhead\\nhealth\\nheart\\nheavy\\nhedgehog\\nheight\\nhello\\nhelmet\\nhelp\\nhen\\nhero\\nhidden\\nhigh\\nhill\\nhint\\nhip\\nhire\\nhistory\\nhobby\\nhockey\\nhold\\nhole\\nholiday\\nhollow\\nhome\\nhoney\\nhood\\nhope\\nhorn\\nhorror\\nhorse\\nhospital\\nhost\\nhotel\\nhour\\nhover\\nhub\\nhuge\\nhuman\\nhumble\\nhumor\\nhundred\\nhungry\\nhunt\\nhurdle\\nhurry\\nhurt\\nhusband\\nhybrid\\nice\\nicon\\nidea\\nidentify\\nidle\\nignore\\nill\\nillegal\\nillness\\nimage\\nimitate\\nimmense\\nimmune\\nimpact\\nimpose\\nimprove\\nimpulse\\ninch\\ninclude\\nincome\\nincrease\\nindex\\nindicate\\nindoor\\nindustry\\ninfant\\ninflict\\ninform\\ninhale\\ninherit\\ninitial\\ninject\\ninjury\\ninmate\\ninner\\ninnocent\\ninput\\ninquiry\\ninsane\\ninsect\\ninside\\ninspire\\ninstall\\nintact\\ninterest\\ninto\\ninvest\\ninvite\\ninvolve\\niron\\nisland\\nisolate\\nissue\\nitem\\nivory\\njacket\\njaguar\\njar\\njazz\\njealous\\njeans\\njelly\\njewel\\njob\\njoin\\njoke\\njourney\\njoy\\njudge\\njuice\\njump\\njungle\\njunior\\njunk\\njust\\nkangaroo\\nkeen\\nkeep\\nketchup\\nkey\\nkick\\nkid\\nkidney\\nkind\\nkingdom\\nkiss\\nkit\\nkitchen\\nkite\\nkitten\\nkiwi\\nknee\\nknife\\nknock\\nknow\\nlab\\nlabel\\nlabor\\nladder\\nlady\\nlake\\nlamp\\nlanguage\\nlaptop\\nlarge\\nlater\\nlatin\\nlaugh\\nlaundry\\nlava\\nlaw\\nlawn\\nlawsuit\\nlayer\\nlazy\\nleader\\nleaf\\nlearn\\nleave\\nlecture\\nleft\\nleg\\nlegal\\nlegend\\nleisure\\nlemon\\nlend\\nlength\\nlens\\nleopard\\nlesson\\nletter\\nlevel\\nliar\\nliberty\\nlibrary\\nlicense\\nlife\\nlift\\nlight\\nlike\\nlimb\\nlimit\\nlink\\nlion\\nliquid\\nlist\\nlittle\\nlive\\nlizard\\nload\\nloan\\nlobster\\nlocal\\nlock\\nlogic\\nlonely\\nlong\\nloop\\nlottery\\nloud\\nlounge\\nlove\\nloyal\\nlucky\\nluggage\\nlumber\\nlunar\\nlunch\\nluxury\\nlyrics\\nmachine\\nmad\\nmagic\\nmagnet\\nmaid\\nmail\\nmain\\nmajor\\nmake\\nmammal\\nman\\nmanage\\nmandate\\nmango\\nmansion\\nmanual\\nmaple\\nmarble\\nmarch\\nmargin\\nmarine\\nmarket\\nmarriage\\nmask\\nmass\\nmaster\\nmatch\\nmaterial\\nmath\\nmatrix\\nmatter\\nmaximum\\nmaze\\nmeadow\\nmean\\nmeasure\\nmeat\\nmechanic\\nmedal\\nmedia\\nmelody\\nmelt\\nmember\\nmemory\\nmention\\nmenu\\nmercy\\nmerge\\nmerit\\nmerry\\nmesh\\nmessage\\nmetal\\nmethod\\nmiddle\\nmidnight\\nmilk\\nmillion\\nmimic\\nmind\\nminimum\\nminor\\nminute\\nmiracle\\nmirror\\nmisery\\nmiss\\nmistake\\nmix\\nmixed\\nmixture\\nmobile\\nmodel\\nmodify\\nmom\\nmoment\\nmonitor\\nmonkey\\nmonster\\nmonth\\nmoon\\nmoral\\nmore\\nmorning\\nmosquito\\nmother\\nmotion\\nmotor\\nmountain\\nmouse\\nmove\\nmovie\\nmuch\\nmuffin\\nmule\\nmultiply\\nmuscle\\nmuseum\\nmushroom\\nmusic\\nmust\\nmutual\\nmyself\\nmystery\\nmyth\\nnaive\\nname\\nnapkin\\nnarrow\\nnasty\\nnation\\nnature\\nnear\\nneck\\nneed\\nnegative\\nneglect\\nneither\\nnephew\\nnerve\\nnest\\nnet\\nnetwork\\nneutral\\nnever\\nnews\\nnext\\nnice\\nnight\\nnoble\\nnoise\\nnominee\\nnoodle\\nnormal\\nnorth\\nnose\\nnotable\\nnote\\nnothing\\nnotice\\nnovel\\nnow\\nnuclear\\nnumber\\nnurse\\nnut\\noak\\nobey\\nobject\\noblige\\nobscure\\nobserve\\nobtain\\nobvious\\noccur\\nocean\\noctober\\nodor\\noff\\noffer\\noffice\\noften\\noil\\nokay\\nold\\nolive\\nolympic\\nomit\\nonce\\none\\nonion\\nonline\\nonly\\nopen\\nopera\\nopinion\\noppose\\noption\\norange\\norbit\\norchard\\norder\\nordinary\\norgan\\norient\\noriginal\\norphan\\nostrich\\nother\\noutdoor\\nouter\\noutput\\noutside\\noval\\noven\\nover\\nown\\nowner\\noxygen\\noyster\\nozone\\npact\\npaddle\\npage\\npair\\npalace\\npalm\\npanda\\npanel\\npanic\\npanther\\npaper\\nparade\\nparent\\npark\\nparrot\\nparty\\npass\\npatch\\npath\\npatient\\npatrol\\npattern\\npause\\npave\\npayment\\npeace\\npeanut\\npear\\npeasant\\npelican\\npen\\npenalty\\npencil\\npeople\\npepper\\nperfect\\npermit\\nperson\\npet\\nphone\\nphoto\\nphrase\\nphysical\\npiano\\npicnic\\npicture\\npiece\\npig\\npigeon\\npill\\npilot\\npink\\npioneer\\npipe\\npistol\\npitch\\npizza\\nplace\\nplanet\\nplastic\\nplate\\nplay\\nplease\\npledge\\npluck\\nplug\\nplunge\\npoem\\npoet\\npoint\\npolar\\npole\\npolice\\npond\\npony\\npool\\npopular\\nportion\\nposition\\npossible\\npost\\npotato\\npottery\\npoverty\\npowder\\npower\\npractice\\npraise\\npredict\\nprefer\\nprepare\\npresent\\npretty\\nprevent\\nprice\\npride\\nprimary\\nprint\\npriority\\nprison\\nprivate\\nprize\\nproblem\\nprocess\\nproduce\\nprofit\\nprogram\\nproject\\npromote\\nproof\\nproperty\\nprosper\\nprotect\\nproud\\nprovide\\npublic\\npudding\\npull\\npulp\\npulse\\npumpkin\\npunch\\npupil\\npuppy\\npurchase\\npurity\\npurpose\\npurse\\npush\\nput\\npuzzle\\npyramid\\nquality\\nquantum\\nquarter\\nquestion\\nquick\\nquit\\nquiz\\nquote\\nrabbit\\nraccoon\\nrace\\nrack\\nradar\\nradio\\nrail\\nrain\\nraise\\nrally\\nramp\\nranch\\nrandom\\nrange\\nrapid\\nrare\\nrate\\nrather\\nraven\\nraw\\nrazor\\nready\\nreal\\nreason\\nrebel\\nrebuild\\nrecall\\nreceive\\nrecipe\\nrecord\\nrecycle\\nreduce\\nreflect\\nreform\\nrefuse\\nregion\\nregret\\nregular\\nreject\\nrelax\\nrelease\\nrelief\\nrely\\nremain\\nremember\\nremind\\nremove\\nrender\\nrenew\\nrent\\nreopen\\nrepair\\nrepeat\\nreplace\\nreport\\nrequire\\nrescue\\nresemble\\nresist\\nresource\\nresponse\\nresult\\nretire\\nretreat\\nreturn\\nreunion\\nreveal\\nreview\\nreward\\nrhythm\\nrib\\nribbon\\nrice\\nrich\\nride\\nridge\\nrifle\\nright\\nrigid\\nring\\nriot\\nripple\\nrisk\\nritual\\nrival\\nriver\\nroad\\nroast\\nrobot\\nrobust\\nrocket\\nromance\\nroof\\nrookie\\nroom\\nrose\\nrotate\\nrough\\nround\\nroute\\nroyal\\nrubber\\nrude\\nrug\\nrule\\nrun\\nrunway\\nrural\\nsad\\nsaddle\\nsadness\\nsafe\\nsail\\nsalad\\nsalmon\\nsalon\\nsalt\\nsalute\\nsame\\nsample\\nsand\\nsatisfy\\nsatoshi\\nsauce\\nsausage\\nsave\\nsay\\nscale\\nscan\\nscare\\nscatter\\nscene\\nscheme\\nschool\\nscience\\nscissors\\nscorpion\\nscout\\nscrap\\nscreen\\nscript\\nscrub\\nsea\\nsearch\\nseason\\nseat\\nsecond\\nsecret\\nsection\\nsecurity\\nseed\\nseek\\nsegment\\nselect\\nsell\\nseminar\\nsenior\\nsense\\nsentence\\nseries\\nservice\\nsession\\nsettle\\nsetup\\nseven\\nshadow\\nshaft\\nshallow\\nshare\\nshed\\nshell\\nsheriff\\nshield\\nshift\\nshine\\nship\\nshiver\\nshock\\nshoe\\nshoot\\nshop\\nshort\\nshoulder\\nshove\\nshrimp\\nshrug\\nshuffle\\nshy\\nsibling\\nsick\\nside\\nsiege\\nsight\\nsign\\nsilent\\nsilk\\nsilly\\nsilver\\nsimilar\\nsimple\\nsince\\nsing\\nsiren\\nsister\\nsituate\\nsix\\nsize\\nskate\\nsketch\\nski\\nskill\\nskin\\nskirt\\nskull\\nslab\\nslam\\nsleep\\nslender\\nslice\\nslide\\nslight\\nslim\\nslogan\\nslot\\nslow\\nslush\\nsmall\\nsmart\\nsmile\\nsmoke\\nsmooth\\nsnack\\nsnake\\nsnap\\nsniff\\nsnow\\nsoap\\nsoccer\\nsocial\\nsock\\nsoda\\nsoft\\nsolar\\nsoldier\\nsolid\\nsolution\\nsolve\\nsomeone\\nsong\\nsoon\\nsorry\\nsort\\nsoul\\nsound\\nsoup\\nsource\\nsouth\\nspace\\nspare\\nspatial\\nspawn\\nspeak\\nspecial\\nspeed\\nspell\\nspend\\nsphere\\nspice\\nspider\\nspike\\nspin\\nspirit\\nsplit\\nspoil\\nsponsor\\nspoon\\nsport\\nspot\\nspray\\nspread\\nspring\\nspy\\nsquare\\nsqueeze\\nsquirrel\\nstable\\nstadium\\nstaff\\nstage\\nstairs\\nstamp\\nstand\\nstart\\nstate\\nstay\\nsteak\\nsteel\\nstem\\nstep\\nstereo\\nstick\\nstill\\nsting\\nstock\\nstomach\\nstone\\nstool\\nstory\\nstove\\nstrategy\\nstreet\\nstrike\\nstrong\\nstruggle\\nstudent\\nstuff\\nstumble\\nstyle\\nsubject\\nsubmit\\nsubway\\nsuccess\\nsuch\\nsudden\\nsuffer\\nsugar\\nsuggest\\nsuit\\nsummer\\nsun\\nsunny\\nsunset\\nsuper\\nsupply\\nsupreme\\nsure\\nsurface\\nsurge\\nsurprise\\nsurround\\nsurvey\\nsuspect\\nsustain\\nswallow\\nswamp\\nswap\\nswarm\\nswear\\nsweet\\nswift\\nswim\\nswing\\nswitch\\nsword\\nsymbol\\nsymptom\\nsyrup\\nsystem\\ntable\\ntackle\\ntag\\ntail\\ntalent\\ntalk\\ntank\\ntape\\ntarget\\ntask\\ntaste\\ntattoo\\ntaxi\\nteach\\nteam\\ntell\\nten\\ntenant\\ntennis\\ntent\\nterm\\ntest\\ntext\\nthank\\nthat\\ntheme\\nthen\\ntheory\\nthere\\nthey\\nthing\\nthis\\nthought\\nthree\\nthrive\\nthrow\\nthumb\\nthunder\\nticket\\ntide\\ntiger\\ntilt\\ntimber\\ntime\\ntiny\\ntip\\ntired\\ntissue\\ntitle\\ntoast\\ntobacco\\ntoday\\ntoddler\\ntoe\\ntogether\\ntoilet\\ntoken\\ntomato\\ntomorrow\\ntone\\ntongue\\ntonight\\ntool\\ntooth\\ntop\\ntopic\\ntopple\\ntorch\\ntornado\\ntortoise\\ntoss\\ntotal\\ntourist\\ntoward\\ntower\\ntown\\ntoy\\ntrack\\ntrade\\ntraffic\\ntragic\\ntrain\\ntransfer\\ntrap\\ntrash\\ntravel\\ntray\\ntreat\\ntree\\ntrend\\ntrial\\ntribe\\ntrick\\ntrigger\\ntrim\\ntrip\\ntrophy\\ntrouble\\ntruck\\ntrue\\ntruly\\ntrumpet\\ntrust\\ntruth\\ntry\\ntube\\ntuition\\ntumble\\ntuna\\ntunnel\\nturkey\\nturn\\nturtle\\ntwelve\\ntwenty\\ntwice\\ntwin\\ntwist\\ntwo\\ntype\\ntypical\\nugly\\numbrella\\nunable\\nunaware\\nuncle\\nuncover\\nunder\\nundo\\nunfair\\nunfold\\nunhappy\\nuniform\\nunique\\nunit\\nuniverse\\nunknown\\nunlock\\nuntil\\nunusual\\nunveil\\nupdate\\nupgrade\\nuphold\\nupon\\nupper\\nupset\\nurban\\nurge\\nusage\\nuse\\nused\\nuseful\\nuseless\\nusual\\nutility\\nvacant\\nvacuum\\nvague\\nvalid\\nvalley\\nvalve\\nvan\\nvanish\\nvapor\\nvarious\\nvast\\nvault\\nvehicle\\nvelvet\\nvendor\\nventure\\nvenue\\nverb\\nverify\\nversion\\nvery\\nvessel\\nveteran\\nviable\\nvibrant\\nvicious\\nvictory\\nvideo\\nview\\nvillage\\nvintage\\nviolin\\nvirtual\\nvirus\\nvisa\\nvisit\\nvisual\\nvital\\nvivid\\nvocal\\nvoice\\nvoid\\nvolcano\\nvolume\\nvote\\nvoyage\\nwage\\nwagon\\nwait\\nwalk\\nwall\\nwalnut\\nwant\\nwarfare\\nwarm\\nwarrior\\nwash\\nwasp\\nwaste\\nwater\\nwave\\nway\\nwealth\\nweapon\\nwear\\nweasel\\nweather\\nweb\\nwedding\\nweekend\\nweird\\nwelcome\\nwest\\nwet\\nwhale\\nwhat\\nwheat\\nwheel\\nwhen\\nwhere\\nwhip\\nwhisper\\nwide\\nwidth\\nwife\\nwild\\nwill\\nwin\\nwindow\\nwine\\nwing\\nwink\\nwinner\\nwinter\\nwire\\nwisdom\\nwise\\nwish\\nwitness\\nwolf\\nwoman\\nwonder\\nwood\\nwool\\nword\\nwork\\nworld\\nworry\\nworth\\nwrap\\nwreck\\nwrestle\\nwrist\\nwrite\\nwrong\\nyard\\nyear\\nyellow\\nyou\\nyoung\\nyouth\\nzebra\\nzero\\nzone\\nzoo\".split(\"\\n\")},7004:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.sha224=t.sha256=void 0;const r=n(3134),o=n(3654),i=(e,t,n)=>e&t^~e&n,a=(e,t,n)=>e&t^e&n^t&n,s=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]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)u[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],n=u[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;u[e]=i+u[e-7]+r+u[e-16]|0}let{A:n,B:r,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,o.rotr)(d,6)^(0,o.rotr)(d,11)^(0,o.rotr)(d,25))+i(d,f,h)+s[e]+u[e]|0,g=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+a(n,r,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=r,r=n,n=t+g|0}n=n+this.A|0,r=r+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(n,r,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{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}}t.sha256=(0,o.wrapConstructor)((()=>new l)),t.sha224=(0,o.wrapConstructor)((()=>new d))},7028:(e,t,n)=>{var r=n(4977),o=n(5755),i=n(8813),a=\"__lodash_placeholder__\",s=128,c=Math.min;e.exports=function(e,t){var n=e[1],u=t[1],l=n|u,d=l<131,f=u==s&&8==n||u==s&&256==n&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==n;if(!d&&!f)return e;1&u&&(e[2]=t[2],l|=1&n?0:4);var h=t[3];if(h){var p=e[3];e[3]=p?r(p,h,t[4]):h,e[4]=p?i(e[3],a):t[4]}return(h=t[5])&&(p=e[5],e[5]=p?o(p,h,t[6]):h,e[6]=p?i(e[5],a):t[6]),(h=t[7])&&(e[7]=h),u&s&&(e[8]=null==e[8]?t[8]:c(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},7034:(e,t,n)=>{var r=n(6285);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},7073:(e,t,n)=>{var r=n(2532);e.exports=function(e,t,n){\"__proto__\"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},7099:(e,t,n)=>{e=n.nmd(e);var r=n(8942),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},7144:(e,t,n)=>{var r=n(7034);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7200:(e,t,n)=>{var r=n(1580),o=n(4882),i=n(8546),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)(\"constructor\"!=s||!t&&a.call(e,s))&&n.push(s);return n}},7250:e=>{e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},7267:(e,t,n)=>{var r=n(1580);e.exports=function(e){return e==e&&!r(e)}},7276:(e,t,n)=>{var r=n(3636),o=n(5899);e.exports=function(e,t){return null!=e&&o(e,t,r)}},7336:(e,t,n)=>{var r=n(8638);function o(e,t,n){var i=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return i.placeholder=o.placeholder,i}o.placeholder={},e.exports=o},7350:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&\"string\"==typeof e[0]&&t.call(e,\"index\")&&(r.index=e.index,r.input=e.input),r}},7379:(e,t,n)=>{var r=n(5650),o=n(8870),i=n(9005),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":a&&a in Object(e)?o(e):i(e)}},7403:(e,t,n)=>{var r=n(2619),o=n(2532),i=n(2053),a=o?function(e,t){return o(e,\"toString\",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},7452:(e,t,n)=>{var r=n(7034);e.exports=function(e){return r(this.__data__,e)>-1}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},7553:(e,t,n)=>{var r=n(9747),o=n(5962);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},7642:(e,t,n)=>{var r=n(3301);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},7681:(e,t,n)=>{var r=n(777),o=n(9460),i=n(2306),a=i&&i.isMap,s=a?o(a):r;e.exports=s},7706:e=>{e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},7769:(e,t,n)=>{var r=n(8486),o=n(547);e.exports=function(e){return o(e)&&\"[object WeakMap]\"==r(e)}},7923:(e,t,n)=>{var r=n(3526),o=n(6040);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},7930:(e,t,n)=>{var r=n(9032),o=n(1211);e.exports=function(e,t){return e&&r(t,o(t),e)}},7979:(e,t,n)=>{var r=n(9847),o=n(9306),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},7991:(e,t)=>{\"use strict\";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,u=r-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\"));return i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},8055:(e,t,n)=>{e.exports={ary:n(5353),assign:n(7930),clone:n(2846),curry:n(7336),forEach:n(9968),isArray:n(3142),isError:n(441),isFunction:n(3655),isWeakMap:n(7769),iteratee:n(2590),keys:n(195),rearg:n(864),toInteger:n(7642),toPath:n(2613)}},8069:(e,t,n)=>{var r=n(5650),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},8121:(e,t,n)=>{var r=n(3766)(Object.keys,Object);e.exports=r},8244:(e,t,n)=>{var r=n(1129),o=n(3142);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},8250:(e,t,n)=>{var r=n(9753),o=n(5681),i=n(88),a=n(4732),s=n(9068);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},8330:(e,t,n)=>{var r=n(1340),o=n(4687);e.exports=function(e,t,n,i){var a=n.length,s=a,c=!i;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var l=(u=n[a])[0],d=e[l],f=u[1];if(c&&u[2]){if(void 0===d&&!(l in e))return!1}else{var h=new r;if(i)var p=i(d,f,l,e,t,h);if(!(void 0===p?o(f,d,3,i,h):p))return!1}}return!0}},8340:e=>{var t=/\\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},8360:(e,t,n)=>{var r=n(7379),o=n(4784),i=n(547),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||\"[object Object]\"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&c.call(n)==l}},8486:(e,t,n)=>{var r=n(3103),o=n(9770),i=n(9413),a=n(4512),s=n(9270),c=n(7379),u=n(4066),l=\"[object Map]\",d=\"[object Promise]\",f=\"[object Set]\",h=\"[object WeakMap]\",p=\"[object DataView]\",g=u(r),m=u(o),y=u(i),w=u(a),v=u(s),b=c;(r&&b(new r(new ArrayBuffer(1)))!=p||o&&b(new o)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||s&&b(new s)!=h)&&(b=function(e){var t=c(e),n=\"[object Object]\"==t?e.constructor:void 0,r=n?u(n):\"\";if(r)switch(r){case g:return p;case m:return l;case y:return d;case w:return f;case v:return h}return t}),e.exports=b},8546:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},8638:(e,t,n)=>{var r=n(4943),o=n(6713),i=n(2443),a=n(3504),s=n(6341),c=n(5196),u=n(7028),l=n(5512),d=n(5620),f=n(7642),h=Math.max;e.exports=function(e,t,n,p,g,m,y,w){var v=2&t;if(!v&&\"function\"!=typeof e)throw new TypeError(\"Expected a function\");var b=p?p.length:0;if(b||(t&=-97,p=g=void 0),y=void 0===y?y:h(f(y),0),w=void 0===w?w:f(w),b-=g?g.length:0,64&t){var A=p,S=g;p=g=void 0}var E=v?void 0:c(e),x=[e,t,n,p,g,A,S,m,y,w];if(E&&u(x,E),e=x[0],t=x[1],n=x[2],p=x[3],g=x[4],!(w=x[9]=void 0===x[9]?v?0:e.length:h(x[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||16==t?i(e,t,w):32!=t&&33!=t||g.length?a.apply(void 0,x):s(e,t,n,p);else var k=o(e,t,n);return d((E?r:l)(k,x),e,t)}},8666:(e,t,n)=>{var r=n(674),o=n(9460),i=n(2306),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},8788:e=>{var t=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,n=/,? & /;e.exports=function(e){var r=e.match(t);return r?r[1].split(n):[]}},8813:e=>{var t=\"__lodash_placeholder__\";e.exports=function(e,n){for(var r=-1,o=e.length,i=0,a=[];++r<o;){var s=e[r];s!==n&&s!==t||(e[r]=t,a[i++]=r)}return a}},8861:(e,t,n)=>{var r=n(5650),o=n(1623),i=n(6285),a=n(3934),s=n(5894),c=n(9828),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,f){switch(n){case\"[object DataView]\":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case\"[object ArrayBuffer]\":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return i(+e,+t);case\"[object Error]\":return e.name==t.name&&e.message==t.message;case\"[object RegExp]\":case\"[object String]\":return e==t+\"\";case\"[object Map]\":var h=s;case\"[object Set]\":var p=1&r;if(h||(h=c),e.size!=t.size&&!p)return!1;var g=f.get(e);if(g)return g==t;r|=2,f.set(e,t);var m=a(h(e),h(t),r,u,d,f);return f.delete(e),m;case\"[object Symbol]\":if(l)return l.call(e)==l.call(t)}return!1}},8870:(e,t,n)=>{var r=n(5650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},8880:(e,t,n)=>{var r=n(7923);e.exports=function(e){return function(t){return r(t,e)}}},8898:(e,t,n)=>{var r=n(1623);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},8942:(e,t,n)=>{var r=n(4967),o=\"object\"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function(\"return this\")();e.exports=i},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9011:(e,t,n)=>{var r=n(8250);function o(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new TypeError(\"Expected a function\");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},9032:(e,t,n)=>{var r=n(3422),o=n(7073);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?o(n,u,l):r(n,u,l)}return n}},9067:e=>{e.exports=function(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}},9068:(e,t,n)=>{var r=n(4700);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},9071:e=>{e.exports=function(){}},9141:e=>{var t=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;e.exports=function(e,n){var r=n.length;if(!r)return e;var o=r-1;return n[o]=(r>1?\"& \":\"\")+n[o],n=n.join(r>2?\", \":\" \"),e.replace(t,\"{\\n/* [wrapped with \"+n+\"] */\\n\")}},9270:(e,t,n)=>{var r=n(4715)(n(8942),\"WeakMap\");e.exports=r},9306:e=>{e.exports=function(){return[]}},9318:(e,t)=>{t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*g}},9334:(e,t,n)=>{var r=n(1340),o=n(9968),i=n(3422),a=n(7930),s=n(125),c=n(7099),u=n(4354),l=n(3546),d=n(4733),f=n(393),h=n(3650),p=n(8486),g=n(7350),m=n(424),y=n(5964),w=n(3142),v=n(5853),b=n(7681),A=n(1580),S=n(3943),E=n(1211),x=n(5288),k=\"[object Arguments]\",I=\"[object Function]\",T=\"[object Object]\",_={};_[k]=_[\"[object Array]\"]=_[\"[object ArrayBuffer]\"]=_[\"[object DataView]\"]=_[\"[object Boolean]\"]=_[\"[object Date]\"]=_[\"[object Float32Array]\"]=_[\"[object Float64Array]\"]=_[\"[object Int8Array]\"]=_[\"[object Int16Array]\"]=_[\"[object Int32Array]\"]=_[\"[object Map]\"]=_[\"[object Number]\"]=_[T]=_[\"[object RegExp]\"]=_[\"[object Set]\"]=_[\"[object String]\"]=_[\"[object Symbol]\"]=_[\"[object Uint8Array]\"]=_[\"[object Uint8ClampedArray]\"]=_[\"[object Uint16Array]\"]=_[\"[object Uint32Array]\"]=!0,_[\"[object Error]\"]=_[I]=_[\"[object WeakMap]\"]=!1,e.exports=function e(t,n,C,B,P,R){var N,O=1&n,U=2&n,M=4&n;if(C&&(N=P?C(t,B,P,R):C(t)),void 0!==N)return N;if(!A(t))return t;var z=w(t);if(z){if(N=g(t),!O)return u(t,N)}else{var L=p(t),j=L==I||\"[object GeneratorFunction]\"==L;if(v(t))return c(t,O);if(L==T||L==k||j&&!P){if(N=U||j?{}:y(t),!O)return U?d(t,s(N,t)):l(t,a(N,t))}else{if(!_[L])return P?t:{};N=m(t,L,O)}}R||(R=new r);var F=R.get(t);if(F)return F;R.set(t,N),S(t)?t.forEach((function(r){N.add(e(r,n,C,r,t,R))})):b(t)&&t.forEach((function(r,o){N.set(o,e(r,n,C,o,t,R))}));var D=z?void 0:(M?U?h:f:U?x:E)(t);return o(D||t,(function(r,o){D&&(r=t[o=r]),i(N,o,e(r,n,C,o,t,R))})),N}},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9413:(e,t,n)=>{var r=n(4715)(n(8942),\"Promise\");e.exports=r},9450:(e,t)=>{\"use strict\";function n(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function r(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}function o(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"alphabet.encode input should be an array of numbers\");return t.map((t=>{if(n(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"alphabet.decode input should be array of strings\");return t.map((t=>{if(\"string\"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n}))}}}function a(e=\"\"){if(\"string\"!=typeof e)throw new Error(\"join separator should be string\");return{encode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"join.encode input should be array of strings\");for(let e of t)if(\"string\"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if(\"string\"!=typeof t)throw new Error(\"join.decode input should be string\");return t.split(e)}}}function s(e,t=\"=\"){if(n(e),\"string\"!=typeof t)throw new Error(\"padding chr should be string\");return{encode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw new Error(\"Invalid padding: string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error(\"Invalid padding: string has too much padding\");return n.slice(0,r)}}}function c(e){if(\"function\"!=typeof e)throw new Error(\"normalize fn should be function\");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error(\"convertRadix: data should be array\");if(!e.length)return[];let o=0;const i=[],a=Array.from(e);for(a.forEach((e=>{if(n(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,n=!0;for(let i=o;i<a.length;i++){const s=a[i],c=t*e+s;if(!Number.isSafeInteger(c)||t*e/t!==e||c-s!==t*e)throw new Error(\"convertRadix: carry overflow\");e=c%r;const u=Math.floor(c/r);if(a[i]=u,!Number.isSafeInteger(u)||u*r+e!==c)throw new Error(\"convertRadix: carry overflow\");n&&(u?n=!1:o=i)}if(i.push(e),n)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}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,t.assertNumber=n;const l=(e,t)=>t?l(t,e%t):e,d=(e,t)=>e+(t-l(e,t));function f(e,t,r,o){if(!Array.isArray(e))throw new Error(\"convertRadix2: data should be array\");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(d(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${d(t,r)}`);let i=0,a=0;const s=2**r-1,c=[];for(const o of e){if(n(o),o>=2**t)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(i=i<<t|o,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)c.push((i>>a-r&s)>>>0);i&=2**a-1}if(i=i<<r-a&s,!o&&a>=t)throw new Error(\"Excess padding\");if(!o&&i)throw new Error(`Non-zero padding: ${i}`);return o&&a>0&&c.push(i>>>0),c}function h(e){return n(e),{encode:t=>{if(!r(t))throw new Error(\"radix.encode input should be Uint8Array\");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"radix.decode input should be array of numbers\");return Uint8Array.from(u(t,e,256))}}}function p(e,t=!1){if(n(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(d(8,e)>32||d(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!r(n))throw new Error(\"radix2.encode input should be Uint8Array\");return f(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"radix2.decode input should be array of numbers\");return Uint8Array.from(f(n,e,8,t))}}}function g(e){if(\"function\"!=typeof e)throw new Error(\"unsafeWrapper fn should be function\");return function(...t){try{return e.apply(null,t)}catch(e){}}}function m(e,t){if(n(e),\"function\"!=typeof t)throw new Error(\"checksum fn should be function\");return{encode(n){if(!r(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const o=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(o,n.length),i},decode(n){if(!r(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const o=n.slice(0,-e),i=t(o).slice(0,e),a=n.slice(-e);for(let t=0;t<e;t++)if(i[t]!==a[t])throw new Error(\"Invalid checksum\");return o}}}t.utils={alphabet:i,chain:o,checksum:m,convertRadix:u,convertRadix2:f,radix:h,radix2:p,join:a,padding:s},t.base16=o(p(4),i(\"0123456789ABCDEF\"),a(\"\")),t.base32=o(p(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),s(5),a(\"\")),t.base32nopad=o(p(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),a(\"\")),t.base32hex=o(p(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),s(5),a(\"\")),t.base32hexnopad=o(p(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),a(\"\")),t.base32crockford=o(p(5),i(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),a(\"\"),c((e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\")))),t.base64=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),s(6),a(\"\")),t.base64nopad=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),a(\"\")),t.base64url=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),s(6),a(\"\")),t.base64urlnopad=o(p(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),a(\"\"));const y=e=>o(h(58),i(e),a(\"\"));t.base58=y(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),t.base58flickr=y(\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"),t.base58xrp=y(\"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\");const w=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let n=\"\";for(let r=0;r<e.length;r+=8){const o=e.subarray(r,r+8);n+=t.base58.encode(o).padStart(w[o.length],\"1\")}return n},decode(e){let n=[];for(let r=0;r<e.length;r+=11){const o=e.slice(r,r+11),i=w.indexOf(o.length),a=t.base58.decode(o);for(let e=0;e<a.length-i;e++)if(0!==a[e])throw new Error(\"base58xmr: wrong padding\");n=n.concat(Array.from(a.slice(a.length-i)))}return Uint8Array.from(n)}};t.createBase58check=e=>o(m(4,(t=>e(e(t)))),t.base58),t.base58check=t.createBase58check;const v=o(i(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),a(\"\")),b=[996825010,642813549,513874426,1027748829,705979059];function A(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<b.length;e++)1==(t>>e&1)&&(n^=b[e]);return n}function S(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=A(o)^n>>5}o=A(o);for(let t=0;t<r;t++)o=A(o)^31&e.charCodeAt(t);for(let e of t)o=A(o)^e;for(let e=0;e<6;e++)o=A(o);return o^=n,v.encode(f([o%2**30],30,5,!1))}function E(e){const t=\"bech32\"===e?1:734539939,n=p(5),r=n.decode,o=n.encode,i=g(r);function a(e,n,r=90){if(\"string\"!=typeof e)throw new Error(\"bech32.encode prefix should be string, not \"+typeof e);if(n instanceof Uint8Array&&(n=Array.from(n)),!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"bech32.encode words should be array of numbers, not \"+typeof n);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const o=e.length+7+n.length;if(!1!==r&&o>r)throw new TypeError(`Length ${o} exceeds limit ${r}`);const i=e.toLowerCase(),a=S(i,n,t);return`${i}1${v.encode(n)}${a}`}function s(e,n=90){if(\"string\"!=typeof e)throw new Error(\"bech32.decode input should be string, not \"+typeof e);if(e.length<8||!1!==n&&e.length>n)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${n})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const o=r.lastIndexOf(\"1\");if(0===o||-1===o)throw new Error('Letter \"1\" must be present between prefix and data only');const i=r.slice(0,o),a=r.slice(o+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const s=v.decode(a).slice(0,-6),c=S(i,s,t);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected \"${c}\"`);return{prefix:i,words:s}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:g(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}t.bech32=E(\"bech32\"),t.bech32m=E(\"bech32m\"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=o(p(4),i(\"0123456789abcdef\"),a(\"\"),c((e=>{if(\"string\"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const x={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},k=\"Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr\";t.bytesToString=(e,t)=>{if(\"string\"!=typeof e||!x.hasOwnProperty(e))throw new TypeError(k);if(!r(t))throw new TypeError(\"bytesToString() expects Uint8Array\");return x[e].encode(t)},t.str=t.bytesToString;t.stringToBytes=(e,t)=>{if(!x.hasOwnProperty(e))throw new TypeError(k);if(\"string\"!=typeof t)throw new TypeError(\"stringToBytes() expects string\");return x[e].decode(t)},t.bytes=t.stringToBytes},9454:e=>{e.exports=function(e){return e!=e}},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},9624:(e,t,n)=>{var r=n(3655),o=n(4759),i=n(1580),a=n(4066),s=/^\\[object .+?Constructor\\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,f=RegExp(\"^\"+l.call(d).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},9632:e=>{var t=/^(?:0|[1-9]\\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&(\"number\"==r||\"symbol\"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},9648:(e,t)=>{\"use strict\";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function r(e){if(\"boolean\"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}(e))throw new Error(\"Expected Uint8Array\");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.wrapConstructor\");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function s(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=n,t.bool=r,t.bytes=o,t.hash=i,t.exists=a,t.output=s;const c={number:n,bool:r,bytes:o,hash:i,exists:a,output:s};t.default=c},9747:(e,t,n)=>{var r=n(1580),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},9753:(e,t,n)=>{var r=n(5098),o=n(1386),i=n(9770);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},9756:(e,t,n)=>{var r=n(2478);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},9770:(e,t,n)=>{var r=n(4715)(n(8942),\"Map\");e.exports=r},9828:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},9847:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},9968:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{\"use strict\";n.r(r),n.d(r,{onActive:()=>aO,onAssetHistoricalPrice:()=>eO,onAssetsConversion:()=>QN,onAssetsLookup:()=>YN,onAssetsMarketData:()=>uO,onClientRequest:()=>tO,onCronjob:()=>JN,onInactive:()=>sO,onInstall:()=>iO,onKeyringRequest:()=>GN,onNameLookup:()=>cO,onProtocolRequest:()=>XN,onRpcRequest:()=>VN,onStart:()=>rO,onUpdate:()=>oO,onUserInput:()=>ZN,onWebSocketEvent:()=>nO});var e={};n.r(e),n.d(e,{aK:()=>rb,e8:()=>Dv,DO:()=>Fv,dJ:()=>ob,OG:()=>ib,My:()=>Kv,Ph:()=>Zv,lX:()=>Jv,Id:()=>eb,fg:()=>cb,qj:()=>Xv,aT:()=>Gv,r4:()=>nb,aY:()=>jv,x:()=>db,lq:()=>Yv,z:()=>Qv,zW:()=>qv,Q5:()=>lb});var t={};n.r(t),n.d(t,{compressPublicKey:()=>GE,compressedPublicKeyLength:()=>QE,curve:()=>FE,decompressPublicKey:()=>ZE,deriveUnhardenedKeys:()=>qE,getPublicKey:()=>HE,isValidPrivateKey:()=>KE,masterNodeGenerationSpec:()=>YE,name:()=>DE,privateKeyLength:()=>JE,publicAdd:()=>VE,publicKeyLength:()=>WE,secret:()=>$E});var o={};n.r(o),n.d(o,{bytesToNumberLE:()=>ax,compressPublicKey:()=>lx,compressedPublicKeyLength:()=>px,curve:()=>XE,decompressPublicKey:()=>dx,deriveUnhardenedKeys:()=>ox,getPublicKey:()=>cx,isValidPrivateKey:()=>rx,masterNodeGenerationSpec:()=>hx,multiplyWithBase:()=>sx,name:()=>ex,privateKeyLength:()=>fx,publicAdd:()=>ux,publicKeyLength:()=>ix,secret:()=>tx});var i={};n.r(i),n.d(i,{compressPublicKey:()=>Fx,compressedPublicKeyLength:()=>qx,curve:()=>Rx,decompressPublicKey:()=>Dx,deriveUnhardenedKeys:()=>Ux,getPublicKey:()=>Lx,isValidPrivateKey:()=>zx,masterNodeGenerationSpec:()=>Kx,name:()=>Nx,privateKeyLength:()=>$x,publicAdd:()=>jx,publicKeyLength:()=>Mx,secret:()=>Ox});var a={};n.r(a),n.d(a,{deriveChildKey:()=>Bk,privateKeyToEthAddress:()=>_k,publicKeyToEthAddress:()=>Ck});var s={};n.r(s),n.d(s,{bip39MnemonicToMultipath:()=>Uk,createBip39KeyFromSeed:()=>zk,deriveChildKey:()=>Mk,entropyToCip3MasterNode:()=>Lk});var c={};n.r(c),n.d(c,{add:()=>Wk,bigIntToBytes:()=>Dk,bytesToBigInt:()=>Fk,deriveChainCode:()=>Qk,deriveChildKey:()=>tI,derivePrivateKey:()=>Zk,derivePublicKey:()=>eI,getKeyExtension:()=>Hk,mod2Pow256:()=>qk,padEnd32Bytes:()=>$k,toReversed:()=>jk,trunc28Mul8:()=>Kk});var u={};n.r(u),n.d(u,{deriveChildKey:()=>nI});var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)},d=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";(()=>{const e=Array(256).fill(-1);for(let t=0;t<58;++t)e[d.charCodeAt(t)]=t})();var f,h,p=e=>{if(!e||\"string\"!=typeof e)throw new Error(`Expected base58 string but got “${e}”`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character “${e.match(/[IOl0]/gmu)}”`);const t=e.match(/^1+/gmu),n=t?t[0].length:0,r=(e.length-n)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(n),...e.match(/.{1}/gmu).map((e=>d.indexOf(e))).reduce(((e,t)=>e.map((e=>{const n=58*e+t;return t=n>>8,n}))),new Uint8Array(r)).reverse().filter((o=!1,e=>o=o||e))]);var o},g=(function(e,t){Object.defineProperty(t,\"__esModule\",{value:!0}),t.bech32m=t.bech32=void 0;const n=\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\",r={};for(let e=0;e<32;e++){const t=n.charAt(e);r[t]=e}function o(e){const t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function i(e){let t=1;for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);if(r<33||r>126)return\"Invalid prefix (\"+e+\")\";t=o(t)^r>>5}t=o(t);for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);t=o(t)^31&r}return t}function a(e,t,n,r){let o=0,i=0;const a=(1<<n)-1,s=[];for(let r=0;r<e.length;++r)for(o=o<<t|e[r],i+=t;i>=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<<n-i&a);else{if(i>=t)return\"Excess padding\";if(o<<n-i&a)return\"Non-zero padding\"}return s}function s(e){return a(e,8,5,!0)}function c(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t}function u(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function a(e,n){if(n=n||90,e.length<8)return e+\" too short\";if(e.length>n)return\"Exceeds length limit\";const a=e.toLowerCase(),s=e.toUpperCase();if(e!==a&&e!==s)return\"Mixed-case string \"+e;const c=(e=a).lastIndexOf(\"1\");if(-1===c)return\"No separator character for \"+e;if(0===c)return\"Missing prefix for \"+e;const u=e.slice(0,c),l=e.slice(c+1);if(l.length<6)return\"Data too short\";let d=i(u);if(\"string\"==typeof d)return d;const f=[];for(let e=0;e<l.length;++e){const t=l.charAt(e),n=r[t];if(void 0===n)return\"Unknown character \"+t;d=o(d)^n,e+6>=l.length||f.push(n)}return d!==t?\"Invalid checksum for \"+e:{prefix:u,words:f}}return t=\"bech32\"===e?1:734539939,{decodeUnsafe:function(e,t){const n=a(e,t);if(\"object\"==typeof n)return n},decode:function(e,t){const n=a(e,t);if(\"object\"==typeof n)return n;throw new Error(n)},encode:function(e,r,a){if(a=a||90,e.length+7+r.length>a)throw new TypeError(\"Exceeds length limit\");let s=i(e=e.toLowerCase());if(\"string\"==typeof s)throw new Error(s);let c=e+\"1\";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5)throw new Error(\"Non 5-bit word\");s=o(s)^t,c+=n.charAt(t)}for(let e=0;e<6;++e)s=o(s);s^=t;for(let e=0;e<6;++e)c+=n.charAt(s>>5*(5-e)&31);return c},toWords:s,fromWordsUnsafe:c,fromWords:u}}t.bech32=l(\"bech32\"),t.bech32m=l(\"bech32m\")}(f={exports:{}},f.exports),f.exports);(h=g)&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,\"default\")&&h.default;var m=g.bech32m,y=g.bech32;const w=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class v{constructor(){this.A=1779033703,this.B=-1150833019,this.C=1013904242,this.D=-1521486534,this.E=1359893119,this.F=-1694144372,this.G=528734635,this.H=1541459225,this._size=0,this._sp=0,(!A||S>=8e3)&&(A=new ArrayBuffer(8e3),S=0),this._byte=new Uint8Array(A,S,80),this._word=new Int32Array(A,S,20),S+=80}update(e){if(\"string\"==typeof e)return this._utf8(e);if(null==e)throw new TypeError(\"Invalid type: \"+typeof e);const t=e.byteOffset,n=e.byteLength;let r=n/64|0,o=0;if(r&&!(3&t)&&!(this._size%64)){const n=new Int32Array(e.buffer,t,16*r);for(;r--;)this._int32(n,o>>2),o+=64;this._size+=o}if(1!==e.BYTES_PER_ELEMENT&&e.buffer){const r=new Uint8Array(e.buffer,t+o,n-o);return this._uint8(r)}return o===n?this:this._uint8(e,o)}_uint8(e,t){const{_byte:n,_word:r}=this,o=e.length;for(t|=0;t<o;){const i=this._size%64;let a=i;for(;t<o&&a<64;)n[a++]=e[t++];a>=64&&this._int32(r),this._size+=a-i}return this}_utf8(e){const{_byte:t,_word:n}=this,r=e.length;let o=this._sp;for(let i=0;i<r;){const a=this._size%64;let s=a;for(;i<r&&s<64;){let n=0|e.charCodeAt(i++);n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|63&n):n<55296||n>57343?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):o?(n=((1023&o)<<10)+(1023&n)+65536,t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n,o=0):o=n}s>=64&&(this._int32(n),n[0]=n[16]),this._size+=s-a}return this._sp=o,this}_int32(e,t){let{A:n,B:r,C:o,D:i,E:a,F:s,G:c,H:u}=this,l=0;for(t|=0;l<16;)b[l++]=x(e[t++]);for(l=16;l<64;l++)b[l]=B(b[l-2])+b[l-7]+C(b[l-15])+b[l-16]|0;for(l=0;l<64;l++){const e=u+_(a)+k(a,s,c)+w[l]+b[l]|0,t=T(n)+I(n,r,o)|0;u=c,c=s,s=a,a=i+e|0,i=o,o=r,r=n,n=e+t|0}this.A=n+this.A|0,this.B=r+this.B|0,this.C=o+this.C|0,this.D=i+this.D|0,this.E=a+this.E|0,this.F=s+this.F|0,this.G=c+this.G|0,this.H=u+this.H|0}digest(e){const{_byte:t,_word:n}=this;let r=this._size%64|0;for(t[r++]=128;3&r;)t[r++]=0;if(r>>=2,r>14){for(;r<16;)n[r++]=0;r=0,this._int32(n)}for(;r<16;)n[r++]=0;const o=8*this._size,i=(4294967295&o)>>>0,a=(o-i)/4294967296;return a&&(n[14]=x(a)),i&&(n[15]=x(i)),this._int32(n),\"hex\"===e?this._hex():this._bin()}_hex(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return E(e)+E(t)+E(n)+E(r)+E(o)+E(i)+E(a)+E(s)}_bin(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s,_byte:c,_word:u}=this;return u[0]=x(e),u[1]=x(t),u[2]=x(n),u[3]=x(r),u[4]=x(o),u[5]=x(i),u[6]=x(a),u[7]=x(s),c.slice(0,32)}}const b=new Int32Array(64);let A,S=0;const E=e=>(e+4294967296).toString(16).substr(-8),x=254===new Uint8Array(new Uint16Array([65279]).buffer)[0]?e=>e:e=>e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255,k=(e,t,n)=>n^e&(t^n),I=(e,t,n)=>e&t|n&(e|t),T=e=>(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),_=e=>(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7),C=e=>(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,B=e=>(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10;var P,R,N=function(e){return(new v).update(e).digest()};!function(e){e.mainnet=\"mainnet\",e.testnet=\"testnet\",e.regtest=\"regtest\"}(P||(P={})),function(e){e.p2pkh=\"p2pkh\",e.p2sh=\"p2sh\",e.p2wpkh=\"p2wpkh\",e.p2wsh=\"p2wsh\",e.p2tr=\"p2tr\"}(R||(R={}));var O={0:{type:R.p2pkh,network:P.mainnet},111:{type:R.p2pkh,network:P.testnet},5:{type:R.p2sh,network:P.mainnet},196:{type:R.p2sh,network:P.testnet}},U=function(e){var t,n=e.substr(0,2).toLowerCase();if(\"bc\"===n||\"tb\"===n)return function(e){var t;try{t=e.startsWith(\"bc1p\")||e.startsWith(\"tb1p\")||e.startsWith(\"bcrt1p\")?m.decode(e):y.decode(e)}catch(e){throw new Error(\"Invalid address\")}var n={bc:P.mainnet,tb:P.testnet,bcrt:P.regtest}[t.prefix];if(void 0===n)throw new Error(\"Invalid address\");var r=t.words[0];if(r<0||r>16)throw new Error(\"Invalid address\");return{bech32:!0,network:n,address:e,type:20===y.fromWords(t.words.slice(1)).length?R.p2wpkh:1===r?R.p2tr:R.p2wsh}}(e);try{t=p(e)}catch(e){throw new Error(\"Invalid address\")}var r=t.length;if(25!==r)throw new Error(\"Invalid address\");var o=t[0],i=t.slice(r-4,r),a=t.slice(0,r-4),s=N(N(a)).slice(0,4);if(i.some((function(e,t){return e!==s[t]})))throw new Error(\"Invalid address\");if(!Object.keys(O).map(Number).includes(o))throw new Error(\"Invalid address\");return l(l({},O[o]),{address:e,bech32:!1})};class M extends TypeError{constructor(e,t){let n;const{message:r,explanation:o,...i}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(\".\")} -- ${r}`;super(o??s),null!=o&&(this.cause=s),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function z(e){return\"object\"==typeof e&&null!==e}function L(e){if(\"[object Object]\"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function j(e){return\"symbol\"==typeof e?e.toString():\"string\"==typeof e?JSON.stringify(e):`${e}`}function F(e,t,n,r){if(!0===e)return;!1===e?e={}:\"string\"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=n,{refinement:s,message:c=`Expected a value of type \\`${a}\\`${s?` with refinement \\`${s}\\``:\"\"}, but received: \\`${j(r)}\\``}=e;return{value:r,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*D(e,t,n,r){(function(e){return z(e)&&\"function\"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const o of e){const e=F(o,t,n,r);e&&(yield e)}}function*$(e,t,n={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:a=!1}=n,s={path:r,branch:o};if(i&&(e=t.coercer(e,s),a&&\"type\"!==t.type&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c=\"valid\";for(const r of t.validator(e,s))r.explanation=n.message,c=\"not_valid\",yield[r,void 0];for(let[u,l,d]of t.entries(e,s)){const t=$(l,d,{path:void 0===u?r:[...r,u],branch:void 0===u?o:[...o,l],coerce:i,mask:a,message:n.message});for(const n of t)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?\"not_valid\":\"not_refined\",yield[n[0],void 0]):i&&(l=n[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):z(e)&&(void 0!==l||u in e)&&(e[u]=l))}if(\"not_valid\"!==c)for(const r of t.refiner(e,s))r.explanation=n.message,c=\"not_refined\",yield[r,void 0];\"valid\"===c&&(yield[void 0,e])}class K{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=i,this.validator=r?(e,t)=>D(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>D(o(e,t),t,this,e):()=>[]}assert(e,t){return H(e,this,t)}create(e,t){return V(e,this,t)}is(e){return G(e,this)}mask(e,t){return function(e,t,n){const r=Z(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return Z(e,this,t)}}const q=\"EXACT_OPTIONAL\";class W extends K{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=q}static isExactOptional(e){return z(e)&&\"brand\"in e&&e.brand===q}}function H(e,t,n){const r=Z(e,t,{message:n});if(r[0])throw r[0]}function V(e,t,n){const r=Z(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function G(e,t){return!Z(e,t)[0]}function Z(e,t,n={}){const r=$(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new M(o[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function J(){return pe(\"any\",(()=>!0))}function Y(e){return new K({type:\"array\",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${j(e)}`})}function Q(){return pe(\"boolean\",(e=>\"boolean\"==typeof e))}function X(e){const t={},n=e.map((e=>j(e))).join();for(const n of e)t[n]=n;return new K({type:\"enums\",schema:t,validator:t=>e.includes(t)||`Expected one of \\`${n}\\`, but received: ${j(t)}`})}function ee(){return pe(\"integer\",(e=>\"number\"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${j(e)}`))}function te(e){const t=j(e),n=typeof e;return new K({type:\"literal\",schema:\"string\"===n||\"number\"===n||\"boolean\"===n?e:null,validator:n=>n===e||`Expected the literal \\`${t}\\`, but received: ${j(n)}`})}function ne(){return pe(\"never\",(()=>!1))}function re(e){return new K({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function oe(){return pe(\"number\",(e=>\"number\"==typeof e&&!isNaN(e)||`Expected a number, but received: ${j(e)}`))}function ie(e){const t=e?Object.keys(e):[],n=ne();return new K({type:\"object\",schema:e??null,*entries(r){if(e&&z(r)){const o=new Set(Object.keys(r));for(const n of t){o.delete(n);const t=e[n];W.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],e[n]])}for(const e of o)yield[e,r[e],n]}},validator:e=>z(e)||`Expected an object, but received: ${j(e)}`,coercer:e=>z(e)?{...e}:e})}function ae(e){return new K({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function se(e){return new W(e)}function ce(e,t){return new K({type:\"record\",schema:null,*entries(n){if(z(n))for(const r in n){const o=n[r];yield[r,r,e],yield[r,o,t]}},validator:e=>z(e)||`Expected an object, but received: ${j(e)}`})}function ue(){return pe(\"string\",(e=>\"string\"==typeof e||`Expected a string, but received: ${j(e)}`))}function le(e){const t=ne();return new K({type:\"tuple\",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let o=0;o<r;o++)yield[o,n[o],e[o]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${j(e)}`})}function de(e){const t=Object.keys(e);return new K({type:\"type\",schema:e,*entries(n){if(z(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>z(e)||`Expected an object, but received: ${j(e)}`,coercer:e=>z(e)?{...e}:e})}function fe(e){const t=e.map((e=>e.type)).join(\" | \");return new K({type:\"union\",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const o=[];for(const t of e){const[...e]=$(n,t,r),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${j(n)}`,...o]}})}function he(){return pe(\"unknown\",(()=>!0))}function pe(e,t){return new K({type:e,schema:null,validator:t})}function ge(e,t){return pe(e,(e=>\"string\"==typeof e&&t.test(e)))}const me=ge(\"UuidV4\",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),ye=me,we=pe(\"Url\",(e=>{try{const t=new URL(e);return\"http:\"===t.protocol||\"https:\"===t.protocol}catch{return!1}})),ve=ge(\"StringNumber\",/^\\d+(\\.\\d+)?$/u);function be(e){return ie(e)}function Ae(e){return e.path[e.path.length-1]in e.branch[e.branch.length-2]}function Se(e){return new K({...e,validator:(t,n)=>!Ae(n)||e.validator(t,n),refiner:(t,n)=>!Ae(n)||e.refiner(t,n)})}function Ee(e){return new K({type:\"union\",schema:null,*entries(t,n){yield*e(t).entries(t,n)},*refiner(t,n){yield*e(t).refiner(t,n)},coercer:(t,n)=>e(t).coercer(t,n),validator:(t,n)=>e(t).validator(t,n)})}function xe(e,t,n){return new K({...e,coercer:(r,o)=>G(r,t)?e.coercer(n(r,o),o):e.coercer(r,o)})}function ke(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Ie(e,t,n={}){const{exclusive:r}=n;return Ce(e,\"min\",(n=>r?n>t:n>=t||`Expected a ${e.type} greater than ${r?\"\":\"or equal to \"}${t} but received \\`${n}\\``))}function Te(e){return Ce(e,\"nonempty\",(t=>ke(t)>0||`Expected a nonempty ${e.type} but received an empty one`))}function _e(e,t){return Ce(e,\"pattern\",(n=>t.test(n)||`Expected a ${e.type} matching \\`/${t.source}/\\` but received \"${n}\"`))}function Ce(e,t,n){return new K({...e,*refiner(r,o){yield*e.refiner(r,o);const i=D(n(r,o),o,e,r);for(const e of i)yield{...e,refinement:t}}})}var Be;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(Be=Be||(Be={}));const Pe=e=>ie(e);function Re({path:e,branch:t}){const n=e[e.length-1];return r=t[t.length-2],o=n,Object.hasOwnProperty.call(r,o);var r,o}function Ne(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!Re(n)||e.validator(t,n),refiner:(t,n)=>!Re(n)||e.refiner(t,n)})}function Oe(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!Oe(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!Oe(n[e][1])){t=!1;break}return t}return!1}const Ue=pe(\"JSON\",(e=>Oe(e))),Me=xe(Ue,Ce(J(),\"JSON\",(e=>G(e,Ue))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));const ze=te(\"2.0\"),Le=re(fe([oe(),ue()])),je=Pe({code:ee(),message:ue(),data:Ne(Me),stack:Ne(ue())}),Fe=fe([ce(ue(),Me),Y(Me)]);Pe({id:Le,jsonrpc:ze,method:ue(),params:Ne(Fe)}),Pe({jsonrpc:ze,method:ue(),params:Ne(Fe)});ie({id:Le,jsonrpc:ze,result:ae(he()),error:ae(je)});const De=Pe({id:Le,jsonrpc:ze,result:Me}),$e=Pe({id:Le,jsonrpc:ze,error:je});fe([De,$e]);const Ke=be({jsonrpc:te(\"2.0\"),id:fe([ue(),oe(),te(null)]),method:ue(),params:Se(fe([Y(Me),ce(ue(),Me)]))});var qe;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(qe=qe||(qe={}));function We(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}const He=e=>ie(e);function Ve({path:e,branch:t}){const n=e[e.length-1];return r=t[t.length-2],o=n,Object.hasOwnProperty.call(r,o);var r,o}function Ge(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!Ve(n)||e.validator(t,n),refiner:(t,n)=>!Ve(n)||e.refiner(t,n)})}function Ze(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!Ze(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!Ze(n[e][1])){t=!1;break}return t}return!1}const Je=pe(\"JSON\",(e=>Ze(e))),Ye=xe(Je,Ce(J(),\"JSON\",(e=>G(e,Je))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));const Qe=te(\"2.0\"),Xe=re(fe([oe(),ue()])),et=He({code:ee(),message:ue(),data:Ge(Ye),stack:Ge(ue())}),tt=fe([ce(ue(),Ye),Y(Ye)]);He({id:Xe,jsonrpc:Qe,method:ue(),params:Ge(tt)}),He({jsonrpc:Qe,method:ue(),params:Ge(tt)});ie({id:Xe,jsonrpc:Qe,result:ae(he()),error:ae(et)});const nt=He({id:Xe,jsonrpc:Qe,result:Ye}),rt=He({id:Xe,jsonrpc:Qe,error:et});fe([nt,rt]);var ot;!function(e){e.Mnemonic=\"mnemonic\",e.PrivateKey=\"private-key\",e.Custom=\"custom\"}(ot||(ot={}));const it=ie({type:te(`${ot.Mnemonic}`),id:ue(),derivationPath:ue(),groupIndex:oe()}),at=ie({type:te(`${ot.PrivateKey}`)}),st=ie({type:te(`${ot.Custom}`)}),ct=Ee((e=>{if(!We(e))return it;switch(e.type){case ot.PrivateKey:return at;case ot.Custom:return st;case ot.Mnemonic:default:return it}})),ut=(lt=[ce(ue(),Ye),(dt={entropy:Se(ct),exportable:Se(Q())},de(dt))],new K({type:\"intersection\",schema:null,*entries(e,t){for(const{entries:n}of lt)yield*n(e,t)},*validator(e,t){for(const{validator:n}of lt)yield*n(e,t)},*refiner(e,t){for(const{refiner:n}of lt)yield*n(e,t)}}));var lt,dt;function ft(e,t){return pe(e,(e=>\"string\"==typeof e&&t.test(e)))}const ht=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,pt=/^[-a-z0-9]{3,8}$/u,gt=/^[-_a-zA-Z0-9]{1,32}$/u,mt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,yt=/^[-.%a-zA-Z0-9]{1,128}$/u,wt=/^[-a-z0-9]{3,8}$/u,vt=/^[-.%a-zA-Z0-9]{1,128}$/u,bt=/^[-.%a-zA-Z0-9]{1,78}$/u,At=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,St=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,Et=ft(\"CaipChainId\",ht),xt=(ft(\"CaipNamespace\",pt),ft(\"CaipReference\",gt),ft(\"CaipAccountId\",mt)),kt=(ft(\"CaipAccountAddress\",yt),ft(\"CaipAssetNamespace\",wt),ft(\"CaipAssetReference\",vt),ft(\"CaipTokenId\",bt),ft(\"CaipAssetType\",At)),It=ft(\"CaipAssetId\",St),Tt=ft(\"CaipAssetTypeOrId\",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var _t,Ct,Bt,Pt,Rt,Nt;!function(e){e.Bip122=\"bip122\",e.Solana=\"solana\",e.Tron=\"tron\",e.Eip155=\"eip155\",e.Wallet=\"wallet\"}(_t=_t||(_t={})),function(e){e.Eoa=\"eip155:eoa\",e.Erc4337=\"eip155:erc4337\"}(Ct||(Ct={})),function(e){e.P2pkh=\"bip122:p2pkh\",e.P2sh=\"bip122:p2sh\",e.P2wpkh=\"bip122:p2wpkh\",e.P2tr=\"bip122:p2tr\"}(Bt||(Bt={})),function(e){e.DataAccount=\"solana:data-account\"}(Pt||(Pt={})),function(e){e.Eoa=\"tron:eoa\"}(Rt||(Rt={})),function(e){e.Account=\"any:account\"}(Nt||(Nt={}));const Ot=X([`${Ct.Eoa}`,`${Ct.Erc4337}`,`${Bt.P2pkh}`,`${Bt.P2sh}`,`${Bt.P2wpkh}`,`${Bt.P2tr}`,`${Pt.DataAccount}`,`${Rt.Eoa}`,`${Nt.Account}`]),Ut=be({id:ye,type:X([`${Ct.Eoa}`,`${Ct.Erc4337}`,`${Bt.P2pkh}`,`${Bt.P2sh}`,`${Bt.P2wpkh}`,`${Bt.P2tr}`,`${Pt.DataAccount}`,`${Rt.Eoa}`,`${Nt.Account}`]),address:ue(),scopes:Te(Y(Et)),options:ut,methods:Y(ue())}),Mt=(ie({address:xt}),be({unit:ue(),amount:ve})),zt=be({fungible:te(!0),type:kt,...Mt.schema}),Lt=be({fungible:te(!1),id:It}),jt=Ee((e=>We(e)&&!e.fungible?Lt:zt)),Ft=be({amount:ve,unit:ue()}),Dt=ft(\"DerivationPath\",/^m(?:\\/\\d+'?)+$/u);var $t;!function(e){e.Bip44=\"bip44\"}($t||($t={}));const Kt=ie({type:te(`${$t.Bip44}`),scopes:Y(Et),derivationPath:Dt}),qt=(ce(ue(),Ye),be({id:me,scope:ue(),account:me,origin:ue(),request:be({method:ue(),params:Se(fe([Y(Ye),ce(ue(),Ye)]))})})),Wt=(fe([be({pending:te(!0),redirect:Se(be({message:Se(ue()),url:Se(ue())}))}),be({pending:te(!1),result:Ye})]),be({address:ue(),asset:re(jt)}));var Ht;!function(e){e.Base=\"base\",e.Priority=\"priority\"}(Ht||(Ht={}));const Vt=be({type:X([`${Ht.Base}`,`${Ht.Priority}`]),asset:jt});var Gt,Zt,Jt;!function(e){e.Submitted=\"submitted\",e.Unconfirmed=\"unconfirmed\",e.Confirmed=\"confirmed\",e.Failed=\"failed\"}(Gt||(Gt={})),function(e){e.Send=\"send\",e.Receive=\"receive\",e.Swap=\"swap\",e.BridgeSend=\"bridge:send\",e.BridgeReceive=\"bridge:receive\",e.StakeDeposit=\"stake:deposit\",e.StakeWithdraw=\"stake:withdraw\",e.Unknown=\"unknown\"}(Zt||(Zt={})),function(e){e.Benign=\"Benign\",e.Warning=\"Warning\",e.Malicious=\"Malicious\"}(Jt||(Jt={}));const Yt=be({origin:Se(ue()),securityAlertResponse:Se(X([`${Jt.Benign}`,`${Jt.Warning}`,`${Jt.Malicious}`]))}),Qt=be({status:X([`${Gt.Submitted}`,`${Gt.Unconfirmed}`,`${Gt.Confirmed}`,`${Gt.Failed}`]),timestamp:re(oe())}),Xt=be({id:ue(),chain:Et,account:me,status:X([`${Gt.Submitted}`,`${Gt.Unconfirmed}`,`${Gt.Confirmed}`,`${Gt.Failed}`]),timestamp:re(oe()),type:X([`${Zt.Send}`,`${Zt.Receive}`,`${Zt.Swap}`,`${Zt.BridgeSend}`,`${Zt.BridgeReceive}`,`${Zt.StakeDeposit}`,`${Zt.StakeWithdraw}`,`${Zt.Unknown}`]),from:Y(Wt),to:Y(Wt),fees:Y(Vt),events:Y(Qt),details:Se(Yt)}),en=(be({data:Y(Xt),next:re(ue())}),be({limit:oe(),next:Se(re(ue()))})),tn=be({metamask:Se(be({correlationId:me}))});var nn;!function(e){e.Hexadecimal=\"hexadecimal\",e.Base58=\"base58\"}(nn||(nn={}));const rn=X([`${nn.Hexadecimal}`,`${nn.Base58}`]),on=ie({encoding:rn,type:se(Ot)}),an=ie({encoding:rn});ie({scopes:Te(Y(Et)),bip44:se(ie({derivePath:se(Q()),deriveIndex:se(Q()),deriveIndexRange:se(Q()),discover:se(Q())})),privateKey:se(ie({importFormats:se(Y(on)),exportFormats:se(Y(an))})),custom:se(function(e){const t=e instanceof K,n=t?{...e.schema}:{...e};for(const e in n)n[e]=ae(n[e]);return t&&\"type\"===e.type?de(n):ie(n)}(ie({createAccounts:Q()})))});var sn;!function(e){e.Hd=\"hd\",e.PrivateKey=\"private-key\",e.Qr=\"qr\",e.Snap=\"snap\",e.Ledger=\"ledger\",e.Lattice=\"lattice\",e.Trezor=\"trezor\",e.OneKey=\"onekey\",e.Money=\"money\"}(sn||(sn={}));const cn=ie({type:te(\"bip44:derive-path\"),entropySource:ue(),derivationPath:Dt}),un=ie({type:te(\"bip44:derive-index\"),entropySource:ue(),groupIndex:oe()}),ln=ie({type:te(\"bip44:discover\"),entropySource:ue(),groupIndex:oe()}),dn=ie({type:te(\"bip44:derive-index-range\"),entropySource:ue(),range:ie({from:oe(),to:oe()})}),fn=de({type:te(\"custom\")}),hn=ie({type:te(\"private-key:import\"),privateKey:ue(),encoding:rn,accountType:se(Ot)});var pn;!function(e){e.Bip44DerivePath=\"bip44:derive-path\",e.Bip44DeriveIndex=\"bip44:derive-index\",e.Bip44DeriveIndexRange=\"bip44:derive-index-range\",e.Bip44Discover=\"bip44:discover\",e.PrivateKeyImport=\"private-key:import\",e.Custom=\"custom\"}(pn||(pn={}));const gn=Ee((e=>{const t=e?.type;switch(t){case pn.Bip44DerivePath:return cn;case pn.Bip44DeriveIndex:return un;case pn.Bip44DeriveIndexRange:return dn;case pn.Bip44Discover:return ln;case pn.PrivateKeyImport:return hn;case pn.Custom:return fn;default:return cn}}));ie({type:te(\"private-key\"),privateKey:ue(),encoding:rn}),ie({type:te(\"private-key\"),encoding:rn});var mn;!function(e){e.PrivateKey=\"private-key\"}(mn||(mn={}));var yn;!function(e){e.Mainnet=\"bip122:000000000019d6689c085ae165831e93\",e.Testnet=\"bip122:000000000933ea01ad0ee984209779ba\",e.Testnet4=\"bip122:00000000da84f2bafbbc53dee25a72ae\",e.Signet=\"bip122:00000008819873e925422c1ff0f99f7c\",e.Regtest=\"bip122:regtest\"}(yn||(yn={}));const wn=(e,t)=>{try{return U(e).type===t||new Error(`Invalid ${t} address`)}catch(e){return new Error(`Failed to decode ${t} address: ${e.message}`)}},vn=Ce(ue(),\"BtcP2pkhAddressStruct\",(e=>wn(e,R.p2pkh))),bn=Ce(ue(),\"BtcP2shAddressStruct\",(e=>wn(e,R.p2sh))),An=Ce(ue(),\"BtcP2wpkhAddressStruct\",(e=>wn(e,R.p2wpkh))),Sn=Ce(ue(),\"BtcP2trAddressStruct\",(e=>wn(e,R.p2tr)));var En;!function(e){e.SignPsbt=\"signPsbt\",e.ComputeFee=\"computeFee\",e.FillPsbt=\"fillPsbt\",e.BroadcastPsbt=\"broadcastPsbt\",e.SendTransfer=\"sendTransfer\",e.GetUtxo=\"getUtxo\",e.ListUtxos=\"listUtxos\",e.PublicDescriptor=\"publicDescriptor\",e.SignMessage=\"signMessage\"}(En||(En={}));const xn=be({...Ut.schema,scopes:Te(Y(Et)),methods:Y(X(Object.values(En)))});be({...xn.schema,address:vn,type:te(`${Bt.P2pkh}`)}),be({...xn.schema,address:bn,type:te(`${Bt.P2sh}`)}),be({...xn.schema,address:An,type:te(`${Bt.P2wpkh}`)}),be({...xn.schema,address:Sn,type:te(`${Bt.P2tr}`)});var kn;!function(e){e.Devnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",e.Mainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",e.Testnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\"}(kn||(kn={}));const In=ft(\"SolAddress\",/^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu);var Tn;!function(e){e.SendAndConfirmTransaction=\"sendAndConfirmTransaction\",e.SignAndSendTransaction=\"signAndSendTransaction\",e.SignTransaction=\"signTransaction\",e.SignMessage=\"signMessage\",e.SignIn=\"signIn\"}(Tn||(Tn={}));be({...Ut.schema,address:In,type:te(`${Pt.DataAccount}`),scopes:Te(Y(Et)),methods:Y(X(Object.values(Tn)))});var _n;!function(e){e.Eoa=\"eip155:0\",e.Mainnet=\"eip155:1\",e.Testnet=\"eip155:11155111\"}(_n||(_n={}));const Cn=ft(\"EthBytes\",/^0x[0-9a-f]*$/iu),Bn=/^0x[0-9a-f]{40}$/iu,Pn=ft(\"EthAddress\",Bn),Rn=ft(\"EthAddressStrict\",Bn),Nn=ft(\"EthUint256\",/^0x([1-9a-f][0-9a-f]*|0)$/iu);var On;!function(e){e.PersonalSign=\"personal_sign\",e.Sign=\"eth_sign\",e.SignTransaction=\"eth_signTransaction\",e.SignTypedDataV1=\"eth_signTypedData_v1\",e.SignTypedDataV3=\"eth_signTypedData_v3\",e.SignTypedDataV4=\"eth_signTypedData_v4\",e.PrepareUserOperation=\"eth_prepareUserOperation\",e.PatchUserOperation=\"eth_patchUserOperation\",e.SignUserOperation=\"eth_signUserOperation\"}(On||(On={}));be({...Ut.schema,address:Pn,type:te(`${Ct.Eoa}`),scopes:Te(Y(te(_n.Eoa))),methods:Y(X([`${On.PersonalSign}`,`${On.Sign}`,`${On.SignTransaction}`,`${On.SignTypedDataV1}`,`${On.SignTypedDataV3}`,`${On.SignTypedDataV4}`]))}),be({...Ut.schema,address:Pn,type:te(`${Ct.Erc4337}`),scopes:Te(Y(Et)),methods:Y(X([`${On.PersonalSign}`,`${On.Sign}`,`${On.SignTypedDataV1}`,`${On.SignTypedDataV3}`,`${On.SignTypedDataV4}`,`${On.PrepareUserOperation}`,`${On.PatchUserOperation}`,`${On.SignUserOperation}`]))}),be({sender:Pn,nonce:Nn,initCode:Cn,callData:Cn,callGasLimit:Nn,verificationGasLimit:Nn,preVerificationGas:Nn,maxFeePerGas:Nn,maxPriorityFeePerGas:Nn,paymasterAndData:Cn,signature:Cn}),be({to:Pn,value:Nn,data:Cn}),be({nonce:Nn,initCode:Cn,callData:Cn,gasLimits:Se(be({callGasLimit:Nn,verificationGasLimit:Nn,preVerificationGas:Nn})),dummyPaymasterAndData:Cn,dummySignature:Cn,bundlerUrl:we}),be({paymasterAndData:Cn,callGasLimit:Se(Nn),verificationGasLimit:Se(Nn),preVerificationGas:Se(Nn)});const Un=de({to:ae(re(Pn)),from:ae(Pn),nonce:ae(fe([ue(),oe()])),value:ae(fe([ue(),oe()])),data:ae(Cn),gas:ae(fe([ue(),oe()])),gasLimit:ae(fe([ue(),oe()])),gasPrice:ae(fe([ue(),oe()])),maxFeePerGas:ae(fe([ue(),oe()])),maxPriorityFeePerGas:ae(fe([ue(),oe()])),accessList:ae(Y(de({address:Pn,storageKeys:Y(ue())}))),type:ae(fe([ue(),oe()])),chainId:ae(fe([ue(),oe()]))}),Mn=Y(be({type:ue(),name:ue(),value:he()})),zn=ce(ue(),Y(be({name:ue(),type:ue()}))),Ln=be({types:zn,primaryType:ue(),domain:ce(ue(),J()),message:ce(ue(),J())}),jn=be({version:te(\"x25519-xsalsa20-poly1305\"),nonce:ue(),ephemPublicKey:ue(),ciphertext:ue()}),Fn=le([oe(),Rn,oe()]),Dn=ce(ue(),he());le([Un]),le([Pn,Cn]),fe([le([Cn]),le([Cn,Pn])]),le([Pn,Mn]),le([Pn,Ln]),le([jn]),le([ue()]),le([Fn]),le([Pn,ae(Dn)]);var $n;!function(e){e.Mainnet=\"tron:728126428\",e.Nile=\"tron:3448148188\",e.Shasta=\"tron:2494104990\"}($n||($n={}));const Kn=ft(\"TrxAddress\",/^T[1-9A-HJ-NP-Za-km-z]{33}$/iu);var qn;!function(e){e.SignMessage=\"signMessage\",e.SignTransaction=\"signTransaction\",e.SignMessageV2=\"signMessageV2\",e.VerifyMessageV2=\"verifyMessageV2\"}(qn||(qn={}));be({...Ut.schema,address:Kn,type:te(`${Rt.Eoa}`),scopes:Te(Y(Et)),methods:Y(X(Object.values(qn)))});var Wn;!function(e){e.CreateAccount=\"keyring_createAccount\",e.CreateAccounts=\"keyring_createAccounts\",e.DeleteAccount=\"keyring_deleteAccount\",e.DiscoverAccounts=\"keyring_discoverAccounts\",e.ExportAccount=\"keyring_exportAccount\",e.FilterAccountChains=\"keyring_filterAccountChains\",e.GetAccount=\"keyring_getAccount\",e.ListAccounts=\"keyring_listAccounts\",e.UpdateAccount=\"keyring_updateAccount\",e.ApproveRequest=\"keyring_approveRequest\",e.GetRequest=\"keyring_getRequest\",e.ListRequests=\"keyring_listRequests\",e.RejectRequest=\"keyring_rejectRequest\",e.SubmitRequest=\"keyring_submitRequest\",e.GetAccountBalances=\"keyring_getAccountBalances\",e.ListAccountAssets=\"keyring_listAccountAssets\",e.ListAccountTransactions=\"keyring_listAccountTransactions\",e.SetSelectedAccounts=\"keyring_setSelectedAccounts\",e.ResolveAccountAddress=\"keyring_resolveAccountAddress\"}(Wn||(Wn={}));const Hn={jsonrpc:te(\"2.0\"),id:fe([ue(),oe(),te(null)])},Vn=be({...Hn,method:te(\"keyring_listAccounts\")}),Gn=(Y(Ut),be({...Hn,method:te(\"keyring_getAccount\"),params:be({id:me})})),Zn=be({...Hn,method:te(\"keyring_createAccount\"),params:be({options:ce(ue(),Ye)})}),Jn=be({...Hn,method:te(\"keyring_createAccounts\"),params:be({options:gn})}),Yn=(Y(Ut),be({...Hn,method:te(\"keyring_setSelectedAccounts\"),params:be({accounts:Y(ue())})})),Qn=(te(null),be({...Hn,method:te(\"keyring_discoverAccounts\"),params:be({scopes:Y(Et),entropySource:ue(),groupIndex:oe()})})),Xn=(Y(Kt),be({...Hn,method:te(\"keyring_listAccountTransactions\"),params:be({id:me,pagination:en})})),er=be({...Hn,method:te(\"keyring_listAccountAssets\"),params:be({id:me})}),tr=Y(Tt),nr=be({...Hn,method:te(`${Wn.GetAccountBalances}`),params:be({id:me,assets:Y(kt)})}),rr=(ce(kt,Ft),be({...Hn,method:te(\"keyring_resolveAccountAddress\"),params:be({scope:Et,request:Ke})})),or=(re(be({address:xt})),be({...Hn,method:te(\"keyring_filterAccountChains\"),params:be({id:me,chains:Y(ue())})})),ir=(Y(ue()),be({...Hn,method:te(\"keyring_updateAccount\"),params:be({account:Ut})})),ar=(te(null),be({...Hn,method:te(\"keyring_deleteAccount\"),params:be({id:me})})),sr=(te(null),be({...Hn,method:te(\"keyring_exportAccount\"),params:be({id:me})})),cr=be({...Hn,method:te(\"keyring_listRequests\")}),ur=(Y(qt),be({...Hn,method:te(\"keyring_getRequest\"),params:be({id:me})})),lr=be({...Hn,method:te(\"keyring_submitRequest\"),params:qt}),dr=be({...Hn,method:te(\"keyring_approveRequest\"),params:be({id:me,data:ce(ue(),Ye)})}),fr=(te(null),be({...Hn,method:te(\"keyring_rejectRequest\"),params:be({id:me})}));te(null);var hr;!function(e){e.AccountCreated=\"notify:accountCreated\",e.AccountUpdated=\"notify:accountUpdated\",e.AccountDeleted=\"notify:accountDeleted\",e.RequestApproved=\"notify:requestApproved\",e.RequestRejected=\"notify:requestRejected\",e.AccountBalancesUpdated=\"notify:accountBalancesUpdated\",e.AccountAssetListUpdated=\"notify:accountAssetListUpdated\",e.AccountTransactionsUpdated=\"notify:accountTransactionsUpdated\"}(hr||(hr={}));be({method:te(`${hr.AccountCreated}`),params:be({account:Ut,accountNameSuggestion:Se(ue()),displayConfirmation:Se(Q()),displayAccountNameSuggestion:Se(Q()),...tn.schema})}),be({method:te(`${hr.AccountUpdated}`),params:be({account:Ut})}),be({method:te(`${hr.AccountDeleted}`),params:be({id:me})}),be({method:te(`${hr.RequestApproved}`),params:be({id:me,result:Ye})}),be({method:te(`${hr.RequestRejected}`),params:be({id:me})}),be({method:te(`${hr.AccountBalancesUpdated}`),params:be({balances:ce(ye,ce(kt,Mt))})}),be({method:te(`${hr.AccountTransactionsUpdated}`),params:be({transactions:ce(ye,Y(Xt))})}),be({method:te(`${hr.AccountAssetListUpdated}`),params:be({assets:ce(ye,be({added:Y(Tt),removed:Y(Tt)}))})});function pr(e){return Boolean(e)&&\"object\"==typeof e&&!Array.isArray(e)}const gr=(e,t)=>Object.hasOwnProperty.call(e,t);var mr;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(mr=mr||(mr={}));var yr=n(282);const wr=e=>ie(e);function vr({path:e,branch:t}){const n=e[e.length-1];return gr(t[t.length-2],n)}function br(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!vr(n)||e.validator(t,n),refiner:(t,n)=>!vr(n)||e.refiner(t,n)})}function Ar(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!Ar(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!Ar(n[e][1])){t=!1;break}return t}return!1}const Sr=pe(\"JSON\",(e=>Ar(e))),Er=xe(Sr,Ce(J(),\"JSON\",(e=>G(e,Sr))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));function xr(e){try{return function(e){V(e,Er)}(e),!0}catch{return!1}}const kr=te(\"2.0\"),Ir=re(fe([oe(),ue()])),Tr=wr({code:ee(),message:ue(),data:br(Er),stack:br(ue())}),_r=fe([ce(ue(),Er),Y(Er)]);wr({id:Ir,jsonrpc:kr,method:ue(),params:br(_r)}),wr({jsonrpc:kr,method:ue(),params:br(_r)});ie({id:Ir,jsonrpc:kr,result:ae(he()),error:ae(Tr)});const Cr=wr({id:Ir,jsonrpc:kr,result:Er}),Br=wr({id:Ir,jsonrpc:kr,error:Tr});fe([Cr,Br]);const Pr={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Rr={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},Nr={\"-32700\":{standard:\"JSON RPC 2.0\",message:\"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.\"},\"-32600\":{standard:\"JSON RPC 2.0\",message:\"The JSON sent is not a valid Request object.\"},\"-32601\":{standard:\"JSON RPC 2.0\",message:\"The method does not exist / is not available.\"},\"-32602\":{standard:\"JSON RPC 2.0\",message:\"Invalid method parameter(s).\"},\"-32603\":{standard:\"JSON RPC 2.0\",message:\"Internal JSON-RPC error.\"},\"-32000\":{standard:\"EIP-1474\",message:\"Invalid input.\"},\"-32001\":{standard:\"EIP-1474\",message:\"Resource not found.\"},\"-32002\":{standard:\"EIP-1474\",message:\"Resource unavailable.\"},\"-32003\":{standard:\"EIP-1474\",message:\"Transaction rejected.\"},\"-32004\":{standard:\"EIP-1474\",message:\"Method not supported.\"},\"-32005\":{standard:\"EIP-1474\",message:\"Request limit exceeded.\"},4001:{standard:\"EIP-1193\",message:\"User rejected the request.\"},4100:{standard:\"EIP-1193\",message:\"The requested account and/or method has not been authorized by the user.\"},4200:{standard:\"EIP-1193\",message:\"The requested method is not supported by this Ethereum provider.\"},4900:{standard:\"EIP-1193\",message:\"The provider is disconnected from all chains.\"},4901:{standard:\"EIP-1193\",message:\"The provider is disconnected from the specified chain.\"}},Or=Pr.internal,Ur=(Mr(Or),\"Unspecified server error.\");function Mr(e,t=\"Unspecified error message. This is a bug, please report it.\"){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(gr(Nr,t))return Nr[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return Ur}return t}function zr(e){return Array.isArray(e)?e.map((e=>xr(e)?e:pr(e)?Lr(e):null)):pr(e)?Lr(e):xr(e)?e:null}function Lr(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const r=e[n];return xr(r)&&(t[n]=r),t}),{})}const jr=function(e){return e?.__esModule?e.default:e}(yr);class Fr extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('\"code\" must be an integer.');if(!t||\"string\"!=typeof t)throw new Error('\"message\" must be a non-empty string.');!function(e){return pr(e)&&gr(e,\"cause\")&&pr(e.cause)}(n)?super(t):(super(t,{cause:n.cause}),gr(this,\"cause\")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=zr(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return jr(this.serialize(),$r,2)}}class Dr extends Fr{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function $r(e,t){if(\"[Circular]\"!==t)return t}const Kr=e=>io(Pr.parse,e),qr=e=>io(Pr.invalidRequest,e),Wr=e=>io(Pr.invalidParams,e),Hr=e=>io(Pr.methodNotFound,e),Vr=e=>io(Pr.internal,e),Gr=e=>io(Pr.invalidInput,e),Zr=e=>io(Pr.resourceNotFound,e),Jr=e=>io(Pr.resourceUnavailable,e),Yr=e=>io(Pr.transactionRejected,e),Qr=e=>io(Pr.methodNotSupported,e),Xr=e=>io(Pr.limitExceeded,e),eo=e=>ao(Rr.userRejectedRequest,e),to=e=>ao(Rr.unauthorized,e),no=e=>ao(Rr.unsupportedMethod,e),ro=e=>ao(Rr.disconnected,e),oo=e=>ao(Rr.chainDisconnected,e);function io(e,t){const[n,r]=so(t);return new Fr(e,n??Mr(e),r)}function ao(e,t){const[n,r]=so(t);return new Dr(e,n??Mr(e),r)}function so(e){if(e){if(\"string\"==typeof e)return[e];if(\"object\"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&\"string\"!=typeof t)throw new Error(\"Must specify string message.\");return[t??void 0,n]}}return[]}const co=(e,t)=>Object.hasOwnProperty.call(e,t);var uo;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(uo=uo||(uo={}));const lo=e=>ie(e);function fo({path:e,branch:t}){const n=e[e.length-1];return co(t[t.length-2],n)}function ho(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!fo(n)||e.validator(t,n),refiner:(t,n)=>!fo(n)||e.refiner(t,n)})}function po(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!po(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!po(n[e][1])){t=!1;break}return t}return!1}const go=pe(\"JSON\",(e=>po(e))),mo=xe(go,Ce(J(),\"JSON\",(e=>G(e,go))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));function yo(e){try{return function(e){V(e,mo)}(e),!0}catch{return!1}}const wo=te(\"2.0\"),vo=re(fe([oe(),ue()])),bo=lo({code:ee(),message:ue(),data:ho(mo),stack:ho(ue())}),Ao=fe([ce(ue(),mo),Y(mo)]);lo({id:vo,jsonrpc:wo,method:ue(),params:ho(Ao)}),lo({jsonrpc:wo,method:ue(),params:ho(Ao)});ie({id:vo,jsonrpc:wo,result:ae(he()),error:ae(bo)});const So=lo({id:vo,jsonrpc:wo,result:mo}),Eo=lo({id:vo,jsonrpc:wo,error:bo});fe([So,Eo]);const xo=-31002,ko=\"Snap Error\";function Io(e,t,n=null){return r=e,Boolean(r)&&\"object\"==typeof r&&!Array.isArray(r)&&co(e,t)?e[t]:n;var r}function To(e,t,n=String(e)){const r=Io(e,t);return\"string\"==typeof r?r:n}function _o(e){return To(e,\"message\")}function Co(e){return To(e,\"stack\",null)}function Bo(e){return To(e,\"name\",e instanceof Error?e.name:\"Error\")}function Po(e){const t=Io(e,\"data\");return null!==t&&yo(t)&&!Array.isArray(t)?t:{}}class Ro extends Error{#e;#t;#n;#r;constructor(e,t={}){const n=_o(e);super(n),this.#t=n,this.#e=function(e){const t=Io(e,\"code\");return\"number\"==typeof t&&Number.isInteger(t)?t:-32603}(e);const r={...Po(e),...t};Object.keys(r).length>0&&(this.#n=r),this.#r=super.stack}get name(){return\"SnapError\"}get code(){return this.#e}get message(){return this.#t}get data(){return this.#n}get stack(){return this.#r}toJSON(){return{code:xo,message:ko,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function No(e){if(\"string\"==typeof e)return{name:\"Error\",message:e,stack:null,cause:null};if(G(e,bo))return{name:\"JsonRpcError\",message:_o(e),stack:Co(e)??Co(e.data)??null,cause:null};const t=function(e){return Io(e,\"cause\")}(e);return{name:Bo(e),message:_o(e),stack:Co(e)??null,cause:null===t?null:No(t)}}function Oo(e){return class extends Ro{constructor(t,n){if(\"object\"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}const Uo=Oo(Vr),Mo=Oo(Gr),zo=Oo(Wr),Lo=Oo(qr),jo=Oo(Xr),Fo=Oo(Hr),Do=Oo(Qr),$o=Oo(Kr),Ko=Oo(Zr),qo=Oo(Jr),Wo=Oo(Yr),Ho=Oo(oo),Vo=Oo(ro),Go=Oo(to),Zo=Oo(no),Jo=Oo(eo);var Yo;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(Yo=Yo||(Yo={}));const Qo=e=>ie(e);function Xo({path:e,branch:t}){const n=e[e.length-1];return r=t[t.length-2],o=n,Object.hasOwnProperty.call(r,o);var r,o}function ei(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!Xo(n)||e.validator(t,n),refiner:(t,n)=>!Xo(n)||e.refiner(t,n)})}function ti(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!ti(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!ti(n[e][1])){t=!1;break}return t}return!1}const ni=pe(\"JSON\",(e=>ti(e))),ri=xe(ni,Ce(J(),\"JSON\",(e=>G(e,ni))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));const oi=te(\"2.0\"),ii=re(fe([oe(),ue()])),ai=Qo({code:ee(),message:ue(),data:ei(ri),stack:ei(ue())}),si=fe([ce(ue(),ri),Y(ri)]);Qo({id:ii,jsonrpc:oi,method:ue(),params:ei(si)}),Qo({jsonrpc:oi,method:ue(),params:ei(si)});ie({id:ii,jsonrpc:oi,result:ae(he()),error:ae(ai)});const ci=Qo({id:ii,jsonrpc:oi,result:ri}),ui=Qo({id:ii,jsonrpc:oi,error:ai});fe([ci,ui]);function li(e){if(t=e,Boolean(t)&&\"object\"==typeof t&&!Array.isArray(t)&&\"serialize\"in e&&\"function\"==typeof e.serialize){const t=e.serialize();return function(e){return G(e,ai)}(t)&&function(e){return e.code===xo&&e.message===ko}(t)}var t;return!1}class di extends Do{constructor(e){super(`Method not supported: ${e}`)}}async function fi(e,t){try{return await async function(e,t){switch(H(t,Ke),t.method){case`${Wn.ListAccounts}`:return H(t,Vn),e.listAccounts();case`${Wn.GetAccount}`:return H(t,Gn),e.getAccount(t.params.id);case`${Wn.CreateAccount}`:return H(t,Zn),e.createAccount(t.params.options);case`${Wn.CreateAccounts}`:if(void 0===e.createAccounts)throw new di(t.method);return H(t,Jn),e.createAccounts(t.params.options);case`${Wn.DiscoverAccounts}`:if(void 0===e.discoverAccounts)throw new di(t.method);return H(t,Qn),e.discoverAccounts(t.params.scopes,t.params.entropySource,t.params.groupIndex);case`${Wn.ListAccountTransactions}`:if(void 0===e.listAccountTransactions)throw new di(t.method);return H(t,Xn),e.listAccountTransactions(t.params.id,t.params.pagination);case`${Wn.ListAccountAssets}`:if(void 0===e.listAccountAssets)throw new di(t.method);return H(t,er),e.listAccountAssets(t.params.id);case`${Wn.GetAccountBalances}`:if(void 0===e.getAccountBalances)throw new di(t.method);return H(t,nr),e.getAccountBalances(t.params.id,t.params.assets);case`${Wn.ResolveAccountAddress}`:if(void 0===e.resolveAccountAddress)throw new di(t.method);return H(t,rr),e.resolveAccountAddress(t.params.scope,t.params.request);case`${Wn.SetSelectedAccounts}`:if(void 0===e.setSelectedAccounts)throw new di(t.method);return H(t,Yn),e.setSelectedAccounts(t.params.accounts);case`${Wn.FilterAccountChains}`:return H(t,or),e.filterAccountChains(t.params.id,t.params.chains);case`${Wn.UpdateAccount}`:return H(t,ir),e.updateAccount(t.params.account);case`${Wn.DeleteAccount}`:return H(t,ar),e.deleteAccount(t.params.id);case`${Wn.ExportAccount}`:if(void 0===e.exportAccount)throw new di(t.method);return H(t,sr),e.exportAccount(t.params.id);case`${Wn.ListRequests}`:if(void 0===e.listRequests)throw new di(t.method);return H(t,cr),e.listRequests();case`${Wn.GetRequest}`:if(void 0===e.getRequest)throw new di(t.method);return H(t,ur),e.getRequest(t.params.id);case`${Wn.SubmitRequest}`:return H(t,lr),e.submitRequest(t.params);case`${Wn.ApproveRequest}`:if(void 0===e.approveRequest)throw new di(t.method);return H(t,dr),e.approveRequest(t.params.id,t.params.data);case`${Wn.RejectRequest}`:if(void 0===e.rejectRequest)throw new di(t.method);return H(t,fr),e.rejectRequest(t.params.id);default:throw new di(t.method)}}(e,t)}catch(e){if(li(e))throw e;const t=e instanceof Error&&\"string\"==typeof e.message?e.message:\"An unknown error occurred while handling the keyring request\";throw new Error(t)}}var hi;!function(e){e.GetSelectedAccounts=\"getSelectedAccounts\"}(hi||(hi={}));ie({method:te(hi.GetSelectedAccounts)});const pi=Y(ue());async function gi(e,t,n){await e.request({method:\"snap_manageAccounts\",params:{method:t,params:{...n}}})}async function mi(e){const t=await e.request({method:\"snap_manageAccounts\",params:{method:hi.GetSelectedAccounts}});return H(t,pi),t}var yi=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,wi=Math.ceil,vi=Math.floor,bi=\"[BigNumber Error] \",Ai=bi+\"Number primitive has more than 15 significant digits: \",Si=1e14,Ei=14,xi=9007199254740991,ki=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ii=1e7,Ti=1e9;function _i(e){var t=0|e;return e>0||e===t?t:t-1}function Ci(e){for(var t,n,r=1,o=e.length,i=e[0]+\"\";r<o;){for(t=e[r++]+\"\",n=Ei-t.length;n--;t=\"0\"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function Bi(e,t){var n,r,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!o||!i)return r?0:!o^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function Pi(e,t,n,r){if(e<t||e>n||e!==vi(e))throw Error(bi+(r||\"Argument\")+(\"number\"==typeof e?e<t||e>n?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(e))}function Ri(e){var t=e.c.length-1;return _i(e.e/Ei)==t&&e.c[t]%2!=0}function Ni(e,t){return(e.length>1?e.charAt(0)+\".\"+e.slice(1):e)+(t<0?\"e\":\"e+\")+t}function Oi(e,t,n){var r,o;if(t<0){for(o=n+\".\";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+\".\"+e.slice(t));return e}var Ui=function e(t){var n,r,o,i,a,s,c,u,l,d,f=I.prototype={constructor:I,toString:null,valueOf:null},h=new I(1),p=20,g=4,m=-7,y=21,w=-1e7,v=1e7,b=!1,A=1,S=0,E={prefix:\"\",groupSize:3,secondaryGroupSize:0,groupSeparator:\",\",decimalSeparator:\".\",fractionGroupSize:0,fractionGroupSeparator:\" \",suffix:\"\"},x=\"0123456789abcdefghijklmnopqrstuvwxyz\",k=!0;function I(e,t){var n,i,a,s,c,u,l,d,f=this;if(!(f instanceof I))return new I(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>v?f.c=f.e=null:e.e<w?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((u=\"number\"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>v?f.c=f.e=null:(f.e=s,f.c=[e]))}d=String(e)}else{if(!yi.test(d=String(e)))return o(f,d,u);f.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf(\".\"))>-1&&(d=d.replace(\".\",\"\")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(Pi(t,2,x.length,\"Base\"),10==t&&k)return B(f=new I(e),p+f.e+1,g);if(d=String(e),u=\"number\"==typeof e){if(0*e!=0)return o(f,d,u,t);if(f.s=1/e<0?(d=d.slice(1),-1):1,I.DEBUG&&d.replace(/^0\\.0*|\\./,\"\").length>15)throw Error(Ai+e)}else f.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(n=x.slice(0,t),s=c=0,l=d.length;c<l;c++)if(n.indexOf(i=d.charAt(c))<0){if(\".\"==i){if(c>s){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return o(f,String(e),u,t)}u=!1,(s=(d=r(d,t,10,f.s)).indexOf(\".\"))>-1?d=d.replace(\".\",\"\"):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(c,++l)){if(l-=c,u&&I.DEBUG&&l>15&&(e>xi||e!==vi(e)))throw Error(Ai+f.s*e);if((s=s-c-1)>v)f.c=f.e=null;else if(s<w)f.c=[f.e=0];else{if(f.e=s,f.c=[],c=(s+1)%Ei,s<0&&(c+=Ei),c<l){for(c&&f.c.push(+d.slice(0,c)),l-=Ei;c<l;)f.c.push(+d.slice(c,c+=Ei));c=Ei-(d=d.slice(c)).length}else c-=l;for(;c--;d+=\"0\");f.c.push(+d)}}else f.c=[f.e=0]}function T(e,t,n,r){var o,i,a,s,c;if(null==n?n=g:Pi(n,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=Ci(e.c),c=1==r||2==r&&(a<=m||a>=y)?Ni(c,a):Oi(c,a,\"0\");else if(i=(e=B(new I(e),t,n)).e,s=(c=Ci(e.c)).length,1==r||2==r&&(t<=i||i<=m)){for(;s<t;c+=\"0\",s++);c=Ni(c,i)}else if(t-=a,c=Oi(c,i,\"0\"),i+1>s){if(--t>0)for(c+=\".\";t--;c+=\"0\");}else if((t+=i-s)>0)for(i+1==s&&(c+=\".\");t--;c+=\"0\");return e.s<0&&o?\"-\"+c:c}function _(e,t){for(var n,r,o=1,i=new I(e[0]);o<e.length;o++)(!(r=new I(e[o])).s||(n=Bi(i,r))===t||0===n&&i.s===t)&&(i=r);return i}function C(e,t,n){for(var r=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,r++);return(n=r+n*Ei-1)>v?e.c=e.e=null:n<w?e.c=[e.e=0]:(e.e=n,e.c=t),e}function B(e,t,n,r){var o,i,a,s,c,u,l,d=e.c,f=ki;if(d){e:{for(o=1,s=d[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=Ei,a=t,c=d[u=0],l=vi(c/f[o-a-1]%10);else if((u=wi((i+1)/Ei))>=d.length){if(!r)break e;for(;d.length<=u;d.push(0));c=l=0,o=1,a=(i%=Ei)-Ei+1}else{for(c=s=d[u],o=1;s>=10;s/=10,o++);l=(a=(i%=Ei)-Ei+o)<0?0:vi(c/f[o-a-1]%10)}if(r=r||t<0||null!=d[u+1]||(a<0?c:c%f[o-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?c/f[o-a]:0:d[u-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=f[(Ei-t%Ei)%Ei],e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=u,s=1,u--):(d.length=u+1,s=f[Ei-i],d[u]=a>0?vi(c/f[o-a]%f[a])*s:0),r)for(;;){if(0==u){for(i=1,a=d[0];a>=10;a/=10,i++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,d[0]==Si&&(d[0]=1));break}if(d[u]+=s,d[u]!=Si)break;d[u--]=0,s=1}for(i=d.length;0===d[--i];d.pop());}e.e>v?e.c=e.e=null:e.e<w&&(e.c=[e.e=0])}return e}function P(e){var t,n=e.e;return null===n?e.toString():(t=Ci(e.c),t=n<=m||n>=y?Ni(t,n):Oi(t,n,\"0\"),e.s<0?\"-\"+t:t)}return I.clone=e,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.EUCLID=9,I.config=I.set=function(e){var t,n;if(null!=e){if(\"object\"!=typeof e)throw Error(bi+\"Object expected: \"+e);if(e.hasOwnProperty(t=\"DECIMAL_PLACES\")&&(Pi(n=e[t],0,Ti,t),p=n),e.hasOwnProperty(t=\"ROUNDING_MODE\")&&(Pi(n=e[t],0,8,t),g=n),e.hasOwnProperty(t=\"EXPONENTIAL_AT\")&&((n=e[t])&&n.pop?(Pi(n[0],-Ti,0,t),Pi(n[1],0,Ti,t),m=n[0],y=n[1]):(Pi(n,-Ti,Ti,t),m=-(y=n<0?-n:n))),e.hasOwnProperty(t=\"RANGE\"))if((n=e[t])&&n.pop)Pi(n[0],-Ti,-1,t),Pi(n[1],1,Ti,t),w=n[0],v=n[1];else{if(Pi(n,-Ti,Ti,t),!n)throw Error(bi+t+\" cannot be zero: \"+n);w=-(v=n<0?-n:n)}if(e.hasOwnProperty(t=\"CRYPTO\")){if((n=e[t])!==!!n)throw Error(bi+t+\" not true or false: \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!n,Error(bi+\"crypto unavailable\");b=n}else b=n}if(e.hasOwnProperty(t=\"MODULO_MODE\")&&(Pi(n=e[t],0,9,t),A=n),e.hasOwnProperty(t=\"POW_PRECISION\")&&(Pi(n=e[t],0,Ti,t),S=n),e.hasOwnProperty(t=\"FORMAT\")){if(\"object\"!=typeof(n=e[t]))throw Error(bi+t+\" not an object: \"+n);E=n}if(e.hasOwnProperty(t=\"ALPHABET\")){if(\"string\"!=typeof(n=e[t])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(bi+t+\" invalid: \"+n);k=\"0123456789\"==n.slice(0,10),x=n}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[m,y],RANGE:[w,v],CRYPTO:b,MODULO_MODE:A,POW_PRECISION:S,FORMAT:E,ALPHABET:x}},I.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!I.DEBUG)return!0;var t,n,r=e.c,o=e.e,i=e.s;e:if(\"[object Array]\"=={}.toString.call(r)){if((1===i||-1===i)&&o>=-Ti&&o<=Ti&&o===vi(o)){if(0===r[0]){if(0===o&&1===r.length)return!0;break e}if((t=(o+1)%Ei)<1&&(t+=Ei),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=Si||n!==vi(n))break e;if(0!==n)return!0}}}else if(null===r&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(bi+\"Invalid BigNumber: \"+e)},I.maximum=I.max=function(){return _(arguments,-1)},I.minimum=I.min=function(){return _(arguments,1)},I.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return vi(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,o,i,s=0,c=[],u=new I(h);if(null==e?e=p:Pi(e,0,Ti),o=wi(e/Ei),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bi+\"crypto unavailable\");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!b)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=Ei,o&&e&&(i=ki[Ei-e],c[s]=vi(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=Ei);for(s=1,i=c[0];i>=10;i/=10,s++);s<Ei&&(r-=Ei-s)}return u.e=r,u.c=c,u}),I.sum=function(){for(var e=1,t=arguments,n=new I(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e=\"0123456789\";function t(e,t,n,r){for(var o,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>n-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/n|0,a[o]%=n)}return a.reverse()}return function(r,o,i,a,s){var c,u,l,d,f,h,m,y,w=r.indexOf(\".\"),v=p,b=g;for(w>=0&&(d=S,S=0,r=r.replace(\".\",\"\"),h=(y=new I(o)).pow(r.length-w),S=d,y.c=t(Oi(Ci(h.c),h.e,\"0\"),10,i,e),y.e=y.c.length),l=d=(m=t(r,o,i,s?(c=x,e):(c=e,x))).length;0==m[--d];m.pop());if(!m[0])return c.charAt(0);if(w<0?--l:(h.c=m,h.e=l,h.s=a,m=(h=n(h,y,v,b,i)).c,f=h.r,l=h.e),w=m[u=l+v+1],d=i/2,f=f||u<0||null!=m[u+1],f=b<4?(null!=w||f)&&(0==b||b==(h.s<0?3:2)):w>d||w==d&&(4==b||f||6==b&&1&m[u-1]||b==(h.s<0?8:7)),u<1||!m[0])r=f?Oi(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=u,f)for(--i;++m[--u]>i;)m[u]=0,u||(++l,m=[1].concat(m));for(d=m.length;!m[--d];);for(w=0,r=\"\";w<=d;r+=c.charAt(m[w++]));r=Oi(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,o,i,a,s=0,c=e.length,u=t%Ii,l=t/Ii|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%Ii)+(r=l*i+(a=e[c]/Ii|0)*u)%Ii*Ii+s)/n|0)+(r/Ii|0)+l*a,e[c]=o%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;o<n;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,i,a,s){var c,u,l,d,f,h,p,g,m,y,w,v,b,A,S,E,x,k=r.s==o.s?1:-1,T=r.c,_=o.c;if(!(T&&T[0]&&_&&_[0]))return new I(r.s&&o.s&&(T?!_||T[0]!=_[0]:_)?T&&0==T[0]||!_?0*k:k/0:NaN);for(m=(g=new I(k)).c=[],k=i+(u=r.e-o.e)+1,s||(s=Si,u=_i(r.e/Ei)-_i(o.e/Ei),k=k/Ei|0),l=0;_[l]==(T[l]||0);l++);if(_[l]>(T[l]||0)&&u--,k<0)m.push(1),d=!0;else{for(A=T.length,E=_.length,l=0,k+=2,(f=vi(s/(_[0]+1)))>1&&(_=e(_,f,s),T=e(T,f,s),E=_.length,A=T.length),b=E,w=(y=T.slice(0,E)).length;w<E;y[w++]=0);x=_.slice(),x=[0].concat(x),S=_[0],_[1]>=s/2&&S++;do{if(f=0,(c=t(_,y,E,w))<0){if(v=y[0],E!=w&&(v=v*s+(y[1]||0)),(f=vi(v/S))>1)for(f>=s&&(f=s-1),p=(h=e(_,f,s)).length,w=y.length;1==t(h,y,p,w);)f--,n(h,E<p?x:_,p,s),p=h.length,c=1;else 0==f&&(c=f=1),p=(h=_.slice()).length;if(p<w&&(h=[0].concat(h)),n(y,h,w,s),w=y.length,-1==c)for(;t(_,y,E,w)<1;)f++,n(y,E<w?x:_,w,s),w=y.length}else 0===c&&(f++,y=[0]);m[l++]=f,y[0]?y[w++]=T[b]||0:(y=[T[b]],w=1)}while((b++<A||null!=y[0])&&k--);d=null!=y[0],m[0]||m.splice(0,1)}if(s==Si){for(l=1,k=m[0];k>=10;k/=10,l++);B(g,i+(g.e=l+u*Ei-1)+1,a,d)}else g.e=u,g.r=+d;return g}}(),s=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,c=/^([^.]+)\\.$/,u=/^\\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,d=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,o=function(e,t,n,r){var o,i=n?t:t.replace(d,\"\");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(s,(function(e,t,n){return o=\"x\"==(n=n.toLowerCase())?16:\"b\"==n?2:8,r&&r!=o?e:t})),r&&(o=r,i=i.replace(c,\"$1\").replace(u,\"0.$1\")),t!=i))return new I(i,o);if(I.DEBUG)throw Error(bi+\"Not a\"+(r?\" base \"+r:\"\")+\" number: \"+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new I(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return Bi(this,new I(e,t))},f.decimalPlaces=f.dp=function(e,t){var n,r,o,i=this;if(null!=e)return Pi(e,0,Ti),null==t?t=g:Pi(t,0,8),B(new I(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-_i(this.e/Ei))*Ei,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(e,t){return n(this,new I(e,t),p,g)},f.dividedToIntegerBy=f.idiv=function(e,t){return n(this,new I(e,t),0,1)},f.exponentiatedBy=f.pow=function(e,t){var n,r,o,i,a,s,c,u,l=this;if((e=new I(e)).c&&!e.isInteger())throw Error(bi+\"Exponent not an integer: \"+P(e));if(null!=t&&(t=new I(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new I(Math.pow(+P(l),a?e.s*(2-Ri(e)):+P(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new I(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&Ri(e)?-0:0,l.e>-1&&(i=1/i),new I(s?1/i:i);S&&(i=wi(S/Ei+2))}for(a?(n=new I(.5),s&&(e.s=1),c=Ri(e)):c=(o=Math.abs(+P(e)))%2,u=new I(h);;){if(c){if(!(u=u.times(l)).c)break;i?u.c.length>i&&(u.c.length=i):r&&(u=u.mod(t))}if(o){if(0===(o=vi(o/2)))break;c=o%2}else if(B(e=e.times(n),e.e+1,1),e.e>14)c=Ri(e);else{if(0===(o=+P(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):r&&(l=l.mod(t))}return r?u:(s&&(u=h.div(u)),t?u.mod(t):i?B(u,S,g,undefined):u)},f.integerValue=function(e){var t=new I(this);return null==e?e=g:Pi(e,0,8),B(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===Bi(this,new I(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return Bi(this,new I(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=Bi(this,new I(e,t)))||0===t},f.isInteger=function(){return!!this.c&&_i(this.e/Ei)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return Bi(this,new I(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=Bi(this,new I(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var n,r,o,i,a=this,s=a.s;if(t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/Ei,u=e.e/Ei,l=a.c,d=e.c;if(!c||!u){if(!l||!d)return l?(e.s=-t,e):new I(d?a:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new I(l[0]?a:3==g?-0:0)}if(c=_i(c),u=_i(u),l=l.slice(),s=c-u){for((i=s<0)?(s=-s,o=l):(u=c,o=d),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(r=(i=(s=l.length)<(t=d.length))?s:t,s=t=0;t<r;t++)if(l[t]!=d[t]){i=l[t]<d[t];break}if(i&&(o=l,l=d,d=o,e.s=-e.s),(t=(r=d.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=Si-1;r>s;){if(l[--r]<d[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=Si}l[r]-=d[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?C(e,l,u):(e.s=3==g?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,t){var r,o,i=this;return e=new I(e,t),!i.c||!e.s||e.c&&!e.c[0]?new I(NaN):!e.c||i.c&&!i.c[0]?new I(i):(9==A?(o=e.s,e.s=1,r=n(i,e,0,3),e.s=o,r.s*=o):r=n(i,e,0,A),(e=i.minus(r.times(e))).c[0]||1!=A||(e.s=i.s),e)},f.multipliedBy=f.times=function(e,t){var n,r,o,i,a,s,c,u,l,d,f,h,p,g,m,y=this,w=y.c,v=(e=new I(e,t)).c;if(!(w&&v&&w[0]&&v[0]))return!y.s||!e.s||w&&!w[0]&&!v||v&&!v[0]&&!w?e.c=e.e=e.s=null:(e.s*=y.s,w&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=_i(y.e/Ei)+_i(e.e/Ei),e.s*=y.s,(c=w.length)<(d=v.length)&&(p=w,w=v,v=p,o=c,c=d,d=o),o=c+d,p=[];o--;p.push(0));for(g=Si,m=Ii,o=d;--o>=0;){for(n=0,f=v[o]%m,h=v[o]/m|0,i=o+(a=c);i>o;)n=((u=f*(u=w[--a]%m)+(s=h*u+(l=w[a]/m|0)*f)%m*m+p[i]+n)/g|0)+(s/m|0)+h*l,p[i--]=u%g;p[i]=n}return n?++r:p.splice(0,1),C(e,p,r)},f.negated=function(){var e=new I(this);return e.s=-e.s||null,e},f.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new I(e,t)).s,!o||!t)return new I(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/Ei,a=e.e/Ei,s=r.c,c=e.c;if(!i||!a){if(!s||!c)return new I(o/0);if(!s[0]||!c[0])return c[0]?e:new I(s[0]?r:0*o)}if(i=_i(i),a=_i(a),s=s.slice(),o=i-a){for(o>0?(a=i,n=c):(o=-o,n=s),n.reverse();o--;n.push(0));n.reverse()}for((o=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/Si|0,s[t]=Si===s[t]?0:s[t]%Si;return o&&(s=[o].concat(s),++a),C(e,s,a)},f.precision=f.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return Pi(e,1,Ti),null==t?t=g:Pi(t,0,8),B(new I(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*Ei+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},f.shiftedBy=function(e){return Pi(e,-9007199254740991,xi),this.times(\"1e\"+e)},f.squareRoot=f.sqrt=function(){var e,t,r,o,i,a=this,s=a.c,c=a.s,u=a.e,l=p+4,d=new I(\"0.5\");if(1!==c||!s||!s[0])return new I(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+P(a)))||c==1/0?(((t=Ci(s)).length+u)%2==0&&(t+=\"0\"),c=Math.sqrt(+t),u=_i((u+1)/2)-(u<0||u%2),r=new I(t=c==1/0?\"5e\"+u:(t=c.toExponential()).slice(0,t.indexOf(\"e\")+1)+u)):r=new I(c+\"\"),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(i=r,r=d.times(i.plus(n(a,i,l,1))),Ci(i.c).slice(0,c)===(t=Ci(r.c)).slice(0,c)){if(r.e<u&&--c,\"9999\"!=(t=t.slice(c-3,c+1))&&(o||\"4999\"!=t)){+t&&(+t.slice(1)||\"5\"!=t.charAt(0))||(B(r,r.e+p+2,1),e=!r.times(r).eq(a));break}if(!o&&(B(i,i.e+p+2,0),i.times(i).eq(a))){r=i;break}l+=4,c+=4,o=1}return B(r,r.e+p+1,g,e)},f.toExponential=function(e,t){return null!=e&&(Pi(e,0,Ti),e++),T(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(Pi(e,0,Ti),e=e+this.e+1),T(this,e,t)},f.toFormat=function(e,t,n){var r,o=this;if(null==n)null!=e&&t&&\"object\"==typeof t?(n=t,t=null):e&&\"object\"==typeof e?(n=e,e=t=null):n=E;else if(\"object\"!=typeof n)throw Error(bi+\"Argument not an object: \"+n);if(r=o.toFixed(e,t),o.c){var i,a=r.split(\".\"),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||\"\",l=a[0],d=a[1],f=o.s<0,h=f?l.slice(1):l,p=h.length;if(c&&(i=s,s=c,c=i,p-=i),s>0&&p>0){for(i=p%s||s,l=h.substr(0,i);i<p;i+=s)l+=u+h.substr(i,s);c>0&&(l+=u+h.slice(i)),f&&(l=\"-\"+l)}r=d?l+(n.decimalSeparator||\"\")+((c=+n.fractionGroupSize)?d.replace(new RegExp(\"\\\\d{\"+c+\"}\\\\B\",\"g\"),\"$&\"+(n.fractionGroupSeparator||\"\")):d):l}return(n.prefix||\"\")+r+(n.suffix||\"\")},f.toFraction=function(e){var t,r,o,i,a,s,c,u,l,d,f,p,m=this,y=m.c;if(null!=e&&(!(c=new I(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(bi+\"Argument \"+(c.isInteger()?\"out of range: \":\"not an integer: \")+P(c));if(!y)return new I(m);for(t=new I(h),l=r=new I(h),o=u=new I(h),p=Ci(y),a=t.e=p.length-m.e-1,t.c[0]=ki[(s=a%Ei)<0?Ei+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=v,v=1/0,c=new I(p),u.c[0]=0;d=n(c,t,0,1),1!=(i=r.plus(d.times(o))).comparedTo(e);)r=o,o=i,l=u.plus(d.times(i=l)),u=i,t=c.minus(d.times(i=t)),c=i;return i=n(e.minus(r),o,0,1),u=u.plus(i.times(l)),r=r.plus(i.times(o)),u.s=l.s=m.s,f=n(l,o,a*=2,g).minus(m).abs().comparedTo(n(u,r,a,g).minus(m).abs())<1?[l,o]:[u,r],v=s,f},f.toNumber=function(){return+P(this)},f.toPrecision=function(e,t){return null!=e&&Pi(e,1,Ti),T(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t=\"Infinity\",o<0&&(t=\"-\"+t)):t=\"NaN\":(null==e?t=i<=m||i>=y?Ni(Ci(n.c),i):Oi(Ci(n.c),i,\"0\"):10===e&&k?t=Oi(Ci((n=B(new I(n),p+i+1,g)).c),n.e,\"0\"):(Pi(e,2,x.length,\"Base\"),t=r(Oi(Ci(n.c),i,\"0\"),10,e,o,!0)),o<0&&n.c[0]&&(t=\"-\"+t)),t},f.valueOf=f.toJSON=function(){return P(this)},f._isBigNumber=!0,f[Symbol.toStringTag]=\"BigNumber\",f[Symbol.for(\"nodejs.util.inspect.custom\")]=f.valueOf,null!=t&&I.set(t),I}();const Mi=Ui;function zi(e,t){return pe(e,(e=>\"string\"==typeof e&&t.test(e)))}const Li=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,ji=/^[-a-z0-9]{3,8}$/u,Fi=/^[-_a-zA-Z0-9]{1,32}$/u,Di=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,$i=/^[-.%a-zA-Z0-9]{1,128}$/u,Ki=/^[-a-z0-9]{3,8}$/u,qi=/^[-.%a-zA-Z0-9]{1,128}$/u,Wi=/^[-.%a-zA-Z0-9]{1,78}$/u,Hi=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,Vi=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,Gi=(zi(\"CaipChainId\",Li),zi(\"CaipNamespace\",ji),zi(\"CaipReference\",Fi),zi(\"CaipAccountId\",Di),zi(\"CaipAccountAddress\",$i),zi(\"CaipAssetNamespace\",Ki),zi(\"CaipAssetReference\",qi),zi(\"CaipTokenId\",Wi),zi(\"CaipAssetType\",Hi));zi(\"CaipAssetId\",Vi),zi(\"CaipAssetTypeOrId\",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var Zi;function Ji(e){const t=Hi.exec(e);if(!t?.groups)throw new Error(\"Invalid CAIP asset type.\");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}function Yi(e,t){return n=e,Boolean(\"string\"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}!function(e){e.Bip122=\"bip122\",e.Solana=\"solana\",e.Eip155=\"eip155\",e.Wallet=\"wallet\"}(Zi=Zi||(Zi={}));class Qi extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function Xi(e,t=\"Assertion failed.\",n=Qi){if(!e){if(t instanceof Error)throw t;throw Yi(n,t)}}var ea=-32700,ta=-32603,na=-32602,ra=-32601,oa=-32600,ia=-32015,aa=-32014,sa=-32012,ca=-32010,ua=-32009,la=-32007,da=-32006,fa=-32004,ha=-32002,pa=-32001,ga=28e5,ma=2800001,ya=2800003,wa=2800006,va=2800007,ba=2800008,Aa=2800009,Sa=323e4,Ea=32300001,xa=3230002,ka=3230004,Ia=361e4,Ta=3610001,_a=3610003,Ca=3610005,Ba=3610006,Pa=3610007,Ra=3704001,Na=3704002,Oa=3704003,Ua=4615e3,Ma=4615026,za=4615045,La=5508e3,ja=5663e3,Fa=5663001,Da=5663004,$a=5663005,Ka=5663006,qa=5663007,Wa=5663008,Ha=5663009,Va=5663012,Ga=5663015,Za=5663016,Ja=5663017,Ya=5663018,Qa=5663019,Xa=705e4,es=7050030,ts=7050031,ns=7050035,rs=8078e3,os=8078001,is=8078002,as=8078004,ss=8078005,cs=8078006,us=8078007,ls=8078008,ds=8078010,fs=8078011,hs=8078012,ps=8078013,gs=8078014,ms=8078017,ys=8078018,ws=8078022,vs=81e5,bs=8100002,As=8100003,Ss=9900003;function Es(e){if(Array.isArray(e)){return\"%5B\"+e.map(Es).join(\"%2C%20\")+\"%5D\"}return\"bigint\"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}function xs([e,t]){return`${e}=${Es(t)}`}function ks(e,t={}){{let n=`Solana error #${e}; Decode this error by running \\`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${function(e){const t=Object.entries(e).map(xs).join(\"&\");return btoa(t)}(t)}'`),`${n}\\``}}function Is(e,t){return!!(e instanceof Error&&\"SolanaError\"===e.name)&&(void 0===t||e.context.__code===t)}var Ts=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;if(t){const{cause:e,...o}=t;e&&(r={cause:e}),Object.keys(o).length>0&&(n=o)}super(ks(e,n),r),this.context={__code:e,...n},this.name=\"SolanaError\"}};function _s(...e){\"captureStackTrace\"in Error&&\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(...e)}function Cs({errorCodeBaseOffset:e,getErrorContext:t,orderedErrorNames:n,rpcEnumError:r},o){let i,a;\"string\"==typeof r?i=r:(i=Object.keys(r)[0],a=r[i]);const s=e+n.indexOf(i),c=t(s,i,a),u=new Ts(s,c);return _s(u,o),u}var Bs=[\"GenericError\",\"InvalidArgument\",\"InvalidInstructionData\",\"InvalidAccountData\",\"AccountDataTooSmall\",\"InsufficientFunds\",\"IncorrectProgramId\",\"MissingRequiredSignature\",\"AccountAlreadyInitialized\",\"UninitializedAccount\",\"UnbalancedInstruction\",\"ModifiedProgramId\",\"ExternalAccountLamportSpend\",\"ExternalAccountDataModified\",\"ReadonlyLamportChange\",\"ReadonlyDataModified\",\"DuplicateAccountIndex\",\"ExecutableModified\",\"RentEpochModified\",\"NotEnoughAccountKeys\",\"AccountDataSizeChanged\",\"AccountNotExecutable\",\"AccountBorrowFailed\",\"AccountBorrowOutstanding\",\"DuplicateAccountOutOfSync\",\"Custom\",\"InvalidError\",\"ExecutableDataModified\",\"ExecutableLamportChange\",\"ExecutableAccountNotRentExempt\",\"UnsupportedProgramId\",\"CallDepth\",\"MissingAccount\",\"ReentrancyNotAllowed\",\"MaxSeedLengthExceeded\",\"InvalidSeeds\",\"InvalidRealloc\",\"ComputationalBudgetExceeded\",\"PrivilegeEscalation\",\"ProgramEnvironmentSetupFailure\",\"ProgramFailedToComplete\",\"ProgramFailedToCompile\",\"Immutable\",\"IncorrectAuthority\",\"BorshIoError\",\"AccountNotRentExempt\",\"InvalidAccountOwner\",\"ArithmeticOverflow\",\"UnsupportedSysvar\",\"IllegalOwner\",\"MaxAccountsDataAllocationsExceeded\",\"MaxAccountsExceeded\",\"MaxInstructionTraceLengthExceeded\",\"BuiltinProgramsMustConsumeComputeUnits\"];function Ps(e,t){const n=Number(e);return Cs({errorCodeBaseOffset:4615001,getErrorContext:(e,t,r)=>e===Ua?{errorName:t,index:n,...void 0!==r?{instructionErrorContext:r}:null}:e===Ma?{code:Number(r),index:n}:e===za?{encodedData:r,index:n}:{index:n},orderedErrorNames:Bs,rpcEnumError:t},Ps)}var Rs=[\"AccountInUse\",\"AccountLoadedTwice\",\"AccountNotFound\",\"ProgramAccountNotFound\",\"InsufficientFundsForFee\",\"InvalidAccountForFee\",\"AlreadyProcessed\",\"BlockhashNotFound\",\"CallChainTooDeep\",\"MissingSignatureForFee\",\"InvalidAccountIndex\",\"SignatureFailure\",\"InvalidProgramForExecution\",\"SanitizeFailure\",\"ClusterMaintenance\",\"AccountBorrowOutstanding\",\"WouldExceedMaxBlockCostLimit\",\"UnsupportedVersion\",\"InvalidWritableAccount\",\"WouldExceedMaxAccountCostLimit\",\"WouldExceedAccountDataBlockLimit\",\"TooManyAccountLocks\",\"AddressLookupTableNotFound\",\"InvalidAddressLookupTableOwner\",\"InvalidAddressLookupTableData\",\"InvalidAddressLookupTableIndex\",\"InvalidRentPayingAccount\",\"WouldExceedMaxVoteCostLimit\",\"WouldExceedAccountDataTotalLimit\",\"DuplicateInstruction\",\"InsufficientFundsForRent\",\"MaxLoadedAccountsDataSizeExceeded\",\"InvalidLoadedAccountsDataSizeLimit\",\"ResanitizationNeeded\",\"ProgramExecutionTemporarilyRestricted\",\"UnbalancedTransaction\"];function Ns(e){return\"object\"==typeof e&&\"InstructionError\"in e?Ps(...e.InstructionError):Cs({errorCodeBaseOffset:7050001,getErrorContext:(e,t,n)=>e===Xa?{errorName:t,...void 0!==n?{transactionErrorContext:n}:null}:e===es?{index:Number(n)}:e===ts||e===ns?{accountIndex:Number(n.account_index)}:void 0,orderedErrorNames:Rs,rpcEnumError:e},Ns)}function Os(e){let t;if(\"object\"==typeof(n=e)&&null!==n&&\"code\"in n&&\"message\"in n&&(\"number\"==typeof n.code||\"bigint\"==typeof n.code)&&\"string\"==typeof n.message){const{code:n,data:r,message:o}=e,i=Number(n);if(i===ha){const{err:e,...n}=r,o=e?{cause:Ns(e)}:null;t=new Ts(ha,{...n,...o})}else{let e;switch(i){case ta:case na:case oa:case ra:case ea:case sa:case pa:case fa:case aa:case ca:case ua:case la:case da:case ia:e={__serverMessage:o};break;default:\"object\"!=typeof r||Array.isArray(r)||(e=r)}t=new Ts(i,e)}}else{const n=\"object\"==typeof e&&null!==e&&\"message\"in e&&\"string\"==typeof e.message?e.message:\"Malformed JSON-RPC error with no message attribute\";t=new Ts(10,{error:e,message:n})}var n;return _s(t,Os),t}var Us=(e,t)=>((e,t)=>{if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n})(e.length<=t?e:e.slice(0,t),t);function Ms(e,t,n){const r=0===n&&e.length===t.length?e:e.slice(n,n+t.length);return r.length===t.length&&t.every(((e,t)=>e===r[t]))}function zs(e,t){return\"fixedSize\"in t?t.fixedSize:t.getSizeFromValue(e)}function Ls(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(zs(t,e));return e.write(t,n,0),n}})}function js(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function Fs(e){return\"fixedSize\"in e&&\"number\"==typeof e.fixedSize}function Ds(e){if(!Fs(e))throw new Ts(is)}function $s(e){return!Fs(e)}function Ks(e,t){if(Fs(e)!==Fs(t))throw new Ts(as);if(Fs(e)&&Fs(t)&&e.fixedSize!==t.fixedSize)throw new Ts(ss,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!Fs(e)&&!Fs(t)&&e.maxSize!==t.maxSize)throw new Ts(cs,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function qs(e,t,n,r=0){const o=n.length-r;if(o<t)throw new Ts(os,{bytesLength:o,codecDescription:e,expected:t})}function Ws(e,t,n){if(t<0||t>n)throw new Ts(gs,{bytesLength:n,codecDescription:e,offset:t})}function Hs(e,t){const n=(n,r,o)=>{const i=e.encode(n);return o=t.write(i.length,r,o),r.set(i,o),o+i.length};if(Fs(t)&&Fs(e))return Ls({...e,fixedSize:t.fixedSize+e.fixedSize,write:n});const r=Fs(t)?t.fixedSize:t.maxSize??null,o=Fs(e)?e.fixedSize:e.maxSize??null,i=null!==r&&null!==o?r+o:null;return Ls({...e,...null!==i?{maxSize:i}:{},getSizeFromValue:n=>{const r=zs(n,e);return zs(r,t)+r},write:n})}function Vs(e,t){const n=(n,r)=>{const[o,i]=t.read(n,r),a=Number(o);return((r=i)>0||n.length>a)&&(n=n.slice(r,r+a)),qs(\"addDecoderSizePrefix\",a,n),[e.decode(n),r+a]};if(Fs(t)&&Fs(e))return js({...e,fixedSize:t.fixedSize+e.fixedSize,read:n});const r=Fs(t)?t.fixedSize:t.maxSize??null,o=Fs(e)?e.fixedSize:e.maxSize??null,i=null!==r&&null!==o?r+o:null;return js({...e,...null!==i?{maxSize:i}:{},read:n})}function Gs(e,t){return Ls({fixedSize:t,write:(n,r,o)=>{const i=e.encode(n),a=i.length>t?i.slice(0,t):i;return r.set(a,o),o+t}})}function Zs(e,t){return js({fixedSize:t,read:(n,r)=>{qs(\"fixCodecSize\",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),Fs(e)&&(n=Us(n,e.fixedSize));const[o]=e.read(n,0);return[o,r+t]}})}function Js(e,t){return Ls({...e,write:(n,r,o)=>{const i=e=>Qs(e,r.length),a=t.preOffset?t.preOffset({bytes:r,preOffset:o,wrapBytes:i}):o;Ws(\"offsetEncoder\",a,r.length);const s=e.write(n,r,a),c=t.postOffset?t.postOffset({bytes:r,newPreOffset:a,postOffset:s,preOffset:o,wrapBytes:i}):s;return Ws(\"offsetEncoder\",c,r.length),c}})}function Ys(e,t){return js({...e,read:(n,r)=>{const o=e=>Qs(e,n.length),i=t.preOffset?t.preOffset({bytes:n,preOffset:r,wrapBytes:o}):r;Ws(\"offsetDecoder\",i,n.length);const[a,s]=e.read(n,i),c=t.postOffset?t.postOffset({bytes:n,newPreOffset:i,postOffset:s,preOffset:r,wrapBytes:o}):s;return Ws(\"offsetDecoder\",c,n.length),[a,c]}})}function Qs(e,t){return 0===t?0:(e%t+t)%t}function Xs(e,t){if(Fs(e)){const n=t(e.fixedSize);if(n<0)throw new Ts(ps,{bytesLength:n,codecDescription:\"resizeEncoder\"});return Ls({...e,fixedSize:n})}return Ls({...e,getSizeFromValue:n=>{const r=t(e.getSizeFromValue(n));if(r<0)throw new Ts(ps,{bytesLength:r,codecDescription:\"resizeEncoder\"});return r}})}function ec(e,t){if(Fs(e)){const n=t(e.fixedSize);if(n<0)throw new Ts(ps,{bytesLength:n,codecDescription:\"resizeDecoder\"});return js({...e,fixedSize:n})}return e}function tc(e,t){return Js(Xs(e,(e=>e+t)),{preOffset:({preOffset:e})=>e+t})}function nc(e,t){return Ys(ec(e,(e=>e+t)),{postOffset:({postOffset:e})=>e+t})}function rc(e,t){return Ls({...$s(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,o)=>e.write(t(n),r,o)})}function oc(e,t){return js({...e,read:(n,r)=>{const[o,i]=e.read(n,r);return[t(o,n,r),i]}})}function ic(e,t,n,r){if(r<t||r>n)throw new Ts(fs,{codecDescription:e,max:n,min:t,value:r})}var ac,sc=((ac=sc||{})[ac.Little=0]=\"Little\",ac[ac.Big=1]=\"Big\",ac);function cc(e){return 1!==e?.endian}function uc(e){return Ls({fixedSize:e.size,write(t,n,r){e.range&&ic(e.name,e.range[0],e.range[1],t);const o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,cc(e.config)),n.set(new Uint8Array(o),r),r+e.size}})}function lc(e){return js({fixedSize:e.size,read(t,n=0){!function(e,t,n=0){if(t.length-n<=0)throw new Ts(rs,{codecDescription:e})}(e.name,t,n),qs(e.name,e.size,t,n);const r=new DataView(function(e,t,n){const r=e.byteOffset+(t??0),o=n??e.byteLength;return e.buffer.slice(r,r+o)}(t,n,e.size));return[e.get(r,cc(e.config)),n+e.size]}})}var dc=(e={})=>lc({config:e,get:(e,t)=>e.getFloat64(0,t),name:\"f64\",size:8}),fc=(e={})=>lc({config:e,get:(e,t)=>e.getInt16(0,t),name:\"i16\",size:2}),hc=(e={})=>lc({config:e,get:(e,t)=>e.getBigInt64(0,t),name:\"i64\",size:8}),pc=()=>lc({get:e=>e.getInt8(0),name:\"i8\",size:1}),gc=()=>Ls({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,n)=>{ic(\"shortU16\",0,65535,e);const r=[0];for(let t=0;;t+=1){const n=Number(e)>>7*t;if(0===n)break;const o=127&n;r[t]=o,t>0&&(r[t-1]|=128)}return t.set(r,n),n+r.length}}),mc=()=>js({maxSize:3,read:(e,t)=>{let n=0,r=0;for(;++r;){const o=r-1,i=e[t+o];if(n|=(127&i)<<7*o,!(128&i))break}return[n,t+r]}}),yc=(e={})=>lc({config:e,get:(e,t)=>e.getUint16(0,t),name:\"u16\",size:2}),wc=(e={})=>uc({config:e,name:\"u32\",range:[0,Number(\"0xffffffff\")],set:(e,t,n)=>e.setUint32(0,Number(t),n),size:4}),vc=(e={})=>lc({config:e,get:(e,t)=>e.getUint32(0,t),name:\"u32\",size:4}),bc=(e={})=>uc({config:e,name:\"u64\",range:[0n,BigInt(\"0xffffffffffffffff\")],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8}),Ac=(e={})=>lc({config:e,get:(e,t)=>e.getBigUint64(0,t),name:\"u64\",size:8}),Sc=()=>uc({name:\"u8\",range:[0,Number(\"0xff\")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),Ec=()=>lc({get:e=>e.getUint8(0),name:\"u8\",size:1});var xc,kc=((xc=kc||{})[xc.WRITABLE_SIGNER=3]=\"WRITABLE_SIGNER\",xc[xc.READONLY_SIGNER=2]=\"READONLY_SIGNER\",xc[xc.WRITABLE=1]=\"WRITABLE\",xc[xc.READONLY=0]=\"READONLY\",xc);function Ic(e){return e>=2}function Tc(e){return!!(1&e)}function _c(e,t){return e|t}function Cc(e){return 2|e}function Bc(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new Ts(hs,{alphabet:e,base:e.length,value:n})}var Pc=e=>Ls({getSizeFromValue:t=>{const[n,r]=Oc(t,e[0]);if(!r)return t.length;const o=Uc(r,e);return n.length+Math.ceil(o.toString(16).length/2)},write(t,n,r){if(Bc(e,t),\"\"===t)return r;const[o,i]=Oc(t,e[0]);if(!i)return n.set(new Uint8Array(o.length).fill(0),r),r+o.length;let a=Uc(i,e);const s=[];for(;a>0n;)s.unshift(Number(a%256n)),a/=256n;const c=[...Array(o.length).fill(0),...s];return n.set(c,r),r+c.length}}),Rc=e=>js({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return[\"\",0];let o=r.findIndex((e=>0!==e));o=-1===o?r.length:o;const i=e[0].repeat(o);if(o===r.length)return[i,t.length];const a=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(\"\")}(r.slice(o).reduce(((e,t)=>256n*e+BigInt(t)),0n),e);return[i+a,t.length]}}),Nc=e=>Ks(Pc(e),Rc(e));function Oc(e,t){const[n,r]=e.split(new RegExp(`((?!${t}).*)`));return[n,r]}function Uc(e,t){const n=BigInt(t.length);let r=0n;for(const o of e)r*=n,r+=BigInt(t.indexOf(o));return r}var Mc=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\",zc=()=>Pc(Mc),Lc=()=>Rc(Mc),jc=()=>Nc(Mc);var Fc,Dc,$c=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",Kc=()=>Ls({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new Ts(hs,{alphabet:$c,base:64,value:e})}},write(e,t,n){try{const r=atob(e).split(\"\").map((e=>e.charCodeAt(0)));return t.set(r,n),r.length+n}catch{throw new Ts(hs,{alphabet:$c,base:64,value:e})}}}),qc=()=>js({read(e,t=0){const n=e.slice(t);return[btoa(String.fromCharCode(...n)),e.length]}}),Wc=()=>Ks(Kc(),qc()),Hc=e=>e.replace(/\\u0000/g,\"\"),Vc=globalThis.TextDecoder,Gc=globalThis.TextEncoder,Zc=()=>{let e;return js({read(t,n){const r=(e||=new Vc).decode(t.slice(n));return[Hc(r),t.length]}})},Jc=()=>Ks((()=>{let e;return Ls({getSizeFromValue:t=>(e||=new Gc).encode(t).length,write:(t,n,r)=>{const o=(e||=new Gc).encode(t);return n.set(o,r),r+o.length}})})(),Zc());function Yc(){if(!globalThis.isSecureContext)throw new Ts(Ia)}function Qc(){if(Yc(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.exportKey)throw new Ts(_a)}function Xc(){return Fc||(Fc=zc()),Fc}function eu(e){if(e.length<32||e.length>44)return!1;const t=Xc();try{return 32===t.encode(e).byteLength}catch{return!1}}function tu(e){if(e.length<32||e.length>44)throw new Ts(ma,{actualLength:e.length});const t=Xc().encode(e).byteLength;if(32!==t)throw new Ts(ga,{actualLength:t})}function nu(e){return tu(e),e}function ru(){return rc(Gs(Xc(),32),(e=>nu(e)))}function ou(){return Zs((Dc||(Dc=Lc()),Dc),32)}function iu(){return Ks(ru(),ou())}function au(){return new Intl.Collator(\"en\",{caseFirst:\"lower\",ignorePunctuation:!1,localeMatcher:\"best fit\",numeric:!1,sensitivity:\"variant\",usage:\"sort\"}).compare}var su=57896044618658097711785492504343953926634992332820282019728792003956564819949n,cu=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function uu(e){const t=e%su;return t>=0n?t:su+t}function lu(e,t){let n=e;for(;t-- >0n;)n*=n,n%=su;return n}function du(e,t){const n=uu(t*t*t),r=function(e){const t=e*e%su*e%su,n=lu(t,2n)*t%su,r=lu(n,1n)*e%su,o=lu(r,5n)*r%su,i=lu(o,10n)*o%su,a=lu(i,20n)*i%su,s=lu(a,40n)*a%su,c=lu(s,80n)*s%su,u=lu(c,80n)*s%su,l=lu(u,10n)*o%su;return lu(l,2n)*e%su}(e*uu(n*n*t));let o=uu(e*n*r);const i=uu(t*o*o),a=o,s=uu(o*cu),c=i===e,u=i===uu(-e),l=i===uu(-e*cu);return c&&(o=a),(u||l)&&(o=s),1n==(1n&uu(o))&&(o=uu(-o)),c||u?o:null}function fu(e){if(32!==e.byteLength)return!1;const t=function(e){const t=e.reduce(((e,t,n)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===n?-129&t:t)}${e}`),\"\");return BigInt(`0x${t}`)}(e);return function(e,t){const n=uu(e*e),r=du(uu(n-1n),uu(37095705934669439343138083508754565189542113879843219016388785533085940283555n*n+1n));return null!==r&&(0n!==r||!(128&t))}(t,e[31])}var hu=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function pu({programAddress:e,seeds:t}){if(function(){if(Yc(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.digest)throw new Ts(Ta)}(),t.length>16)throw new Ts(wa,{actual:t.length,maxSeeds:16});let n;const r=t.reduce(((e,t,r)=>{const o=\"string\"==typeof t?(n||=new TextEncoder).encode(t):t;if(o.byteLength>32)throw new Ts(va,{actual:o.byteLength,index:r,maxSeedLength:32});return e.push(...o),e}),[]),o=iu(),i=o.encode(e),a=await crypto.subtle.digest(\"SHA-256\",new Uint8Array([...r,...i,...hu])),s=new Uint8Array(a);if(fu(s))throw new Ts(ba);return o.decode(s)}async function gu({programAddress:e,seeds:t}){let n=255;for(;n>0;)try{return[await pu({programAddress:e,seeds:[...t,new Uint8Array([n])]}),n]}catch(e){if(!Is(e,ba))throw e;n--}throw new Ts(Aa)}async function mu(e){if(Qc(),\"public\"!==e.type||\"Ed25519\"!==e.algorithm.name)throw new Ts(ya);const t=await crypto.subtle.exportKey(\"raw\",e);return ou().decode(new Uint8Array(t))}var yu,wu=Object.freeze({name:\"Ed25519\"});async function vu(e,t){const n=e.byteLength;if(32!==n)throw new Ts(Ra,{actualLength:n});const r=function(e){return new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...e])}(e);return await crypto.subtle.importKey(\"pkcs8\",r,wu,t??!1,[\"sign\"])}async function bu(e,t){!function(){if(Yc(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.sign)throw new Ts(Ca)}();const n=await crypto.subtle.sign(wu,e,t);return new Uint8Array(n)}function Au(e){return function(e){if(yu||(yu=zc()),e.length<64||e.length>88)throw new Ts(Oa,{actualLength:e.length});const t=yu.encode(e).byteLength;if(64!==t)throw new Ts(Na,{actualLength:t})}(e),e}async function Su(e,t,n){return function(){if(Yc(),void 0===globalThis.crypto||\"function\"!=typeof globalThis.crypto.subtle?.verify)throw new Ts(Ba)}(),await crypto.subtle.verify(wu,e,t,n)}async function Eu(e,t=!1){const n=vu(e,t),[r,o]=await Promise.all([(t?n:vu(e,!0)).then((async e=>await async function(e,t=!1){if(Qc(),!1===e.extractable)throw new Ts(Pa,{key:e});const n=await crypto.subtle.exportKey(\"jwk\",e);return await crypto.subtle.importKey(\"jwk\",{crv:\"Ed25519\",ext:t,key_ops:[\"verify\"],kty:\"OKP\",x:n.x},\"Ed25519\",t,[\"verify\"])}(e,!0))),n]);return{privateKey:o,publicKey:r}}function xu(e,t,n){if(t!==n)throw new Ts(us,{actual:n,codecDescription:e,expected:t})}function ku(e){return e.reduce(((e,t)=>null===e||null===t?null:e+t),0)}function Iu(e){return Fs(e)?e.fixedSize:null}function Tu(e){return Fs(e)?e.fixedSize:e.maxSize??null}function _u(e,t={}){const n=t.size??wc(),r=Bu(n,Iu(e)),o=Bu(n,Tu(e))??void 0;return Ls({...null!==r?{fixedSize:r}:{getSizeFromValue:t=>(\"object\"==typeof n?zs(t.length,n):0)+[...t].reduce(((t,n)=>t+zs(n,e)),0),maxSize:o},write:(t,r,o)=>(\"number\"==typeof n&&xu(\"array\",n,t.length),\"object\"==typeof n&&(o=n.write(t.length,r,o)),t.forEach((t=>{o=e.write(t,r,o)})),o)})}function Cu(e,t={}){const n=t.size??vc(),r=Iu(e),o=Bu(n,r),i=Bu(n,Tu(e))??void 0;return js({...null!==o?{fixedSize:o}:{maxSize:i},read:(t,r)=>{const o=[];if(\"object\"==typeof n&&0===t.slice(r).length)return[o,r];if(\"remainder\"===n){for(;r<t.length;){const[n,i]=e.read(t,r);r=i,o.push(n)}return[o,r]}const[i,a]=\"number\"==typeof n?[n,r]:n.read(t,r);r=a;for(let n=0;n<i;n+=1){const[n,i]=e.read(t,r);r=i,o.push(n)}return[o,r]}})}function Bu(e,t){return\"number\"!=typeof e?null:0===e?0:null===t?null:t*e}function Pu(e={}){return rc(e.size??Sc(),(e=>e?1:0))}function Ru(e={}){return oc(e.size??Ec(),(e=>1===Number(e)))}function Nu(){return Ls({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function Ou(){return js({read:(e,t)=>{const n=e.slice(t);return[n,t+n.length]}})}function Uu(e){return Ls({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function Mu(e){return js({fixedSize:e.length,read:(t,n)=>{const r=js({read(e,t){const n=e.slice(t).reduce(((e,t)=>e+t.toString(16).padStart(2,\"0\")),\"\");return[n,e.length]}});if(!Ms(t,e,n))throw new Ts(ys,{constant:e,data:t,hexConstant:r.decode(e),hexData:r.decode(t),offset:n});return[void 0,n+e.length]}})}function zu(e){const t=ku(e.map(Iu)),n=ku(e.map(Tu))??void 0;return Ls({...null===t?{getSizeFromValue:t=>e.map(((e,n)=>zs(t[n],e))).reduce(((e,t)=>e+t),0),maxSize:n}:{fixedSize:t},write:(t,n,r)=>(xu(\"tuple\",e.length,t.length),e.forEach(((e,o)=>{r=e.write(t[o],n,r)})),r)})}function Lu(e){const t=ku(e.map(Iu)),n=ku(e.map(Tu))??void 0;return js({...null===t?{maxSize:n}:{fixedSize:t},read:(t,n)=>{const r=[];return e.forEach((e=>{const[o,i]=e.read(t,n);r.push(o),n=i})),[r,n]}})}function ju(e,t){const n=$u(e),r=(n,r,o)=>{const i=t(n);return Du(e,i),e[i].write(n,r,o)};if(null!==n)return Ls({fixedSize:n,write:r});const o=Ku(e);return Ls({...null!==o?{maxSize:o}:{},getSizeFromValue:n=>{const r=t(n);return Du(e,r),zs(n,e[r])},write:r})}function Fu(e,t){const n=$u(e),r=(n,r)=>{const o=t(n,r);return Du(e,o),e[o].read(n,r)};if(null!==n)return js({fixedSize:n,read:r});const o=Ku(e);return js({...null!==o?{maxSize:o}:{},read:r})}function Du(e,t){if(void 0===e[t])throw new Ts(ms,{maxRange:e.length-1,minRange:0,variant:t})}function $u(e){if(0===e.length)return 0;if(!Fs(e[0]))return null;const t=e[0].fixedSize;return e.every((e=>Fs(e)&&e.fixedSize===t))?t:null}function Ku(e){return e.map((e=>Tu(e))).reduce(((e,t)=>null===e||null===t?null:Math.max(e,t)),0)}function qu(e,t={}){const n=t.discriminator??\"__kind\",r=t.size??Ec();return Fu(e.map((([e,t])=>oc(Lu([r,t]),(([,t])=>({[n]:e,...t}))))),((e,t)=>Number(r.read(e,t)[0])))}function Wu(e){const t=[...new Set(Object.values(e).filter((e=>\"number\"==typeof e)))].sort(),n=Object.fromEntries(Object.entries(e).slice(t.length)),r=Object.keys(n),o=Object.values(n),i=[...new Set([...r,...o.filter((e=>\"string\"==typeof e))])];return{enumKeys:r,enumRecord:n,enumValues:o,numericalValues:t,stringValues:i}}function Hu(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return n;return-1}function Vu(e){if(0===e.length)return\"\";let t=[e[0],e[0]];const n=[];for(let r=1;r<e.length;r++){const o=e[r];t[1]+1===o?t[1]=o:(n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),t=[o,o])}return n.push(t[0]===t[1]?`${t[0]}`:`${t[0]}-${t[1]}`),n.join(\", \")}function Gu(e,t={}){const n=t.size??Sc(),r=t.useValuesAsDiscriminators??!1,{enumKeys:o,enumValues:i,numericalValues:a,stringValues:s}=Wu(e);if(r&&i.some((e=>\"string\"==typeof e)))throw new Ts(ws,{stringValues:i.filter((e=>\"string\"==typeof e))});return rc(n,(e=>{const t=function({enumKeys:e,enumValues:t,variant:n}){const r=Hu(t,(e=>e===n));return r>=0?r:e.findIndex((e=>e===n))}({enumKeys:o,enumValues:i,variant:e});if(t<0)throw new Ts(ds,{formattedNumericalValues:Vu(a),numericalValues:a,stringValues:s,variant:e});return r?i[t]:t}))}function Zu(e,t={}){const n=t.size??Ec(),r=t.useValuesAsDiscriminators??!1,{enumKeys:o,enumValues:i,numericalValues:a}=Wu(e);if(r&&i.some((e=>\"string\"==typeof e)))throw new Ts(ws,{stringValues:i.filter((e=>\"string\"==typeof e))});return oc(n,(e=>{const t=Number(e),n=function({discriminator:e,enumKeys:t,enumValues:n,useValuesAsDiscriminators:r}){return r?Hu(n,(t=>t===e)):e>=0&&e<t.length?e:-1}({discriminator:t,enumKeys:o,enumValues:i,useValuesAsDiscriminators:r});if(n<0){const e=r?a:[...Array(o.length).keys()];throw new Ts(ls,{discriminator:t,formattedValidDiscriminators:Vu(e),validDiscriminators:e})}return i[n]}))}var Ju;function Yu(e,t){return oc(Lu([...t,e]),(e=>e[e.length-1]))}function Qu(e,t,n={}){return oc(Cu(Lu([e,t]),n),(e=>new Map(e)))}function Xu(){return Ls({fixedSize:0,write:(e,t,n)=>n})}function el(){return js({fixedSize:0,read:(e,t)=>[void 0,t]})}function tl(e){const t=e.map((([,e])=>e)),n=ku(t.map(Iu)),r=ku(t.map(Tu))??void 0;return Ls({...null===n?{getSizeFromValue:t=>e.map((([e,n])=>zs(t[e],n))).reduce(((e,t)=>e+t),0),maxSize:r}:{fixedSize:n},write:(t,n,r)=>(e.forEach((([e,o])=>{r=o.write(t[e],n,r)})),r)})}function nl(e){const t=e.map((([,e])=>e)),n=ku(t.map(Iu)),r=ku(t.map(Tu))??void 0;return js({...null===n?{maxSize:r}:{fixedSize:n},read:(t,n)=>{const r={};return e.forEach((([e,o])=>{const[i,a]=o.read(t,n);n=a,r[e]=i})),[r,n]}})}function rl(){return Ju||(Ju=zc()),Ju}function ol(e){if(e.length<32||e.length>44)throw new Ts(4,{actualLength:e.length});const t=rl().encode(e).byteLength;if(32!==t)throw new Ts(5,{actualLength:t})}function il(e){switch(e){case\"finalized\":return 2;case\"confirmed\":return 1;case\"processed\":return 0;default:throw new Ts(Ss,{unexpectedValue:e})}}var al=18446744073709551615n;function sl(e){return function(e){if(e<0||e>al)throw new Ts(6)}(e),e}function cl(e,...t){return t.reduce(((e,t)=>t(e)),e)}function ul(e){if(!(\"lifetimeConstraint\"in e&&\"string\"==typeof e.lifetimeConstraint.blockhash&&\"bigint\"==typeof e.lifetimeConstraint.lastValidBlockHeight))return!1;try{return ol(e.lifetimeConstraint.blockhash),!0}catch{return!1}}function ll(e,t){if(\"lifetimeConstraint\"in t&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return t;const n={...t,lifetimeConstraint:Object.freeze(e)};return Object.freeze(n),n}var dl=e=>Ls({getSizeFromValue:t=>{const[n,r]=hl(t,e[0]);if(!r)return t.length;const o=pl(r,e);return n.length+Math.ceil(o.toString(16).length/2)},write(t,n,r){if(function(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new Ts(hs,{alphabet:e,base:e.length,value:n})}(e,t),\"\"===t)return r;const[o,i]=hl(t,e[0]);if(!i)return n.set(new Uint8Array(o.length).fill(0),r),r+o.length;let a=pl(i,e);const s=[];for(;a>0n;)s.unshift(Number(a%256n)),a/=256n;const c=[...Array(o.length).fill(0),...s];return n.set(c,r),r+c.length}}),fl=e=>js({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return[\"\",0];let o=r.findIndex((e=>0!==e));o=-1===o?r.length:o;const i=e[0].repeat(o);if(o===r.length)return[i,t.length];const a=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(\"\")}(r.slice(o).reduce(((e,t)=>256n*e+BigInt(t)),0n),e);return[i+a,t.length]}});function hl(e,t){const[n,r]=e.split(new RegExp(`((?!${t}).*)`));return[n,r]}function pl(e,t){const n=BigInt(t.length);let r=0n;for(const o of e)r*=n,r+=BigInt(t.indexOf(o));return r}var gl,ml,yl,wl,vl,bl,Al=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";function Sl(){return yl||(yl=Sc()),yl}function El(){return wl||(wl=Ec()),wl}function xl(){return Ls({getSizeFromValue:e=>\"legacy\"===e?0:1,maxSize:1,write:(e,t,n)=>{if(\"legacy\"===e)return n;if(e<0||e>127)throw new Ts(Da,{actualVersion:e});return t.set([128|e],n),n+1}})}function kl(){return js({maxSize:1,read:(e,t)=>{const n=e[t];if(128&n){return[128^n,t+1]}return[\"legacy\",t]}})}function Il(){return tl(_l())}function Tl(){return rc(tl([..._l(),[\"addressTableLookups\",_u((gl||(gl=tl([[\"lookupTableAddress\",ru()],[\"writableIndices\",_u(Sc(),{size:gc()})],[\"readableIndices\",_u(Sc(),{size:gc()})]])),gl),{size:gc()})]]),(e=>\"legacy\"===e.version?e:{...e,addressTableLookups:e.addressTableLookups??[]}))}function _l(){return[[\"version\",xl()],[\"header\",tl([[\"numSignerAccounts\",Sl()],[\"numReadonlySignerAccounts\",Sl()],[\"numReadonlyNonSignerAccounts\",Sl()]])],[\"staticAccounts\",_u(ru(),{size:gc()})],[\"lifetimeToken\",Gs(dl(Al),32)],[\"instructions\",_u((vl||(vl=rc(tl([[\"programAddressIndex\",Sc()],[\"accountIndices\",_u(Sc(),{size:gc()})],[\"data\",Hs(Nu(),gc())]]),(e=>void 0!==e.accountIndices&&void 0!==e.data?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)}))),vl),{size:gc()})]]}function Cl(){return Ls({getSizeFromValue:e=>\"legacy\"===e.version?Il().getSizeFromValue(e):Tl().getSizeFromValue(e),write:(e,t,n)=>\"legacy\"===e.version?Il().write(e,t,n):Tl().write(e,t,n)})}function Bl(){return oc(nl([[\"version\",kl()],[\"header\",nl([[\"numSignerAccounts\",El()],[\"numReadonlySignerAccounts\",El()],[\"numReadonlyNonSignerAccounts\",El()]])],[\"staticAccounts\",Cu(ou(),{size:mc()})],[\"lifetimeToken\",Zs(fl(Al),32)],[\"instructions\",Cu((bl||(bl=oc(nl([[\"programAddressIndex\",Ec()],[\"accountIndices\",Cu(Ec(),{size:mc()})],[\"data\",Vs(Ou(),mc())]]),(e=>{if(e.accountIndices.length&&e.data.byteLength)return e;const{accountIndices:t,data:n,...r}=e;return{...r,...t.length?{accountIndices:t}:null,...n.byteLength?{data:n}:null}}))),bl),{size:mc()})],[\"addressTableLookups\",Cu((ml||(ml=nl([[\"lookupTableAddress\",ou()],[\"writableIndices\",Cu(Ec(),{size:mc()})],[\"readableIndices\",Cu(Ec(),{size:mc()})]])),ml),{size:mc()})]]),(({addressTableLookups:e,...t})=>\"legacy\"!==t.version&&e?.length?{...t,addressTableLookups:e}:t))}function Pl(e,t,n){e[t]=n(e[t]??{role:kc.READONLY})}var Rl=Symbol(\"AddressMapTypeProperty\");function Nl(e){const t={};for(const n of e){if(!(\"lookupTableAddress\"in n))continue;const e=t[n.lookupTableAddress]||={readableIndices:[],writableIndices:[]};n.role===kc.WRITABLE?e.writableIndices.push(n.addressIndex):e.readableIndices.push(n.addressIndex)}return Object.keys(t).sort(au()).map((e=>({lookupTableAddress:e,...t[e]})))}function Ol(e){let t=0,n=0,r=0;for(const o of e){if(\"lookupTableAddress\"in o)break;const e=Tc(o.role);Ic(o.role)?(r++,e||n++):e||t++}return{numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:n,numSignerAccounts:r}}function Ul(e,t){const n=function(e){const t={};for(const[n,r]of e.entries())t[r.address]=n;return t}(t);return e.map((({accounts:e,data:t,programAddress:r})=>({programAddressIndex:n[r],...e?{accountIndices:e.map((({address:e})=>n[e]))}:null,...t?{data:t}:null})))}function Ml(e){const t=e.findIndex((e=>\"lookupTableAddress\"in e));return(-1===t?e:e.slice(0,t)).map((({address:e})=>e))}function zl(e){const t=function(e){let t;const n=Object.entries(e).sort((([e,n],[r,o])=>{if(n[Rl]!==o[Rl]){if(0===n[Rl])return-1;if(0===o[Rl])return 1;if(2===n[Rl])return-1;if(2===o[Rl])return 1}const i=Ic(n.role);if(i!==Ic(o.role))return i?-1:1;const a=Tc(n.role);return a!==Tc(o.role)?a?-1:1:(t||=au(),1===n[Rl]&&1===o[Rl]&&n.lookupTableAddress!==o.lookupTableAddress?t(n.lookupTableAddress,o.lookupTableAddress):t(e,r))})).map((([e,t])=>({address:e,...t})));return n}(function(e,t){const n={[e]:{[Rl]:0,role:kc.WRITABLE_SIGNER}},r=new Set;for(const e of t){let t;if(Pl(n,e.programAddress,(t=>{if(r.add(e.programAddress),Rl in t){if(Tc(t.role)){if(0===t[Rl])throw new Ts(ja,{programAddress:e.programAddress});throw new Ts(Fa,{programAddress:e.programAddress})}if(2===t[Rl])return t}return{[Rl]:2,role:kc.READONLY}})),e.accounts)for(const o of e.accounts)Pl(n,o.address,(e=>{const{address:n,...i}=o;if(Rl in e)switch(e[Rl]){case 0:return e;case 1:{const n=_c(e.role,i.role);if(\"lookupTableAddress\"in i){if(e.lookupTableAddress!==i.lookupTableAddress&&(t||=au())(i.lookupTableAddress,e.lookupTableAddress)<0)return{[Rl]:1,...i,role:n}}else if(Ic(i.role))return{[Rl]:2,role:n};return e.role!==n?{...e,role:n}:e}case 2:{const t=_c(e.role,i.role);if(r.has(o.address)){if(Tc(i.role))throw new Ts(Fa,{programAddress:o.address});return e.role!==t?{...e,role:t}:e}return\"lookupTableAddress\"in i&&!Ic(e.role)?{...i,[Rl]:1,role:t}:e.role!==t?{...e,role:t}:e}}return\"lookupTableAddress\"in i?{...i,[Rl]:1}:{...i,[Rl]:2}}))}return n}(e.feePayer.address,e.instructions));return{...\"legacy\"!==e.version?{addressTableLookups:Nl(t)}:null,header:Ol(t),instructions:Ul(e.instructions,t),lifetimeToken:(n=e.lifetimeConstraint,\"nonce\"in n?n.nonce:n.blockhash),staticAccounts:Ml(t),version:e.version};var n}function Ll({version:e}){return Object.freeze({instructions:Object.freeze([]),version:e})}var jl,Fl=\"SysvarRecentB1ockHashes11111111111111111111\",Dl=\"11111111111111111111111111111111\";function $l(e,t){return{accounts:[{address:e,role:kc.WRITABLE},{address:Fl,role:kc.READONLY},{address:t,role:kc.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Dl}}function Kl(e){return e.programAddress===Dl&&null!=e.data&&(4===(t=e.data).byteLength&&4===t[0]&&0===t[1]&&0===t[2]&&0===t[3])&&3===e.accounts?.length&&null!=e.accounts[0].address&&e.accounts[0].role===kc.WRITABLE&&e.accounts[1].address===Fl&&e.accounts[1].role===kc.READONLY&&null!=e.accounts[2].address&&Ic(e.accounts[2].role);var t}function ql(e){return\"lifetimeConstraint\"in e&&\"string\"==typeof e.lifetimeConstraint.nonce&&null!=e.instructions[0]&&Kl(e.instructions[0])}function Wl(e,t){if(\"feePayer\"in t&&e===t.feePayer?.address&&function(e){return!!e&&\"address\"in e&&\"string\"==typeof e.address&&1===Object.keys(e).length}(t.feePayer))return t;const n={...t,feePayer:Object.freeze({address:e})};return Object.freeze(n),n}function Hl(e,t){return Vl([e],t)}function Vl(e,t){return Object.freeze({...t,instructions:Object.freeze([...t.instructions,...e])})}function Gl(e,t){return Object.freeze({...t,instructions:Object.freeze([...e,...t.instructions])})}function Zl(e,t){const n=e.staticAccounts[0];if(!n)throw new Ts(Wa);const r=[...function(e){const{header:t}=e,n=t.numSignerAccounts-t.numReadonlySignerAccounts,r=e.staticAccounts.length-t.numSignerAccounts-t.numReadonlyNonSignerAccounts,o=[];let i=0;for(let t=0;t<n;t++)o.push({address:e.staticAccounts[i],role:kc.WRITABLE_SIGNER}),i++;for(let n=0;n<t.numReadonlySignerAccounts;n++)o.push({address:e.staticAccounts[i],role:kc.READONLY_SIGNER}),i++;for(let t=0;t<r;t++)o.push({address:e.staticAccounts[i],role:kc.WRITABLE}),i++;for(let n=0;n<t.numReadonlyNonSignerAccounts;n++)o.push({address:e.staticAccounts[i],role:kc.READONLY}),i++;return o}(e),...\"addressTableLookups\"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?function(e,t){const n=e.map((e=>e.lookupTableAddress)).filter((e=>void 0===t[e]));if(n.length>0)throw new Ts($a,{lookupTableAddresses:n});const r=[],o=[];for(const n of e){const e=t[n.lookupTableAddress],i=Math.max(...n.readableIndices,...n.writableIndices);if(i>=e.length)throw new Ts(Ka,{highestKnownIndex:e.length-1,highestRequestedIndex:i,lookupTableAddress:n.lookupTableAddress});const a=n.readableIndices.map((t=>({address:e[t],addressIndex:t,lookupTableAddress:n.lookupTableAddress,role:kc.READONLY})));r.push(...a);const s=n.writableIndices.map((t=>({address:e[t],addressIndex:t,lookupTableAddress:n.lookupTableAddress,role:kc.WRITABLE})));o.push(...s)}return[...o,...r]}(e.addressTableLookups,t?.addressesByLookupTableAddress??{}):[]],o=e.instructions.map((e=>function(e,t){const n=t[e.programAddressIndex]?.address;if(!n)throw new Ts(qa,{index:e.programAddressIndex});const r=e.accountIndices?.map((e=>t[e])),{data:o}=e;return Object.freeze({programAddress:n,...r&&r.length?{accounts:Object.freeze(r)}:{},...o&&o.length?{data:o}:{}})}(e,r))),i=o[0],a=function(e,t,n){if(t&&Kl(t)){const n=t.accounts[0].address;tu(n);const r=t.accounts[2].address;return tu(r),{nonce:e,nonceAccountAddress:n,nonceAuthorityAddress:r}}return{blockhash:e,lastValidBlockHeight:n??2n**64n-1n}}(e.lifetimeToken,i,t?.lastValidBlockHeight);return cl(Ll({version:e.version}),(e=>Wl(n,e)),(e=>o.reduce(((e,t)=>Hl(t,e)),e)),(e=>\"blockhash\"in a?ll(a,e):function({nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:n},r){let o;const i=r.instructions[0];if(i&&Kl(i))if(function(e,t,n){return e.accounts[0].address===t&&e.accounts[2].address===n}(i,t,n)){if(ql(r)&&r.lifetimeConstraint.nonce===e)return r;o=[i,...r.instructions.slice(1)]}else o=[Object.freeze($l(t,n)),...r.instructions.slice(1)];else o=[Object.freeze($l(t,n)),...r.instructions];return Object.freeze({...r,instructions:Object.freeze(o),lifetimeConstraint:Object.freeze({nonce:e})})}(a,e)))}function Jl(e){const t=Object.values(e);if(0===t.length)throw new Ts(Za);return t.map((e=>e||new Uint8Array(64).fill(0)))}function Yl(){return tl([[\"signatures\",rc(_u(Gs(Nu(),64),{size:gc()}),Jl)],[\"messageBytes\",Nu()]])}function Ql(){return oc(nl([[\"signatures\",Cu(Zs(Ou(),64),{size:mc()})],[\"messageBytes\",Ou()]]),Xl)}function Xl(e){const{messageBytes:t,signatures:n}=e,r=Lu([kl(),nc(Ec(),2),Cu(ou(),{size:mc()})]),[o,i,a]=r.decode(t),s=a.slice(0,i);if(s.length!==n.length)throw new Ts(Ja,{numRequiredSignatures:i,signaturesLength:n.length,signerAddresses:s});const c={};return s.forEach(((e,t)=>{const r=n[t];r.every((e=>0===e))?c[e]=null:c[e]=r})),{messageBytes:t,signatures:Object.freeze(c)}}function ed(e){const t=zl(e),n=Cl().encode(t),r=t.staticAccounts.slice(0,t.header.numSignerAccounts),o={};for(const e of r)o[e]=null;let i;i=ul(e)?{blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:{nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address};const a={lifetimeConstraint:i,messageBytes:n,signatures:Object.freeze(o)};return Object.freeze(a)}function td(e){jl||(jl=Lc());const t=Object.values(e.signatures)[0];if(!t)throw new Ts(Va);return jl.decode(t)}async function nd(e,t){let n,r;if(await Promise.all(e.map((async e=>{const o=await mu(e.publicKey),i=t.signatures[o];if(void 0===i)return r||=new Set,void r.add(o);if(r)return;const a=await bu(e.privateKey,t.messageBytes);var s,c;null!==i&&(c=i,(s=a).length===c.length&&s.every(((e,t)=>e===c[t])))||(n||={},n[o]=a)}))),r&&r.size>0){const e=Object.keys(t.signatures);throw new Ts(Ga,{expectedAddresses:e,unexpectedAddresses:[...r]})}return n?Object.freeze({...t,signatures:Object.freeze({...t.signatures,...n})}):t}function rd(e){const t=[];if(Object.entries(e.signatures).forEach((([e,n])=>{n||t.push(e)})),t.length>0)throw new Ts(Ha,{addresses:t})}function od(e){const t=Yl().encode(e);return qc().decode(t)}function id(e){const t={};return e.forEach((e=>{if(t[e.address]){if(t[e.address]!==e)throw new Ts(La,{address:e.address})}else t[e.address]=e})),Object.values(t)}function ad(e){return\"modifyAndSignTransactions\"in e&&\"function\"==typeof e.modifyAndSignTransactions}function sd(e){return\"signTransactions\"in e&&\"function\"==typeof e.signTransactions}function cd(e){return\"signAndSendTransactions\"in e&&\"function\"==typeof e.signAndSendTransactions}function ud(e){return sd(e)||ad(e)||cd(e)}function ld(e){return id((e.accounts??[]).flatMap((e=>\"signer\"in e?e.signer:[])))}function dd(e){return id([...e.feePayer&&ud(e.feePayer)?[e.feePayer]:[],...e.instructions.flatMap(ld)])}function fd(e,t){const n=(r=t)&&\"feePayer\"in r&&r.feePayer&&\"string\"==typeof r.feePayer.address&&!ud(r.feePayer)?e.find((e=>e.address===t.feePayer.address)):void 0;var r;return n||0!==t.instructions.length?Object.freeze({...t,...n?{feePayer:n}:null,instructions:t.instructions.map((t=>function(e,t){if(!t.accounts||0===t.accounts.length)return t;const n=new Map(id(e).map((e=>[e.address,e])));return Object.freeze({...t,accounts:t.accounts.map((e=>{const t=n.get(e.address);return Ic(e.role)&&!(\"signer\"in e)&&t?Object.freeze({...e,signer:t}):e}))})}(e,t)))}):t}async function hd(e){const t=await mu(e.publicKey),n={address:t,keyPair:e,signMessages:n=>Promise.all(n.map((async n=>Object.freeze({[t]:await bu(e.privateKey,n.content)})))),signTransactions:n=>Promise.all(n.map((async n=>{const r=await nd([e],n);return Object.freeze({[t]:r.signatures[t]})})))};return Object.freeze(n)}async function pd(e,t){return await hd(await Eu(e,t))}function gd(e){const t={address:e,signMessages:e=>Promise.resolve(e.map((()=>Object.freeze({})))),signTransactions:e=>Promise.resolve(e.map((()=>Object.freeze({}))))};return Object.freeze(t)}async function md(e,t){const{partialSigners:n,modifyingSigners:r}=yd(id(dd(e).filter(ud)),{identifySendingSigner:!1});return await wd(e,r,n,t)}function yd(e,t={}){const n=t.identifySendingSigner??!0?function(e){const t=e.filter(cd);if(0===t.length)return null;const n=t.filter((e=>!ad(e)&&!sd(e)));if(n.length>0)return n[0];return t[0]}(e):null,r=e.filter((e=>e!==n&&(ad(e)||sd(e)))),o=function(e){const t=e.filter(ad);if(0===t.length)return[];const n=t.filter((e=>!sd(e)));return n.length>0?n:[t[0]]}(r),i=r.filter(sd).filter((e=>!o.includes(e)));return Object.freeze({modifyingSigners:o,partialSigners:i,sendingSigner:n})}async function wd(e,t=[],n=[],r){const o=ed(e),i=await t.reduce((async(e,t)=>{r?.abortSignal?.throwIfAborted();const[n]=await t.modifyAndSignTransactions([await e],r);return Object.freeze(n)}),Promise.resolve(o));r?.abortSignal?.throwIfAborted();const a=await Promise.all(n.map((async e=>{const[t]=await e.signTransactions([i],r);return t}))),s={...i,signatures:Object.freeze(a.reduce(((e,t)=>({...e,...t})),i.signatures??{}))};return Object.freeze(s)}var vd=globalThis.TextEncoder;var bd,Ad=((bd=Ad||{})[bd.Uninitialized=0]=\"Uninitialized\",bd[bd.Initialized=1]=\"Initialized\",bd);var Sd,Ed=((Sd=Ed||{})[Sd.Legacy=0]=\"Legacy\",Sd[Sd.Current=1]=\"Current\",Sd);var xd,kd,Id=\"11111111111111111111111111111111\",Td=((xd=Td||{})[xd.Nonce=0]=\"Nonce\",xd),_d=((kd=_d||{})[kd.CreateAccount=0]=\"CreateAccount\",kd[kd.Assign=1]=\"Assign\",kd[kd.TransferSol=2]=\"TransferSol\",kd[kd.CreateAccountWithSeed=3]=\"CreateAccountWithSeed\",kd[kd.AdvanceNonceAccount=4]=\"AdvanceNonceAccount\",kd[kd.WithdrawNonceAccount=5]=\"WithdrawNonceAccount\",kd[kd.InitializeNonceAccount=6]=\"InitializeNonceAccount\",kd[kd.AuthorizeNonceAccount=7]=\"AuthorizeNonceAccount\",kd[kd.Allocate=8]=\"Allocate\",kd[kd.AllocateWithSeed=9]=\"AllocateWithSeed\",kd[kd.AssignWithSeed=10]=\"AssignWithSeed\",kd[kd.TransferSolWithSeed=11]=\"TransferSolWithSeed\",kd[kd.UpgradeNonceAccount=12]=\"UpgradeNonceAccount\",kd);function Cd(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function Bd(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:kc.READONLY});const n=t.isWritable?kc.WRITABLE:kc.READONLY;return Object.freeze({address:Cd(t.value),role:Pd(t.value)?Cc(n):n,...Pd(t.value)?{signer:t.value}:{}})}}function Pd(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&ud(e)}function Rd(){return nl([[\"discriminator\",vc()]])}function Nd(){return nl([[\"discriminator\",vc()],[\"space\",Ac()]])}function Od(){return nl([[\"discriminator\",vc()],[\"base\",ou()],[\"seed\",Vs(Zc(),Ac())],[\"space\",Ac()],[\"programAddress\",ou()]])}function Ud(){return nl([[\"discriminator\",vc()],[\"programAddress\",ou()]])}function Md(){return nl([[\"discriminator\",vc()],[\"base\",ou()],[\"seed\",Vs(Zc(),Ac())],[\"programAddress\",ou()]])}function zd(){return nl([[\"discriminator\",vc()],[\"newNonceAuthority\",ou()]])}function Ld(){return nl([[\"discriminator\",vc()],[\"lamports\",Ac()],[\"space\",Ac()],[\"programAddress\",ou()]])}function jd(){return nl([[\"discriminator\",vc()],[\"base\",ou()],[\"seed\",Vs(Zc(),Ac())],[\"amount\",Ac()],[\"space\",Ac()],[\"programAddress\",ou()]])}function Fd(){return nl([[\"discriminator\",vc()],[\"nonceAuthority\",ou()]])}function Dd(){return rc(tl([[\"discriminator\",wc()],[\"amount\",bc()]]),(e=>({...e,discriminator:2})))}function $d(){return nl([[\"discriminator\",vc()],[\"amount\",Ac()]])}function Kd(){return nl([[\"discriminator\",vc()],[\"amount\",Ac()],[\"fromSeed\",Vs(Zc(),Ac())],[\"fromOwner\",ou()]])}function qd(){return nl([[\"discriminator\",vc()]])}function Wd(){return nl([[\"discriminator\",vc()],[\"withdrawAmount\",Ac()]])}const Hd={log:(console.log,(...e)=>{}),info:(console.info,(...e)=>{}),warn:(console.warn,(...e)=>{}),debug:(console.debug,(...e)=>{}),error:(console.error,(...e)=>{})};const Vd={log:()=>{},info:()=>{},warn:()=>{},debug:()=>{},error:()=>{}},Gd=(e,t)=>new Proxy(e,{get(e,n){const r=e[n];return\"function\"==typeof r?(n,...o)=>r.call(e,t,n,...o):r}}),Zd=Hd;const Jd=(e,t)=>`${e}:${t.map((e=>JSON.stringify(e))).join(\":\")}`,Yd=(e,t,{ttlMilliseconds:n,functionName:r,generateCacheKey:o})=>{const i=o??Jd,a=r??e.name??\"anonymousFunction\";return async(...r)=>{const o=i(a,r);try{const e=await t.get(o);if(void 0!==e)return e}catch(e){Zd.error(`Cache get error for key \"${o}\":`,e)}const s=await e(...r);return t.set(o,s,n).catch((e=>{Zd.error(`Cache set error for key \"${o}\":`,e)})),s}},Qd=1000000n,Xd=1e9,ef=\"metamask\";var tf=function(e){return e.Mainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",e.Devnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",e.Testnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\",e.Localnet=\"solana:123456789abcdef\",e}({}),nf=function(e){return e.SolMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\",e.SolDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\",e.SolTestnet=\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\",e.SolLocalnet=\"solana:123456789abcdef/slip44:501\",e.UsdcMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",e.UsdcDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",e.UsdcLocalnet=\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",e.EurcMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.EurcDevnet=\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.EurcLocalnet=\"solana:123456789abcdef/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr\",e.Ai16zMainnet=\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC\",e}({});_e(ue(),/^solana:[a-zA-Z0-9]+\\/slip44:501$/u);const rf=_e(ue(),/^solana:[a-zA-Z0-9]+\\/token:[a-zA-Z0-9]+$/u),of=(_e(ue(),/^solana:[a-zA-Z0-9]+\\/nft:[a-zA-Z0-9]+$/u),pe(\"TokenCaipAssetTypeFromString\",(e=>{if(\"string\"!=typeof e)return\"Expected a string, but received: \"+typeof e;const[t]=rf.validate(e);return t||!0})));var af=function(e){return e.SOL=\"slip44:501\",e}({});const sf={\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:123456789abcdef/slip44:501\":{symbol:\"SOL\",caip19Id:\"solana:123456789abcdef/slip44:501\",address:\"So11111111111111111111111111111111111111112\",decimals:9},\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\":{symbol:\"USDC\",caip19Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",address:\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",decimals:6},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\":{symbol:\"USDC\",caip19Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/token:4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",address:\"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU\",decimals:6},\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\":{symbol:\"USDC\",caip19Id:\"solana:123456789abcdef/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",address:\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",decimals:6}},cf={\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\":{caip2Id:\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",cluster:\"mainnet\",name:\"Solana Mainnet\",nativeToken:sf[\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501\"]},\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\":{caip2Id:\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\",cluster:\"devnet\",name:\"Solana Devnet\",nativeToken:sf[\"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501\"]},\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\":{caip2Id:\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z\",cluster:\"testnet\",name:\"Solana Testnet\",nativeToken:sf[\"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501\"]},\"solana:123456789abcdef\":{caip2Id:\"solana:123456789abcdef\",cluster:\"local\",name:\"Solana Localnet\",nativeToken:sf[\"solana:123456789abcdef/slip44:501\"]}},uf=_e(ue(),/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u),lf=_e(ue(),/^(?!0\\d)(\\d+(\\.\\d+)?)$/u),df=Ce(ue(),\"safe-url\",(e=>{try{const t=new URL(e),n=[\"http:\",\"https:\",\"wss:\"];if(!n.includes(t.protocol))return`URL must use one of the following protocols: ${n}`;if(!e.match(/^(https?|wss):\\/\\/[^/]+\\/?/u))return\"Malformed URL - incorrect protocol format\";const r=t.hostname.toLowerCase();if(!(\"localhost\"===r||r.includes(\".\")&&/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/u.test(r)))return\"Invalid hostname format\";const o=decodeURIComponent(e.toLowerCase());if(e.includes(\"\\\\\")||e.includes(\"@\")||o.includes(\"\\\\\")||o.includes(\"@\")||e.toLowerCase().includes(\"%2f@\")||e.toLowerCase().includes(\"%5c@\"))return\"URL contains protocol pollution attempts\";const i=decodeURIComponent(r);if(r.includes(\"\\\\\")||r.includes(\"@\")||i.includes(\"/\")||r.toLowerCase().includes(\"%2f\"))return\"Invalid hostname characters detected\";if(e.includes(\"../\")||e.includes(\"..%2f\")||e.includes(\"..%2F\"))return\"Directory traversal attempts are not allowed\";const a=[/<[^>]*>/u,/javascript:/u,/data:/u,/\\\\[@\\\\]/u,/%2f@/u,/[^\\x20-\\x7E]/u,/\\$\\{.*?\\}/u,/#\\{.*?\\}/u,/[|;]/u,/%0[acd]|%0[acd]/u,/\\/\\/\\w+@/u,/(?:[^a-z]|^)(?:union\\s+(?:all\\s+)?select|select\\s+(?:.*\\s+)?from|insert\\s+into|update\\s+.*\\s+set|delete\\s+from|drop\\s+table|alter\\s+table|create\\s+table|exec(?:ute)?|union|where\\s+[\\d\\w]\\s*=\\s*[\\d\\w]|\\bor\\b\\s*[\\d\\w]\\s*=\\s*[\\d\\w])/iu,/'.*?(?:OR|UNION|SELECT|FROM|WHERE).*?'/iu,/%27.*?(?:OR|UNION|SELECT|FROM|WHERE).*?(?:%27|')/iu,/%20(?:OR|UNION|SELECT|FROM|WHERE)%20/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=(?:[^&]*\\/\\/|https?:)/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=%(?:[^&]*\\/\\/|https?:)/iu];for(const e of a)if(e.test(o))return\"URL contains potentially malicious patterns\";return!(t.port&&!/^\\d+$/u.test(t.port))||\"Invalid port number\"}catch(e){return\"Invalid URL format\"}})),ff=ie({accountId:uf}),hf=ie({accountId:uf}),pf=ie({accountId:uf}),gf=ie({accountId:uf,assets:Y(kt)}),mf=ie({accountId:uf,pagination:ie({limit:ee(),next:ae(re(ue()))})}),yf=ce(kt,ie({amount:lf,unit:ue()})),wf=(Y(kt),X(Object.values(Tn)),X(Object.values(tf))),vf=(X([\"btc\",\"eth\",\"ltc\",\"bch\",\"bnb\",\"eos\",\"xrp\",\"xlm\",\"link\",\"dot\",\"yfi\",\"usd\",\"aed\",\"ars\",\"aud\",\"bdt\",\"bhd\",\"bmd\",\"brl\",\"cad\",\"chf\",\"clp\",\"cny\",\"czk\",\"dkk\",\"eur\",\"gbp\",\"gel\",\"hkd\",\"huf\",\"idr\",\"ils\",\"inr\",\"jpy\",\"krw\",\"kwd\",\"lkr\",\"mmk\",\"mxn\",\"myr\",\"ngn\",\"nok\",\"nzd\",\"php\",\"pkr\",\"pln\",\"rub\",\"sar\",\"sek\",\"sgd\",\"thb\",\"try\",\"twd\",\"uah\",\"vef\",\"vnd\",\"zar\",\"xdr\",\"xag\",\"xau\",\"bits\",\"sats\"]),ie({transaction:ue(),scope:X(Object.values(tf))})),bf=ie({value:re(lf)}),Af=pe(\"Base58\",(e=>\"string\"!=typeof e?\"Expected a string, but received: \"+typeof e:!!/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(e)||\"Expected a Base58 encoded string, but received a string with invalid characters\")),Sf=_e(ue(),/^(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u),Ef=_e(ue(),/^m\\/44'\\/501'/u),xf=(_e(ue(),/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/u),pe(\"SolanaAddress\",(e=>{if(\"string\"!=typeof e)return\"Expected a string, but received: \"+typeof e;try{return nu(e),!0}catch(e){return\"Invalid Solana address\"}})));function kf(e){return e&&\"string\"==typeof e?e.replace(/[\\u0000-\\u0008\\u000A-\\u001F\\u007F]/gu,\"\"):\"\"}function If(e,t=1e3){if(!e||\"string\"!=typeof e)return\"\";let n=kf(e);return n.length>t&&(n=n.substring(0,t)),n=n.trim(),n}function Tf(e){if(!e||\"string\"!=typeof e)return\"\";const t=kf(e);return/^[1-9A-HJ-NP-Za-km-z]+$/u.test(t)?t.length<32||t.length>44?\"\":t:\"\"}function _f(e){if(!e||\"string\"!=typeof e)return\"\";const t=kf(e);try{const e=new URL(t);return[\"http:\",\"https:\",\"wss:\",\"ipfs:\"].includes(e.protocol)?t.length>2048?\"\":t:\"\"}catch{return\"\"}}function Cf(e){const{baseUrl:t,path:n,pathParams:r,queryParams:o,encodePathParams:i=!0}=e,a=_f(t);if(\"\"===a)throw new Error(\"Invalid URL format\");H(a,df);const s=n.replace(/\\{(\\w+)\\}/gu,((e,t)=>{const n=r?.[t];if(void 0===n)throw new Error(`Path parameter ${t} is undefined`);const o=kf(n);return i?encodeURIComponent(o):o})).replace(/^\\/+/u,\"\").replace(/\\/+/gu,\"/\").replace(/\\/+$/u,\"\"),c=new URL(s,a);Object.entries(o??{}).filter((([e,t])=>void 0!==t)).filter((([e,t])=>null!==t)).forEach((([e,t])=>{if(t){const n=kf(t);c.searchParams.append(e,n)}}));const u=c.toString();return H(u,df),u}var Bf=n(5250);const Pf=fe([X([\"btc\",\"eth\",\"ltc\",\"bch\",\"bnb\",\"eos\",\"xrp\",\"xlm\",\"link\",\"dot\",\"yfi\",\"bits\",\"sats\",\"sol\",\"sei\",\"sonic\"]),X([\"usd\",\"aed\",\"amd\",\"ars\",\"aud\",\"bam\",\"bdt\",\"bhd\",\"bmd\",\"brl\",\"cad\",\"chf\",\"clp\",\"cny\",\"cop\",\"crc\",\"czk\",\"dkk\",\"dop\",\"eur\",\"gbp\",\"gel\",\"gtq\",\"hkd\",\"hnl\",\"huf\",\"idr\",\"ils\",\"inr\",\"jpy\",\"kes\",\"krw\",\"kwd\",\"lbp\",\"lkr\",\"mmk\",\"mxn\",\"myr\",\"ngn\",\"nok\",\"nzd\",\"pen\",\"php\",\"pkr\",\"pln\",\"ron\",\"rub\",\"sar\",\"sek\",\"sgd\",\"svc\",\"thb\",\"try\",\"twd\",\"uah\",\"vef\",\"vnd\",\"xdr\",\"zar\",\"zmw\"]),X([\"xag\",\"xau\"])]),Rf=ie({id:ue(),price:Ie(oe(),0),marketCap:ae(re(Ie(oe(),0))),allTimeHigh:ae(re(Ie(oe(),0))),allTimeLow:ae(re(Ie(oe(),0))),totalVolume:ae(re(Ie(oe(),0))),high1d:ae(re(Ie(oe(),0))),low1d:ae(re(Ie(oe(),0))),circulatingSupply:ae(re(Ie(oe(),0))),dilutedMarketCap:ae(re(Ie(oe(),0))),marketCapPercentChange1d:ae(re(oe())),priceChange1d:ae(re(oe())),pricePercentChange1h:ae(re(oe())),pricePercentChange1d:ae(re(oe())),pricePercentChange7d:ae(re(oe())),pricePercentChange14d:ae(re(oe())),pricePercentChange30d:ae(re(oe())),pricePercentChange200d:ae(re(oe())),pricePercentChange1y:ae(re(oe())),bondingCurveProgressPercent:ae(re(oe())),liquidity:ae(re(oe())),totalSupply:ae(re(oe())),holderCount:ae(re(oe())),isMutable:ae(re(Q()))}),Nf=ce(Gi,re(Rf)),Of=Pf,Uf=ie({assetType:Gi,timePeriod:ae(_e(ue(),/^[1-9][0-9]*[dmy]$/u)),from:ae(Ie(oe(),0)),to:ae(Ie(oe(),0)),vsCurrency:ae(Of)}),Mf=ie({prices:Y(le([oe(),oe()])),marketCaps:Y(le([oe(),oe()])),totalVolumes:Y(le([oe(),oe()]))}),zf={prices:[],marketCaps:[],totalVolumes:[]};const Lf=function(e){if(e.length>=255)throw new TypeError(\"Alphabet too long\");const t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let n=0;n<e.length;n++){const r=e.charAt(n),o=r.charCodeAt(0);if(255!==t[o])throw new TypeError(r+\" is ambiguous\");t[o]=n}const n=e.length,r=e.charAt(0),o=Math.log(n)/Math.log(256),i=Math.log(256)/Math.log(n);function a(e){if(\"string\"!=typeof e)throw new TypeError(\"Expected String\");if(0===e.length)return new Uint8Array;let i=0,a=0,s=0;for(;e[i]===r;)a++,i++;const c=(e.length-i)*o+1>>>0,u=new Uint8Array(c);for(;e[i];){let r=t[e.charCodeAt(i)];if(255===r)return;let o=0;for(let e=c-1;(0!==r||o<s)&&-1!==e;e--,o++)r+=n*u[e]>>>0,u[e]=r%256>>>0,r=r/256>>>0;if(0!==r)throw new Error(\"Non-zero carry\");s=o,i++}let l=c-s;for(;l!==c&&0===u[l];)l++;const d=new Uint8Array(a+(c-l));let f=a;for(;l!==c;)d[f++]=u[l++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError(\"Expected Uint8Array\");if(0===t.length)return\"\";let o=0,a=0,s=0;const c=t.length;for(;s!==c&&0===t[s];)s++,o++;const u=(c-s)*i+1>>>0,l=new Uint8Array(u);for(;s!==c;){let e=t[s],r=0;for(let t=u-1;(0!==e||r<a)&&-1!==t;t--,r++)e+=256*l[t]>>>0,l[t]=e%n>>>0,e=e/n>>>0;if(0!==e)throw new Error(\"Non-zero carry\");a=r,s++}let d=u-a;for(;d!==u&&0===l[d];)d++;let f=r.repeat(o);for(;d<u;++d)f+=e.charAt(l[d]);return f},decodeUnsafe:a,decode:function(e){const t=a(e);if(t)return t;throw new Error(\"Non-base\"+n+\" character\")}}};const jf=Lf(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\");var Ff=n(1048).hp;const Df={[tf.Mainnet]:\"mainnet\",[tf.Devnet]:\"devnet\",[tf.Testnet]:\"testnet\",[tf.Localnet]:\"localnet\"};const $f=Y(ie({decimals:ee(),assetId:of,name:ae(ue()),symbol:ae(ue()),iconUrl:ae(df)})),Kf={name:\"UNKNOWN\",symbol:\"UNKNOWN\",fungible:!0,iconUrl:\"\",units:[{name:\"UNKNOWN\",symbol:\"UNKNOWN\",decimals:9}]};class qf{#o;#i;#a;#s;#c;static supportedNetworks=[tf.Mainnet,tf.Devnet];constructor(e,t=globalThis.fetch,n=Zd){this.#o=t,this.#i=n;const{tokenApi:r,staticApi:o}=e.get(),{baseUrl:i,chunkSize:a}=r;H(i,df),this.#a=i,this.#s=a,this.#c=o.baseUrl}async#u(e){H(e,Y(rf));const t=Cf({baseUrl:this.#a,path:\"/v3/assets\",queryParams:{assetIds:e.join(\",\")}}),n=await this.#o(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();return H(r,$f),r}async getTokensMetadata(e){try{H(e,Y(Gi));const t=e.filter((e=>{const{chainId:t}=Ji(e);return qf.supportedNetworks.includes(t)}));t.length!==e.length&&this.#i.warn(`[TokenApiClient] Received some asset types on networks that the Token API doesn't support. They will be ignored. Supported networks: ${qf.supportedNetworks.join(\", \")}`);const n=[];for(let e=0;e<t.length;e+=this.#s)n.push(t.slice(e,e+this.#s));const r=(await Promise.all(n.map((async e=>this.#u(e))))).flat(),o=new Map(r.map((e=>[e.assetId,e]))),i=new Map;return e.forEach((e=>{const t=o.get(e),n=this.#l(t,e);i.set(e,n)})),Object.fromEntries(i)}catch(e){throw this.#i.error(e,\"Error fetching token metadata\"),e}}#d(e){return Cf({baseUrl:this.#c,path:\"/api/v2/tokenIcons/assets/{assetType}.png\",pathParams:{assetType:e.replace(/:/gu,\"/\")},encodePathParams:!1})}#l(e,t){const n=this.#d(t);if(!e)return this.#i.warn(`No metadata for ${t}. Returning default values.`),{...Kf,iconUrl:n};const r=e.name??Kf.name,o=e.symbol??Kf.symbol,i=e.decimals??9;return{name:r,symbol:o,fungible:!0,iconUrl:e.iconUrl??n,units:[{name:r,symbol:o,decimals:i}]}}}var Wf,Hf=\"ComputeBudget111111111111111111111111111111\",Vf=((Wf=Vf||{})[Wf.RequestUnits=0]=\"RequestUnits\",Wf[Wf.RequestHeapFrame=1]=\"RequestHeapFrame\",Wf[Wf.SetComputeUnitLimit=2]=\"SetComputeUnitLimit\",Wf[Wf.SetComputeUnitPrice=3]=\"SetComputeUnitPrice\",Wf[Wf.SetLoadedAccountsDataSizeLimit=4]=\"SetLoadedAccountsDataSizeLimit\",Wf);function Gf(e){const t=\"data\"in e?e.data:e;if(Ms(t,Sc().encode(0),0))return 0;if(Ms(t,Sc().encode(1),0))return 1;if(Ms(t,Sc().encode(2),0))return 2;if(Ms(t,Sc().encode(3),0))return 3;if(Ms(t,Sc().encode(4),0))return 4;throw new Error(\"The provided instruction could not be identified as a computeBudget instruction.\")}function Zf(){return nl([[\"discriminator\",Ec()],[\"bytes\",vc()]])}function Jf(){return nl([[\"discriminator\",Ec()],[\"units\",vc()],[\"additionalFee\",vc()]])}function Yf(){return rc(tl([[\"discriminator\",Sc()],[\"units\",wc()]]),(e=>({...e,discriminator:2})))}function Qf(){return nl([[\"discriminator\",Ec()],[\"units\",vc()]])}function Xf(e,t){const n={...e};return{programAddress:t?.programAddress??Hf,data:Yf().encode(n)}}function eh(e){return{programAddress:e.programAddress,data:Qf().decode(e.data)}}function th(){return rc(tl([[\"discriminator\",Sc()],[\"microLamports\",bc()]]),(e=>({...e,discriminator:3})))}function nh(){return nl([[\"discriminator\",Ec()],[\"microLamports\",Ac()]])}function rh(e,t){const n={...e};return{programAddress:t?.programAddress??Hf,data:th().encode(n)}}function oh(e){return{programAddress:e.programAddress,data:nh().decode(e.data)}}function ih(){return nl([[\"discriminator\",Ec()],[\"accountDataSizeLimit\",vc()]])}var ah=e=>({__option:\"Some\",value:e}),sh=e=>!!(e&&\"object\"==typeof e&&\"__option\"in e&&(\"Some\"===e.__option&&\"value\"in e||\"None\"===e.__option)),ch=e=>\"Some\"===e.__option;function uh(e,t={}){const n=null===t.prefix?rc(Xu(),(e=>{})):Pu({size:t.prefix??Sc()});return ju([rc(zu([n,\"zeroes\"===t.noneValue?(Ds(e),Gs(Xu(),e.fixedSize)):t.noneValue?Uu(t.noneValue):Xu()]),(e=>[!1,void 0])),rc(zu([n,e]),(e=>[!0,sh(e)&&ch(e)?e.value:e]))],(e=>{const t=sh(e)?e:(e=>null!==e?ah(e):{__option:\"None\"})(e);return Number(ch(t))}))}function lh(e,t={}){const n=null===t.prefix?oc(el(),(()=>!1)):Ru({size:t.prefix??Ec()}),r=\"zeroes\"===t.noneValue?(Ds(e),Zs(el(),e.fixedSize)):t.noneValue?Mu(t.noneValue):el();return Fu([oc(Lu([n,r]),(()=>({__option:\"None\"}))),oc(Lu([n,e]),(([,e])=>ah(e)))],((e,o)=>{if(null===t.prefix&&!t.noneValue)return Number(o<e.length);if(null===t.prefix&&null!=t.noneValue){return Ms(e,\"zeroes\"===t.noneValue?new Uint8Array(r.fixedSize).fill(0):t.noneValue,o)?0:1}return Number(n.read(e,o)[0])}))}var dh,fh=((dh=fh||{})[dh.Uninitialized=0]=\"Uninitialized\",dh[dh.Initialized=1]=\"Initialized\",dh[dh.Frozen=2]=\"Frozen\",dh);var hh,ph=((hh=ph||{})[hh.MintTokens=0]=\"MintTokens\",hh[hh.FreezeAccount=1]=\"FreezeAccount\",hh[hh.AccountOwner=2]=\"AccountOwner\",hh[hh.CloseAccount=3]=\"CloseAccount\",hh);function gh(){return Zu(ph)}var mh,yh=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",wh=((mh=wh||{})[mh.CreateAssociatedToken=0]=\"CreateAssociatedToken\",mh[mh.CreateAssociatedTokenIdempotent=1]=\"CreateAssociatedTokenIdempotent\",mh[mh.RecoverNestedAssociatedToken=2]=\"RecoverNestedAssociatedToken\",mh);var vh,bh=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",Ah=((vh=Ah||{})[vh.Mint=0]=\"Mint\",vh[vh.Token=1]=\"Token\",vh[vh.Multisig=2]=\"Multisig\",vh);var Sh,Eh=((Sh=Eh||{})[Sh.InitializeMint=0]=\"InitializeMint\",Sh[Sh.InitializeAccount=1]=\"InitializeAccount\",Sh[Sh.InitializeMultisig=2]=\"InitializeMultisig\",Sh[Sh.Transfer=3]=\"Transfer\",Sh[Sh.Approve=4]=\"Approve\",Sh[Sh.Revoke=5]=\"Revoke\",Sh[Sh.SetAuthority=6]=\"SetAuthority\",Sh[Sh.MintTo=7]=\"MintTo\",Sh[Sh.Burn=8]=\"Burn\",Sh[Sh.CloseAccount=9]=\"CloseAccount\",Sh[Sh.FreezeAccount=10]=\"FreezeAccount\",Sh[Sh.ThawAccount=11]=\"ThawAccount\",Sh[Sh.TransferChecked=12]=\"TransferChecked\",Sh[Sh.ApproveChecked=13]=\"ApproveChecked\",Sh[Sh.MintToChecked=14]=\"MintToChecked\",Sh[Sh.BurnChecked=15]=\"BurnChecked\",Sh[Sh.InitializeAccount2=16]=\"InitializeAccount2\",Sh[Sh.SyncNative=17]=\"SyncNative\",Sh[Sh.InitializeAccount3=18]=\"InitializeAccount3\",Sh[Sh.InitializeMultisig2=19]=\"InitializeMultisig2\",Sh[Sh.InitializeMint2=20]=\"InitializeMint2\",Sh[Sh.GetAccountDataSize=21]=\"GetAccountDataSize\",Sh[Sh.InitializeImmutableOwner=22]=\"InitializeImmutableOwner\",Sh[Sh.AmountToUiAmount=23]=\"AmountToUiAmount\",Sh[Sh.UiAmountToAmount=24]=\"UiAmountToAmount\",Sh);function xh(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function kh(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:kc.READONLY});const n=t.isWritable?kc.WRITABLE:kc.READONLY;return Object.freeze({address:xh(t.value),role:Ih(t.value)?Cc(n):n,...Ih(t.value)?{signer:t.value}:{}})}}function Ih(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&ud(e)}function Th(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function _h(){return rc(tl([[\"discriminator\",Sc()],[\"amount\",bc()]]),(e=>({...e,discriminator:4})))}function Ch(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Bh(e,t){const n=t?.programAddress??bh,r={source:{value:e.source??null,isWritable:!0},delegate:{value:e.delegate??null,isWritable:!1},owner:{value:e.owner??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map((e=>({address:e.address,role:kc.READONLY_SIGNER,signer:e}))),a=kh(n);return{accounts:[a(r.source),a(r.delegate),a(r.owner),...i],programAddress:n,data:_h().encode(o)}}function Ph(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Rh(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Nh(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Oh(){return nl([[\"discriminator\",Ec()]])}async function Uh(e,t={}){const{programAddress:n=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"}=t;return await gu({programAddress:n,seeds:[ru().encode(e.owner),ru().encode(e.tokenProgram),ru().encode(e.mint)]})}function Mh(){return rc(tl([[\"discriminator\",Sc()]]),(e=>({...e,discriminator:0})))}function zh(e,t){const n=t?.programAddress??yh,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=kh(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Mh().encode({})}}function Lh(){return rc(tl([[\"discriminator\",Sc()]]),(e=>({...e,discriminator:1})))}function jh(e,t){const n=t?.programAddress??yh,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=kh(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:Lh().encode({})}}function Fh(){return nl([[\"discriminator\",Ec()]])}function Dh(){return nl([[\"discriminator\",Ec()]])}function $h(){return nl([[\"discriminator\",Ec()]])}function Kh(){return nl([[\"discriminator\",Ec()],[\"owner\",ou()]])}function qh(){return nl([[\"discriminator\",Ec()],[\"owner\",ou()]])}function Wh(){return nl([[\"discriminator\",Ec()]])}function Hh(){return nl([[\"discriminator\",Ec()],[\"decimals\",Ec()],[\"mintAuthority\",ou()],[\"freezeAuthority\",lh(ou())]])}function Vh(){return nl([[\"discriminator\",Ec()],[\"decimals\",Ec()],[\"mintAuthority\",ou()],[\"freezeAuthority\",lh(ou())]])}function Gh(){return nl([[\"discriminator\",Ec()],[\"m\",Ec()]])}function Zh(){return nl([[\"discriminator\",Ec()],[\"m\",Ec()]])}function Jh(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Yh(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Qh(){return nl([[\"discriminator\",Ec()]])}function Xh(){return nl([[\"discriminator\",Ec()],[\"authorityType\",gh()],[\"newAuthority\",lh(ou())]])}function ep(){return nl([[\"discriminator\",Ec()]])}function tp(){return nl([[\"discriminator\",Ec()]])}function np(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function rp(){return rc(tl([[\"discriminator\",Sc()],[\"amount\",bc()],[\"decimals\",Sc()]]),(e=>({...e,discriminator:12})))}function op(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function ip(e,t){const n=t?.programAddress??bh,r={source:{value:e.source??null,isWritable:!0},mint:{value:e.mint??null,isWritable:!1},destination:{value:e.destination??null,isWritable:!0},authority:{value:e.authority??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map((e=>({address:e.address,role:kc.READONLY_SIGNER,signer:e}))),a=kh(n);return{accounts:[a(r.source),a(r.mint),a(r.destination),a(r.authority),...i],programAddress:n,data:rp().encode(o)}}function ap(){return nl([[\"discriminator\",Ec()],[\"uiAmount\",Zc()]])}function sp(e){return!(\"exists\"in e)||\"exists\"in e&&e.exists}function cp(e,t){if(!t)return Object.freeze({address:e,exists:!1});const n=Kc().encode(t.data[0]);return Object.freeze({...lp(t),address:e,data:n,exists:!0})}function up(e,t){if(!t)return Object.freeze({address:e,exists:!1});const n=t.data.parsed.info;return Object.freeze({...lp(t),address:e,data:n,exists:!0})}function lp(e){return Object.freeze({executable:e.executable,lamports:e.lamports,programAddress:e.owner,space:e.space})}async function dp(e,t,n={}){const{abortSignal:r,...o}=n;return cp(t,(await e.getAccountInfo(t,{...o,encoding:\"base64\"}).send({abortSignal:r})).value)}async function fp(e,t,n={}){const{abortSignal:r,...o}=n;return(await e.getMultipleAccounts(t,{...o,encoding:\"base64\"}).send({abortSignal:r})).value.map(((e,n)=>cp(t[n],e)))}function hp(e){if(!e.exists)throw new Ts(Sa,{address:e.address})}var pp=(e=>(e[e.Uninitialized=0]=\"Uninitialized\",e[e.Initialized=1]=\"Initialized\",e[e.Frozen=2]=\"Frozen\",e))(pp||{});function gp(){return Zu(pp)}var mp=(e=>(e[e.MintTokens=0]=\"MintTokens\",e[e.FreezeAccount=1]=\"FreezeAccount\",e[e.AccountOwner=2]=\"AccountOwner\",e[e.CloseAccount=3]=\"CloseAccount\",e[e.TransferFeeConfig=4]=\"TransferFeeConfig\",e[e.WithheldWithdraw=5]=\"WithheldWithdraw\",e[e.CloseMint=6]=\"CloseMint\",e[e.InterestRate=7]=\"InterestRate\",e[e.PermanentDelegate=8]=\"PermanentDelegate\",e[e.ConfidentialTransferMint=9]=\"ConfidentialTransferMint\",e[e.TransferHookProgramId=10]=\"TransferHookProgramId\",e[e.ConfidentialTransferFeeConfig=11]=\"ConfidentialTransferFeeConfig\",e[e.MetadataPointer=12]=\"MetadataPointer\",e[e.GroupPointer=13]=\"GroupPointer\",e[e.GroupMemberPointer=14]=\"GroupMemberPointer\",e[e.ScaledUiAmount=15]=\"ScaledUiAmount\",e[e.Pause=16]=\"Pause\",e))(mp||{});function yp(){return Zu(mp)}function wp(){return Zs(Ou(),36)}function vp(){return Zs(Ou(),64)}function bp(){return qu([[\"Uninitialized\",el()],[\"TransferFeeConfig\",Vs(nl([[\"transferFeeConfigAuthority\",ou()],[\"withdrawWithheldAuthority\",ou()],[\"withheldAmount\",Ac()],[\"olderTransferFee\",kp()],[\"newerTransferFee\",kp()]]),yc())],[\"TransferFeeAmount\",Vs(nl([[\"withheldAmount\",Ac()]]),yc())],[\"MintCloseAuthority\",Vs(nl([[\"closeAuthority\",ou()]]),yc())],[\"ConfidentialTransferMint\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"autoApproveNewAccounts\",Ru()],[\"auditorElgamalPubkey\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]]),yc())],[\"ConfidentialTransferAccount\",Vs(nl([[\"approved\",Ru()],[\"elgamalPubkey\",ou()],[\"pendingBalanceLow\",vp()],[\"pendingBalanceHigh\",vp()],[\"availableBalance\",vp()],[\"decryptableAvailableBalance\",wp()],[\"allowConfidentialCredits\",Ru()],[\"allowNonConfidentialCredits\",Ru()],[\"pendingBalanceCreditCounter\",Ac()],[\"maximumPendingBalanceCreditCounter\",Ac()],[\"expectedPendingBalanceCreditCounter\",Ac()],[\"actualPendingBalanceCreditCounter\",Ac()]]),yc())],[\"DefaultAccountState\",Vs(nl([[\"state\",gp()]]),yc())],[\"ImmutableOwner\",Vs(nl([]),yc())],[\"MemoTransfer\",Vs(nl([[\"requireIncomingTransferMemos\",Ru()]]),yc())],[\"NonTransferable\",Vs(nl([]),yc())],[\"InterestBearingConfig\",Vs(nl([[\"rateAuthority\",ou()],[\"initializationTimestamp\",Ac()],[\"preUpdateAverageRate\",fc()],[\"lastUpdateTimestamp\",Ac()],[\"currentRate\",fc()]]),yc())],[\"CpiGuard\",Vs(nl([[\"lockCpi\",Ru()]]),yc())],[\"PermanentDelegate\",Vs(nl([[\"delegate\",ou()]]),yc())],[\"NonTransferableAccount\",Vs(nl([]),yc())],[\"TransferHook\",Vs(nl([[\"authority\",ou()],[\"programId\",ou()]]),yc())],[\"TransferHookAccount\",Vs(nl([[\"transferring\",Ru()]]),yc())],[\"ConfidentialTransferFee\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"elgamalPubkey\",ou()],[\"harvestToMintEnabled\",Ru()],[\"withheldAmount\",vp()]]),yc())],[\"ConfidentialTransferFeeAmount\",Vs(nl([[\"withheldAmount\",vp()]]),yc())],[\"MetadataPointer\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"metadataAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]]),yc())],[\"TokenMetadata\",Vs(nl([[\"updateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"mint\",ou()],[\"name\",Vs(Zc(),vc())],[\"symbol\",Vs(Zc(),vc())],[\"uri\",Vs(Zc(),vc())],[\"additionalMetadata\",Qu(Vs(Zc(),vc()),Vs(Zc(),vc()))]]),yc())],[\"GroupPointer\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"groupAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]]),yc())],[\"TokenGroup\",Vs(nl([[\"updateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"mint\",ou()],[\"size\",Ac()],[\"maxSize\",Ac()]]),yc())],[\"GroupMemberPointer\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"memberAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]]),yc())],[\"TokenGroupMember\",Vs(nl([[\"mint\",ou()],[\"group\",ou()],[\"memberNumber\",Ac()]]),yc())],[\"ConfidentialMintBurn\",el()],[\"ScaledUiAmountConfig\",Vs(nl([[\"authority\",ou()],[\"multiplier\",dc()],[\"newMultiplierEffectiveTimestamp\",Ac()],[\"newMultiplier\",dc()]]),yc())],[\"PausableConfig\",Vs(nl([[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"paused\",Ru()]]),yc())],[\"PausableAccount\",el()]],{size:yc()})}var Ap,Sp=((Ap=Sp||{})[Ap.Uninitialized=0]=\"Uninitialized\",Ap[Ap.TransferFeeConfig=1]=\"TransferFeeConfig\",Ap[Ap.TransferFeeAmount=2]=\"TransferFeeAmount\",Ap[Ap.MintCloseAuthority=3]=\"MintCloseAuthority\",Ap[Ap.ConfidentialTransferMint=4]=\"ConfidentialTransferMint\",Ap[Ap.ConfidentialTransferAccount=5]=\"ConfidentialTransferAccount\",Ap[Ap.DefaultAccountState=6]=\"DefaultAccountState\",Ap[Ap.ImmutableOwner=7]=\"ImmutableOwner\",Ap[Ap.MemoTransfer=8]=\"MemoTransfer\",Ap[Ap.NonTransferable=9]=\"NonTransferable\",Ap[Ap.InterestBearingConfig=10]=\"InterestBearingConfig\",Ap[Ap.CpiGuard=11]=\"CpiGuard\",Ap[Ap.PermanentDelegate=12]=\"PermanentDelegate\",Ap[Ap.NonTransferableAccount=13]=\"NonTransferableAccount\",Ap[Ap.TransferHook=14]=\"TransferHook\",Ap[Ap.TransferHookAccount=15]=\"TransferHookAccount\",Ap[Ap.ConfidentialTransferFee=16]=\"ConfidentialTransferFee\",Ap[Ap.ConfidentialTransferFeeAmount=17]=\"ConfidentialTransferFeeAmount\",Ap[Ap.ScaledUiAmountConfig=18]=\"ScaledUiAmountConfig\",Ap[Ap.PausableConfig=19]=\"PausableConfig\",Ap[Ap.PausableAccount=20]=\"PausableAccount\",Ap[Ap.MetadataPointer=21]=\"MetadataPointer\",Ap[Ap.TokenMetadata=22]=\"TokenMetadata\",Ap[Ap.GroupPointer=23]=\"GroupPointer\",Ap[Ap.TokenGroup=24]=\"TokenGroup\",Ap[Ap.GroupMemberPointer=25]=\"GroupMemberPointer\",Ap[Ap.TokenGroupMember=26]=\"TokenGroupMember\",Ap);function Ep(){return Zu(Sp,{size:yc()})}function xp(){return qu([[\"Name\",el()],[\"Symbol\",el()],[\"Uri\",el()],[\"Key\",nl([[\"fields\",Lu([Vs(Zc(),vc())])]])]])}function kp(){return nl([[\"epoch\",Ac()],[\"maximumFee\",Ac()],[\"transferFeeBasisPoints\",yc()]])}function Ip(){return nl([[\"mintAuthority\",lh(ou(),{prefix:vc(),noneValue:\"zeroes\"})],[\"supply\",Ac()],[\"decimals\",Ec()],[\"isInitialized\",Ru()],[\"freezeAuthority\",lh(ou(),{prefix:vc(),noneValue:\"zeroes\"})],[\"extensions\",lh(Yu(Cu(bp(),{size:\"remainder\"}),[Mu(tc(Sc(),83).encode(1))]),{prefix:null})]])}function Tp(e){return function(e,t){try{return\"exists\"in e&&!e.exists?e:Object.freeze({...e,data:t.decode(e.data)})}catch{throw new Ts(xa,{address:e.address})}}(e,Ip())}async function _p(e,t,n){const r=await async function(e,t,n){const r=await dp(e,t,n);return Tp(r)}(e,t,n);return hp(r),r}var Cp=\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",Bp=(e=>(e[e.CreateAssociatedToken=0]=\"CreateAssociatedToken\",e[e.CreateAssociatedTokenIdempotent=1]=\"CreateAssociatedTokenIdempotent\",e[e.RecoverNestedAssociatedToken=2]=\"RecoverNestedAssociatedToken\",e))(Bp||{});var Pp,Rp=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\",Np=((Pp=Np||{})[Pp.Mint=0]=\"Mint\",Pp[Pp.Token=1]=\"Token\",Pp[Pp.Multisig=2]=\"Multisig\",Pp);var Op,Up=((Op=Up||{})[Op.InitializeMint=0]=\"InitializeMint\",Op[Op.InitializeAccount=1]=\"InitializeAccount\",Op[Op.InitializeMultisig=2]=\"InitializeMultisig\",Op[Op.Transfer=3]=\"Transfer\",Op[Op.Approve=4]=\"Approve\",Op[Op.Revoke=5]=\"Revoke\",Op[Op.SetAuthority=6]=\"SetAuthority\",Op[Op.MintTo=7]=\"MintTo\",Op[Op.Burn=8]=\"Burn\",Op[Op.CloseAccount=9]=\"CloseAccount\",Op[Op.FreezeAccount=10]=\"FreezeAccount\",Op[Op.ThawAccount=11]=\"ThawAccount\",Op[Op.TransferChecked=12]=\"TransferChecked\",Op[Op.ApproveChecked=13]=\"ApproveChecked\",Op[Op.MintToChecked=14]=\"MintToChecked\",Op[Op.BurnChecked=15]=\"BurnChecked\",Op[Op.InitializeAccount2=16]=\"InitializeAccount2\",Op[Op.SyncNative=17]=\"SyncNative\",Op[Op.InitializeAccount3=18]=\"InitializeAccount3\",Op[Op.InitializeMultisig2=19]=\"InitializeMultisig2\",Op[Op.InitializeMint2=20]=\"InitializeMint2\",Op[Op.GetAccountDataSize=21]=\"GetAccountDataSize\",Op[Op.InitializeImmutableOwner=22]=\"InitializeImmutableOwner\",Op[Op.AmountToUiAmount=23]=\"AmountToUiAmount\",Op[Op.UiAmountToAmount=24]=\"UiAmountToAmount\",Op[Op.InitializeMintCloseAuthority=25]=\"InitializeMintCloseAuthority\",Op[Op.InitializeTransferFeeConfig=26]=\"InitializeTransferFeeConfig\",Op[Op.TransferCheckedWithFee=27]=\"TransferCheckedWithFee\",Op[Op.WithdrawWithheldTokensFromMint=28]=\"WithdrawWithheldTokensFromMint\",Op[Op.WithdrawWithheldTokensFromAccounts=29]=\"WithdrawWithheldTokensFromAccounts\",Op[Op.HarvestWithheldTokensToMint=30]=\"HarvestWithheldTokensToMint\",Op[Op.SetTransferFee=31]=\"SetTransferFee\",Op[Op.InitializeConfidentialTransferMint=32]=\"InitializeConfidentialTransferMint\",Op[Op.UpdateConfidentialTransferMint=33]=\"UpdateConfidentialTransferMint\",Op[Op.ConfigureConfidentialTransferAccount=34]=\"ConfigureConfidentialTransferAccount\",Op[Op.ApproveConfidentialTransferAccount=35]=\"ApproveConfidentialTransferAccount\",Op[Op.EmptyConfidentialTransferAccount=36]=\"EmptyConfidentialTransferAccount\",Op[Op.ConfidentialDeposit=37]=\"ConfidentialDeposit\",Op[Op.ConfidentialWithdraw=38]=\"ConfidentialWithdraw\",Op[Op.ConfidentialTransfer=39]=\"ConfidentialTransfer\",Op[Op.ApplyConfidentialPendingBalance=40]=\"ApplyConfidentialPendingBalance\",Op[Op.EnableConfidentialCredits=41]=\"EnableConfidentialCredits\",Op[Op.DisableConfidentialCredits=42]=\"DisableConfidentialCredits\",Op[Op.EnableNonConfidentialCredits=43]=\"EnableNonConfidentialCredits\",Op[Op.DisableNonConfidentialCredits=44]=\"DisableNonConfidentialCredits\",Op[Op.ConfidentialTransferWithFee=45]=\"ConfidentialTransferWithFee\",Op[Op.InitializeDefaultAccountState=46]=\"InitializeDefaultAccountState\",Op[Op.UpdateDefaultAccountState=47]=\"UpdateDefaultAccountState\",Op[Op.Reallocate=48]=\"Reallocate\",Op[Op.EnableMemoTransfers=49]=\"EnableMemoTransfers\",Op[Op.DisableMemoTransfers=50]=\"DisableMemoTransfers\",Op[Op.CreateNativeMint=51]=\"CreateNativeMint\",Op[Op.InitializeNonTransferableMint=52]=\"InitializeNonTransferableMint\",Op[Op.InitializeInterestBearingMint=53]=\"InitializeInterestBearingMint\",Op[Op.UpdateRateInterestBearingMint=54]=\"UpdateRateInterestBearingMint\",Op[Op.EnableCpiGuard=55]=\"EnableCpiGuard\",Op[Op.DisableCpiGuard=56]=\"DisableCpiGuard\",Op[Op.InitializePermanentDelegate=57]=\"InitializePermanentDelegate\",Op[Op.InitializeTransferHook=58]=\"InitializeTransferHook\",Op[Op.UpdateTransferHook=59]=\"UpdateTransferHook\",Op[Op.InitializeConfidentialTransferFee=60]=\"InitializeConfidentialTransferFee\",Op[Op.WithdrawWithheldTokensFromMintForConfidentialTransferFee=61]=\"WithdrawWithheldTokensFromMintForConfidentialTransferFee\",Op[Op.WithdrawWithheldTokensFromAccountsForConfidentialTransferFee=62]=\"WithdrawWithheldTokensFromAccountsForConfidentialTransferFee\",Op[Op.HarvestWithheldTokensToMintForConfidentialTransferFee=63]=\"HarvestWithheldTokensToMintForConfidentialTransferFee\",Op[Op.EnableHarvestToMint=64]=\"EnableHarvestToMint\",Op[Op.DisableHarvestToMint=65]=\"DisableHarvestToMint\",Op[Op.WithdrawExcessLamports=66]=\"WithdrawExcessLamports\",Op[Op.InitializeMetadataPointer=67]=\"InitializeMetadataPointer\",Op[Op.UpdateMetadataPointer=68]=\"UpdateMetadataPointer\",Op[Op.InitializeGroupPointer=69]=\"InitializeGroupPointer\",Op[Op.UpdateGroupPointer=70]=\"UpdateGroupPointer\",Op[Op.InitializeGroupMemberPointer=71]=\"InitializeGroupMemberPointer\",Op[Op.UpdateGroupMemberPointer=72]=\"UpdateGroupMemberPointer\",Op[Op.InitializeScaledUiAmountMint=73]=\"InitializeScaledUiAmountMint\",Op[Op.UpdateMultiplierScaledUiMint=74]=\"UpdateMultiplierScaledUiMint\",Op[Op.InitializePausableConfig=75]=\"InitializePausableConfig\",Op[Op.Pause=76]=\"Pause\",Op[Op.Resume=77]=\"Resume\",Op[Op.InitializeTokenMetadata=78]=\"InitializeTokenMetadata\",Op[Op.UpdateTokenMetadataField=79]=\"UpdateTokenMetadataField\",Op[Op.RemoveTokenMetadataKey=80]=\"RemoveTokenMetadataKey\",Op[Op.UpdateTokenMetadataUpdateAuthority=81]=\"UpdateTokenMetadataUpdateAuthority\",Op[Op.EmitTokenMetadata=82]=\"EmitTokenMetadata\",Op[Op.InitializeTokenGroup=83]=\"InitializeTokenGroup\",Op[Op.UpdateTokenGroupMaxSize=84]=\"UpdateTokenGroupMaxSize\",Op[Op.UpdateTokenGroupUpdateAuthority=85]=\"UpdateTokenGroupUpdateAuthority\",Op[Op.InitializeTokenGroupMember=86]=\"InitializeTokenGroupMember\",Op);function Mp(e){if(!e)throw new Error(\"Expected a Address.\");return\"object\"==typeof e&&\"address\"in e?e.address:Array.isArray(e)?e[0]:e}function zp(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:kc.READONLY});const n=t.isWritable?kc.WRITABLE:kc.READONLY;return Object.freeze({address:Mp(t.value),role:Lp(t.value)?Cc(n):n,...Lp(t.value)?{signer:t.value}:{}})}}function Lp(e){return!!e&&\"object\"==typeof e&&\"address\"in e&&ud(e)}function jp(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Fp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"expectedPendingBalanceCreditCounter\",Ac()],[\"newDecryptableAvailableBalance\",wp()]])}function Dp(){return rc(tl([[\"discriminator\",Sc()],[\"amount\",bc()]]),(e=>({...e,discriminator:4})))}function $p(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Kp(e,t){const n=t?.programAddress??Rp,r={source:{value:e.source??null,isWritable:!0},delegate:{value:e.delegate??null,isWritable:!1},owner:{value:e.owner??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map((e=>({address:e.address,role:kc.READONLY_SIGNER,signer:e}))),a=zp(n);return{accounts:[a(r.source),a(r.delegate),a(r.owner),...i],programAddress:n,data:Dp().encode(o)}}function qp(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Wp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()]])}function Hp(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Vp(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Gp(){return nl([[\"discriminator\",Ec()]])}function Zp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Jp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"newSourceDecryptableAvailableBalance\",wp()],[\"equalityProofInstructionOffset\",pc()],[\"ciphertextValidityProofInstructionOffset\",pc()],[\"rangeProofInstructionOffset\",pc()]])}function Yp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"newSourceDecryptableAvailableBalance\",wp()],[\"equalityProofInstructionOffset\",pc()],[\"transferAmountCiphertextValidityProofInstructionOffset\",pc()],[\"feeSigmaProofInstructionOffset\",pc()],[\"feeCiphertextValidityProofInstructionOffset\",pc()],[\"rangeProofInstructionOffset\",pc()]])}function Qp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()],[\"newDecryptableAvailableBalance\",wp()],[\"equalityProofInstructionOffset\",pc()],[\"rangeProofInstructionOffset\",pc()]])}function Xp(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"decryptableZeroBalance\",wp()],[\"maximumPendingBalanceCreditCounter\",Ac()],[\"proofInstructionOffset\",pc()]])}function eg(){return rc(tl([[\"discriminator\",Sc()]]),(e=>({...e,discriminator:0})))}function tg(){return nl([[\"discriminator\",Ec()]])}function ng(e,t){const n=t?.programAddress??Cp,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=zp(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:eg().encode({})}}function rg(){return rc(tl([[\"discriminator\",Sc()]]),(e=>({...e,discriminator:1})))}function og(){return nl([[\"discriminator\",Ec()]])}function ig(e,t){const n=t?.programAddress??Cp,r={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};r.tokenProgram.value||(r.tokenProgram.value=\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\"),r.systemProgram.value||(r.systemProgram.value=\"11111111111111111111111111111111\");const o=zp(n);return{accounts:[o(r.payer),o(r.ata),o(r.owner),o(r.mint),o(r.systemProgram),o(r.tokenProgram)],programAddress:n,data:rg().encode({})}}function ag(){return nl([[\"discriminator\",Ec()]])}function sg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()]])}function cg(){return nl([[\"discriminator\",Ec()],[\"cpiGuardDiscriminator\",Ec()]])}function ug(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()]])}function lg(){return nl([[\"discriminator\",Ec()],[\"memoTransfersDiscriminator\",Ec()]])}function dg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()]])}new Uint8Array([250,166,180,250,13,12,184,70]);function fg(){return nl([[\"discriminator\",Ou()],[\"start\",lh(Ac())],[\"end\",lh(Ac())]])}function hg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"proofInstructionOffset\",pc()]])}function pg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()]])}function gg(){return nl([[\"discriminator\",Ec()],[\"cpiGuardDiscriminator\",Ec()]])}function mg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()]])}function yg(){return nl([[\"discriminator\",Ec()],[\"memoTransfersDiscriminator\",Ec()]])}function wg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()]])}function vg(){return nl([[\"discriminator\",Ec()]])}function bg(){return nl([[\"discriminator\",Ec()]])}function Ag(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()]])}function Sg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()]])}function Eg(){return nl([[\"discriminator\",Ec()]])}function xg(){return nl([[\"discriminator\",Ec()],[\"owner\",ou()]])}function kg(){return nl([[\"discriminator\",Ec()],[\"owner\",ou()]])}function Ig(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"withdrawWithheldAuthorityElGamalPubkey\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Tg(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"autoApproveNewAccounts\",Ru()],[\"auditorElgamalPubkey\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function _g(){return nl([[\"discriminator\",Ec()],[\"defaultAccountStateDiscriminator\",Ec()],[\"state\",gp()]])}function Cg(){return nl([[\"discriminator\",Ec()],[\"groupMemberPointerDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"memberAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Bg(){return nl([[\"discriminator\",Ec()],[\"groupPointerDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"groupAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Pg(){return nl([[\"discriminator\",Ec()]])}function Rg(){return nl([[\"discriminator\",Ec()],[\"interestBearingMintDiscriminator\",Ec()],[\"rateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"rate\",fc()]])}function Ng(){return nl([[\"discriminator\",Ec()],[\"metadataPointerDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"metadataAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Og(){return nl([[\"discriminator\",Ec()],[\"decimals\",Ec()],[\"mintAuthority\",ou()],[\"freezeAuthority\",lh(ou())]])}function Ug(){return nl([[\"discriminator\",Ec()],[\"decimals\",Ec()],[\"mintAuthority\",ou()],[\"freezeAuthority\",lh(ou())]])}function Mg(){return nl([[\"discriminator\",Ec()],[\"closeAuthority\",lh(ou())]])}function zg(){return nl([[\"discriminator\",Ec()],[\"m\",Ec()]])}function Lg(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{multisig:n(),rent:n()},data:zg().decode(e.data)}}function jg(){return nl([[\"discriminator\",Ec()]])}function Fg(){return nl([[\"discriminator\",Ec()],[\"pausableDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Dg(){return nl([[\"discriminator\",Ec()],[\"delegate\",ou()]])}function $g(){return nl([[\"discriminator\",Ec()],[\"scaledUiAmountMintDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"multiplier\",dc()]])}new Uint8Array([121,113,108,39,54,51,0,4]);function Kg(){return nl([[\"discriminator\",Ou()],[\"updateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"maxSize\",Ac()]])}new Uint8Array([152,32,222,176,223,237,116,134]);function qg(){return nl([[\"discriminator\",Ou()]])}new Uint8Array([210,225,30,162,88,184,77,141]);function Wg(){return nl([[\"discriminator\",Ou()],[\"name\",Vs(Zc(),vc())],[\"symbol\",Vs(Zc(),vc())],[\"uri\",Vs(Zc(),vc())]])}function Hg(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()],[\"transferFeeConfigAuthority\",lh(ou())],[\"withdrawWithheldAuthority\",lh(ou())],[\"transferFeeBasisPoints\",yc()],[\"maximumFee\",Ac()]])}function Vg(){return nl([[\"discriminator\",Ec()],[\"transferHookDiscriminator\",Ec()],[\"authority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})],[\"programId\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Gg(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function Zg(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function Jg(){return nl([[\"discriminator\",Ec()],[\"pausableDiscriminator\",Ec()]])}function Yg(){return nl([[\"discriminator\",Ec()],[\"newExtensionTypes\",Cu(Ep(),{size:\"remainder\"})]])}function Qg(){return nl([[\"discriminator\",Ec()]])}new Uint8Array([234,18,32,56,89,141,37,181]);function Xg(){return nl([[\"discriminator\",Ou()],[\"idempotent\",Ru()],[\"key\",Vs(Zc(),vc())]])}function em(){return nl([[\"discriminator\",Ec()],[\"pausableDiscriminator\",Ec()]])}function tm(){return nl([[\"discriminator\",Ec()]])}function nm(){return nl([[\"discriminator\",Ec()],[\"authorityType\",yp()],[\"newAuthority\",lh(ou())]])}function rm(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()],[\"transferFeeBasisPoints\",yc()],[\"maximumFee\",Ac()]])}function om(){return nl([[\"discriminator\",Ec()]])}function im(){return nl([[\"discriminator\",Ec()]])}function am(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()]])}function sm(){return rc(tl([[\"discriminator\",Sc()],[\"amount\",bc()],[\"decimals\",Sc()]]),(e=>({...e,discriminator:12})))}function cm(){return nl([[\"discriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()]])}function um(e,t){const n=t?.programAddress??Rp,r={source:{value:e.source??null,isWritable:!0},mint:{value:e.mint??null,isWritable:!1},destination:{value:e.destination??null,isWritable:!0},authority:{value:e.authority??null,isWritable:!1}},o={...e},i=(o.multiSigners??[]).map((e=>({address:e.address,role:kc.READONLY_SIGNER,signer:e}))),a=zp(n);return{accounts:[a(r.source),a(r.mint),a(r.destination),a(r.authority),...i],programAddress:n,data:sm().encode(o)}}function lm(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()],[\"amount\",Ac()],[\"decimals\",Ec()],[\"fee\",Ac()]])}function dm(){return nl([[\"discriminator\",Ec()],[\"uiAmount\",Zc()]])}function fm(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferDiscriminator\",Ec()],[\"autoApproveNewAccounts\",Ru()],[\"auditorElgamalPubkey\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function hm(){return nl([[\"discriminator\",Ec()],[\"defaultAccountStateDiscriminator\",Ec()],[\"state\",gp()]])}function pm(){return nl([[\"discriminator\",Ec()],[\"groupMemberPointerDiscriminator\",Ec()],[\"memberAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function gm(){return nl([[\"discriminator\",Ec()],[\"groupPointerDiscriminator\",Ec()],[\"groupAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function mm(){return nl([[\"discriminator\",Ec()],[\"metadataPointerDiscriminator\",Ec()],[\"metadataAddress\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function ym(){return nl([[\"discriminator\",Ec()],[\"scaledUiAmountMintDiscriminator\",Ec()],[\"multiplier\",dc()],[\"effectiveTimestamp\",hc()]])}function wm(){return nl([[\"discriminator\",Ec()],[\"interestBearingMintDiscriminator\",Ec()],[\"rate\",fc()]])}new Uint8Array([108,37,171,143,248,30,18,110]);function vm(){return nl([[\"discriminator\",Ou()],[\"maxSize\",Ac()]])}new Uint8Array([161,105,88,1,237,221,216,203]);function bm(){return nl([[\"discriminator\",Ou()],[\"newUpdateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}new Uint8Array([221,233,49,45,181,202,220,200]);function Am(){return nl([[\"discriminator\",Ou()],[\"field\",xp()],[\"value\",Vs(Zc(),vc())]])}new Uint8Array([215,228,166,228,84,100,86,123]);function Sm(){return nl([[\"discriminator\",Ou()],[\"newUpdateAuthority\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function Em(){return nl([[\"discriminator\",Ec()],[\"transferHookDiscriminator\",Ec()],[\"programId\",lh(ou(),{prefix:null,noneValue:\"zeroes\"})]])}function xm(){return nl([[\"discriminator\",Ec()]])}function km(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()],[\"numTokenAccounts\",Ec()]])}function Im(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()],[\"numTokenAccounts\",Ec()],[\"proofInstructionOffset\",pc()],[\"newDecryptableAvailableBalance\",wp()]])}function Tm(){return nl([[\"discriminator\",Ec()],[\"transferFeeDiscriminator\",Ec()]])}function _m(){return nl([[\"discriminator\",Ec()],[\"confidentialTransferFeeDiscriminator\",Ec()],[\"proofInstructionOffset\",pc()],[\"newDecryptableAvailableBalance\",wp()]])}function Cm(e,t,n){const r=t-e;if(r<0)throw new Error(\"Invalid timespan: end time before start time\");const o=n*r/31556736e4;return Math.exp(o)}function Bm({currentTimestamp:e,lastUpdateTimestamp:t,initializationTimestamp:n,preUpdateAverageRate:r,currentRate:o}){return Cm(n,t,r)*Cm(t,e,o)}function Pm(e){return Math.pow(10,e)}function Rm(e,t,n,r,o,i,a){const s=parseFloat(e)*Pm(t)/Bm({currentTimestamp:n,lastUpdateTimestamp:r,initializationTimestamp:o,preUpdateAverageRate:i,currentRate:a});return BigInt(Math.trunc(s))}function Nm(e,t,n){const r=parseFloat(e)*Pm(t)/n;return BigInt(Math.trunc(r))}var Om=\"ComputeBudget111111111111111111111111111111\",Um={blockhash:\"11111111111111111111111111111111\",lastValidBlockHeight:0n};function Mm(e){return function(e,t){return e.programAddress===t}(e,Om)&&function(e){return void 0!==e.data}(e)&&2===e.data[0]}async function zm({abortSignal:e,rpc:t,transactionMessage:n,...r}){const o=ql(n);let i;i=o||ul(n)?n:ll(Um,n);const a=n.instructions.findIndex(Mm),s=function(e){const t=new Uint8Array(5);return t[0]=2,wc().write(e,t,1),Object.freeze({data:t,programAddress:Om})}(14e5);if(-1===a)i=Hl(s,i);else{const e=[...i.instructions];e.splice(a,1,s),i=Object.freeze({...i,instructions:e})}const c=od(ed(i));try{const{value:{err:n,unitsConsumed:i}}=await t.simulateTransaction(c,{...r,encoding:\"base64\",replaceRecentBlockhash:!o,sigVerify:!1}).send({abortSignal:e});if(null==i)throw new Ts(Ya);const a=i>4294967295n?4294967295:Number(i);if(n)throw new Ts(Qa,{cause:n,unitsConsumed:a});return a}catch(e){if(Is(e,Qa))throw e;throw new Ts(Ya,{cause:e})}}async function Lm(e,t,n){if(0===e.length)return{};const r=await async function(e,t,n={}){const{abortSignal:r,...o}=n;return(await e.getMultipleAccounts(t,{...o,encoding:\"jsonParsed\"}).send({abortSignal:r})).value.map(((e,n)=>e&&\"object\"==typeof e&&\"parsed\"in e.data?up(t[n],e):cp(t[n],e)))}(t,e,n);return function(e){const t=e.filter((e=>sp(e)&&e.data instanceof Uint8Array));if(t.length>0){const e=t.map((e=>e.address));throw new Ts(ka,{addresses:e})}}(r),function(e){const t=e.filter((e=>!e.exists));if(t.length>0){const e=t.map((e=>e.address));throw new Ts(Ea,{addresses:e})}}(r),r.reduce(((e,t)=>({...e,[t.address]:t.data.addresses})),{})}async function jm(e,t,n){const r=(\"addressTableLookups\"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?e.addressTableLookups:[]).map((e=>e.lookupTableAddress)),{lastValidBlockHeight:o,...i}=n??{};return Zl(e,{addressesByLookupTableAddress:r.length>0?await Lm(r,t,i):{},lastValidBlockHeight:o})}function Fm(e,t){return!t?.preflightCommitment&&function(e,t){return e===t?0:il(e)<il(t)?-1:1}(e,\"finalized\")<0?{...t,preflightCommitment:e}:t}async function Dm({abortSignal:e,commitment:t,rpc:n,transaction:r,...o}){const i=od(r);return await n.sendTransaction(i,{...Fm(t,o),encoding:\"base64\"}).send({abortSignal:e})}const $m=async(e,t,n)=>cl(e,Kc().encode,Bl().decode,(async e=>jm(e,t,n))),Km=async(e,t,n)=>cl(e,Bl().decode,(async e=>jm(e,t,n))),qm=e=>cl(e,Yl().encode,qc().decode),Wm=async e=>cl(e,Kc().encode,Ql().decode),Hm=async(e,t,n)=>(async e=>new Promise(((t,n)=>{if(0===e.length)return void n(new AggregateError([],\"No promises to resolve\"));let r=0;const o=[];e.forEach(((i,a)=>{Promise.resolve(i).then((e=>t(e)),(t=>{o[a]=t,r+=1,r===e.length&&n(new AggregateError(o,\"All promises rejected\"))}))}))})))([Wm(e),$m(e,t,n)]),Vm=nu(\"KeccakSecp256k11111111111111111111111111111\"),Gm=nu(\"Secp256r1SigVerify1111111111111111111111111\");var Zm=function(e){return e[e.Verify=0]=\"Verify\",e}({});const Jm=e=>0,Ym=e=>e.programAddress===Vm,Qm=e=>e.programAddress===Gm,Xm=()=>{return e=[[\"numSignatures\",Ks(Sc(),Ec())]],Ks(tl(e),nl(e));var e},ey=e=>({programAddress:e.programAddress,data:Xm().decode(e.data??new Uint8Array)});const ty={[Id]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(Ms(t,wc().encode(0),0))return 0;if(Ms(t,wc().encode(1),0))return 1;if(Ms(t,wc().encode(2),0))return 2;if(Ms(t,wc().encode(3),0))return 3;if(Ms(t,wc().encode(4),0))return 4;if(Ms(t,wc().encode(5),0))return 5;if(Ms(t,wc().encode(6),0))return 6;if(Ms(t,wc().encode(7),0))return 7;if(Ms(t,wc().encode(8),0))return 8;if(Ms(t,wc().encode(9),0))return 9;if(Ms(t,wc().encode(10),0))return 10;if(Ms(t,wc().encode(11),0))return 11;if(Ms(t,wc().encode(12),0))return 12;throw new Error(\"The provided instruction could not be identified as a system instruction.\")},instructionEnum:_d,typeToParserMap:{[_d.Assign]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ud().decode(e.data)}},[_d.TransferSol]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n()},data:$d().decode(e.data)}},[_d.CreateAccount]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),newAccount:n()},data:Ld().decode(e.data)}},[_d.CreateAccountWithSeed]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),newAccount:n(),baseAccount:n()},data:jd().decode(e.data)}},[_d.AdvanceNonceAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recentBlockhashesSysvar:n(),nonceAuthority:n()},data:Rd().decode(e.data)}},[_d.WithdrawNonceAccount]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recipientAccount:n(),recentBlockhashesSysvar:n(),rentSysvar:n(),nonceAuthority:n()},data:Wd().decode(e.data)}},[_d.InitializeNonceAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),recentBlockhashesSysvar:n(),rentSysvar:n()},data:Fd().decode(e.data)}},[_d.AuthorizeNonceAccount]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nonceAccount:n(),nonceAuthority:n()},data:zd().decode(e.data)}},[_d.Allocate]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{newAccount:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Nd().decode(e.data)}},[_d.AllocateWithSeed]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{newAccount:n(),baseAccount:n()},data:Od().decode(e.data)}},[_d.AssignWithSeed]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),baseAccount:n()},data:Md().decode(e.data)}},[_d.TransferSolWithSeed]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),baseAccount:n(),destination:n()},data:Kd().decode(e.data)}},[_d.UpgradeNonceAccount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{nonceAccount:(()=>{const n=e.accounts[t];return t+=1,n})()},data:qd().decode(e.data)}}}},[Hf]:{identifier:Gf,instructionEnum:Vf,typeToParserMap:{[Vf.RequestUnits]:function(e){return{programAddress:e.programAddress,data:Jf().decode(e.data)}},[Vf.RequestHeapFrame]:function(e){return{programAddress:e.programAddress,data:Zf().decode(e.data)}},[Vf.SetComputeUnitPrice]:oh,[Vf.SetComputeUnitLimit]:eh,[Vf.SetLoadedAccountsDataSizeLimit]:function(e){return{programAddress:e.programAddress,data:ih().decode(e.data)}}}},[bh]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(Ms(t,Sc().encode(0),0))return 0;if(Ms(t,Sc().encode(1),0))return 1;if(Ms(t,Sc().encode(2),0))return 2;if(Ms(t,Sc().encode(3),0))return 3;if(Ms(t,Sc().encode(4),0))return 4;if(Ms(t,Sc().encode(5),0))return 5;if(Ms(t,Sc().encode(6),0))return 6;if(Ms(t,Sc().encode(7),0))return 7;if(Ms(t,Sc().encode(8),0))return 8;if(Ms(t,Sc().encode(9),0))return 9;if(Ms(t,Sc().encode(10),0))return 10;if(Ms(t,Sc().encode(11),0))return 11;if(Ms(t,Sc().encode(12),0))return 12;if(Ms(t,Sc().encode(13),0))return 13;if(Ms(t,Sc().encode(14),0))return 14;if(Ms(t,Sc().encode(15),0))return 15;if(Ms(t,Sc().encode(16),0))return 16;if(Ms(t,Sc().encode(17),0))return 17;if(Ms(t,Sc().encode(18),0))return 18;if(Ms(t,Sc().encode(19),0))return 19;if(Ms(t,Sc().encode(20),0))return 20;if(Ms(t,Sc().encode(21),0))return 21;if(Ms(t,Sc().encode(22),0))return 22;if(Ms(t,Sc().encode(23),0))return 23;if(Ms(t,Sc().encode(24),0))return 24;throw new Error(\"The provided instruction could not be identified as a token instruction.\")},instructionEnum:Eh,typeToParserMap:{[Eh.InitializeMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rent:n()},data:Hh().decode(e.data)}},[Eh.InitializeAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n(),rent:n()},data:$h().decode(e.data)}},[Eh.InitializeMultisig]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{multisig:n(),rent:n()},data:Gh().decode(e.data)}},[Eh.Transfer]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n(),authority:n()},data:np().decode(e.data)}},[Eh.Approve]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),delegate:n(),owner:n()},data:Ch().decode(e.data)}},[Eh.Revoke]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),owner:n()},data:Qh().decode(e.data)}},[Eh.SetAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{owned:n(),owner:n()},data:Xh().decode(e.data)}},[Eh.MintTo]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Jh().decode(e.data)}},[Eh.Burn]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Rh().decode(e.data)}},[Eh.CloseAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),destination:n(),owner:n()},data:Oh().decode(e.data)}},[Eh.FreezeAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:Fh().decode(e.data)}},[Eh.ThawAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:tp().decode(e.data)}},[Eh.TransferChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:op().decode(e.data)}},[Eh.ApproveChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),delegate:n(),owner:n()},data:Ph().decode(e.data)}},[Eh.MintToChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Yh().decode(e.data)}},[Eh.BurnChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Nh().decode(e.data)}},[Eh.InitializeAccount2]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),rent:n()},data:Kh().decode(e.data)}},[Eh.SyncNative]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:ep().decode(e.data)}},[Eh.InitializeAccount3]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n()},data:qh().decode(e.data)}},[Eh.InitializeMultisig2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{multisig:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Zh().decode(e.data)}},[Eh.InitializeMint2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Vh().decode(e.data)}},[Eh.GetAccountDataSize]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Dh().decode(e.data)}},[Eh.InitializeImmutableOwner]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Wh().decode(e.data)}},[Eh.AmountToUiAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Th().decode(e.data)}},[Eh.UiAmountToAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:ap().decode(e.data)}}}},[Rp]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(Ms(t,Sc().encode(0),0))return 0;if(Ms(t,Sc().encode(1),0))return 1;if(Ms(t,Sc().encode(2),0))return 2;if(Ms(t,Sc().encode(3),0))return 3;if(Ms(t,Sc().encode(4),0))return 4;if(Ms(t,Sc().encode(5),0))return 5;if(Ms(t,Sc().encode(6),0))return 6;if(Ms(t,Sc().encode(7),0))return 7;if(Ms(t,Sc().encode(8),0))return 8;if(Ms(t,Sc().encode(9),0))return 9;if(Ms(t,Sc().encode(10),0))return 10;if(Ms(t,Sc().encode(11),0))return 11;if(Ms(t,Sc().encode(12),0))return 12;if(Ms(t,Sc().encode(13),0))return 13;if(Ms(t,Sc().encode(14),0))return 14;if(Ms(t,Sc().encode(15),0))return 15;if(Ms(t,Sc().encode(16),0))return 16;if(Ms(t,Sc().encode(17),0))return 17;if(Ms(t,Sc().encode(18),0))return 18;if(Ms(t,Sc().encode(19),0))return 19;if(Ms(t,Sc().encode(20),0))return 20;if(Ms(t,Sc().encode(21),0))return 21;if(Ms(t,Sc().encode(22),0))return 22;if(Ms(t,Sc().encode(23),0))return 23;if(Ms(t,Sc().encode(24),0))return 24;if(Ms(t,Sc().encode(25),0))return 25;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(0),1))return 26;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(1),1))return 27;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(2),1))return 28;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(3),1))return 29;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(4),1))return 30;if(Ms(t,Sc().encode(26),0)&&Ms(t,Sc().encode(5),1))return 31;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(0),1))return 32;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(1),1))return 33;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(2),1))return 34;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(3),1))return 35;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(4),1))return 36;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(5),1))return 37;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(6),1))return 38;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(7),1))return 39;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(8),1))return 40;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(9),1))return 41;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(10),1))return 42;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(11),1))return 43;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(12),1))return 44;if(Ms(t,Sc().encode(27),0)&&Ms(t,Sc().encode(13),1))return 45;if(Ms(t,Sc().encode(28),0)&&Ms(t,Sc().encode(0),1))return 46;if(Ms(t,Sc().encode(28),0)&&Ms(t,Sc().encode(1),1))return 47;if(Ms(t,Sc().encode(29),0))return 48;if(Ms(t,Sc().encode(30),0)&&Ms(t,Sc().encode(0),1))return 49;if(Ms(t,Sc().encode(30),0)&&Ms(t,Sc().encode(1),1))return 50;if(Ms(t,Sc().encode(31),0))return 51;if(Ms(t,Sc().encode(32),0))return 52;if(Ms(t,Sc().encode(33),0)&&Ms(t,Sc().encode(0),1))return 53;if(Ms(t,Sc().encode(33),0)&&Ms(t,Sc().encode(1),1))return 54;if(Ms(t,Sc().encode(34),0)&&Ms(t,Sc().encode(0),1))return 55;if(Ms(t,Sc().encode(34),0)&&Ms(t,Sc().encode(1),1))return 56;if(Ms(t,Sc().encode(35),0))return 57;if(Ms(t,Sc().encode(36),0)&&Ms(t,Sc().encode(0),1))return 58;if(Ms(t,Sc().encode(36),0)&&Ms(t,Sc().encode(1),1))return 59;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(0),1))return 60;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(1),1))return 61;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(2),1))return 62;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(3),1))return 63;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(4),1))return 64;if(Ms(t,Sc().encode(37),0)&&Ms(t,Sc().encode(5),1))return 65;if(Ms(t,Sc().encode(38),0))return 66;if(Ms(t,Sc().encode(39),0)&&Ms(t,Sc().encode(0),1))return 67;if(Ms(t,Sc().encode(39),0)&&Ms(t,Sc().encode(1),1))return 68;if(Ms(t,Sc().encode(40),0)&&Ms(t,Sc().encode(0),1))return 69;if(Ms(t,Sc().encode(40),0)&&Ms(t,Sc().encode(1),1))return 70;if(Ms(t,Sc().encode(41),0)&&Ms(t,Sc().encode(0),1))return 71;if(Ms(t,Sc().encode(41),0)&&Ms(t,Sc().encode(1),1))return 72;if(Ms(t,Sc().encode(43),0)&&Ms(t,Sc().encode(0),1))return 73;if(Ms(t,Sc().encode(43),0)&&Ms(t,Sc().encode(1),1))return 74;if(Ms(t,Sc().encode(44),0)&&Ms(t,Sc().encode(0),1))return 75;if(Ms(t,Sc().encode(44),0)&&Ms(t,Sc().encode(1),1))return 76;if(Ms(t,Sc().encode(44),0)&&Ms(t,Sc().encode(2),1))return 77;if(Ms(t,new Uint8Array([210,225,30,162,88,184,77,141]),0))return 78;if(Ms(t,new Uint8Array([221,233,49,45,181,202,220,200]),0))return 79;if(Ms(t,new Uint8Array([234,18,32,56,89,141,37,181]),0))return 80;if(Ms(t,new Uint8Array([215,228,166,228,84,100,86,123]),0))return 81;if(Ms(t,new Uint8Array([250,166,180,250,13,12,184,70]),0))return 82;if(Ms(t,new Uint8Array([121,113,108,39,54,51,0,4]),0))return 83;if(Ms(t,new Uint8Array([108,37,171,143,248,30,18,110]),0))return 84;if(Ms(t,new Uint8Array([161,105,88,1,237,221,216,203]),0))return 85;if(Ms(t,new Uint8Array([152,32,222,176,223,237,116,134]),0))return 86;throw new Error(\"The provided instruction could not be identified as a token-2022 instruction.\")},instructionEnum:Up,typeToParserMap:{[Up.InitializeMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rent:n()},data:Og().decode(e.data)}},[Up.InitializeAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n(),rent:n()},data:Eg().decode(e.data)}},[Up.InitializeMultisig]:Lg,[Up.Transfer]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),destination:n(),authority:n()},data:am().decode(e.data)}},[Up.Approve]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),delegate:n(),owner:n()},data:$p().decode(e.data)}},[Up.Revoke]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),owner:n()},data:tm().decode(e.data)}},[Up.SetAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{owned:n(),owner:n()},data:nm().decode(e.data)}},[Up.MintTo]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Gg().decode(e.data)}},[Up.Burn]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Hp().decode(e.data)}},[Up.CloseAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),destination:n(),owner:n()},data:Gp().decode(e.data)}},[Up.FreezeAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:vg().decode(e.data)}},[Up.ThawAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),owner:n()},data:im().decode(e.data)}},[Up.TransferChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:cm().decode(e.data)}},[Up.ApproveChecked]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),delegate:n(),owner:n()},data:qp().decode(e.data)}},[Up.MintToChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),token:n(),mintAuthority:n()},data:Zg().decode(e.data)}},[Up.BurnChecked]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),authority:n()},data:Vp().decode(e.data)}},[Up.InitializeAccount2]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n(),rent:n()},data:xg().decode(e.data)}},[Up.SyncNative]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:om().decode(e.data)}},[Up.InitializeAccount3]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{account:n(),mint:n()},data:kg().decode(e.data)}},[Up.InitializeMultisig2]:Lg,[Up.InitializeMint2]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ug().decode(e.data)}},[Up.GetAccountDataSize]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:bg().decode(e.data)}},[Up.InitializeImmutableOwner]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{account:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Pg().decode(e.data)}},[Up.AmountToUiAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:jp().decode(e.data)}},[Up.UiAmountToAmount]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:dm().decode(e.data)}},[Up.InitializeMintCloseAuthority]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Mg().decode(e.data)}},[Up.InitializeTransferFeeConfig]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Hg().decode(e.data)}},[Up.TransferCheckedWithFee]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{source:n(),mint:n(),destination:n(),authority:n()},data:lm().decode(e.data)}},[Up.WithdrawWithheldTokensFromMint]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),feeReceiver:n(),withdrawWithheldAuthority:n()},data:Tm().decode(e.data)}},[Up.WithdrawWithheldTokensFromAccounts]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),feeReceiver:n(),withdrawWithheldAuthority:n()},data:km().decode(e.data)}},[Up.HarvestWithheldTokensToMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ag().decode(e.data)}},[Up.SetTransferFee]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),transferFeeConfigAuthority:n()},data:rm().decode(e.data)}},[Up.InitializeConfidentialTransferMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Tg().decode(e.data)}},[Up.UpdateConfidentialTransferMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:fm().decode(e.data)}},[Up.ConfigureConfidentialTransferAccount]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===Rp?void 0:e})(),authority:n()},data:Xp().decode(e.data)}},[Up.ApproveConfidentialTransferAccount]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),authority:n()},data:Wp().decode(e.data)}},[Up.EmptyConfidentialTransferAccount]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===Rp?void 0:e})(),authority:n()},data:hg().decode(e.data)}},[Up.ConfidentialDeposit]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),authority:n()},data:Zp().decode(e.data)}},[Up.ConfidentialWithdraw]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===Rp?void 0:e};return{programAddress:e.programAddress,accounts:{token:n(),mint:n(),instructionsSysvar:r(),equalityRecord:r(),rangeRecord:r(),authority:n()},data:Qp().decode(e.data)}},[Up.ConfidentialTransfer]:function(e){if(e.accounts.length<8)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===Rp?void 0:e};return{programAddress:e.programAddress,accounts:{sourceToken:n(),mint:n(),destinationToken:n(),instructionsSysvar:r(),equalityRecord:r(),ciphertextValidityRecord:r(),rangeRecord:r(),authority:n()},data:Jp().decode(e.data)}},[Up.ApplyConfidentialPendingBalance]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:Fp().decode(e.data)}},[Up.EnableConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:pg().decode(e.data)}},[Up.DisableConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:sg().decode(e.data)}},[Up.EnableNonConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:wg().decode(e.data)}},[Up.DisableNonConfidentialCredits]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),authority:n()},data:dg().decode(e.data)}},[Up.ConfidentialTransferWithFee]:function(e){if(e.accounts.length<10)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n},r=()=>{const e=n();return e.address===Rp?void 0:e};return{programAddress:e.programAddress,accounts:{sourceToken:n(),mint:n(),destinationToken:n(),instructionsSysvar:r(),equalityRecord:r(),transferAmountCiphertextValidityRecord:r(),feeSigmaRecord:r(),feeCiphertextValidityRecord:r(),rangeRecord:r(),authority:n()},data:Yp().decode(e.data)}},[Up.InitializeDefaultAccountState]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:_g().decode(e.data)}},[Up.UpdateDefaultAccountState]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),freezeAuthority:n()},data:hm().decode(e.data)}},[Up.Reallocate]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),payer:n(),systemProgram:n(),owner:n()},data:Yg().decode(e.data)}},[Up.EnableMemoTransfers]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:yg().decode(e.data)}},[Up.DisableMemoTransfers]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:lg().decode(e.data)}},[Up.CreateNativeMint]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),nativeMint:n(),systemProgram:n()},data:ag().decode(e.data)}},[Up.InitializeNonTransferableMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:jg().decode(e.data)}},[Up.InitializeInterestBearingMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Rg().decode(e.data)}},[Up.UpdateRateInterestBearingMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),rateAuthority:n()},data:wm().decode(e.data)}},[Up.EnableCpiGuard]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:gg().decode(e.data)}},[Up.DisableCpiGuard]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{token:n(),owner:n()},data:cg().decode(e.data)}},[Up.InitializePermanentDelegate]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Dg().decode(e.data)}},[Up.InitializeTransferHook]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Vg().decode(e.data)}},[Up.UpdateTransferHook]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:Em().decode(e.data)}},[Up.InitializeConfidentialTransferFee]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ig().decode(e.data)}},[Up.WithdrawWithheldTokensFromMintForConfidentialTransferFee]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),destination:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===Rp?void 0:e})(),authority:n()},data:_m().decode(e.data)}},[Up.WithdrawWithheldTokensFromAccountsForConfidentialTransferFee]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),destination:n(),instructionsSysvarOrContextState:n(),record:(()=>{const e=n();return e.address===Rp?void 0:e})(),authority:n()},data:Im().decode(e.data)}},[Up.HarvestWithheldTokensToMintForConfidentialTransferFee]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Sg().decode(e.data)}},[Up.EnableHarvestToMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:mg().decode(e.data)}},[Up.DisableHarvestToMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:ug().decode(e.data)}},[Up.WithdrawExcessLamports]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{sourceAccount:n(),destinationAccount:n(),authority:n()},data:xm().decode(e.data)}},[Up.InitializeMetadataPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Ng().decode(e.data)}},[Up.UpdateMetadataPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),metadataPointerAuthority:n()},data:mm().decode(e.data)}},[Up.InitializeGroupPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Bg().decode(e.data)}},[Up.UpdateGroupPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),groupPointerAuthority:n()},data:gm().decode(e.data)}},[Up.InitializeGroupMemberPointer]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Cg().decode(e.data)}},[Up.UpdateGroupMemberPointer]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),groupMemberPointerAuthority:n()},data:pm().decode(e.data)}},[Up.InitializeScaledUiAmountMint]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:$g().decode(e.data)}},[Up.UpdateMultiplierScaledUiMint]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:ym().decode(e.data)}},[Up.InitializePausableConfig]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{mint:(()=>{const n=e.accounts[t];return t+=1,n})()},data:Fg().decode(e.data)}},[Up.Pause]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:Jg().decode(e.data)}},[Up.Resume]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{mint:n(),authority:n()},data:em().decode(e.data)}},[Up.InitializeTokenMetadata]:function(e){if(e.accounts.length<4)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n(),mint:n(),mintAuthority:n()},data:Wg().decode(e.data)}},[Up.UpdateTokenMetadataField]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:Am().decode(e.data)}},[Up.RemoveTokenMetadataKey]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:Xg().decode(e.data)}},[Up.UpdateTokenMetadataUpdateAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{metadata:n(),updateAuthority:n()},data:Sm().decode(e.data)}},[Up.EmitTokenMetadata]:function(e){if(e.accounts.length<1)throw new Error(\"Not enough accounts\");let t=0;return{programAddress:e.programAddress,accounts:{metadata:(()=>{const n=e.accounts[t];return t+=1,n})()},data:fg().decode(e.data)}},[Up.InitializeTokenGroup]:function(e){if(e.accounts.length<3)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),mint:n(),mintAuthority:n()},data:Kg().decode(e.data)}},[Up.UpdateTokenGroupMaxSize]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),updateAuthority:n()},data:vm().decode(e.data)}},[Up.UpdateTokenGroupUpdateAuthority]:function(e){if(e.accounts.length<2)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{group:n(),updateAuthority:n()},data:bm().decode(e.data)}},[Up.InitializeTokenGroupMember]:function(e){if(e.accounts.length<5)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{member:n(),memberMint:n(),memberMintAuthority:n(),group:n(),groupUpdateAuthority:n()},data:qg().decode(e.data)}}}},[yh]:{identifier:function(e){const t=\"data\"in e?e.data:e;if(Ms(t,Sc().encode(0),0))return 0;if(Ms(t,Sc().encode(1),0))return 1;if(Ms(t,Sc().encode(2),0))return 2;throw new Error(\"The provided instruction could not be identified as a associatedToken instruction.\")},instructionEnum:Bp,typeToParserMap:{[Bp.CreateAssociatedToken]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),ata:n(),owner:n(),mint:n(),systemProgram:n(),tokenProgram:n()},data:tg().decode(e.data)}},[Bp.CreateAssociatedTokenIdempotent]:function(e){if(e.accounts.length<6)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{payer:n(),ata:n(),owner:n(),mint:n(),systemProgram:n(),tokenProgram:n()},data:og().decode(e.data)}},[Bp.RecoverNestedAssociatedToken]:function(e){if(e.accounts.length<7)throw new Error(\"Not enough accounts\");let t=0;const n=()=>{const n=e.accounts[t];return t+=1,n};return{programAddress:e.programAddress,accounts:{nestedAssociatedAccountAddress:n(),nestedTokenMintAddress:n(),destinationAssociatedAccountAddress:n(),ownerAssociatedAccountAddress:n(),ownerTokenMintAddress:n(),walletAddress:n(),tokenProgram:n()},data:Qg().decode(e.data)}}}},[Vm]:{identifier:Jm,instructionEnum:Zm,typeToParserMap:{[Zm.Verify]:ey}},[Gm]:{identifier:Jm,instructionEnum:Zm,typeToParserMap:{[Zm.Verify]:ey}}},ny=e=>{const{programAddress:t}=e,n={...e,dataBase58:jc().decode(e.data??new Uint8Array)};try{const r=ty[t];if(!r)throw new Error(\"Unsupported program address\");const{identifier:o,typeToParserMap:i,instructionEnum:a}=r,s=o(e),c=a[s],u=i[s];if(!u)throw new Error(\"Unsupported instruction type\");return{type:c,encoded:n,parsed:u(e)}}catch(e){return{type:\"Unknown\",encoded:n,parsed:null}}},ry=(e,t)=>{const n=e.accounts.filter((e=>e<t.transaction.message.accountKeys.length)).map((e=>({address:t.transaction.message.accountKeys[e],role:0}))),r=t.transaction.message.accountKeys[e.programIdIndex];if(!r)throw new Error(\"Program address not found\");return{accounts:n,data:jc().encode(e.data),programAddress:r}};function oy(e){const{type:t,id:n,address:r,options:o,methods:i,scopes:a}=e;return{type:t,id:n,address:r,options:o,methods:i,scopes:a}}const iy={accountSubscribe:\"accountUnsubscribe\",programSubscribe:\"programUnsubscribe\",signatureSubscribe:\"signatureUnsubscribe\"},ay=X([\"processed\",\"confirmed\",\"finalized\"]),sy=(e,t)=>(e=>Boolean(e.feePayer))(t)?t:Wl(e,t),cy=e=>e.programAddress===Hf&&Gf({data:new Uint8Array,...e})===Vf.SetComputeUnitPrice,uy=e=>e.instructions.filter(Boolean).some(cy),ly=e=>e.programAddress===Hf&&Gf({data:new Uint8Array,...e})===Vf.SetComputeUnitLimit,dy=e=>e.instructions.filter(Boolean).some(ly),fy=async(e,t,n)=>{try{const r=e.instructions.filter(Boolean),o=function({rpc:e}){return async function(t,n){return await zm({...n,rpc:e,transactionMessage:t})}}({rpc:t}),i=await o(e,n?.getComputeUnitEstimateConfig).catch((e=>{if(Is(e,Qa))return e.context.unitsConsumed;throw e}));return{...(0,Bf.cloneDeep)(e),instructions:[...r.filter((e=>!ly(e))),Xf({units:i},n?.getSetComputeUnitLimitInstructionConfig)]}}catch(t){return e}};class hy extends Error{constructor(e){super(e),this.name=\"FeeCalculatorError\"}}class py extends hy{constructor(e){super(e),this.name=\"FeeCalculatorUnsupportedInputTypeError\"}}const gy=e=>({ed25519Signatures:[\"signature\"],instructions:e.instructions.map((t=>({accounts:[],data:t.data??new Uint8Array,programAddress:e.staticAccounts[t.programAddressIndex]})))}),my=e=>({...cl(e.messageBytes,Bl().decode,gy),ed25519Signatures:Object.values(e.signatures)}),yy=e=>cl(e,Kc().encode,Ql().decode,my),wy=e=>cl(e,Kc().encode,Bl().decode,gy);class vy{static calculateFee(e){const t=this.#f(e),{ed25519SignaturesCount:n,secp256k1SignaturesCount:r,secp256r1SignaturesCount:o,totalSignaturesCount:i}=this.#h(t),a=this.#p(i),s=this.#g(t),c=this.#m(t),u=this.#y(s,c);return{ed25519SignaturesCount:n,secp256k1SignaturesCount:r,secp256r1SignaturesCount:o,totalSignaturesCount:i,baseFee:a,computeUnitLimit:s,computeUnitPriceMicroLamportsPerComputeUnit:c,priorityFee:u,totalFee:sl(a+u)}}static#p(e){return sl(5000n*BigInt(e))}static#g(e){const{instructions:t}=e,n=t.find(ly);return n?eh(n).data.units:0}static#m(e){const{instructions:t}=e,n=t.find(cy);return n?oh(n).data.microLamports:0n}static#y(e,t){return cl(e,(e=>Mi(e)),(e=>e.multipliedBy(t.toString())),(e=>e.dividedToIntegerBy(Qd.toString())),(e=>e.toString()),BigInt,sl)}static#h(e){const{ed25519Signatures:t,instructions:n}=e,r=t.length,o=n.filter(Ym).map(ny).reduce(((e,t)=>e+(t.parsed?.data.numSignatures??0)),0),i=n.filter(Qm).map(ny).reduce(((e,t)=>e+(t.parsed?.data.numSignatures??0)),0);return{ed25519SignaturesCount:r,secp256k1SignaturesCount:o,secp256r1SignaturesCount:i,totalSignaturesCount:r+o+i}}static#f(e){if(this.#w(e))return yy(e);if(this.#v(e))return wy(e);if(this.#b(e))return gy(e);if(this.#A(e))return my(e);if(this.#S(e))return(e=>({ed25519Signatures:e.transaction.signatures,instructions:e.transaction.message.instructions.map((t=>ry(t,e)))}))(e);throw new py(\"The fee calculator could not recognize the input type. It supports SolanaTransactions, kit Transactions, and base64 strings.\")}static#w(e){try{return\"string\"==typeof e&&(yy(e),!0)}catch(e){return!1}}static#v(e){try{return\"string\"==typeof e&&(wy(e),!0)}catch(e){return!1}}static#b(e){return\"object\"==typeof e&&\"instructions\"in e&&\"staticAccounts\"in e}static#S(e){return\"object\"==typeof e&&\"transaction\"in e&&\"object\"==typeof e.transaction&&\"message\"in e.transaction&&\"object\"==typeof e.transaction.message&&\"accountKeys\"in e.transaction.message&&\"object\"==typeof e.transaction.message.accountKeys&&\"instructions\"in e.transaction.message&&\"object\"==typeof e.transaction.message.instructions&&\"signatures\"in e.transaction&&\"object\"==typeof e.transaction.signatures}static#A(e){return\"object\"==typeof e&&\"messageBytes\"in e&&\"object\"==typeof e.messageBytes&&\"signatures\"in e}}const by=e=>Mi(e.toString()).dividedBy(Xd),Ay=e=>Mi(e.toString()).multipliedBy(Xd).integerValue(Mi.ROUND_DOWN);var Sy=function(e){return e.SignAndSendTransactionWithoutConfirmation=\"signAndSendTransactionWithoutConfirmation\",e.ConfirmSend=\"confirmSend\",e.SignAndSendTransaction=\"signAndSendTransaction\",e.ComputeFee=\"computeFee\",e.OnAddressInput=\"onAddressInput\",e.OnAmountInput=\"onAmountInput\",e.SignRewardsMessage=\"signRewardsMessage\",e.SignCardMessage=\"signCardMessage\",e.ApproveCardAmount=\"approveCardAmount\",e}({});function Ey(e){return pe(JSON.stringify(e),te(e).validator)}function xy(e){return null==e}var ky;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(ky=ky||(ky={}));const Iy=e=>ie(e);function Ty({path:e,branch:t}){const n=e[e.length-1];return r=t[t.length-2],o=n,Object.hasOwnProperty.call(r,o);var r,o}function _y(e){return new K({...e,type:`optional ${e.type}`,validator:(t,n)=>!Ty(n)||e.validator(t,n),refiner:(t,n)=>!Ty(n)||e.refiner(t,n)})}function Cy(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!Cy(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!Cy(n[e][1])){t=!1;break}return t}return!1}const By=pe(\"JSON\",(e=>Cy(e))),Py=xe(By,Ce(J(),\"JSON\",(e=>G(e,By))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));const Ry=te(\"2.0\"),Ny=re(fe([oe(),ue()])),Oy=Iy({code:ee(),message:ue(),data:_y(Py),stack:_y(ue())}),Uy=fe([ce(ue(),Py),Y(Py)]);Iy({id:Ny,jsonrpc:Ry,method:ue(),params:_y(Uy)}),Iy({jsonrpc:Ry,method:ue(),params:_y(Uy)});ie({id:Ny,jsonrpc:Ry,result:ae(he()),error:ae(Oy)});const My=Iy({id:Ny,jsonrpc:Ry,result:Py}),zy=Iy({id:Ny,jsonrpc:Ry,error:Oy});fe([My,zy]);function Ly(e){return G(e,zy)}var jy=function(e){return e.Required=\"Required\",e.Invalid=\"Invalid\",e.InsufficientBalanceToCoverFee=\"InsufficientBalanceToCoverFee\",e.InsufficientBalance=\"InsufficientBalance\",e}({});const Fy=X(Object.values(tf)),Dy=de({address:xe(ue(),ue(),(e=>{if(!e||\"\"===e)throw new Error(\"Account address is required\");const t=Tf(e);if(\"\"===t)throw new Error(\"Invalid Solana address format\");return t}))}),$y=te(\"ed25519\"),Ky=xe(ue(),ue(),(e=>{const t=function(e){if(!e||\"string\"!=typeof e)return\"\";let t=kf(e);const n=t.match(/^([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+)/u);return n?.[1]&&(t=n[1]),/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+$/u.test(t)?t.length>253?\"\":t.toLowerCase():\"\"}(e);if(\"\"===t)throw new Error(\"Invalid domain format\");return t})),qy=xe(ue(),ue(),(e=>{const t=Tf(e);if(\"\"===t)throw new Error(\"Invalid Solana address format\");return t})),Wy=xe(ue(),ue(),(e=>{const t=If(e,1e3);if(\"\"===t)throw new Error(\"Statement cannot be empty. Control characters and excessive whitespace are removed for security. Please use plain text only.\");return t})),Hy=xe(ue(),ue(),(e=>_f(e))),Vy=xe(ue(),ue(),(e=>If(e,10))),Gy=xe(ue(),ue(),(e=>If(e,50))),Zy=xe(ue(),ue(),(e=>If(e,100))),Jy=xe(ue(),ue(),(e=>function(e){if(!e||\"string\"!=typeof e)return\"\";const t=kf(e);if(!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/u.test(t))return\"\";const n=new Date(t);return isNaN(n.getTime())?\"\":t}(e))),Yy=xe(ue(),ue(),(e=>If(e,100))),Qy=xe(Y(ue()),Y(ue()),(e=>{var t;return t=e,Array.isArray(t)?t.filter((e=>\"string\"==typeof e)).map((e=>_f(e))).filter((e=>\"\"!==e)):[]})),Xy=de({domain:ae(Ky),address:ae(qy),statement:ae(Wy),uri:ae(Hy),version:ae(Vy),chainId:ae(Gy),nonce:ae(Zy),issuedAt:ae(Jy),expirationTime:ae(Jy),notBefore:ae(Jy),requestId:ae(Yy),resources:ae(Qy)}),ew=de({account:Dy,message:Sf}),tw=X([\"processed\",\"confirmed\",\"finalized\"]),nw=de({preflightCommitment:ae(tw),minContextSlot:ae(oe())}),rw=de({account:Dy,transaction:Sf,scope:Fy,options:ae(nw)}),ow=de({...nw.schema,commitment:ae(tw),skipPreflight:ae(Q()),maxRetries:ae(oe())}),iw=de({...rw.schema,scope:Fy,options:ae(ow)}),aw=ie({method:X([Tn.SignAndSendTransaction]),params:iw}),sw=ie({method:X([Tn.SignIn]),params:Xy}),cw=ie({method:X([Tn.SignMessage]),params:ew}),uw=ie({method:X([Tn.SignTransaction]),params:rw}),lw=ie({signature:Af}),dw=ie({signedTransaction:Sf}),fw=ie({signature:Af,signedMessage:Sf,signatureType:$y}),hw=ie({account:Dy,...fw.schema}),pw=fe([aw,sw,cw,uw]),gw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.SignAndSendTransactionWithoutConfirmation),params:iw}),mw=ie({transaction:Sf,accountId:uf,scope:Fy,options:ae(ow)}),yw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.SignAndSendTransaction),params:mw}),ww=ie({transactionId:Af}),vw=ie({fromAccountId:uf,toAddress:xf,amount:lf,assetId:Gi}),bw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.ConfirmSend),params:vw}),Aw=ie({value:ue(),scope:function(e,t,n={}){return xe(e,he(),(e=>{const r=\"function\"==typeof t?t():t;if(void 0===e)return r;if(!n.strict&&L(e)&&L(r)){const t={...e};let n=!1;for(const e in r)void 0===t[e]&&(t[e]=r[e],n=!0);if(n)return t}return e}))}(Fy,tf.Mainnet)}),Sw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.OnAddressInput),params:Aw}),Ew=ie({value:lf,accountId:uf,assetId:Gi}),xw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.OnAmountInput),params:Ew});function kw(e){const t=cl(e,Wc().encode,Jc().decode);if(!t.startsWith(\"rewards,\"))throw new Error('Message must start with \"rewards,\"');const n=t.split(\",\");if(3!==n.length)throw new Error(\"Message must have exactly 3 parts: rewards,{address},{timestamp}\");const[r,o,i]=n;if(\"rewards\"!==r)throw new Error('Message must start with \"rewards\"');if(!G(o,xf))throw new Error(\"Invalid Solana address\");if(!G(i,lf))throw new Error(\"Invalid timestamp format\");if(i.includes(\".\"))throw new Error(\"Invalid timestamp\");const a=parseInt(i,10);if(a<=0)throw new Error(\"Invalid timestamp\");return{address:o,timestamp:a}}const Iw=Ce(Sf,\"RewardsMessage\",(e=>{try{return kw(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid rewards message\"}})),Tw=ie({accountId:uf,message:Iw}),_w=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.SignRewardsMessage),params:Tw});function Cw(e){const t=cl(e,Wc().encode,Jc().decode),n=t.replaceAll(/\\s+/gu,\" \").trim(),r=/^(\\S+) wants you to sign in with your Solana account: (\\S{32,44}) (.+?) URI: (\\S+) Version: (\\d+) Chain ID: (\\d+) Nonce: (\\w+) Issued At: (\\S+)(?: Expiration Time: (\\S+))?$/u.exec(n);if(!r)throw new Error('Invalid card message format. Expected format: \"{domain} wants you to sign in with your Solana account: {address} {statement} URI: {uri} Version: {version} Chain ID: {chainId} Nonce: {nonce} Issued At: {issuedAt} [Expiration Time: {expirationTime}]\"');const[,o,i,,a,s,c,u,l,d]=r,f=t.indexOf(i),h=t.indexOf(\"URI:\"),p=t.slice(f+i.length,h).trim();if(!o||\"\"===o.trim())throw new Error(\"Invalid domain in card message\");if(!G(i,xf))throw new Error(\"Invalid Solana address in card message\");try{if(!new URL(a).protocol)throw new Error(\"Invalid URI\")}catch{throw new Error(\"Invalid URI in card message\")}const g=new Date(l);if(isNaN(g.getTime()))throw new Error(\"Invalid Issued At date in card message\");if(void 0!==d){const e=new Date(d);if(isNaN(e.getTime()))throw new Error(\"Invalid Expiration Time date in card message\")}return{domain:o,address:i,statement:p,uri:a,version:s,chainId:c,nonce:u,issuedAt:l,...void 0!==d&&{expirationTime:d}}}const Bw=Ce(Sf,\"CardMessage\",(e=>{try{return Cw(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid card message\"}})),Pw=ie({accountId:uf,message:Bw}),Rw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.SignCardMessage),params:Pw}),Nw=ie({accountId:uf,amount:lf,mint:xf,delegate:xf,scope:Fy}),Ow=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.ApproveCardAmount),params:Nw}),Uw=ie({signature:Af}),Mw=ie({valid:Q(),errors:Y(ie({code:X(Object.values(jy))}))}),zw=ie({transaction:Sf,accountId:uf,scope:Fy}),Lw=ie({jsonrpc:Ry,id:Ny,method:Ey(Sy.ComputeFee),params:zw}),jw=Y(ie({type:X(Object.values(Ht)),asset:jt}));function Fw(e,t){return n=e,Boolean(\"string\"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class Dw extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function $w(e,t=\"Assertion failed.\",n=Dw){if(!e){if(t instanceof Error)throw t;throw Fw(n,t)}}const Kw=32,qw=4294967295,Ww=\"bip32:44'\",Hw=/^\\d+$/u,Vw=/^bip32:\\d+'?$/u,Gw=/^slip10:\\d+'?$/u,Zw=/^cip3:\\d+'?$/u,Jw=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,Yw=2147483648,Qw=_e(ue(),/^(?:0x)?[0-9a-f]+$/iu);_e(ue(),/^0x[0-9a-f]+$/iu),_e(ue(),/^0x[0-9a-f]{40}$/u),_e(ue(),/^0x[0-9a-fA-F]{40}$/u);function Xw(e){$w(function(e){return G(e,Qw)}(e),\"Value must be a hexadecimal string.\")}function ev(e){return e.startsWith(\"0x\")?e:e.startsWith(\"0X\")?`0x${e.substring(2)}`:`0x${e}`}function tv(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}var nv=n(1048).hp;const rv=48,ov=58,iv=87;const av=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,\"0\"));return e}}();function sv(e){return e instanceof Uint8Array}function cv(e){$w(sv(e),\"Value must be a Uint8Array.\")}function uv(e){if(cv(e),0===e.length)return\"0x\";const t=av(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return ev(n.join(\"\"))}function lv(e){cv(e);const t=uv(e);return BigInt(t)}function dv(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;Xw(e);const t=tv(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<ov?rv:iv),a=o-(o<ov?rv:iv);r[e]=16*i+a}return r}function fv(e){return $w(\"string\"==typeof e,\"Value must be a string.\"),(new TextEncoder).encode(e)}function hv(e){if(\"bigint\"==typeof e)return function(e){return $w(\"bigint\"==typeof e,\"Value must be a bigint.\"),$w(e>=BigInt(0),\"Value must be a non-negative bigint.\"),dv(e.toString(16))}(e);if(\"number\"==typeof e)return function(e){return $w(\"number\"==typeof e,\"Value must be a number.\"),$w(e>=0,\"Value must be a non-negative number.\"),$w(Number.isSafeInteger(e),\"Value is not a safe integer. Use `bigIntToBytes` instead.\"),dv(e.toString(16))}(e);if(\"string\"==typeof e)return e.startsWith(\"0x\")?dv(e):fv(e);if(sv(e))return e;throw new TypeError(`Unsupported value type: \"${typeof e}\".`)}function pv(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const o=hv(e[r]);t[r]=o,n+=o.length}const r=new Uint8Array(n);for(let e=0,n=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r}function gv(e){if(void 0!==nv&&e instanceof nv){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}function mv(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function yv(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function wv(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}const vv=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0;function bv(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Av(e,t){return e<<32-t|e>>>t}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,\"0\")));function Sv(e){return\"string\"==typeof e&&(e=function(e){if(\"string\"!=typeof e)throw new Error(\"utf8ToBytes expected string, got \"+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),yv(e),e}class Ev{clone(){return this._cloneInto()}}function xv(e){const t=t=>e().update(Sv(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function kv(e=32){if(vv&&\"function\"==typeof vv.getRandomValues)return vv.getRandomValues(new Uint8Array(e));if(vv&&\"function\"==typeof vv.randomBytes)return vv.randomBytes(e);throw new Error(\"crypto.getRandomValues must be defined\")}function Iv(e,t,n){return e&t^~e&n}function Tv(e,t,n){return e&t^e&n^t&n}class _v extends Ev{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=bv(this.buffer)}update(e){wv(this);const{view:t,buffer:n,blockLen:r}=this,o=(e=Sv(e)).length;for(let i=0;i<o;){const a=Math.min(r-this.pos,o-i);if(a!==r)n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=bv(e);for(;r<=o-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){wv(this),function(e,t){yv(e);const n=t.outputLen;if(e.length<n)throw new Error(\"digestInto() expects output buffer of length at least \"+n)}(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:o}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;e<r;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const a=bv(e),s=this.outputLen;if(s%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=s/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.length=r,e.pos=a,e.finished=o,e.destroyed=i,r%t&&e.buffer.set(n),e}}const Cv=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]),Bv=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pv=new Uint32Array(64);class Rv extends _v{constructor(){super(64,32,8,!1),this.A=0|Bv[0],this.B=0|Bv[1],this.C=0|Bv[2],this.D=0|Bv[3],this.E=0|Bv[4],this.F=0|Bv[5],this.G=0|Bv[6],this.H=0|Bv[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)Pv[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Pv[e-15],n=Pv[e-2],r=Av(t,7)^Av(t,18)^t>>>3,o=Av(n,17)^Av(n,19)^n>>>10;Pv[e]=o+Pv[e-7]+r+Pv[e-16]|0}let{A:n,B:r,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Av(a,6)^Av(a,11)^Av(a,25))+Iv(a,s,c)+Cv[e]+Pv[e]|0,l=(Av(n,2)^Av(n,13)^Av(n,22))+Tv(n,r,o)|0;u=c,c=s,s=a,a=i+t|0,i=o,o=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,o,i,a,s,c,u)}roundClean(){Pv.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Nv=xv((()=>new Rv));class Ov extends Ev{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.wrapConstructor\");mv(e.outputLen),mv(e.blockLen)}(e);const n=Sv(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,o=new Uint8Array(r);o.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return wv(this),this.iHash.update(e),this}digestInto(e){wv(this),yv(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Uv=(e,t,n)=>new Ov(e,t).update(n).digest();Uv.create=(e,t)=>new Ov(e,t);const Mv=BigInt(0),zv=BigInt(1),Lv=BigInt(2);function jv(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Fv(e){if(!jv(e))throw new Error(\"Uint8Array expected\")}function Dv(e,t){if(\"boolean\"!=typeof t)throw new Error(e+\" boolean expected, got \"+t)}const $v=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,\"0\")));function Kv(e){Fv(e);let t=\"\";for(let n=0;n<e.length;n++)t+=$v[e[n]];return t}function qv(e){const t=e.toString(16);return 1&t.length?\"0\"+t:t}function Wv(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);return\"\"===e?Mv:BigInt(\"0x\"+e)}const Hv={_0:48,_9:57,A:65,F:70,a:97,f:102};function Vv(e){return e>=Hv._0&&e<=Hv._9?e-Hv._0:e>=Hv.A&&e<=Hv.F?e-(Hv.A-10):e>=Hv.a&&e<=Hv.f?e-(Hv.a-10):void 0}function Gv(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=Vv(e.charCodeAt(o)),i=Vv(e.charCodeAt(o+1));if(void 0===n||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+o)}r[t]=16*n+i}return r}function Zv(e){return Wv(Kv(e))}function Jv(e){return Fv(e),Wv(Kv(Uint8Array.from(e).reverse()))}function Yv(e,t){return Gv(e.toString(16).padStart(2*t,\"0\"))}function Qv(e,t){return Yv(e,t).reverse()}function Xv(e,t,n){let r;if(\"string\"==typeof t)try{r=Gv(t)}catch(t){throw new Error(e+\" must be hex string or Uint8Array, cause: \"+t)}else{if(!jv(t))throw new Error(e+\" must be hex string or Uint8Array\");r=Uint8Array.from(t)}const o=r.length;if(\"number\"==typeof n&&o!==n)throw new Error(e+\" of length \"+n+\" expected, got \"+o);return r}function eb(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Fv(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}const tb=e=>\"bigint\"==typeof e&&Mv<=e;function nb(e,t,n){return tb(e)&&tb(t)&&tb(n)&&t<=e&&e<n}function rb(e,t,n,r){if(!nb(t,n,r))throw new Error(\"expected valid \"+e+\": \"+n+\" <= n < \"+r+\", got \"+t)}function ob(e){let t;for(t=0;e>Mv;e>>=zv,t+=1);return t}const ib=e=>(Lv<<BigInt(e-1))-zv,ab=e=>new Uint8Array(e),sb=e=>Uint8Array.from(e);function cb(e,t,n){if(\"number\"!=typeof e||e<2)throw new Error(\"hashLen must be a number\");if(\"number\"!=typeof t||t<2)throw new Error(\"qByteLen must be a number\");if(\"function\"!=typeof n)throw new Error(\"hmacFn must be a function\");let r=ab(e),o=ab(e),i=0;const a=()=>{r.fill(1),o.fill(0),i=0},s=(...e)=>n(o,r,...e),c=(e=ab())=>{o=s(sb([0]),e),r=s(),0!==e.length&&(o=s(sb([1]),e),r=s())},u=()=>{if(i++>=1e3)throw new Error(\"drbg: tried 1000 values\");let e=0;const n=[];for(;e<t;){r=s();const t=r.slice();n.push(t),e+=r.length}return eb(...n)};return(e,t)=>{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}}const ub={bigint:e=>\"bigint\"==typeof e,function:e=>\"function\"==typeof e,boolean:e=>\"boolean\"==typeof e,string:e=>\"string\"==typeof e,stringOrUint8Array:e=>\"string\"==typeof e||jv(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>\"function\"==typeof e&&Number.isSafeInteger(e.outputLen)};function lb(e,t,n={}){const r=(t,n,r)=>{const o=ub[n];if(\"function\"!=typeof o)throw new Error(\"invalid validator function\");const i=e[t];if(!(r&&void 0===i||o(i,e)))throw new Error(\"param \"+String(t)+\" is invalid. Expected \"+n+\", got \"+i)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}function db(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const i=e(n,...r);return t.set(n,i),i}}const fb=BigInt(0),hb=BigInt(1),pb=BigInt(2),gb=BigInt(3),mb=BigInt(4),yb=BigInt(5),wb=BigInt(8);BigInt(9),BigInt(16);function vb(e,t){const n=e%t;return n>=fb?n:t+n}function bb(e,t,n){if(t<fb)throw new Error(\"invalid exponent, negatives unsupported\");if(n<=fb)throw new Error(\"invalid modulus\");if(n===hb)return fb;let r=hb;for(;t>fb;)t&hb&&(r=r*e%n),e=e*e%n,t>>=hb;return r}function Ab(e,t,n){let r=e;for(;t-- >fb;)r*=r,r%=n;return r}function Sb(e,t){if(e===fb)throw new Error(\"invert: expected non-zero number\");if(t<=fb)throw new Error(\"invert: expected positive modulus, got \"+t);let n=vb(e,t),r=t,o=fb,i=hb,a=hb,s=fb;for(;n!==fb;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}if(r!==hb)throw new Error(\"invert: does not exist\");return vb(o,t)}function Eb(e){if(e%mb===gb){const t=(e+hb)/mb;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error(\"Cannot find square root\");return r}}if(e%wb===yb){const t=(e-yb)/wb;return function(e,n){const r=e.mul(n,pb),o=e.pow(r,t),i=e.mul(n,o),a=e.mul(e.mul(i,pb),o),s=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),n))throw new Error(\"Cannot find square root\");return s}}return function(e){const t=(e-hb)/pb;let n,r,o;for(n=e-hb,r=0;n%pb===fb;n/=pb,r++);for(o=pb;o<e&&bb(o,t,e)!==e-hb;o++)if(o>1e3)throw new Error(\"Cannot find square root: likely non-prime P\");if(1===r){const t=(e+hb)/mb;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error(\"Cannot find square root\");return r}}const i=(n+hb)/pb;return function(e,a){if(e.pow(a,t)===e.neg(e.ONE))throw new Error(\"Cannot find square root\");let s=r,c=e.pow(e.mul(e.ONE,o),n),u=e.pow(a,i),l=e.pow(a,n);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(l);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const n=e.pow(c,hb<<BigInt(s-t-1));c=e.sqr(n),u=e.mul(u,n),l=e.mul(l,c),s=t}return u}}(e)}const xb=[\"create\",\"isValid\",\"is0\",\"neg\",\"inv\",\"sqrt\",\"sqr\",\"eql\",\"add\",\"sub\",\"mul\",\"pow\",\"div\",\"addN\",\"subN\",\"mulN\",\"sqrN\"];function kb(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Ib(e,t,n=!1,r={}){if(e<=fb)throw new Error(\"invalid field: expected ORDER > 0, got \"+e);const{nBitLength:o,nByteLength:i}=kb(e,t);if(i>2048)throw new Error(\"invalid field: expected ORDER of <= 2048 bytes\");let a;const s=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:i,MASK:ib(o),ZERO:fb,ONE:hb,create:t=>vb(t,e),isValid:t=>{if(\"bigint\"!=typeof t)throw new Error(\"invalid field element: expected bigint, got \"+typeof t);return fb<=t&&t<e},is0:e=>e===fb,isOdd:e=>(e&hb)===hb,neg:t=>vb(-t,e),eql:(e,t)=>e===t,sqr:t=>vb(t*t,e),add:(t,n)=>vb(t+n,e),sub:(t,n)=>vb(t-n,e),mul:(t,n)=>vb(t*n,e),pow:(e,t)=>function(e,t,n){if(n<fb)throw new Error(\"invalid exponent, negatives unsupported\");if(n===fb)return e.ONE;if(n===hb)return t;let r=e.ONE,o=t;for(;n>fb;)n&hb&&(r=e.mul(r,o)),o=e.sqr(o),n>>=hb;return r}(s,e,t),div:(t,n)=>vb(t*Sb(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Sb(t,e),sqrt:r.sqrt||(t=>(a||(a=Eb(e)),a(s,t))),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r))),e.ONE),o=e.inv(r);return t.reduceRight(((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r))),o),n}(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?Qv(e,i):Yv(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(\"Field.fromBytes: expected \"+i+\" bytes, got \"+e.length);return n?Jv(e):Zv(e)}});return Object.freeze(s)}function Tb(e){if(\"bigint\"!=typeof e)throw new Error(\"field order must be bigint\");const t=e.toString(2).length;return Math.ceil(t/8)}function _b(e){const t=Tb(e);return t+Math.ceil(t/2)}const Cb=BigInt(0),Bb=BigInt(1);function Pb(e,t){const n=t.negate();return e?n:t}function Rb(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error(\"invalid window size, expected [1..\"+t+\"], got W=\"+e)}function Nb(e,t){Rb(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function Ob(e,t){if(!Array.isArray(e))throw new Error(\"array expected\");e.forEach(((e,n)=>{if(!(e instanceof t))throw new Error(\"invalid point at index \"+n)}))}function Ub(e,t){if(!Array.isArray(e))throw new Error(\"array of scalars expected\");e.forEach(((e,n)=>{if(!t.isValid(e))throw new Error(\"invalid scalar at index \"+n)}))}const Mb=new WeakMap,zb=new WeakMap;function Lb(e){return zb.get(e)||1}function jb(e,t){return{constTimeNegate:Pb,hasPrecomputes:e=>1!==Lb(e),unsafeLadder(t,n,r=e.ZERO){let o=t;for(;n>Cb;)n&Bb&&(r=r.add(o)),o=o.double(),n>>=Bb;return r},precomputeWindow(e,n){const{windows:r,windowSize:o}=Nb(n,t),i=[];let a=e,s=a;for(let e=0;e<r;e++){s=a,i.push(s);for(let e=1;e<o;e++)s=s.add(a),i.push(s);a=s.double()}return i},wNAF(n,r,o){const{windows:i,windowSize:a}=Nb(n,t);let s=e.ZERO,c=e.BASE;const u=BigInt(2**n-1),l=2**n,d=BigInt(n);for(let e=0;e<i;e++){const t=e*a;let n=Number(o&u);o>>=d,n>a&&(n-=l,o+=Bb);const i=t,f=t+Math.abs(n)-1,h=e%2!=0,p=n<0;0===n?c=c.add(Pb(h,r[i])):s=s.add(Pb(p,r[f]))}return{p:s,f:c}},wNAFUnsafe(n,r,o,i=e.ZERO){const{windows:a,windowSize:s}=Nb(n,t),c=BigInt(2**n-1),u=2**n,l=BigInt(n);for(let e=0;e<a;e++){const t=e*s;if(o===Cb)break;let n=Number(o&c);if(o>>=l,n>s&&(n-=u,o+=Bb),0===n)continue;let a=r[t+Math.abs(n)-1];n<0&&(a=a.negate()),i=i.add(a)}return i},getPrecomputes(e,t,n){let r=Mb.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&Mb.set(t,n(r))),r},wNAFCached(e,t,n){const r=Lb(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const o=Lb(e);return 1===o?this.unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)},setWindowSize(e,n){Rb(n,t),zb.set(e,n),Mb.delete(e)}}}function Fb(e,t,n,r){if(Ob(n,e),Ub(r,t),n.length!==r.length)throw new Error(\"arrays of points and scalars must have equal length\");const o=e.ZERO,i=ob(BigInt(n.length)),a=i>12?i-3:i>4?i-2:i?2:1,s=(1<<a)-1,c=new Array(s+1).fill(o);let u=o;for(let e=Math.floor((t.BITS-1)/a)*a;e>=0;e-=a){c.fill(o);for(let t=0;t<r.length;t++){const o=r[t],i=Number(o>>BigInt(e)&BigInt(s));c[i]=c[i].add(n[t])}let t=o;for(let e=c.length-1,n=o;e>0;e--)n=n.add(c[e]),t=t.add(n);if(u=u.add(t),0!==e)for(let e=0;e<a;e++)u=u.double()}return u}function Db(e){return function(e){const t=xb.reduce(((e,t)=>(e[t]=\"function\",e)),{ORDER:\"bigint\",MASK:\"bigint\",BYTES:\"isSafeInteger\",BITS:\"isSafeInteger\"});lb(e,t)}(e.Fp),lb(e,{n:\"bigint\",h:\"bigint\",Gx:\"field\",Gy:\"field\"},{nBitLength:\"isSafeInteger\",nByteLength:\"isSafeInteger\"}),Object.freeze({...kb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function $b(e){void 0!==e.lowS&&Dv(\"lowS\",e.lowS),void 0!==e.prehash&&Dv(\"prehash\",e.prehash)}const{Ph:Kb,aT:qb}=e;class Wb extends Error{constructor(e=\"\"){super(e)}}const Hb={Err:Wb,_tlv:{encode:(e,t)=>{const{Err:n}=Hb;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(1&t.length)throw new n(\"tlv.encode: unpadded data\");const r=t.length/2,o=qv(r);if(o.length/2&128)throw new n(\"tlv.encode: long form length too big\");const i=r>127?qv(o.length/2|128):\"\";return qv(e)+i+o+t},decode(e,t){const{Err:n}=Hb;let r=0;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(t.length<2||t[r++]!==e)throw new n(\"tlv.decode: wrong tlv\");const o=t[r++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new n(\"tlv.decode(long): indefinite length not supported\");if(e>4)throw new n(\"tlv.decode(long): byte length is too big\");const a=t.subarray(r,r+e);if(a.length!==e)throw new n(\"tlv.decode: length bytes not complete\");if(0===a[0])throw new n(\"tlv.decode(long): zero leftmost byte\");for(const e of a)i=i<<8|e;if(r+=e,i<128)throw new n(\"tlv.decode(long): not minimal encoding\")}else i=o;const a=t.subarray(r,r+i);if(a.length!==i)throw new n(\"tlv.decode: wrong value length\");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=Hb;if(e<Vb)throw new t(\"integer: negative integers are not allowed\");let n=qv(e);if(8&Number.parseInt(n[0],16)&&(n=\"00\"+n),1&n.length)throw new t(\"unexpected DER parsing assertion: unpadded hex\");return n},decode(e){const{Err:t}=Hb;if(128&e[0])throw new t(\"invalid signature integer: negative\");if(0===e[0]&&!(128&e[1]))throw new t(\"invalid signature integer: unnecessary leading zero\");return Kb(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Hb,o=\"string\"==typeof e?qb(e):e;Fv(o);const{v:i,l:a}=r.decode(48,o);if(a.length)throw new t(\"invalid signature: left bytes after parsing\");const{v:s,l:c}=r.decode(2,i),{v:u,l}=r.decode(2,c);if(l.length)throw new t(\"invalid signature: left bytes after parsing\");return{r:n.decode(s),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Hb,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Vb=BigInt(0),Gb=BigInt(1),Zb=(BigInt(2),BigInt(3));BigInt(4);function Jb(e){const t=function(e){const t=Db(e);lb(t,{a:\"field\",b:\"field\"},{allowedPrivateKeyLengths:\"array\",wrapPrivateKey:\"boolean\",isTorsionFree:\"function\",clearCofactor:\"function\",allowInfinityPoint:\"boolean\",fromBytes:\"function\",toBytes:\"function\"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error(\"invalid endomorphism, can only be defined for Koblitz curves that have a=0\");if(\"object\"!=typeof n||\"bigint\"!=typeof n.beta||\"function\"!=typeof n.splitScalar)throw new Error(\"invalid endomorphism, expected beta: bigint and splitScalar: function\")}return Object.freeze({...t})}(e),{Fp:n}=t,r=Ib(t.n,t.nBitLength),o=t.toBytes||((e,t,r)=>{const o=t.toAffine();return eb(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:o}=t,i=n.sqr(e),a=n.mul(i,e);return n.add(n.add(a,n.mul(e,r)),o)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error(\"bad generator point: equation left != right\");function s(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=t;if(n&&\"bigint\"!=typeof e){if(jv(e)&&(e=Kv(e)),\"string\"!=typeof e||!n.includes(e.length))throw new Error(\"invalid private key\");e=e.padStart(2*r,\"0\")}let a;try{a=\"bigint\"==typeof e?e:Zv(Xv(\"private key\",e,r))}catch(t){throw new Error(\"invalid private key, expected hex or \"+r+\" bytes, got \"+typeof e)}return o&&(a=vb(a,i)),rb(\"private key\",a,Gb,i),a}function c(e){if(!(e instanceof d))throw new Error(\"ProjectivePoint expected\")}const u=db(((e,t)=>{const{px:r,py:o,pz:i}=e;if(n.eql(i,n.ONE))return{x:r,y:o};const a=e.is0();null==t&&(t=a?n.ONE:n.inv(i));const s=n.mul(r,t),c=n.mul(o,t),u=n.mul(i,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error(\"invZ was invalid\");return{x:s,y:c}})),l=db((e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw new Error(\"bad point: ZERO\")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error(\"bad point: x or y not FE\");const i=n.sqr(o),s=a(r);if(!n.eql(i,s))throw new Error(\"bad point: equation left != right\");if(!e.isTorsionFree())throw new Error(\"bad point: not in prime-order subgroup\");return!0}));class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,null==e||!n.isValid(e))throw new Error(\"x required\");if(null==t||!n.isValid(t))throw new Error(\"y required\");if(null==r||!n.isValid(r))throw new Error(\"z required\");Object.freeze(this)}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error(\"invalid affine point\");if(e instanceof d)throw new Error(\"projective point not allowed\");const o=e=>n.eql(e,n.ZERO);return o(t)&&o(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i(Xv(\"pointHex\",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(s(e))}static msm(e,t){return Fb(d,r,e,t)}_setWindowSize(e){h.setWindowSize(this,e)}assertValidity(){l(this)}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error(\"Field doesn't support isOdd\")}equals(e){c(e);const{px:t,py:r,pz:o}=this,{px:i,py:a,pz:s}=e,u=n.eql(n.mul(t,s),n.mul(i,o)),l=n.eql(n.mul(r,s),n.mul(a,o));return u&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,o=n.mul(r,Zb),{px:i,py:a,pz:s}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(i,i),h=n.mul(a,a),p=n.mul(s,s),g=n.mul(i,a);return g=n.add(g,g),l=n.mul(i,s),l=n.add(l,l),c=n.mul(e,l),u=n.mul(o,p),u=n.add(c,u),c=n.sub(h,u),u=n.add(h,u),u=n.mul(c,u),c=n.mul(g,c),l=n.mul(o,l),p=n.mul(e,p),g=n.sub(f,p),g=n.mul(e,g),g=n.add(g,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,p),f=n.mul(f,g),u=n.add(u,f),p=n.mul(a,s),p=n.add(p,p),f=n.mul(p,g),c=n.sub(c,f),l=n.mul(p,h),l=n.add(l,l),l=n.add(l,l),new d(c,u,l)}add(e){c(e);const{px:r,py:o,pz:i}=this,{px:a,py:s,pz:u}=e;let l=n.ZERO,f=n.ZERO,h=n.ZERO;const p=t.a,g=n.mul(t.b,Zb);let m=n.mul(r,a),y=n.mul(o,s),w=n.mul(i,u),v=n.add(r,o),b=n.add(a,s);v=n.mul(v,b),b=n.add(m,y),v=n.sub(v,b),b=n.add(r,i);let A=n.add(a,u);return b=n.mul(b,A),A=n.add(m,w),b=n.sub(b,A),A=n.add(o,i),l=n.add(s,u),A=n.mul(A,l),l=n.add(y,w),A=n.sub(A,l),h=n.mul(p,b),l=n.mul(g,w),h=n.add(l,h),l=n.sub(y,h),h=n.add(y,h),f=n.mul(l,h),y=n.add(m,m),y=n.add(y,m),w=n.mul(p,w),b=n.mul(g,b),y=n.add(y,w),w=n.sub(m,w),w=n.mul(p,w),b=n.add(b,w),m=n.mul(y,b),f=n.add(f,m),m=n.mul(A,b),l=n.mul(v,l),l=n.sub(l,m),m=n.mul(v,y),h=n.mul(A,h),h=n.add(h,m),new d(l,f,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return h.wNAFCached(this,e,d.normalizeZ)}multiplyUnsafe(e){const{endo:r,n:o}=t;rb(\"scalar\",e,Vb,o);const i=d.ZERO;if(e===Vb)return i;if(this.is0()||e===Gb)return this;if(!r||h.hasPrecomputes(this))return h.wNAFCachedUnsafe(this,e,d.normalizeZ);let{k1neg:a,k1:s,k2neg:c,k2:u}=r.splitScalar(e),l=i,f=i,p=this;for(;s>Vb||u>Vb;)s&Gb&&(l=l.add(p)),u&Gb&&(f=f.add(p)),p=p.double(),s>>=Gb,u>>=Gb;return a&&(l=l.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,r.beta),f.py,f.pz),l.add(f)}multiply(e){const{endo:r,n:o}=t;let i,a;if(rb(\"scalar\",e,Gb,o),r){const{k1neg:t,k1:o,k2neg:s,k2:c}=r.splitScalar(e);let{p:u,f:l}=this.wNAF(o),{p:f,f:p}=this.wNAF(c);u=h.constTimeNegate(t,u),f=h.constTimeNegate(s,f),f=new d(n.mul(f.px,r.beta),f.py,f.pz),i=u.add(f),a=l.add(p)}else{const{p:t,f:n}=this.wNAF(e);i=t,a=n}return d.normalizeZ([i,a])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,o=(e,t)=>t!==Vb&&t!==Gb&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),i=o(this,t).add(o(e,n));return i.is0()?void 0:i}toAffine(e){return u(this,e)}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Gb)return!0;if(n)return n(d,this);throw new Error(\"isTorsionFree() has not been declared for the elliptic curve\")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Gb?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return Dv(\"isCompressed\",e),this.assertValidity(),o(d,this,e)}toHex(e=!0){return Dv(\"isCompressed\",e),Kv(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,h=jb(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:s,weierstrassEquation:a,isWithinCurveOrder:function(e){return nb(e,Gb,t.n)}}}function Yb(e){const t=function(e){const t=Db(e);return lb(t,{hash:\"hash\",hmac:\"function\",randomBytes:\"function\"},{bits2int:\"function\",bits2int_modN:\"function\",lowS:\"boolean\"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(e){return vb(e,r)}function s(e){return Sb(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=Jb({...t,toBytes(e,t,r){const o=t.toAffine(),i=n.toBytes(o.x),a=eb;return Dv(\"isCompressed\",r),r?a(Uint8Array.from([t.hasEvenY()?2:3]),i):a(Uint8Array.from([4]),i,n.toBytes(o.y))},fromBytes(e){const t=e.length,r=e[0],a=e.subarray(1);if(t!==o||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(a.subarray(0,n.BYTES)),y:n.fromBytes(a.subarray(n.BYTES,2*n.BYTES))}}throw new Error(\"invalid Point, expected length of \"+o+\", or uncompressed \"+i+\", got \"+t)}{const e=Zv(a);if(!nb(e,Gb,n.ORDER))throw new Error(\"Point is not on curve\");const t=l(e);let o;try{o=n.sqrt(t)}catch(e){const t=e instanceof Error?\": \"+e.message:\"\";throw new Error(\"Point is not on curve\"+t)}return!(1&~r)!==((o&Gb)===Gb)&&(o=n.neg(o)),{x:e,y:o}}}}),f=e=>Kv(Yv(e,t.nByteLength));function h(e){return e>r>>Gb}const p=(e,t,n)=>Zv(e.slice(t,n));class g{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Xv(\"compactSignature\",e,2*n),new g(p(e,0,n),p(e,n,2*n))}static fromDER(e){const{r:t,s:n}=Hb.toSig(Xv(\"DER\",e));return new g(t,n)}assertValidity(){rb(\"r\",this.r,Gb,r),rb(\"s\",this.s,Gb,r)}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r,s:o,recovery:i}=this,u=v(Xv(\"msgHash\",e));if(null==i||![0,1,2,3].includes(i))throw new Error(\"recovery id invalid\");const l=2===i||3===i?r+t.n:r;if(l>=n.ORDER)throw new Error(\"recovery id 2 or 3 invalid\");const d=1&i?\"03\":\"02\",h=c.fromHex(d+f(l)),p=s(l),g=a(-u*p),m=a(o*p),y=c.BASE.multiplyAndAddUnsafe(h,g,m);if(!y)throw new Error(\"point at infinify\");return y.assertValidity(),y}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Gv(this.toDERHex())}toDERHex(){return Hb.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Gv(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const m={isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=_b(t.n);return function(e,t,n=!1){const r=e.length,o=Tb(t),i=_b(t);if(r<16||r<i||r>1024)throw new Error(\"expected \"+i+\"-1024 bytes of input, got \"+r);const a=vb(n?Jv(e):Zv(e),t-hb)+hb;return n?Qv(a,o):Yv(a,o)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=jv(e),n=\"string\"==typeof e,r=(t||n)&&e.length;return t?r===o||r===i:n?r===2*o||r===2*i:e instanceof c}const w=t.bits2int||function(e){if(e.length>8192)throw new Error(\"input is too large\");const n=Zv(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return a(w(e))},b=ib(t.nBitLength);function A(e){return rb(\"num < 2^\"+t.nBitLength,e,Vb,b),Yv(e,t.nByteLength)}function S(e,r,o=E){if([\"recovered\",\"canonical\"].some((e=>e in o)))throw new Error(\"sign() legacy options not supported\");const{hash:i,randomBytes:l}=t;let{lowS:f,prehash:p,extraEntropy:m}=o;null==f&&(f=!0),e=Xv(\"msgHash\",e),$b(o),p&&(e=Xv(\"prehashed msgHash\",i(e)));const y=v(e),b=u(r),S=[A(b),A(y)];if(null!=m&&!1!==m){const e=!0===m?l(n.BYTES):m;S.push(Xv(\"extraEntropy\",e))}const x=eb(...S),k=y;return{seed:x,k2sig:function(e){const t=w(e);if(!d(t))return;const n=s(t),r=c.BASE.multiply(t).toAffine(),o=a(r.x);if(o===Vb)return;const i=a(n*a(k+o*b));if(i===Vb)return;let u=(r.x===o?0:2)|Number(r.y&Gb),l=i;return f&&h(i)&&(l=function(e){return h(e)?a(-e):e}(i),u^=1),new g(o,l,u)}}}const E={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(y(e))throw new Error(\"first arg must be private key\");if(!y(t))throw new Error(\"second arg must be public key\");return c.fromHex(t).multiply(u(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:o,k2sig:i}=S(e,n,r),a=t;return cb(a.hash.outputLen,a.nByteLength,a.hmac)(o,i)},verify:function(e,n,r,o=x){const i=e;n=Xv(\"msgHash\",n),r=Xv(\"publicKey\",r);const{lowS:u,prehash:l,format:d}=o;if($b(o),\"strict\"in o)throw new Error(\"options.strict was renamed to lowS\");if(void 0!==d&&\"compact\"!==d&&\"der\"!==d)throw new Error(\"format must be compact or der\");const f=\"string\"==typeof i||jv(i),h=!f&&!d&&\"object\"==typeof i&&null!==i&&\"bigint\"==typeof i.r&&\"bigint\"==typeof i.s;if(!f&&!h)throw new Error(\"invalid signature, expected Uint8Array, hex string or Signature instance\");let p,m;try{if(h&&(p=new g(i.r,i.s)),f){try{\"compact\"!==d&&(p=g.fromDER(i))}catch(e){if(!(e instanceof Hb.Err))throw e}p||\"der\"===d||(p=g.fromCompact(i))}m=c.fromHex(r)}catch(e){return!1}if(!p)return!1;if(u&&p.hasHighS())return!1;l&&(n=t.hash(n));const{r:y,s:w}=p,b=v(n),A=s(w),S=a(b*A),E=a(y*A),k=c.BASE.multiplyAndAddUnsafe(m,S,E)?.toAffine();return!!k&&a(k.x)===y},ProjectivePoint:c,Signature:g,utils:m}}function Qb(e){return{hash:e,hmac:(t,...n)=>Uv(e,t,function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];yv(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}(...n)),randomBytes:kv}}const Xb=BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\"),eA=BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\"),tA=BigInt(1),nA=BigInt(2),rA=(e,t)=>(e+t/nA)/t;function oA(e){const t=Xb,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=Ab(l,n,t)*l%t,f=Ab(d,n,t)*l%t,h=Ab(f,nA,t)*u%t,p=Ab(h,o,t)*h%t,g=Ab(p,i,t)*p%t,m=Ab(g,s,t)*g%t,y=Ab(m,c,t)*m%t,w=Ab(y,s,t)*g%t,v=Ab(w,n,t)*l%t,b=Ab(v,a,t)*p%t,A=Ab(b,r,t)*u%t,S=Ab(A,nA,t);if(!iA.eql(iA.sqr(S),e))throw new Error(\"Cannot find square root\");return S}const iA=Ib(Xb,void 0,void 0,{sqrt:oA}),aA=function(e,t){const n=t=>Yb({...e,...Qb(t)});return{...n(t),create:n}}({a:BigInt(0),b:BigInt(7),Fp:iA,n:eA,Gx:BigInt(\"55066263022277343669578718895168534326250603453777594175500187360389116729240\"),Gy:BigInt(\"32670510020758816978083085130507043184471273380659243275938904335757337482424\"),h:BigInt(1),lowS:!0,endo:{beta:BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\"),splitScalar:e=>{const t=eA,n=BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\"),r=-tA*BigInt(\"0xe4437ed6010e88286f547fa90abfe4c3\"),o=BigInt(\"0x114ca50f7a8e2f3f657c1108d9d44cfd8\"),i=n,a=BigInt(\"0x100000000000000000000000000000000\"),s=rA(i*e,t),c=rA(-r*e,t);let u=vb(e-s*n-c*o,t),l=vb(-s*r-c*i,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error(\"splitScalar: Endomorphism failed, k=\"+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},Nv);BigInt(0);aA.ProjectivePoint;var sA=n(6925);function cA(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function uA(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function lA(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.createHasher\");cA(e.outputLen),cA(e.blockLen)}function dA(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function fA(e,t){uA(e);const n=t.outputLen;if(e.length<n)throw new Error(\"digestInto() expects output buffer of length at least \"+n)}function hA(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function pA(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gA(e,t){return e<<32-t|e>>>t}function mA(e,t){return e<<t|e>>>32-t>>>0}const yA=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function wA(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const vA=yA?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=wA(e[t]);return e};Array.from({length:256},((e,t)=>t.toString(16).padStart(2,\"0\")));function bA(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function AA(e){return\"string\"==typeof e&&(e=bA(e)),uA(e),e}function SA(e){return\"string\"==typeof e&&(e=bA(e)),uA(e),e}class EA{}function xA(e){const t=t=>e().update(AA(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function kA(e,t,n){return e&t^~e&n}function IA(e,t,n){return e&t^e&n^t&n}class TA extends EA{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=pA(this.buffer)}update(e){dA(this),uA(e=AA(e));const{view:t,buffer:n,blockLen:r}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(r-this.pos,o-i);if(a!==r)n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=pA(e);for(;r<=o-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){dA(this),fA(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:o}=this;let{pos:i}=this;t[i++]=128,hA(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;e<r;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const a=pA(e),s=this.outputLen;if(s%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=s/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=r,e.pos=a,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const _A=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),CA=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),BA=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]);new Uint32Array(80);const PA=Math.pow(2,32);Array.from({length:64},((e,t)=>Math.floor(PA*Math.abs(Math.sin(t+1))))),BA.slice(0,4),new Uint32Array(16);const RA=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),NA=Uint8Array.from(new Array(16).fill(0).map(((e,t)=>t))),OA=NA.map((e=>(9*e+5)%16)),UA=(()=>{const e=[[NA],[OA]];for(let t=0;t<4;t++)for(let n of e)n.push(n[t].map((e=>RA[e])));return e})(),MA=UA[0],zA=UA[1],LA=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>Uint8Array.from(e))),jA=MA.map(((e,t)=>e.map((e=>LA[t][e])))),FA=zA.map(((e,t)=>e.map((e=>LA[t][e])))),DA=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),$A=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function KA(e,t,n,r){return 0===e?t^n^r:1===e?t&n|~t&r:2===e?(t|~n)^r:3===e?t&r|n&~r:t^(n|~r)}const qA=new Uint32Array(16);class WA extends TA{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:r,h4:o}=this;return[e,t,n,r,o]}set(e,t,n,r,o){this.h0=0|e,this.h1=0|t,this.h2=0|n,this.h3=0|r,this.h4=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)qA[n]=e.getUint32(t,!0);let n=0|this.h0,r=n,o=0|this.h1,i=o,a=0|this.h2,s=a,c=0|this.h3,u=c,l=0|this.h4,d=l;for(let e=0;e<5;e++){const t=4-e,f=DA[e],h=$A[e],p=MA[e],g=zA[e],m=jA[e],y=FA[e];for(let t=0;t<16;t++){const r=mA(n+KA(e,o,a,c)+qA[p[t]]+f,m[t])+l|0;n=l,l=c,c=0|mA(a,10),a=o,o=r}for(let e=0;e<16;e++){const n=mA(r+KA(t,i,s,u)+qA[g[e]]+h,y[e])+d|0;r=d,d=u,u=0|mA(s,10),s=i,i=n}}this.set(this.h1+a+u|0,this.h2+c+d|0,this.h3+l+r|0,this.h4+n+i|0,this.h0+o+s|0)}roundClean(){hA(qA)}destroy(){this.destroyed=!0,hA(this.buffer),this.set(0,0,0,0,0)}}const HA=xA((()=>new WA)),VA=BigInt(2**32-1),GA=BigInt(32);function ZA(e,t=!1){return t?{h:Number(e&VA),l:Number(e>>GA&VA)}:{h:0|Number(e>>GA&VA),l:0|Number(e&VA)}}function JA(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=ZA(e[i],t);[r[i],o[i]]=[n,a]}return[r,o]}const YA=(e,t,n)=>e>>>n,QA=(e,t,n)=>e<<32-n|t>>>n,XA=(e,t,n)=>e>>>n|t<<32-n,eS=(e,t,n)=>e<<32-n|t>>>n,tS=(e,t,n)=>e<<64-n|t>>>n-32,nS=(e,t,n)=>e>>>n-32|t<<64-n,rS=(e,t,n)=>e<<n|t>>>32-n,oS=(e,t,n)=>t<<n|e>>>32-n,iS=(e,t,n)=>t<<n-32|e>>>64-n,aS=(e,t,n)=>e<<n-32|t>>>64-n;function sS(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const cS=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),uS=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,lS=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),dS=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,fS=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),hS=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,pS=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gS=new Uint32Array(64);class mS extends TA{constructor(e=32){super(64,e,8,!1),this.A=0|_A[0],this.B=0|_A[1],this.C=0|_A[2],this.D=0|_A[3],this.E=0|_A[4],this.F=0|_A[5],this.G=0|_A[6],this.H=0|_A[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)gS[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=gS[e-15],n=gS[e-2],r=gA(t,7)^gA(t,18)^t>>>3,o=gA(n,17)^gA(n,19)^n>>>10;gS[e]=o+gS[e-7]+r+gS[e-16]|0}let{A:n,B:r,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(gA(a,6)^gA(a,11)^gA(a,25))+kA(a,s,c)+pS[e]+gS[e]|0,l=(gA(n,2)^gA(n,13)^gA(n,22))+IA(n,r,o)|0;u=c,c=s,s=a,a=i+t|0,i=o,o=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,o,i,a,s,c,u)}roundClean(){hA(gS)}destroy(){this.set(0,0,0,0,0,0,0,0),hA(this.buffer)}}const yS=JA([\"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((e=>BigInt(e)))),wS=yS[0],vS=yS[1],bS=new Uint32Array(80),AS=new Uint32Array(80);class SS extends TA{constructor(e=64){super(128,e,16,!1),this.Ah=0|CA[0],this.Al=0|CA[1],this.Bh=0|CA[2],this.Bl=0|CA[3],this.Ch=0|CA[4],this.Cl=0|CA[5],this.Dh=0|CA[6],this.Dl=0|CA[7],this.Eh=0|CA[8],this.El=0|CA[9],this.Fh=0|CA[10],this.Fl=0|CA[11],this.Gh=0|CA[12],this.Gl=0|CA[13],this.Hh=0|CA[14],this.Hl=0|CA[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g]}set(e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)bS[n]=e.getUint32(t),AS[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|bS[e-15],n=0|AS[e-15],r=XA(t,n,1)^XA(t,n,8)^YA(t,0,7),o=eS(t,n,1)^eS(t,n,8)^QA(t,n,7),i=0|bS[e-2],a=0|AS[e-2],s=XA(i,a,19)^tS(i,a,61)^YA(i,0,6),c=eS(i,a,19)^nS(i,a,61)^QA(i,a,6),u=lS(o,c,AS[e-7],AS[e-16]),l=dS(u,r,s,bS[e-7],bS[e-16]);bS[e]=0|l,AS[e]=0|u}let{Ah:n,Al:r,Bh:o,Bl:i,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){const t=XA(l,d,14)^XA(l,d,18)^tS(l,d,41),w=eS(l,d,14)^eS(l,d,18)^nS(l,d,41),v=l&f^~l&p,b=fS(y,w,d&h^~d&g,vS[e],AS[e]),A=hS(b,m,t,v,wS[e],bS[e]),S=0|b,E=XA(n,r,28)^tS(n,r,34)^tS(n,r,39),x=eS(n,r,28)^nS(n,r,34)^nS(n,r,39),k=n&o^n&a^o&a,I=r&i^r&s^i&s;m=0|p,y=0|g,p=0|f,g=0|h,f=0|l,h=0|d,({h:l,l:d}=sS(0|c,0|u,0|A,0|S)),c=0|a,u=0|s,a=0|o,s=0|i,o=0|n,i=0|r;const T=cS(S,x,I);n=uS(T,A,E,k),r=0|T}({h:n,l:r}=sS(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l:i}=sS(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=sS(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=sS(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=sS(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=sS(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:g}=sS(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=sS(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,o,i,a,s,c,u,l,d,f,h,p,g,m,y)}roundClean(){hA(bS,AS)}destroy(){hA(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const ES=xA((()=>new mS)),xS=xA((()=>new SS)),kS=ES;function IS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function TS(e,...t){if(!IS(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function _S(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>\"string\"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function CS(e){if(\"function\"!=typeof e)throw new Error(\"function expected\");return!0}function BS(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function PS(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function RS(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function NS(e,t){if(!_S(!0,t))throw new Error(`${e}: array of strings expected`)}function OS(e,t){if(!_S(!1,t))throw new Error(`${e}: array of numbers expected`)}function US(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function MS(e){const t=\"string\"==typeof e?e.split(\"\"):e,n=t.length;NS(\"alphabet\",t);const r=new Map(t.map(((e,t)=>[e,t])));return{encode:r=>(RS(r),r.map((r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet \"${r}\". Allowed: ${e}`);return t[r]}))),decode:t=>(RS(t),t.map((t=>{BS(\"alphabet.decode\",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n})))}}function zS(e=\"\"){return BS(\"join\",e),{encode:t=>(NS(\"join.decode\",t),t.join(e)),decode:t=>(BS(\"join.decode\",t),t.split(e))}}function LS(e,t=\"=\"){return PS(e),BS(\"padding\",t),{encode(n){for(NS(\"padding.encode\",n);n.length*e%8;)n.push(t);return n},decode(n){NS(\"padding.decode\",n);let r=n.length;if(r*e%8)throw new Error(\"padding: invalid, string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8==0)throw new Error(\"padding: invalid, string has too much padding\")}return n.slice(0,r)}}}function jS(e){return CS(e),{encode:e=>e,decode:t=>e(t)}}function FS(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(RS(e),!e.length)return[];let r=0;const o=[],i=Array.from(e,(e=>{if(PS(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e})),a=i.length;for(;;){let e=0,s=!0;for(let o=r;o<a;o++){const a=i[o],c=t*e,u=c+a;if(!Number.isSafeInteger(u)||c/t!==e||u-a!==c)throw new Error(\"convertRadix: carry overflow\");const l=u/n;e=u%n;const d=Math.floor(l);if(i[o]=d,!Number.isSafeInteger(d)||d*n+e!==u)throw new Error(\"convertRadix: carry overflow\");s&&(d?s=!1:r=o)}if(o.push(e),s)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}const DS=(e,t)=>0===t?e:DS(t,e%t),$S=(e,t)=>e+(t-DS(e,t)),KS=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function qS(e,t,n,r){if(RS(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($S(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${$S(t,n)}`);let o=0,i=0;const a=KS[t],s=KS[n]-1,c=[];for(const r of e){if(PS(r),r>=a)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(o=o<<t|r,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((o>>i-n&s)>>>0);const e=KS[i];if(void 0===e)throw new Error(\"invalid carry\");o&=e-1}if(o=o<<n-i&s,!r&&i>=t)throw new Error(\"Excess padding\");if(!r&&o>0)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&c.push(o>>>0),c}function WS(e){PS(e);return{encode:t=>{if(!IS(t))throw new Error(\"radix.encode input should be Uint8Array\");return FS(Array.from(t),256,e)},decode:t=>(OS(\"radix.decode\",t),Uint8Array.from(FS(t,e,256)))}}function HS(e,t=!1){if(PS(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if($S(8,e)>32||$S(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!IS(n))throw new Error(\"radix2.encode input should be Uint8Array\");return qS(Array.from(n),8,e,!t)},decode:n=>(OS(\"radix2.decode\",n),Uint8Array.from(qS(n,e,8,t)))}}function VS(e){return CS(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function GS(e,t){return PS(e),CS(t),{encode(n){if(!IS(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const r=t(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(r,n.length),o},decode(n){if(!IS(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const r=n.slice(0,-e),o=n.slice(-e),i=t(r).slice(0,e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error(\"Invalid checksum\");return r}}}const ZS=US(HS(4),MS(\"0123456789ABCDEF\"),zS(\"\")),JS=US(HS(5),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),LS(5),zS(\"\")),YS=(US(HS(5),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),zS(\"\")),US(HS(5),MS(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),LS(5),zS(\"\")),US(HS(5),MS(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),zS(\"\")),US(HS(5),MS(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),zS(\"\"),jS((e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\")))),\"function\"==typeof Uint8Array.from([]).toBase64&&\"function\"==typeof Uint8Array.fromBase64),QS=(e,t)=>{BS(\"base64\",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?\"base64url\":\"base64\";if(e.length>0&&!n.test(e))throw new Error(\"invalid base64\");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:\"strict\"})},XS=YS?{encode:e=>(TS(e),e.toBase64()),decode:e=>QS(e,!1)}:US(HS(6),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),LS(6),zS(\"\")),eE=(US(HS(6),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),zS(\"\")),YS?{encode:e=>(TS(e),e.toBase64({alphabet:\"base64url\"})),decode:e=>QS(e,!0)}:US(HS(6),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),LS(6),zS(\"\"))),tE=(US(HS(6),MS(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),zS(\"\")),e=>US(WS(58),MS(e),zS(\"\"))),nE=tE(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),rE=(tE(\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"),tE(\"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\"),[0,2,3,5,6,7,9,10,11]),oE={encode(e){let t=\"\";for(let n=0;n<e.length;n+=8){const r=e.subarray(n,n+8);t+=nE.encode(r).padStart(rE[r.length],\"1\")}return t},decode(e){let t=[];for(let n=0;n<e.length;n+=11){const r=e.slice(n,n+11),o=rE.indexOf(r.length),i=nE.decode(r);for(let e=0;e<i.length-o;e++)if(0!==i[e])throw new Error(\"base58xmr: wrong padding\");t=t.concat(Array.from(i.slice(i.length-o)))}return Uint8Array.from(t)}},iE=e=>US(GS(4,(t=>e(e(t)))),nE),aE=US(MS(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),zS(\"\")),sE=[996825010,642813549,513874426,1027748829,705979059];function cE(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<sE.length;e++)1==(t>>e&1)&&(n^=sE[e]);return n}function uE(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=cE(o)^n>>5}o=cE(o);for(let t=0;t<r;t++)o=cE(o)^31&e.charCodeAt(t);for(let e of t)o=cE(o)^e;for(let e=0;e<6;e++)o=cE(o);return o^=n,aE.encode(qS([o%KS[30]],30,5,!1))}function lE(e){const t=\"bech32\"===e?1:734539939,n=HS(5),r=n.decode,o=n.encode,i=VS(r);function a(e,n,r=90){BS(\"bech32.encode prefix\",e),IS(n)&&(n=Array.from(n)),OS(\"bech32.encode\",n);const o=e.length;if(0===o)throw new TypeError(`Invalid prefix length ${o}`);const i=o+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);const a=e.toLowerCase(),s=uE(a,n,t);return`${a}1${aE.encode(n)}${s}`}function s(e,n=90){BS(\"bech32.decode input\",e);const r=e.length;if(r<8||!1!==n&&r>n)throw new TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);const o=e.toLowerCase();if(e!==o&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const i=o.lastIndexOf(\"1\");if(0===i||-1===i)throw new Error('Letter \"1\" must be present between prefix and data only');const a=o.slice(0,i),s=o.slice(i+1);if(s.length<6)throw new Error(\"Data must be at least 6 characters long\");const c=aE.decode(s).slice(0,-6),u=uE(a,c,t);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected \"${u}\"`);return{prefix:a,words:c}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:VS(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}lE(\"bech32\"),lE(\"bech32m\");const dE={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},fE=(\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex||US(HS(4),MS(\"0123456789abcdef\"),zS(\"\"),jS((e=>{if(\"string\"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}))),BigInt(2**32-1)),hE=BigInt(32);function pE(e,t=!1){return t?{h:Number(e&fE),l:Number(e>>hE&fE)}:{h:0|Number(e>>hE&fE),l:0|Number(e&fE)}}const gE={fromBig:pE,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:a}=pE(e[o],t);[n[o],r[o]]=[i,a]}return[n,r]},toBig:(e,t)=>BigInt(e>>>0)<<hE|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<<n|t>>>32-n,rotlSL:(e,t,n)=>t<<n|e>>>32-n,rotlBH:(e,t,n)=>t<<n-32|e>>>64-n,rotlBL:(e,t,n)=>e<<n-32|t>>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},[mE,yE]=gE.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((e=>BigInt(e)))),wE=new Uint32Array(80),vE=new Uint32Array(80);class bE extends _v{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:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g]}set(e,t,n,r,o,i,a,s,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let n=0;n<16;n++,t+=4)wE[n]=e.getUint32(t),vE[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|wE[e-15],n=0|vE[e-15],r=gE.rotrSH(t,n,1)^gE.rotrSH(t,n,8)^gE.shrSH(t,n,7),o=gE.rotrSL(t,n,1)^gE.rotrSL(t,n,8)^gE.shrSL(t,n,7),i=0|wE[e-2],a=0|vE[e-2],s=gE.rotrSH(i,a,19)^gE.rotrBH(i,a,61)^gE.shrSH(i,a,6),c=gE.rotrSL(i,a,19)^gE.rotrBL(i,a,61)^gE.shrSL(i,a,6),u=gE.add4L(o,c,vE[e-7],vE[e-16]),l=gE.add4H(u,r,s,wE[e-7],wE[e-16]);wE[e]=0|l,vE[e]=0|u}let{Ah:n,Al:r,Bh:o,Bl:i,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){const t=gE.rotrSH(l,d,14)^gE.rotrSH(l,d,18)^gE.rotrBH(l,d,41),w=gE.rotrSL(l,d,14)^gE.rotrSL(l,d,18)^gE.rotrBL(l,d,41),v=l&f^~l&p,b=d&h^~d&g,A=gE.add5L(y,w,b,yE[e],vE[e]),S=gE.add5H(A,m,t,v,mE[e],wE[e]),E=0|A,x=gE.rotrSH(n,r,28)^gE.rotrBH(n,r,34)^gE.rotrBH(n,r,39),k=gE.rotrSL(n,r,28)^gE.rotrBL(n,r,34)^gE.rotrBL(n,r,39),I=n&o^n&a^o&a,T=r&i^r&s^i&s;m=0|p,y=0|g,p=0|f,g=0|h,f=0|l,h=0|d,({h:l,l:d}=gE.add(0|c,0|u,0|S,0|E)),c=0|a,u=0|s,a=0|o,s=0|i,o=0|n,i=0|r;const _=gE.add3L(E,k,T);n=gE.add3H(_,S,x,I),r=0|_}({h:n,l:r}=gE.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l:i}=gE.add(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=gE.add(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=gE.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=gE.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=gE.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:g}=gE.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=gE.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,o,i,a,s,c,u,l,d,f,h,p,g,m,y)}roundClean(){wE.fill(0),vE.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)}}const AE=xv((()=>new bE)),SE=BigInt(0),EE=BigInt(1),xE=BigInt(2),kE=BigInt(8),IE={zip215:!0};function TE(e){const t=function(e){const t=Db(e);return lb(e,{hash:\"function\",a:\"bigint\",d:\"bigint\",randomBytes:\"function\"},{adjustScalarBytes:\"function\",domain:\"function\",uvRatio:\"function\",mapToCurve:\"function\"}),Object.freeze({...t})}(e),{Fp:n,n:r,prehash:o,hash:i,randomBytes:a,nByteLength:s,h:c}=t,u=xE<<BigInt(8*s)-EE,l=n.create,d=Ib(t.n,t.nBitLength),f=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(e){return{isValid:!1,value:SE}}}),h=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,n)=>{if(Dv(\"phflag\",n),t.length||n)throw new Error(\"Contexts/pre-hash are not supported\");return e});function g(e,t){rb(\"coordinate \"+e,t,SE,u)}function m(e){if(!(e instanceof v))throw new Error(\"ExtendedPoint expected\")}const y=db(((e,t)=>{const{ex:r,ey:o,ez:i}=e,a=e.is0();null==t&&(t=a?kE:n.inv(i));const s=l(r*t),c=l(o*t),u=l(i*t);if(a)return{x:SE,y:EE};if(u!==EE)throw new Error(\"invZ was invalid\");return{x:s,y:c}})),w=db((e=>{const{a:n,d:r}=t;if(e.is0())throw new Error(\"bad point: ZERO\");const{ex:o,ey:i,ez:a,et:s}=e,c=l(o*o),u=l(i*i),d=l(a*a),f=l(d*d),h=l(c*n);if(l(d*l(h+u))!==l(f+l(r*l(c*u))))throw new Error(\"bad point: equation left != right (1)\");if(l(o*i)!==l(a*s))throw new Error(\"bad point: equation left != right (2)\");return!0}));class v{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,g(\"x\",e),g(\"y\",t),g(\"z\",n),g(\"t\",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw new Error(\"extended point not allowed\");const{x:t,y:n}=e||{};return g(\"x\",t),g(\"y\",n),new v(t,n,EE,l(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.ez)));return e.map(((e,n)=>e.toAffine(t[n]))).map(v.fromAffine)}static msm(e,t){return Fb(v,d,e,t)}_setWindowSize(e){S.setWindowSize(this,e)}assertValidity(){w(this)}equals(e){m(e);const{ex:t,ey:n,ez:r}=this,{ex:o,ey:i,ez:a}=e,s=l(t*a),c=l(o*r),u=l(n*a),d=l(i*r);return s===c&&u===d}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:o}=this,i=l(n*n),a=l(r*r),s=l(xE*l(o*o)),c=l(e*i),u=n+r,d=l(l(u*u)-i-a),f=c+a,h=f-s,p=c-a,g=l(d*h),m=l(f*p),y=l(d*p),w=l(h*f);return new v(g,m,w,y)}add(e){m(e);const{a:n,d:r}=t,{ex:o,ey:i,ez:a,et:s}=this,{ex:c,ey:u,ez:d,et:f}=e;if(n===BigInt(-1)){const e=l((i-o)*(u+c)),t=l((i+o)*(u-c)),n=l(t-e);if(n===SE)return this.double();const r=l(a*xE*f),h=l(s*xE*d),p=h+r,g=t+e,m=h-r,y=l(p*n),w=l(g*m),b=l(p*m),A=l(n*g);return new v(y,w,A,b)}const h=l(o*c),p=l(i*u),g=l(s*r*f),y=l(a*d),w=l((o+i)*(c+u)-h-p),b=y-g,A=y+g,S=l(p-n*h),E=l(w*b),x=l(A*S),k=l(w*S),I=l(b*A);return new v(E,x,I,k)}subtract(e){return this.add(e.negate())}wNAF(e){return S.wNAFCached(this,e,v.normalizeZ)}multiply(e){const t=e;rb(\"scalar\",t,EE,r);const{p:n,f:o}=this.wNAF(t);return v.normalizeZ([n,o])[0]}multiplyUnsafe(e,t=v.ZERO){const n=e;return rb(\"scalar\",n,SE,r),n===SE?A:this.is0()||n===EE?this:S.wNAFCachedUnsafe(this,n,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return S.unsafeLadder(this,r).is0()}toAffine(e){return y(this,e)}clearCofactor(){const{h:e}=t;return e===EE?this:this.multiplyUnsafe(e)}static fromHex(e,r=!1){const{d:o,a:i}=t,a=n.BYTES;e=Xv(\"pointHex\",e,a),Dv(\"zip215\",r);const s=e.slice(),c=e[a-1];s[a-1]=-129&c;const d=Jv(s),h=r?u:n.ORDER;rb(\"pointHex.y\",d,SE,h);const p=l(d*d),g=l(p-EE),m=l(o*p-i);let{isValid:y,value:w}=f(g,m);if(!y)throw new Error(\"Point.fromHex: invalid y coordinate\");const b=(w&EE)===EE,A=!!(128&c);if(!r&&w===SE&&A)throw new Error(\"Point.fromHex: x=0 and x_0=1\");return A!==b&&(w=l(-w)),v.fromAffine({x:w,y:d})}static fromPrivateKey(e){return k(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=Qv(t,n.BYTES);return r[r.length-1]|=e&EE?128:0,r}toHex(){return Kv(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,EE,l(t.Gx*t.Gy)),v.ZERO=new v(SE,EE,EE,SE);const{BASE:b,ZERO:A}=v,S=jb(v,8*s);function E(e){return vb(e,r)}function x(e){return E(Jv(e))}function k(e){const t=n.BYTES;e=Xv(\"private key\",e,t);const r=Xv(\"hashed private key\",i(e),2*t),o=h(r.slice(0,t)),a=r.slice(t,2*t),s=x(o),c=b.multiply(s),u=c.toRawBytes();return{head:o,prefix:a,scalar:s,point:c,pointBytes:u}}function I(e=new Uint8Array,...t){const n=eb(...t);return x(i(p(n,Xv(\"context\",e),!!o)))}const T=IE;b._setWindowSize(8);return{CURVE:t,getPublicKey:function(e){return k(e).pointBytes},sign:function(e,t,i={}){e=Xv(\"message\",e),o&&(e=o(e));const{prefix:a,scalar:s,pointBytes:c}=k(t),u=I(i.context,a,e),l=b.multiply(u).toRawBytes(),d=E(u+I(i.context,l,c,e)*s);return rb(\"signature.s\",d,SE,r),Xv(\"result\",eb(l,Qv(d,n.BYTES)),2*n.BYTES)},verify:function(e,t,r,i=T){const{context:a,zip215:s}=i,c=n.BYTES;e=Xv(\"signature\",e,2*c),t=Xv(\"message\",t),r=Xv(\"publicKey\",r,c),void 0!==s&&Dv(\"zip215\",s),o&&(t=o(t));const u=Jv(e.slice(c,2*c));let l,d,f;try{l=v.fromHex(r,s),d=v.fromHex(e.slice(0,c),s),f=b.multiplyUnsafe(u)}catch(e){return!1}if(!s&&l.isSmallOrder())return!1;const h=I(a,d.toRawBytes(),l.toRawBytes(),t);return d.add(l.multiplyUnsafe(h)).subtract(f).clearCofactor().equals(v.ZERO)},ExtendedPoint:v,utils:{getExtendedPublicKey:k,randomPrivateKey:()=>a(n.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}const _E=BigInt(\"57896044618658097711785492504343953926634992332820282019728792003956564819949\"),CE=BigInt(\"19681161376707505956807079304988542015446066515923890162744021073123829784752\"),BE=(BigInt(0),BigInt(1)),PE=BigInt(2),RE=(BigInt(3),BigInt(5)),NE=BigInt(8);function OE(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),i=_E,a=e*e%i*e%i,s=Ab(a,PE,i)*a%i,c=Ab(s,BE,i)*e%i,u=Ab(c,RE,i)*c%i,l=Ab(u,t,i)*u%i,d=Ab(l,n,i)*l%i,f=Ab(d,r,i)*d%i,h=Ab(f,o,i)*f%i,p=Ab(h,o,i)*f%i,g=Ab(p,t,i)*u%i;return{pow_p_5_8:Ab(g,PE,i)*e%i,b2:a}}function UE(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function ME(e,t){const n=_E,r=vb(t*t*t,n),o=vb(r*r*t,n);let i=vb(e*r*OE(e*o).pow_p_5_8,n);const a=vb(t*i*i,n),s=i,c=vb(i*CE,n),u=a===e,l=a===vb(-e,n),d=a===vb(-e*CE,n);return u&&(i=s),(l||d)&&(i=c),((e,t)=>(vb(e,t)&hb)===hb)(i,n)&&(i=vb(-i,n)),{isValid:u||l,value:i}}const zE=Ib(_E,void 0,!0),LE={a:BigInt(-1),d:BigInt(\"37095705934669439343138083508754565189542113879843219016388785533085940283555\"),Fp:zE,n:BigInt(\"7237005577332262213973186563042994240857116359379907606001950938285454250989\"),h:NE,Gx:BigInt(\"15112221349535400772501151409588531511454012693041857206046113283949847762202\"),Gy:BigInt(\"46316835694926478169428394003475163141307993866256225615783033603165251855960\"),hash:AE,randomBytes:kv,adjustScalarBytes:UE,uvRatio:ME},jE=TE(LE);const FE=jE.CURVE,DE=\"ed25519\",$E=fv(\"ed25519 seed\"),KE=e=>!0,qE=!1,WE=33,HE=(e,t)=>{const n=jE.getPublicKey(e);return pv([new Uint8Array([0]),n])},VE=(e,t)=>{throw new Error(\"Ed25519 does not support public key derivation.\")},GE=e=>e,ZE=e=>e,JE=32,YE=\"slip10\",QE=33,XE=jE.CURVE,ex=\"ed25519Bip32\",tx=fv(\"\");function nx(e,t){const n=e[t];return $w(void 0!==n,\"Private key is too short.\"),n}const rx=e=>!(7&nx(e,0))&&(!(128&nx(e,31))&&!(64&~nx(e,31))),ox=!0,ix=32,ax=e=>{return Xw(t=uv(Uint8Array.from(e).reverse())),BigInt(ev(t));var t},sx=e=>{const t=vb(ax(e),XE.n);return jE.ExtendedPoint.BASE.multiply(t).toRawBytes()},cx=async(e,t)=>sx(e.slice(0,32)),ux=(e,t)=>jE.ExtendedPoint.fromHex(tv(uv(e))).add(jE.ExtendedPoint.fromHex(tv(uv(t)))).toRawBytes(),lx=e=>e,dx=e=>e,fx=64,hx=\"cip3\",px=32,gx={secp256k1:i,ed25519:t,ed25519Bip32:o};function mx(e){return gx[e]}function yx(e){return bx(e),`${wx(e)}'`}function wx(e){return bx(e),`bip32:${e}`}function vx(e){if(\"number\"==typeof e)return wx(e);if(!e||!Number.isInteger(e.index)||\"boolean\"!=typeof e.hardened)throw new Error(\"Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.\");return e.hardened?yx(e.index):wx(e.index)}function bx(e){if(!(kx(t=e)&&t<=qw))throw new Error(\"Invalid BIP-32 index: Must be a non-negative integer.\");var t}function Ax(e){return e.endsWith(\"'\")}function Sx(e){return e instanceof Uint8Array?e:dv(e)}function Ex(e){if(void 0!==e)return Sx(e)}function xx(e,t){if(e.length!==t)return!1;for(const t of e)if(0!==t)return!0;return!1}function kx(e){return\"number\"==typeof e&&Number.isInteger(e)&&e>=0}function Ix(e,t){if(e instanceof Uint8Array)return _x(e,t),e;if(\"string\"==typeof e){const n=dv(e);return _x(n,t),n}throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function Tx(e,t){if(e instanceof Uint8Array)return $w(e.length===t,`Invalid value: Must be a ${t}-byte byte array.`),e;if(\"string\"==typeof e)return Tx(dv(e),t);throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function _x(e,t){if(!xx(e,t))throw new Error(`Invalid value: Must be a non-zero ${t}-byte byte array.`)}const Cx=(e,t)=>{if(!xx(e,t))throw new Error(`Invalid public key: The key must be a ${t}-byte, non-zero byte array.`);return gv(HA(kS(e))).getUint32(0,!1)};function Bx(e){if(!e||\"string\"!=typeof e)throw new Error(\"Invalid curve: Must specify a curve.\");if(!Object.keys(gx).includes(e))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(gx).join(\", \")}.`)}function Px(e,t=!1){const n=new Uint8Array(4);return gv(n).setUint32(0,e,t),n}const Rx=aA.CURVE,Nx=\"secp256k1\",Ox=fv(\"Bitcoin seed\"),Ux=!0,Mx=65,zx=e=>aA.utils.isValidPrivateKey(e),Lx=(e,t=!1)=>aA.getPublicKey(e,t),jx=(e,t)=>{$w(xx(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const n=aA.ProjectivePoint.fromHex(e).add(aA.ProjectivePoint.fromPrivateKey(t));return n.assertValidity(),n.toRawBytes(!1)},Fx=e=>aA.ProjectivePoint.fromHex(e).toRawBytes(!0),Dx=e=>aA.ProjectivePoint.fromHex(e).toRawBytes(!1),$x=32,Kx=\"slip10\",qx=33,Wx=76067358,Hx=76066276,Vx=e=>{const t=(e=>{const t=iE(kS);try{return t.decode(e)}catch{throw new Error(\"Invalid extended key: Value is not base58-encoded, or the checksum is invalid.\")}})(e);if(78!==t.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${t.length}.`);const n=gv(t),r=n.getUint32(0,!1),o=n.getUint8(4);mI(o);const i=n.getUint32(5,!1),a=n.getUint32(9,!1),s=t.slice(13,45);if(!xx(s,32))throw new Error(\"Invalid extended key: Chain code must be a 32-byte non-zero byte array.\");const c=t.slice(45,78);if(!xx(c,33))throw new Error(\"Invalid extended key: Key must be a 33-byte non-zero byte array.\");const u=gv(c);if(r===Wx){if(2!==u.getUint8(0)&&3!==u.getUint8(0))throw new Error(\"Invalid extended key: Public key must start with 0x02 or 0x03.\");return{version:r,depth:o,parentFingerprint:i,index:a,chainCode:s,publicKey:Dx(c)}}if(r===Hx){if(0!==u.getUint8(0))throw new Error(\"Invalid extended key: Private key must start with 0x00.\");return{version:r,depth:o,parentFingerprint:i,index:a,chainCode:s,privateKey:c.slice(1)}}throw new Error(\"Invalid extended key: Expected a public (xpub) or private key (xprv) version.\")},Gx=e=>{const{version:t,depth:n,parentFingerprint:r,index:o,chainCode:i}=e,a=new Uint8Array(78),s=gv(a);if(s.setUint32(0,t,!1),s.setUint8(4,n),s.setUint32(5,r,!1),s.setUint32(9,o,!1),a.set(i,13),e.version===Wx){const{publicKey:t}=e,n=Fx(t);a.set(n,45)}if(e.version===Hx){const{privateKey:t}=e;a.set(t,46)}return c=a,iE(kS).encode(c);var c};var Zx,Jx=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Yx=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class Qx{constructor(e,t){Zx.set(this,void 0),Jx(this,Zx,e,\"f\"),this.coin_type=t,this.path=function(e){return`m / ${Ww} / ${yx(e)}`}(t),Object.freeze(this)}static async fromJSON(e,t){ek(t),Xx(e.depth);const n=await gI.fromExtendedKey({depth:e.depth,index:e.index,parentFingerprint:e.parentFingerprint,chainCode:Sx(e.chainCode),privateKey:Ex(e.privateKey),publicKey:Sx(e.publicKey)});return new Qx(n,t)}static async fromDerivationPath(e){Xx(e.length-1);const t=await gI.fromDerivationPath({derivationPath:e}),n=e[2].split(\":\")[1]?.replace(\"'\",\"\");$w(n,\"Invalid derivation path.\");const r=Number.parseInt(n,10);return new Qx(t,r)}static async fromNode(e,t){if(!(e instanceof gI))throw new Error(\"Invalid node: Expected an instance of BIP44Node.\");return ek(t),Xx(e.depth),Promise.resolve(new Qx(e,t))}get depth(){return Yx(this,Zx,\"f\").depth}get privateKeyBytes(){return Yx(this,Zx,\"f\").privateKeyBytes}get publicKeyBytes(){return Yx(this,Zx,\"f\").publicKeyBytes}get chainCodeBytes(){return Yx(this,Zx,\"f\").chainCodeBytes}get privateKey(){return Yx(this,Zx,\"f\").privateKey}get publicKey(){return Yx(this,Zx,\"f\").publicKey}get compressedPublicKey(){return Yx(this,Zx,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return Yx(this,Zx,\"f\").compressedPublicKeyBytes}get chainCode(){return Yx(this,Zx,\"f\").chainCode}get address(){return Yx(this,Zx,\"f\").address}get masterFingerprint(){return Yx(this,Zx,\"f\").masterFingerprint}get parentFingerprint(){return Yx(this,Zx,\"f\").parentFingerprint}get fingerprint(){return Yx(this,Zx,\"f\").fingerprint}get index(){return Yx(this,Zx,\"f\").index}get curve(){return Yx(this,Zx,\"f\").curve}get extendedKey(){return Yx(this,Zx,\"f\").extendedKey}async deriveBIP44AddressKey({account:e=0,change:t=0,address_index:n}){return await Yx(this,Zx,\"f\").derive(function({account:e=0,change:t=0,address_index:n}){return[yx(e),vx(t),vx(n)]}({account:e,change:t,address_index:n}))}toJSON(){return{...Yx(this,Zx,\"f\").toJSON(),coin_type:this.coin_type,path:this.path}}}function Xx(e){if(2!==e)throw new Error(`Invalid depth: Coin type nodes must be of depth 2. Received: \"${e}\"`)}function ek(e){if(\"number\"!=typeof e||!Number.isInteger(e)||e<0)throw new Error(\"Invalid coin type: The specified coin type must be a non-negative integer number.\")}Zx=new WeakMap;const tk=BigInt(0),nk=BigInt(1),rk=BigInt(2),ok=BigInt(7),ik=BigInt(256),ak=BigInt(113),sk=[],ck=[],uk=[];for(let e=0,t=nk,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],sk.push(2*(5*r+n)),ck.push((e+1)*(e+2)/2%64);let o=tk;for(let e=0;e<7;e++)t=(t<<nk^(t>>ok)*ak)%ik,t&rk&&(o^=nk<<(nk<<BigInt(e))-nk);uk.push(o)}const lk=JA(uk,!0),dk=lk[0],fk=lk[1],hk=(e,t,n)=>n>32?iS(e,t,n):rS(e,t,n),pk=(e,t,n)=>n>32?aS(e,t,n):oS(e,t,n);class gk extends EA{constructor(e,t,n,r=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=o,cA(n),!(0<e&&e<200))throw new Error(\"only keccak-f1600 function is supported\");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){vA(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,o=(t+2)%10,i=n[o],a=n[o+1],s=hk(i,a,1)^n[r],c=pk(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],o=e[3];for(let n=0;n<24;n++){const r=ck[n],i=hk(t,o,r),a=pk(t,o,r),s=sk[n];t=e[s],o=e[s+1],e[s]=i,e[s+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=dk[r],e[1]^=fk[r]}hA(n)}(this.state32,this.rounds),vA(this.state32),this.posOut=0,this.pos=0}update(e){dA(this),uA(e=AA(e));const{blockLen:t,state:n}=this,r=e.length;for(let o=0;o<r;){const i=Math.min(t-this.pos,r-o);for(let t=0;t<i;t++)n[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){dA(this,!1),uA(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,o=e.length;r<o;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,o-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error(\"XOF is not possible for this instance\");return this.writeInto(e)}xof(e){return cA(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(fA(e,this),this.finished)throw new Error(\"digest() was already called\");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,hA(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:o,enableXOF:i}=this;return e||(e=new gk(t,n,r,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const mk=(e,t,n)=>xA((()=>new gk(t,e,n))),yk=mk(1,136,32);class wk extends EA{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,lA(e);const n=AA(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,o=new Uint8Array(r);o.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),hA(o)}update(e){return dA(this),this.iHash.update(e),this}digestInto(e){dA(this),uA(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const vk=(e,t,n)=>new wk(e,t).update(n).digest();vk.create=(e,t)=>new wk(e,t);const bk=xS;async function Ak({path:e,node:t,curve:n},r){Ik(t);const{childIndex:o,isHardened:i}=Tk(e,t,n),a={chainCode:t.chainCodeBytes,childIndex:o,isHardened:i,depth:t.depth,parentFingerprint:t.fingerprint,masterFingerprint:t.masterFingerprint,curve:n};if(t.privateKeyBytes){const e=await Ek({privateKey:t.privateKeyBytes,childIndex:o,isHardened:i,curve:n}),s=kk({chainCode:t.chainCodeBytes,extension:e});return await Sk({privateKey:t.privateKeyBytes,entropy:s,...a},r)}const s=xk({parentPublicKey:t.compressedPublicKeyBytes,childIndex:o}),c=kk({chainCode:t.chainCodeBytes,extension:s});return await Sk({publicKey:t.compressedPublicKeyBytes,entropy:c,...a},r)}async function Sk(e,t){const{privateKey:n,publicKey:r,entropy:o,childIndex:i,isHardened:a,depth:s,parentFingerprint:c,masterFingerprint:u,curve:l}=e;try{return n?await async function({entropy:e,privateKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,isHardened:a,curve:s}){const c=i+(a?Yw:0),{privateKey:u,chainCode:l}=await async function({privateKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32);if(\"ed25519\"===n.name){return{privateKey:r,publicKey:await n.getPublicKey(r),chainCode:o}}const i=function(e,t,n){$w(xx(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const r=lv(e),o=lv(t);if(o>=n.curve.n)throw new Error(\"Invalid tweak: Tweak is larger than the curve order.\");const i=vb(r+o,n.curve.n),a=dv(i.toString(16).padStart(64,\"0\"));if(!n.isValidPrivateKey(a))throw new Error(\"Invalid private key or tweak: The resulting private key is invalid.\");return a}(e,r,n),a=await n.getPublicKey(i);return{privateKey:i,publicKey:a,chainCode:o}}({privateKey:t,entropy:e,curve:s});return await lI.fromExtendedKey({privateKey:u,chainCode:l,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:c,curve:s.name})}({entropy:o,privateKey:n,depth:s,masterFingerprint:u,parentFingerprint:c,childIndex:i,isHardened:a,curve:l}):await async function({entropy:e,publicKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,curve:a}){const{publicKey:s,chainCode:c}=function({publicKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32),i=n.publicAdd(e,r);return{publicKey:i,chainCode:o}}({publicKey:t,entropy:e,curve:a});return await lI.fromExtendedKey({publicKey:s,chainCode:c,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:i,curve:a.name})}({entropy:o,publicKey:r,depth:s,masterFingerprint:u,parentFingerprint:c,childIndex:i,curve:l})}catch(n){return await Sk(await t(n,e),t)}}async function Ek({privateKey:e,childIndex:t,isHardened:n,curve:r}){if(n)return pv([new Uint8Array([0]),e,Px(t+Yw)]);return xk({parentPublicKey:await r.getPublicKey(e,!0),childIndex:t})}function xk({parentPublicKey:e,childIndex:t}){return pv([e,Px(t)])}function kk({chainCode:e,extension:t}){return vk(bk,e,t)}function Ik(e){$w(e,\"Invalid parameters: Must specify a node to derive from.\")}function Tk(e,t,n){!function(e,t,n){$w(\"string\"==typeof e,\"Invalid path: Must be a string.\");const r=e.endsWith(\"'\");$w(!r||t.privateKey,\"Invalid parameters: Cannot derive hardened child keys without a private key.\"),$w(r||n.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${n.name}.`)}(e,t,n);const r=e.split(\"'\")[0];$w(r);const o=parseInt(r,10);if(!Hw.test(r)||!Number.isInteger(o)||o<0||o>=Yw)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${Yw}.`);return{childIndex:o,isHardened:e.includes(\"'\")}}function _k(e){$w(e instanceof Uint8Array&&xx(e,Kw),\"Invalid key: The key must be a 32-byte, non-zero Uint8Array.\");return Ck(Lx(e,!1))}function Ck(e){return $w(e instanceof Uint8Array&&xx(e,Mx),\"Invalid key: The key must be a 65-byte, non-zero Uint8Array.\"),yk(e.slice(1)).slice(-20)}async function Bk(e){return $w(\"secp256k1\"===e.curve.name,\"Invalid curve: Only secp256k1 is supported by BIP-32.\"),Ak(e,Pk)}async function Pk(e,t){const{childIndex:n,privateKey:r,publicKey:o,isHardened:i,curve:a,chainCode:s}=t;if(bx(n+1),r){const e=kk({chainCode:s,extension:await Ek({privateKey:r,childIndex:n+1,isHardened:i,curve:a})});return{...t,childIndex:n+1,entropy:e}}const c=kk({chainCode:s,extension:xk({parentPublicKey:o,childIndex:n+1})});return{...t,childIndex:n+1,entropy:c}}var Rk=n(2091);function Nk(e,t,n,r){lA(e);const o=function(e,t){if(void 0!==t&&\"[object Object]\"!=={}.toString.call(t))throw new Error(\"options should be object or undefined\");return Object.assign(e,t)}({dkLen:32,asyncTick:10},r),{c:i,dkLen:a,asyncTick:s}=o;if(cA(i),cA(a),cA(s),i<1)throw new Error(\"iterations (c) should be >= 1\");const c=SA(t),u=SA(n),l=new Uint8Array(a),d=vk.create(e,c),f=d._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:s,DK:l,PRF:d,PRFSalt:f}}function Ok(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),hA(o),n}function Uk(e){return`bip39:${e.toLowerCase().trim()}`}async function Mk({path:e,curve:t}){switch(t.masterNodeGenerationSpec){case\"slip10\":return zk(await(0,Rk.nl)(e,sA.p),t);case\"cip3\":return Lk((0,Rk.x2)(e,sA.p),t);default:throw new Error(\"Unsupported master node generation spec.\")}}async function zk(e,t){$w(e.length>=16&&e.length<=64,\"Invalid seed: The seed must be between 16 and 64 bytes long.\");const n=vk(bk,t.secret,e),r=n.slice(0,Kw),o=n.slice(Kw);$w(t.isValidPrivateKey(r),\"Invalid private key: The private key must greater than 0 and less than the curve order.\");const i=Cx(await t.getPublicKey(r,!0),t.compressedPublicKeyLength);return lI.fromExtendedKey({privateKey:r,chainCode:o,masterFingerprint:i,depth:0,parentFingerprint:0,index:0,curve:t.name})}async function Lk(e,t){$w(e.length>=16&&e.length<=64,\"Invalid entropy: The entropy must be between 16 and 64 bytes long.\");const n=function(e,t,n,r){const{c:o,dkLen:i,DK:a,PRF:s,PRFSalt:c}=Nk(e,t,n,r);let u;const l=new Uint8Array(4),d=pA(l),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<i;e++,t+=s.outputLen){const n=a.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(u=c._cloneInto(u)).update(l).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<o;e++){s._cloneInto(u).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return Ok(s,c,a,u,f)}(bk,t.secret,e,{c:4096,dkLen:96});n[0]&=248,n[31]&=31,n[31]|=64;const r=n.slice(0,t.privateKeyLength),o=n.slice(t.privateKeyLength);$w(t.isValidPrivateKey(r),\"Invalid private key.\");const i=Cx(await t.getPublicKey(r),t.compressedPublicKeyLength);return lI.fromExtendedKey({privateKey:r,chainCode:o,masterFingerprint:i,depth:0,parentFingerprint:0,index:0,curve:t.name})}const jk=e=>e.slice().reverse(),Fk=e=>{const t=uv(jk(e));return BigInt(t)},Dk=e=>{const t=e.toString(16);return jk(dv(t))},$k=e=>pv([e,new Uint8Array(Math.max(32-e.length,0)).fill(0)]),Kk=e=>{const t=Fk(e.slice(0,28))*BigInt(8);return $k(Dk(t))},qk=e=>$k(Dk(vb(Fk(e),BigInt(2)**BigInt(256)))),Wk=(e,t)=>{const n=Fk(e)+Fk(t);return $k(Dk(n)).slice(0,32)},Hk=(e,t,n)=>pv([new Uint8Array([e]),t,Px(n,!0)]),Vk=2,Gk=0,Zk=async({parentNode:e,childIndex:t,isHardened:n})=>{const r=n?Hk(Gk,e.privateKeyBytes,t+Yw):Hk(Vk,e.publicKeyBytes,t),o=kk({chainCode:e.chainCodeBytes,extension:r}),i=o.subarray(0,32),a=o.subarray(32),s=e.privateKeyBytes.subarray(0,32),c=e.privateKeyBytes.subarray(32);return pv([Wk(Kk(i),s),Wk(a,c)])},Jk=3,Yk=1,Qk=async({parentNode:e,childIndex:t,isHardened:n})=>{const r=n?Hk(Yk,e.privateKeyBytes,t+Yw):Hk(Jk,e.publicKeyBytes,t);return kk({chainCode:e.chainCodeBytes,extension:r}).subarray(32)},Xk=2,eI=async({parentNode:e,childIndex:t,curve:n})=>{const r=Hk(Xk,e.publicKeyBytes,t),o=kk({chainCode:e.chainCodeBytes,extension:r}).slice(0,32),i=await n.getPublicKey(Kk(o));return n.publicAdd(e.publicKeyBytes,i)};async function tI(e){const{curve:t,node:n,path:r}=e;Ik(n);const{childIndex:o,isHardened:i}=Tk(r,n,t);if(\"ed25519Bip32\"!==t.name||!n)throw new Error(\"Unsupported curve: Only ed25519Bip32 is supported by CIP3.\");const a=o+(i?Yw:0),{privateKeyBytes:s,chainCodeBytes:c,publicKeyBytes:u,masterFingerprint:l,depth:d,fingerprint:f}=n;if(s){const e={privateKeyBytes:s,chainCodeBytes:c,publicKeyBytes:u},n=await Zk({parentNode:e,childIndex:o,isHardened:i}),r=await Qk({parentNode:e,childIndex:o,isHardened:i});return lI.fromExtendedKey({privateKey:uv(n),chainCode:uv(r),masterFingerprint:l,depth:d+1,parentFingerprint:f,index:a,curve:t.name})}$w(!i,\"Invalid parameters: Cannot derive hardened child keys without a private key.\");const h={chainCodeBytes:c,publicKeyBytes:u},p=await eI({parentNode:h,childIndex:o,isHardened:!1,curve:t}),g=await Qk({parentNode:h,childIndex:o,isHardened:!1});return lI.fromExtendedKey({publicKey:uv(p),chainCode:uv(g),masterFingerprint:l,depth:d+1,parentFingerprint:f,index:a,curve:t.name})}async function nI(e){return await Ak(e,rI)}async function rI(e,t){const{curve:n,isHardened:r,childIndex:o,entropy:i,chainCode:a}=t;if(\"ed25519\"===n.name)throw e;const s=r?o+Yw:o,c=kk({chainCode:a,extension:pv([1,i.slice(32,64),Px(s)])});return{...t,entropy:c}}const oI={bip32:a,bip39:s,slip10:u,cip3:c};async function iI(e){const{path:t,depth:n=t.length}=e,r=\"node\"in e?e.node:void 0,o=\"curve\"in e?e.curve:r?.curve;if(r&&!(r instanceof lI)&&!(r instanceof gI)&&!(r instanceof Qx))throw new Error(\"Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.\");if(!o)throw new Error(\"Invalid arguments: Must specify either a parent node or curve.\");return function(e,t,n){if(0===e.length)throw new Error(\"Invalid HD path segment: The segment must not be empty.\");let r=!1;if(e.forEach(((e,t)=>{if(0===t){if(r=e instanceof Uint8Array||Jw.test(e),!(e instanceof Uint8Array||r||Vw.test(e)||Gw.test(e)||Zw.test(e)))throw aI()}else if(e instanceof Uint8Array||!Vw.test(e)&&!Gw.test(e)&&!Zw.test(e))throw aI()})),0===n&&(!r||1!==e.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of 0. Received: \"${String(e)}\".`);if(!t&&!r)throw new Error(\"Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.\");if(t&&r)throw new Error(\"Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.\");const o=r?e.slice(1):e;if(o.length>0){const e=o[0]?.split(\":\")[0];$w(e),$w(o.every((t=>t.startsWith(`${e}:`))),\"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.\")}}(t,Boolean(r?.privateKey)||Boolean(r?.publicKey),n),await t.reduce((async(e,t,n)=>{const r=await e;if(\"string\"==typeof t){const[e,n]=t.split(\":\");$w(e),$w(n),$w(function(e){return e in oI}(e),`Unknown derivation type: \"${e}\".`);const i=oI[e];return await i.deriveChildKey({path:n,node:r,curve:mx(o)})}return $w(0===n,aI()),await oI.bip39.deriveChildKey({path:t,node:r,curve:mx(o)})}),Promise.resolve(r))}function aI(){return new Error(\"Invalid HD path segment: The path segment is malformed.\")}var sI,cI,uI=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class lI{constructor({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:o,privateKey:i,publicKey:a,curve:s},c){$w(c===uI(lI,sI,\"f\",cI),\"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, or `SLIP10Node.fromDerivationPath`.\"),this.depth=e,this.masterFingerprint=t,this.parentFingerprint=n,this.index=r,this.chainCodeBytes=o,this.privateKeyBytes=i,this.publicKeyBytes=a,this.curve=s,Object.freeze(this)}static async fromJSON(e){return lI.fromExtendedKey(e)}static async fromExtendedKey({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,privateKey:o,publicKey:i,chainCode:a,curve:s}){const c=Ix(a,Kw);Bx(s),dI(e),bx(r),function(e,t){if(0===t&&0!==e)throw new Error(`Invalid index: The index of the root node must be 0. Received: \"${String(e)}\".`)}(r,e),function(e,t){if(!kx(e))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: \"${String(e)}\".`);if(0===t&&0!==e)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: \"${String(e)}\".`);if(t>0&&0===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: \"${String(e)}\".`)}(n,e),function(e,t,n){if(!e)return;if(n>=2&&e===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: \"${String(t)}\".`)}(t,n,e);const u=mx(s);if(o){const i=Tx(o,u.privateKeyLength);return $w(u.isValidPrivateKey(i),`Invalid private key: Value is not a valid ${s} private key.`),new lI({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:c,privateKey:i,publicKey:await u.getPublicKey(i),curve:s},uI(this,sI,\"f\",cI))}if(i){const o=Ix(i,u.publicKeyLength);return new lI({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,chainCode:c,publicKey:o,curve:s},uI(this,sI,\"f\",cI))}throw new Error(\"Invalid options: Must provide either a private key or a public key.\")}static async fromDerivationPath({derivationPath:e,curve:t}){if(Bx(t),!e)throw new Error(\"Invalid options: Must provide a derivation path.\");if(0===e.length)throw new Error(\"Invalid derivation path: May not specify an empty derivation path.\");return await iI({path:e,depth:e.length-1,curve:t})}get chainCode(){return uv(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return uv(this.privateKeyBytes)}get publicKey(){return uv(this.publicKeyBytes)}get compressedPublicKeyBytes(){return mx(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return uv(this.compressedPublicKeyBytes)}get address(){if(\"secp256k1\"!==this.curve)throw new Error(\"Unable to get address for this node: Only secp256k1 is supported.\");return uv(Ck(this.publicKeyBytes))}get fingerprint(){return Cx(this.compressedPublicKeyBytes,mx(this.curve).compressedPublicKeyLength)}neuter(){return new lI({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve},uI(lI,sI,\"f\",cI))}async derive(e){return await async function({path:e,node:t}){if(0===e.length)throw new Error(\"Invalid HD tree derivation path: Deriving a path of length 0 is not defined.\");const n=t.depth+e.length;return dI(n),await iI({path:e,node:t,depth:n})}({path:e,node:this})}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function dI(e){if(!kx(e))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: \"${String(e)}\".`)}sI=lI,cI={value:Symbol(\"SLIP10Node.constructor\")};var fI,hI=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},pI=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class gI{constructor(e){fI.set(this,void 0),hI(this,fI,e,\"f\"),Object.freeze(this)}static async fromJSON(e){return gI.fromExtendedKey(e)}static async fromExtendedKey(e){if(\"string\"==typeof e){const t=Vx(e),{chainCode:n,depth:r,parentFingerprint:o,index:i}=t;if(t.version===Hx){const{privateKey:e}=t;return gI.fromExtendedKey({depth:r,parentFingerprint:o,index:i,privateKey:e,chainCode:n})}const{publicKey:a}=t;return gI.fromExtendedKey({depth:r,parentFingerprint:o,index:i,publicKey:a,chainCode:n})}const{privateKey:t,publicKey:n,chainCode:r,depth:o,parentFingerprint:i,index:a}=e;mI(o);const s=await lI.fromExtendedKey({privateKey:t,publicKey:n,chainCode:r,depth:o,parentFingerprint:i,index:a,curve:\"secp256k1\"});return new gI(s)}static async fromDerivationPath({derivationPath:e}){mI(e.length-1),yI(e,0);const t=await lI.fromDerivationPath({derivationPath:e,curve:\"secp256k1\"});return new gI(t)}get depth(){return pI(this,fI,\"f\").depth}get privateKeyBytes(){return pI(this,fI,\"f\").privateKeyBytes}get publicKeyBytes(){return pI(this,fI,\"f\").publicKeyBytes}get chainCodeBytes(){return pI(this,fI,\"f\").chainCodeBytes}get privateKey(){return pI(this,fI,\"f\").privateKey}get publicKey(){return pI(this,fI,\"f\").publicKey}get compressedPublicKey(){return pI(this,fI,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return pI(this,fI,\"f\").compressedPublicKeyBytes}get chainCode(){return pI(this,fI,\"f\").chainCode}get address(){return pI(this,fI,\"f\").address}get masterFingerprint(){return pI(this,fI,\"f\").masterFingerprint}get parentFingerprint(){return pI(this,fI,\"f\").parentFingerprint}get fingerprint(){return pI(this,fI,\"f\").fingerprint}get index(){return pI(this,fI,\"f\").index}get extendedKey(){const e={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes};return this.privateKeyBytes?Gx({...e,version:Hx,privateKey:this.privateKeyBytes}):Gx({...e,version:Wx,publicKey:this.publicKeyBytes})}get curve(){return pI(this,fI,\"f\").curve}neuter(){const e=pI(this,fI,\"f\").neuter();return new gI(e)}async derive(e){if(5===this.depth)throw new Error(\"Illegal operation: This HD tree node is already a leaf node.\");mI(this.depth+e.length),yI(e,this.depth+1);const t=await pI(this,fI,\"f\").derive(e);return new gI(t)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function mI(e){if(dI(e),e<0||e>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: \"${e}\"`)}function yI(e,t){e.forEach(((e,n)=>{const r=t+n;if(0!==r)switch($w(\"string\"==typeof e),r){case 1:if(e!==Ww)throw new Error(`Invalid derivation path: The \"purpose\" node (depth 1) must be the string \"${Ww}\".`);break;case 2:if(!Vw.test(e)||!Ax(e))throw new Error('Invalid derivation path: The \"coin_type\" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!Vw.test(e)||!Ax(e))throw new Error('Invalid derivation path: The \"account\" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!Vw.test(e))throw new Error('Invalid derivation path: The \"change\" node (depth 4) must be a BIP-32 node.');break;case 5:if(!Vw.test(e))throw new Error('Invalid derivation path: The \"address_index\" node (depth 5) must be a BIP-32 node.')}else if(!(e instanceof Uint8Array||Jw.test(e)))throw new Error('Invalid derivation path: The \"m\" / seed node (depth 0) must be a BIP-39 node.')}))}fI=new WeakMap;const wI=_e(ue(),/^(?:0x)?[0-9a-f]+$/iu);_e(ue(),/^0x[0-9a-f]+$/iu),_e(ue(),/^0x[0-9a-f]{40}$/u),_e(ue(),/^0x[0-9a-fA-F]{40}$/u);function vI(e){Xi(function(e){return G(e,wI)}(e),\"Value must be a hexadecimal string.\")}function bI(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}n(1048).hp;!function(){const e=[]}();function AI(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;vI(e);const t=bI(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<58?48:87),a=o-(o<58?48:87);r[e]=16*i+a}return r}async function SI({entropySource:e,path:t,curve:n}){return await snap.request({method:\"snap_getBip32Entropy\",params:{path:t,curve:n,...e?{source:e}:{}}})}async function EI({entropySource:e,derivationPath:t}){Zd.log({derivationPath:t},\"Generating solana wallet\"),H(t,Ef);const n=t.split(\"/\");try{const t=await SI({entropySource:e,path:n,curve:\"ed25519\"});if(!t.privateKey||!t.publicKey)throw new Error(\"Unable to derive private key\");return{privateKeyBytes:AI(t.privateKey),publicKeyBytes:AI(t.publicKey)}}catch(e){throw Zd.error({error:e},\"Error deriving keypair\"),new Error(e)}}async function xI({coinTypeNode:e,accountIndex:t}){const n=await e.derive([`slip10:${t}'`,\"slip10:0'\"]);if(!n.privateKeyBytes||!n.publicKeyBytes)throw new Error(\"Unable to derive private key\");return{privateKeyBytes:n.privateKeyBytes,publicKeyBytes:n.publicKeyBytes}}const kI=e=>JSON.parse(JSON.stringify(e),((e,t)=>t?\"undefined\"!==t.__type?\"BigNumber\"===t.__type?new Mi(t.value):\"bigint\"===t.__type?BigInt(t.value):\"Uint8Array\"===t.__type?Wc().encode(t.value):t:void 0:t)),II=e=>(0,Bf.cloneDeepWith)(e,(e=>void 0===e?{__type:\"undefined\"}:e instanceof Mi?{__type:\"BigNumber\",value:e.toString()}:\"bigint\"==typeof e?{__type:\"bigint\",value:e.toString()}:e instanceof Uint8Array?{__type:\"Uint8Array\",value:Wc().decode(e)}:void 0)),TI=\"send-form\",_I=\"confirm-sign-and-send-transaction\";async function CI(e,t){const n=II(t);return snap.request({method:\"snap_createInterface\",params:{ui:e,context:n}})}async function BI(e,t,n){const r=II(n);return snap.request({method:\"snap_updateInterface\",params:{id:e,ui:t,context:r}})}async function PI(e,t){return snap.request({method:\"snap_resolveInterface\",params:{id:e,value:t}})}async function RI(e){return snap.request({method:\"snap_dialog\",params:{id:e}})}async function NI(){return snap.request({method:\"snap_getPreferences\"})}async function OI(e){const t=await snap.request({method:\"snap_getInterfaceContext\",params:{id:e}});return t?kI(t):null}async function UI(){return await snap.request({method:\"snap_getClientStatus\"})}async function MI(e){try{return await snap.request({method:\"snap_startTrace\",params:{name:e}})}catch(e){return null}}async function zI(e){try{return await snap.request({method:\"snap_endTrace\",params:{name:e}})}catch(e){return null}}var LI,jI=function(e){return e.StartSendTransactionFlow=\"startSendTransactionFlow\",e.GetFeeForTransaction=\"getFeeForTransaction\",e}({}),FI=function(e){return e.ListWebSockets=\"listWebSockets\",e.ListSubscriptions=\"listSubscriptions\",e.TestOnStart=\"testOnStart\",e.TestOnInstall=\"testOnInstall\",e.TestOnUpdate=\"testOnUpdate\",e.SynchronizeAccounts=\"synchronizeAccounts\",e.SetAccountSelected=\"setAccountSelected\",e.ConfirmSend=\"confirmSend\",e.SignRewardsMessage=\"signRewardsMessage\",e}({});!function(e){e[e.Millisecond=1]=\"Millisecond\",e[e.Second=1e3]=\"Second\",e[e.Minute=6e4]=\"Minute\",e[e.Hour=36e5]=\"Hour\",e[e.Day=864e5]=\"Day\",e[e.Week=6048e5]=\"Week\",e[e.Year=31536e6]=\"Year\"}(LI=LI||(LI={}));const DI=[tf.Mainnet,tf.Devnet],$I={production:[tf.Mainnet],local:[tf.Mainnet],test:[tf.Localnet]},KI=xe(Y(df),ue(),(e=>e.split(\",\"))),qI=xe(Y(ue()),ue(),(e=>e.split(\",\"))),WI=ie({ENVIRONMENT:X([\"local\",\"test\",\"production\"]),RPC_URL_MAINNET_LIST:KI,RPC_URL_DEVNET_LIST:KI,RPC_URL_TESTNET_LIST:KI,RPC_URL_LOCALNET_LIST:qI,RPC_WEB_SOCKET_URL_MAINNET:df,RPC_WEB_SOCKET_URL_DEVNET:df,RPC_WEB_SOCKET_URL_TESTNET:df,RPC_WEB_SOCKET_URL_LOCALNET:df,EXPLORER_BASE_URL:df,PRICE_API_BASE_URL:df,TOKEN_API_BASE_URL:df,STATIC_API_BASE_URL:df,SECURITY_ALERTS_API_BASE_URL:df,NFT_API_BASE_URL:df,LOCAL_API_BASE_URL:ue()});class HI{#E;#x;constructor(){const e=this.#k();this.#E=this.#I(e),this.#x=[]}#k(){return V({ENVIRONMENT:\"production\",RPC_URL_MAINNET_LIST:\"https://solana-mainnet.infura.io/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_URL_DEVNET_LIST:\"https://solana-devnet.infura.io/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_URL_TESTNET_LIST:\"https://api.testnet.solana.com\",RPC_URL_LOCALNET_LIST:\"http://localhost:8899\",RPC_WEB_SOCKET_URL_MAINNET:\"wss://solana-mainnet.infura.io/ws/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_WEB_SOCKET_URL_DEVNET:\"wss://solana-devnet.infura.io/ws/v3/5b98a22672004ef1bf40a80123c5c48d\",RPC_WEB_SOCKET_URL_TESTNET:\"wss://api.testnet.solana.com\",RPC_WEB_SOCKET_URL_LOCALNET:\"wss://localhost:8899\",EXPLORER_BASE_URL:\"https://solscan.io\",PRICE_API_BASE_URL:\"https://price.api.cx.metamask.io\",TOKEN_API_BASE_URL:\"https://tokens.api.cx.metamask.io\",STATIC_API_BASE_URL:\"https://static.cx.metamask.io\",SECURITY_ALERTS_API_BASE_URL:\"https://security-alerts.api.cx.metamask.io\",LOCAL_API_BASE_URL:\"http://localhost:8899\",NFT_API_BASE_URL:\"https://nft.api.cx.metamask.io\"},WI)}#I(e){return{environment:e.ENVIRONMENT,networks:[{...cf[tf.Mainnet],rpcUrls:e.RPC_URL_MAINNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_MAINNET},{...cf[tf.Devnet],rpcUrls:e.RPC_URL_DEVNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_DEVNET},{...cf[tf.Testnet],rpcUrls:e.RPC_URL_TESTNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_TESTNET},{...cf[tf.Localnet],rpcUrls:e.RPC_URL_LOCALNET_LIST,webSocketUrl:e.RPC_WEB_SOCKET_URL_LOCALNET}],explorerBaseUrl:e.EXPLORER_BASE_URL,priceApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.PRICE_API_BASE_URL,chunkSize:50,cacheTtlsMilliseconds:{fiatExchangeRates:LI.Minute,spotPrices:LI.Minute,historicalPrices:LI.Minute}},tokenApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.TOKEN_API_BASE_URL,chunkSize:50},staticApi:{baseUrl:e.STATIC_API_BASE_URL},transactions:{storageLimit:10},securityAlertsApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.SECURITY_ALERTS_API_BASE_URL},nftApi:{baseUrl:\"test\"===e.ENVIRONMENT?e.LOCAL_API_BASE_URL:e.NFT_API_BASE_URL,cacheTtlsMilliseconds:{listAddressSolanaNfts:LI.Minute,getNftMetadata:LI.Minute}},subscriptions:{maxReconnectAttempts:5,reconnectDelayMilliseconds:LI.Second,closeConnectionsGracePeriodMilliseconds:5*LI.Minute}}}get(){return this.#E}getNetworkBy(e,t){const n=this.get().networks.find((n=>n[e]===t));if(!n)throw new Error(`Network ${e} not found`);return n}async getActiveNetworks(){if(this.#x.length>0)return this.#x;const e=(0,Bf.uniq)([tf.Mainnet,...$I[this.#E.environment]??[]]);try{const{clientVersion:t}=await UI(),n=t.includes(\"flask\")?[tf.Devnet]:[],r=(0,Bf.uniq)([...e,...n]);return this.#x=r,this.#x}catch(t){return e}}}const VI=(new HI).get(),GI=[\"local\",\"test\"].includes(VI.environment),ZI=GI?[\"http://localhost:3000\"]:[\"https://portfolio.metamask.io\"],JI=GI?new Set([Wn.ListAccounts,Wn.GetAccount,Wn.CreateAccount,Wn.FilterAccountChains,Wn.DeleteAccount,Wn.DiscoverAccounts,Wn.GetAccountBalances,Wn.SubmitRequest,Wn.ListAccountTransactions,Wn.ListAccountAssets,Wn.SetSelectedAccounts,jI.StartSendTransactionFlow,jI.GetFeeForTransaction,FI.ListWebSockets,FI.ListSubscriptions,FI.TestOnStart,FI.TestOnInstall,FI.TestOnUpdate,FI.SynchronizeAccounts,FI.SetAccountSelected,FI.ConfirmSend,FI.SignRewardsMessage]):new Set([]),YI=new Set([Wn.ListAccounts,Wn.GetAccount,Wn.CreateAccount,Wn.CreateAccounts,Wn.DeleteAccount,Wn.DiscoverAccounts,Wn.GetAccountBalances,Wn.SubmitRequest,Wn.ListAccountTransactions,Wn.ListAccountAssets,Wn.ResolveAccountAddress,Wn.SetSelectedAccounts,jI.StartSendTransactionFlow,jI.GetFeeForTransaction,Sy.SignAndSendTransactionWithoutConfirmation]),QI=new Map([]);for(const e of ZI)QI.set(e,JI);QI.set(\"metamask\",YI);const XI=(e,t)=>{if(!e)throw new Go(\"Origin not found\");if(!QI.get(e)?.has(t))throw new Go(\"Permission denied\")};function eT(e,t){try{H(e,t)}catch(e){throw new zo(e.message)}}function tT(e,t){try{H(e,t)}catch(e){throw new Ro(\"Invalid Response\")}}const nT=ie({...qt.schema,scope:wf,request:pw}),rT=ie({scopes:Te(Y(wf)),entropySource:ue(),groupIndex:Ie(oe(),0)}),oT=ou();function iT(e,t){return new Mi(e.toString()).div(10**t).toFixed()}function aT(e){return e.split(\"/\")[0]}function sT(e,t){return`${e}/token:${t}`}class cT{#i;#T;#_;#C;#B;#P;#R;#N;static cacheTtlsMilliseconds={tokenAccountsByOwner:5*LI.Second};constructor({connection:e,logger:t,configProvider:n,assetsRepository:r,tokenApiClient:o,tokenPricesService:i,cache:a,nftApiClient:s}){this.#i=Gd(t,\"[🪙 AssetsService]\"),this.#T=e,this.#_=n,this.#C=r,this.#P=o,this.#B=i,this.#R=a,this.#N=s}#O(e){return{nativeAssetTypes:e.filter((e=>e.endsWith(af.SOL))),tokenAssetTypes:e.filter((e=>e.includes(\"/token:\"))),nftAssetTypes:e.filter((e=>e.includes(\"/nft:\")))}}#U(e){const t={};for(const n of e){const{chain:{namespace:e,reference:r},assetNamespace:o,assetReference:i}=Ji(n);t[n]={name:\"Solana\",symbol:\"SOL\",fungible:!0,iconUrl:`${this.#_.get().staticApi.baseUrl}/api/v2/tokenIcons/assets/${e}/${r}/${o}/${i}.png`,units:[{name:\"Solana\",symbol:\"SOL\",decimals:9}]}}return t}async#M(e){const t=await this.#N.getNftsMetadata(e.map((e=>{const{assetReference:t}=Ji(e);return t}))),n={};return e.forEach(((e,r)=>{const o=t[r];if(!o)return;const i={name:o.name,symbol:o.name,imageUrl:o.imageUrl,description:o.description,fungible:!1,isPossibleSpam:!1,attributes:Object.fromEntries(o.attributes.map((e=>[e.key,e.value]))),collection:{name:o.collectionName,address:o.onchainCollectionAddress,symbol:o.collectionSymbol,tokenCount:o.collectionCount,creator:\"\",imageUrl:o.collectionImageUrl??\"\"}};n[e]=i})),n}async getAssetsMetadata(e){this.#i.log(\"Fetching metadata for assets\",e);const{nativeAssetTypes:t,tokenAssetTypes:n,nftAssetTypes:r}=this.#O(e),[o,i]=await Promise.all([this.#U(t),this.#P.getTokensMetadata(n)]);return{...o,...i}}async#z(e,t=[bh,Rp],n=[tf.Mainnet]){if(0===t.length||0===n.length)return[];const r=e.flatMap((e=>t.flatMap((t=>n.map((n=>({account:e,programId:t,scope:n}))))))),o=Yd(this.#L.bind(this),this.#R,{functionName:\"AssetsService:fetchTokenAccounts\",ttlMilliseconds:cT.cacheTtlsMilliseconds.tokenAccountsByOwner,generateCacheKey:(e,t)=>{const[n,r,o]=t;return`${e}:${n.id}:${r}:${o}`}});return(await Promise.allSettled(r.map((async({account:e,programId:t,scope:n})=>await o(e,t,n))))).flatMap((e=>\"fulfilled\"===e.status?e.value:[]))}async#L(e,t=bh,n=tf.Mainnet){return(await this.#T.getRpc(n).getTokenAccountsByOwner(nu(e.address),{programId:t},{encoding:\"jsonParsed\"}).send()).value.map((t=>({token:t,scope:n,assetType:sT(n,t.account.data.parsed.info.mint),keyringAccount:e})))}async fetch(e){const[t,n]=await Promise.all([this.#j(e),this.#z([e],[bh,Rp],await this.#_.getActiveNetworks())]),r=n.map((e=>e.assetType)),o=await this.#P.getTokensMetadata(r);return[...t,...n.filter((e=>e.assetType.includes(\"/token:\"))).map((e=>{const{assetType:t}=e,{decimals:n,amount:r,uiAmountString:i}=e.token.account.data.parsed.info.tokenAmount;return{assetType:t,keyringAccountId:e.keyringAccount.id,network:e.scope,mint:e.token.account.data.parsed.info.mint,pubkey:e.token.pubkey,symbol:o[t]?.symbol??\"UNKNOWN\",decimals:n,rawAmount:r,uiAmount:i??iT(r,n)}}))]}async getNativeAssetTypes(){return(await this.#_.getActiveNetworks()).map((e=>`${e}/${af.SOL}`))}async#j(e){const t=await this.getNativeAssetTypes(),n=nu(e.address),r=t.map((async t=>{const r=await this.#T.getRpc(aT(t)).getBalance(n).send();return{assetType:t,keyringAccountId:e.id,network:aT(t),address:n,symbol:\"SOL\",decimals:9,rawAmount:r.value.toString(),uiAmount:iT(r.value,9)}}));return(await Promise.allSettled(r)).flatMap((e=>\"fulfilled\"===e.status?e.value:[]))}async#F(e,t){const n=nu(e.address),r=await this.#N.listAddressSolanaNfts(n),o={};for(const e of t){const{assetReference:t}=Ji(e),n=r.find((e=>e.tokenAddress===t));n&&(o[e]={unit:n.nftToken.name,amount:n.balance.toString()})}return o}async fetchAssetsMarketData(e){this.#i.info(\"Fetching market data for assets\",e);return await this.#B.getMultipleTokensMarketData(e)}async save(e){await this.saveMany([e])}async saveMany(e){this.#i.info(\"Saving assets\",e);const t=e=>\"0\"===e.rawAmount||\"0\"===e.uiAmount;await this.getAll();await this.#C.saveMany(e);const n=e=>t(e)&&!(e=>e.assetType.includes(af.SOL))(e),r=e=>!n(e)&&!0,o=e.reduce(((e,t)=>({...e,[t.keyringAccountId]:{added:[...e[t.keyringAccountId]?.added??[],...r(t)?[t.assetType]:[]],removed:[...e[t.keyringAccountId]?.removed??[],...n(t)?[t.assetType]:[]]}})),{});Object.values(o).map((e=>e.added.length+e.removed.length)).every((e=>0===e))||await gi(snap,hr.AccountAssetListUpdated,{assets:o});const i=e.filter((()=>!0)).reduce(((e,t)=>({...e,[t.keyringAccountId]:{...e[t.keyringAccountId]??{},[t.assetType]:{unit:t.symbol,amount:t.uiAmount}}})),{});Object.values(i).map((e=>Object.keys(e).length)).some((e=>e>0))&&await gi(snap,hr.AccountBalancesUpdated,{balances:i})}static hasChanged(e,t){const n=t.find((t=>t.keyringAccountId===e.keyringAccountId&&t.assetType===e.assetType));if(!n)return!0;const r=n.rawAmount!==e.rawAmount,o=n.uiAmount!==e.uiAmount;return r||o}async getAll(){return this.#C.getAll()}async findByAccount(e){const{id:t,address:n}=e,r=await this.#C.findByKeyringAccountId(t),o=await this.getNativeAssetTypes(),i=[];for(const t of o){if(!r.some((e=>e.assetType===t))){const r=aT(t);i.push({assetType:t,keyringAccountId:e.id,network:r,address:n,symbol:\"SOL\",decimals:9,rawAmount:\"0\",uiAmount:\"0\"})}}return[...r,...i]}}const uT=sl(5000n);class lT{#D;constructor(e){this.#D=e}#$(){const e=this.#D.getComputeUnitLimit(),t=this.#D.getComputeUnitPriceMicroLamportsPerComputeUnit();return cl(e,(e=>Mi(e)),(e=>e.multipliedBy(t.toString())),(e=>e.dividedToIntegerBy(Qd.toString())),(e=>e.toString()),BigInt,sl)}getFee(){const e=this.#$();return sl(uT+e)}}const dT=\"Sending to this address may result in permanent loss of funds.\";class fT extends Error{constructor(e,t){super(e,t),this.name=\"RecipientClassificationError\"}}class hT extends fT{constructor(){super(`Cannot send to this address. This appears to be a mint account, program data account, metadata account, or PDA. ${dT} Only wallet addresses and token accounts are supported.`),this.name=\"RecipientUnsupportedError\"}}class pT extends fT{constructor(){super(`Cannot send to this address. This is a token account for a different token than the one you're trying to send. ${dT}`),this.name=\"RecipientTokenAccountMintMismatchError\"}}class gT{#K;#q;#T;#i;#W=4e4;#H=10000n;constructor(e,t,n,r){this.#K=e,this.#q=t,this.#T=n,this.#i=Gd(r,\"[📩 SendSplTokenBuilder]\")}async buildTransactionMessage(e){this.#i.log(\"Build transfer SPL token transaction message\");const{from:{entropySource:t,derivationPath:n},to:r,mint:o,amount:i,network:a}=e;Xi(o,\"Mint is required\");const s=await this.#q.classify(r,a);if(\"UNSUPPORTED\"===s.type)throw new hT;const[c,u,{privateKeyBytes:l},d]=await Promise.all([this.#T.fetchMint(o,a),this.#K.uiAmountToAmountForMint(o,a,i.toString()),EI({entropySource:t,derivationPath:n}),this.#T.getLatestBlockhash(a)]),{programAddress:f,data:{decimals:h}}=c,p=await pd(l),g=await gT.deriveAssociatedTokenAccountAddress({mint:o,owner:p.address,tokenProgram:f}),m=[],y=f===Rp,w=y?ig:jh,v=y?um:ip;switch(s.type){case\"SYSTEM\":{const e=await gT.deriveAssociatedTokenAccountAddress({mint:o,owner:r,tokenProgram:f});m.push(w({mint:o,payer:p,tokenProgram:f,owner:r,ata:e})),m.push(v({source:g,mint:o,destination:e,authority:p,amount:u,decimals:h}));break}case\"TOKEN_ACCOUNT\":if(s.mint!==o)throw new pT;m.push(v({source:g,mint:o,destination:r,authority:p,amount:u,decimals:h}));break;default:throw new hT}const b=cl(Ll({version:0}),(e=>Wl(p.address,e)),(e=>ll(d,e)),(e=>Vl(m,e)));return Gl([Xf({units:this.#W}),rh({microLamports:this.#H})],b)}static async deriveAssociatedTokenAccountAddress({mint:e,owner:t,tokenProgram:n}){return(await Uh({mint:e,owner:t,tokenProgram:n}))[0]}getComputeUnitLimit(){return this.#W}getComputeUnitPriceMicroLamportsPerComputeUnit(){return this.#H}}class mT{#T;#i;static defaultComputeUnitPriceInMicroLamportsPerComputeUnit=10000n;constructor(e,t){this.#T=e,this.#i=Gd(t,\"[🖋️ Signer]\")}async partiallySignBase64String(e,t,n,r){this.#i.log(\"Partially sign base64 string\",{base64String:e,account:t,network:n,config:r});const o=this.#T.getRpc(n),i=await Hm(e,o,r);if(\"instructions\"in i)return this.#V(i,t,n);if(Object.values(i.signatures).every((e=>!e))){const{messageBytes:e}=i,a=await Km(e,o,r);return this.#V(a,t,n)}return this.#G(i,t)}async#V(e,t,n){const r=ul(e)?e.lifetimeConstraint:await this.#T.getLatestBlockhash(n),o=uy(e),i=mT.defaultComputeUnitPriceInMicroLamportsPerComputeUnit,a=!dy(e)||!o,{privateKeyBytes:s}=await EI({entropySource:t.entropySource,derivationPath:t.derivationPath}),c=await pd(s),u=await cl(e,(e=>sy(c.address,e)),(e=>{return t=r,ul(n=e)?n:ll(t,n);var t,n}),(e=>((e,t,n)=>uy(e)?e:Gl([rh(t,n)],e))(e,{microLamports:i})),(async e=>a?fy(e,this.#T.getRpc(n)):e)),l=fd([c],u);return await md(l)}async#G(e,t){const{privateKeyBytes:n}=await EI({entropySource:t.entropySource,derivationPath:t.derivationPath});return nd([await Eu(n)],e)}}const yT=(e,t)=>{const{to:n,type:r,status:o}=e,{address:i}=t;if(!(r===Zt.Receive||o===Gt.Failed))return!1;const{hasReceivedSOL:a,receivedSOLAmount:s}=n.reduce(((e,t)=>t.address!==i||!t.asset?.fungible||t.asset.type!==nf.SolMainnet&&t.asset.type!==nf.SolDevnet?e:{hasReceivedSOL:!0,receivedSOLAmount:e.receivedSOLAmount.plus(t.asset.amount)}),{hasReceivedSOL:!1,receivedSOLAmount:new Mi(0)});return a&&s.isLessThan(.001)};function wT(e,t){return[yT].some((n=>n(e,t)))}class vT{#Z;#J;#Y;#Q;#X;#K;#_;#i;#ee=[bh,Rp];constructor(e,t,n,r,o,i,a,s){this.#Z=e,this.#J=t,this.#Y=n,this.#Q=r,this.#X=o,this.#K=i,this.#_=a,this.#i=Gd(s,\"[🗝️ KeyringAccountMonitor]\"),this.#te()}#te(){this.#i.info(\"Binding handlers\"),DI.forEach((e=>{this.#Z.registerNotificationHandler(\"accountSubscribe\",e,this.#ne.bind(this)),this.#Z.registerNotificationHandler(\"programSubscribe\",e,this.#re.bind(this))})),DI.forEach((e=>{this.#Z.registerConnectionRecoveryHandler(e,this.#oe.bind(this))}))}async setMonitoredAccounts(e){this.#i.info(\"Setting monitored accounts\",e);const[t,n,r]=await Promise.all([this.#J.getAll(),this.#Z.getAll(),this.#_.getActiveNetworks()]),o=t.filter((e=>n.some((t=>e.address===(0,Bf.get)(t,\"params[0]\")||e.address===(0,Bf.get)(t,\"params[1].filters[0].memcmp.bytes\"))))),i=o.filter((t=>!e.includes(t.id))),a=t.filter((t=>e.includes(t.id))).filter((e=>!o.includes(e)));await Promise.allSettled([this.#ie(i,n),this.#ae(a,r)])}async#ae(e,t){try{this.#i.log(\"Monitoring keyring accounts\",e);const n=this.#X.synchronize(e),r=e.flatMap((e=>{const n=t=>e.scopes.includes(t);return[...t.filter(n).map((async t=>this.#se(e,t))),...t.filter(n).map((async t=>{await Promise.all(this.#ee.map((async n=>this.#ce(e,n,t))))}))]}));await Promise.allSettled([...r,n])}catch(e){throw this.#i.error(\"Error monitoring keyring account\",e),e}}async#ie(e,t){this.#i.log(\"Stopping to monitor accounts\",e);const n=e.map((e=>e.address)),r=t.filter((e=>vT.#ue(e)||vT.#le(e))).filter((e=>n.includes(vT.#de(e))));await Promise.allSettled(r.map((async e=>this.#Z.unsubscribe(e.id))))}async#se(e,t){this.#i.log(\"Monitoring native asset balance\",{account:e,network:t});const{address:n}=e;await this.#Z.subscribe({method:\"accountSubscribe\",network:t,params:[n,{commitment:\"confirmed\",encoding:\"jsonParsed\"}]})}async#ce(e,t,n){this.#i.log(\"Monitoring token program by owner\",{account:e,tokenProgramAddress:t,network:n});const{address:r}=e;await this.#Z.subscribe({method:\"programSubscribe\",network:n,params:[t,{commitment:\"confirmed\",encoding:\"jsonParsed\",filters:[{memcmp:{offset:32,bytes:r,encoding:\"base58\"}}]}]})}async#ne(e,t){this.#i.info(\"Account notification received\",{notification:e,subscription:t});const{network:n}=t,r=(0,Bf.get)(t,\"params[0]\");H(r,ue());const o=await this.#J.findByAddress(r);if(!o)throw new Error(`No keyring account found for address: ${r}`);const{lamports:i}=e.params.result.value;H(i,oe());await Promise.all([this.#Y.save({assetType:`${n}/${af.SOL}`,keyringAccountId:o.id,network:n,address:r,symbol:\"SOL\",decimals:9,rawAmount:i.toString(),uiAmount:iT(i,9)}),this.#fe(o,n,r)])}async#re(e,t){this.#i.info(\"Handling program notification\",{notification:e,subscription:t});const{network:n}=t,r=(0,Bf.get)(t,\"params[0]\");if(H(r,ue()),r!==bh&&r!==Rp)throw new Error(`Program not supported: ${r}`);const{owner:o}=e.params.result.value.account.data.parsed.info;H(o,ue());const{mint:i}=e.params.result.value.account.data.parsed.info;H(i,ue());const{amount:a,decimals:s,uiAmountString:c}=e.params.result.value.account.data.parsed.info.tokenAmount;H(a,ue()),H(s,oe()),H(c,ue());const{pubkey:u}=e.params.result.value;H(u,ue());const l=sT(n,i),d=await this.#J.findByAddress(o);if(!d)throw new Error(`No keyring account found with address: ${o}`);const f=await this.#K.amountToUiAmountForMint(i,n,sl(BigInt(a))).catch((e=>(this.#i.error(\"Error converting amount to uiAmount\",e),c))),h=(await this.#Y.getAssetsMetadata([l]))[l];await Promise.all([this.#Y.save({assetType:l,keyringAccountId:d.id,network:n,mint:i,pubkey:u,symbol:h?.symbol??\"UNKNOWN\",decimals:s,rawAmount:a,uiAmount:f}),this.#fe(d,n,u)])}async#fe(e,t,n){const r=(await this.#Q.fetchLatestSignatures(t,nu(n),{limit:1}))?.[0];if(!r)throw new Error(\"No signature found\");const o=await this.#Q.fetchBySignature(r,e,t);if(!o)throw new Error(\"No transaction found\");wT(o,e)?this.#i.info(`Transaction ${r} is spam. Skipping.`):await this.#Q.save(o)}async#oe(e){this.#i.info(\"Handling connection recovery\",{network:e});const[t,n]=await Promise.all([this.#J.getAll(),this.#Z.getAll()]),r=n.filter((e=>vT.#ue(e)||vT.#le(e))),o=(0,Bf.uniq)(r.map((e=>vT.#de(e)))),i=t.filter((e=>o.includes(e.address)));i.length?await this.#X.synchronize(i):this.#i.info(\"No monitored accounts found. Skipping connection recovery.\")}static#ue(e){return\"accountSubscribe\"===e.method}static#le(e){return\"programSubscribe\"===e.method}static#de(e){if(this.#ue(e))return(0,Bf.get)(e,\"params[0]\");if(this.#le(e))return(0,Bf.get)(e,\"params[1].filters[0].memcmp.bytes\");throw new Error(\"Invalid subscription\")}}class bT{#he;#pe;#ge;#i;#me=new Map;constructor(e,t,n,r){this.#he=e,this.#pe=t,this.#ge=n,this.#i=Gd(r,\"[🔔 SubscriptionService]\"),this.#te()}#te(){this.#ge.on(\"onInactive\",this.#ye.bind(this)),this.#ge.on(\"onWebSocketEvent\",this.#we.bind(this)),this.#ge.on(\"onListSubscriptions\",this.#ve.bind(this)),DI.forEach((e=>{this.#he.onConnectionRecovery(e,this.#be.bind(this))}))}registerNotificationHandler(e,t,n){this.#i.info(\"Registering notification handler\",{network:t,method:e,handler:n});const r=`${e}:${t}`;this.#me.has(r)||this.#me.set(r,new Set),this.#me.get(r).add(n)}registerConnectionRecoveryHandler(e,t){this.#he.onConnectionRecovery(e,t)}async subscribe(e){this.#i.info(\"New subscription request\",e);const{method:t,params:n,network:r,expiryMilliseconds:o}=e,i=await this.#Ae(e),a=await this.#pe.getById(i);if(a){if(\"confirmed\"===a.status)return i;await this.#pe.delete(i)}const s={...e,id:i,status:\"pending\",requestId:i,createdAt:(new Date).toISOString(),...o?{expiresAt:new Date(Date.now()+o).toISOString()}:{}};await this.#pe.save(s);const c=await this.#he.findByNetwork(r),u=async e=>{const r={jsonrpc:\"2.0\",id:i,method:t,params:n};e&&await this.#Se(e,r)};return c&&await u(c.id),s.id}async unsubscribe(e){this.#i.info(\"Unsubscribing from\",e);const t=await this.#pe.getById(e);if(!t)return void this.#i.warn(`Subscription not found: ${e}`);const{id:n,network:r,method:o}=t,i=iy[o];if(await this.#pe.delete(n),\"confirmed\"===t.status){const e=await this.#he.findByNetwork(r);e&&await this.#Se(e.id,{jsonrpc:\"2.0\",id:globalThis.crypto.randomUUID(),method:i,params:[t.rpcSubscriptionId]})}}async getAll(){return this.#pe.getAll()}async#we(e){if(\"message\"!==e.type)return;const t=(e=>{const{data:t}=e;let n;if(t&&\"object\"==typeof t&&\"type\"in t)if(\"text\"===t.type)n=\"string\"==typeof t.message?JSON.parse(t.message):t.message;else{if(\"binary\"!==t.type)throw new Error(\"Unknown message data\");{const e=t.message,r=String.fromCharCode(...e);n=JSON.parse(r)}}else n=\"string\"==typeof t?JSON.parse(t):t;return n})(e),n=await this.#he.findById(e.id);if(n)switch(this.#i.info(\"Received message\",e),t.method){case\"accountNotification\":case\"programNotification\":case\"signatureNotification\":await this.#Ee(t,n.network);break;default:this.#xe(t)?await this.#ke(t):this.#Ie(t)?await this.#Te(t):Ly(t)?await this.#_e(t):this.#i.warn(\"Received unknown message\",t)}}async#Ee(e,t){const{subscription:n}=e.params,r=await this.#pe.findBy(\"rpcSubscriptionId\",n);if(!r)return void this.#i.warn(\"No subscription found for RPC ID:\",n);const o=`${r.method}:${t}`,i=this.#me.get(o);if(i&&i.size>0){(await Promise.allSettled(Array.from(i).map((async t=>t(e,r))))).forEach((e=>{\"rejected\"===e.status&&this.#i.error(`Handler failed for ${r.method}:`,e.reason)}))}}async#Se(e,t){this.#i.info(`Sending message to connection ${e}`,t),await snap.request({method:\"snap_sendWebSocketMessage\",params:{id:e,message:JSON.stringify(t)}})}#xe(e){return\"jsonrpc\"in e&&\"2.0\"===e.jsonrpc&&\"id\"in e&&\"result\"in e&&\"number\"==typeof e.result}#Ie(e){return\"jsonrpc\"in e&&\"id\"in e&&\"result\"in e&&!0===e.result}async#ke(e){const{id:t,result:n}=e,r=await this.#pe.getById(String(t));r?(await this.#pe.update({...r,status:\"confirmed\",rpcSubscriptionId:n,confirmedAt:(new Date).toISOString()}),this.#i.info(`Subscription confirmed: request ID: ${t} -> RPC ID: ${n}`)):this.#i.warn(`Received subscription confirmation, but no matching pending subscription found for subscription ID: ${t}.`)}async#Te(e){this.#i.info(\"Received unsubscription confirmation\",e)}async#_e(e){if(\"id\"in e&&void 0!==e.id){const t=await this.#pe.getById(String(e.id));\"pending\"===t?.status?(await this.#pe.delete(t.id),this.#i.error(`Subscription establishment failed for ${t.id}:`,e.error)):this.#i.error(`Received error for request ID: ${e.id}`,e.error)}else this.#i.error(\"Connection-level error:\",e.error)}async#Ae(e){const t={method:e.method,params:e.params,network:e.network,metadata:e.metadata??null},n=this.#Ce(t),r=(new TextEncoder).encode(n),o=await globalThis.crypto.subtle.digest(\"SHA-256\",r),i=Array.from(new Uint8Array(o)).map((e=>e.toString(16).padStart(2,\"0\"))).join(\"\");return i}#Ce(e){if(null==e)return JSON.stringify(e);if(\"object\"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map((e=>this.#Ce(e))).join(\",\")}]`;const t=Object.keys(e).sort(((e,t)=>e.localeCompare(t)));return`{${t.map((t=>`\"${t}\":${this.#Ce(e[t])}`)).join(\",\")}}`}async#ve(){const e=await this.#pe.getAll();this.#i.info(\"Subscriptions\",{subscriptions:e,notificationHandlers:this.#me})}#Be(e){return{method:e.method,params:e.params,network:e.network,...e.expiryMilliseconds?{expiryMilliseconds:e.expiryMilliseconds}:{},...e.metadata?{metadata:e.metadata}:{}}}async#be(e){this.#i.info(`Re-subscribing to all subscriptions for network ${e}`);const t=(await this.#pe.getAll()).filter((t=>t.network===e)).filter(bT.#Pe),n=t.map((e=>e.id));await this.#pe.deleteMany(n),await Promise.allSettled(t.map((async e=>{await this.subscribe(this.#Be(e))})))}async#ye(){this.#i.info(\"Client became inactive\"),await this.#Re()}async#Re(){this.#i.info(\"Removing expired subscriptions\");const e=(await this.#pe.getAll()).filter(bT.#Ne);await Promise.allSettled(e.map((async e=>{await this.unsubscribe(e.id)})))}static#Ne(e){const t=new Date;return Boolean(e.expiresAt&&new Date(e.expiresAt)<t)}static#Pe(e){return!bT.#Ne(e)}}function AT(e,t,n){if(\"string\"==typeof e)throw new Error(`An HTML element (\"${String(e)}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error(\"A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.\");return e({...t,key:n})}function ST(e,t,n){return AT(e,t,n)}const ET='<svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\"><image width=\"16\" height=\"16\" href=\"data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUFBQUFBQUGBgUICAcICAsKCQkKCxEMDQwNDBEaEBMQEBMQGhcbFhUWGxcpIBwcICkvJyUnLzkzMzlHREddXX0BBQUFBQUFBQYGBQgIBwgICwoJCQoLEQwNDA0MERoQExAQExAaFxsWFRYbFykgHBwgKS8nJScvOTMzOUdER11dff/CABEIAPoA+gMBIgACEQEDEQH/xAA1AAEAAwEBAQEBAAAAAAAAAAAAAQIHBggEBQMBAQADAQEBAQAAAAAAAAAAAAACAwQBBQYH/9oADAMBAAIQAxAAAADxkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx204cU3mdnnYLG+IQwNvsxhgLfrRh5/egLRh59egkYefXoRCPn6mv5BH2ajuwAAAACZdFZz6/SvzfofWfLWtS2jw7WpNGO01mjJaas+P+k0tRjtNbUY38Leccnq/DxFq5f2ao7cAAAAB+36W8/9p7+DZZxp6nl7LOM3qzbLOMqs2zzjF6suyzjNqqNlnGrU5NkY7zlHP75Wjzv0mg5pAAAAAAs6jqdsMuajacMsam5HLGqORytqkxjlTVbc5lLVpjDKGsfhQlwdb1p3QAAAAAADofSXk7q/cp9MT8n0/cebe1Jpx2tS2fJNqTRkvNLUY7TWaMdqXZ8vnHPvZHmrw/u+JTGL6EAAAAABMDuvQvkLQfo6PQU55P0WLRJztTl0Sc7U5tFnOppzaOzmacujTnSrLo3x8NNFOM8zsuM+H99Aq2AAAAAATMfpWPznbNXOJdqjHi47Wec4l2jnOLdo5zi57JFxrsp5HjadRy9d0CMgAAAAJPqm+j0X8fW/oV82rPvUWRNGObUmjHe1LUZLIUY7TDPk/opk2CP5uPy+U+1qKrwAAAAPo3zPdc+23fu2/BfYXdA/AmjL+/bn1GToZ55Tl6KedmjJ0c87anL0LnuZyUTgH9fm+Q9+Bk0AAAAAAWVdWVFlRZUWVFpo4uoLxV0HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//EAEEQAAECAwQHBAgDBgcBAAAAAAECBAADBgURF1UQMUFRkpPSEiFSohYgIjBAYaPiBzLBEyRUYnCRFBVDRYGhstH/2gAIAQEAAT8A/qXdF0XRd8ou9a4R3aOz8AO+KUo95Uc1SyoyGcs+3OIvvPhQDrMYUWPmbzhRGFFj5m74URhRY2Zu+FEYT2NmbvhRGE1jZm84URhNY2ZvOFEYTWNmjzhRGEti5o84URhLYuaPP7IjCWxc0ecKIwksXM3nCiMJLFzN5wojCSxczd/2RGEliZm8/siKt/DthYNkTLRbWlNUqWtIKJwA7Xa8JHwFK0w6qN6EJvQ1lkGfO2AeEb1HZDRq2YNpLVrJTLkyk9lCAO4D9TtJ2nQIv0C/QDAOgGL9Lp22Yt5rl1NTLky03rWrUB+p+W2KyqubUr72SpDOSSJEonzKHiPv6dsB7UT1LduLkJuM2afyy0bzvO4RZdmtbIZSGTRHZlS069qlbVK3k6AYGkQDA0DQDonTpTaVMnTpqUSkJKlrUbkhI1kmK3rJdQuRIaKUiz5BPYB7jMV41CD3++sWx3ltv5LNqm9au9Sj+VCRrUo7hFg2IzsBhLZthftmzCO+Yvao7vkNA0AxfA0A6RAMCCpKUqJUAALySbgBFeVsLXUuzbPWQxQr25m2coH/AMiFa/f0rVK6ZmO1hkiemehIIKuwoFBvFyrjGLByIc89MYsnIxz/ALIxZORjn/ZGLJyMc89MYspyP6/2xi0nIvr/AGxi2nI/r/bGLYyL6/2xi5LyM8/7Yxbl5Gef9sYuSsjPPHTGLkrI1c8dMYuSMjXzh0xi63yRfOHTFR/iO9tpktk1bBpJWLpp7fbWtPh1CCTBJPwN3udfqk6vgKcph7Ui3KW02VKEhIK1zL9atQFwJjCu1szZ+fpjCy18zZ+fpjCu1syZefpjCu1syZefpjCq18yZ+fpjCq18yZ+fpjCm18zZ+fpjCi1s0Z+fpjCe1szZ+fpjCe1s0Z+fpjCa180Z+fpjCa1szZ+fpjCa1szZefpjCW1s0Zefpi36Etan2gdrVKcSAblqlX+wTvBAMKB7ou9/T9vPKffJctriki6bLP5Vo3H9DFl2m1tdlIetV9qXMGralW1KtxGgGAYvgQDoBi+L9A0TZUtxKmSp0tK5cwFK0K7wUnWCIrWjlU+4DltethOPsE95lK8CjB+ApipnVPPAtN62yyBPk7FDeNyhsMNHbZ+2kum04TJMxPaSobR+hG0bIEXwDpB0AwIHqO2rZ+2nNXMlM2TMR2VoVqI/Q7jsisKWn049ISVTGc4kyJvy1lCvmII9+DdFH1VNsB0JThalMJyh+1RrKD40jeIkzpLiVLnSZqZkqYkKQtJvSUnUQdAOi+BF+gHQNA0WjZzO1Wc5m8lCZKmC4jaDsUk7FDYYqWnHtOv1t56SqUq8yJwHctH/ANG2B78G4xR1ZKsLttXiVzGSzeAk3mUraUg6wdojEum9zzkp64xMprc85KeuMTKa8Lzkp64xMprwvOSnrjE2mvC85KeuMTaa8LzlJ64xNprwveSnrjE6mvC95KeuMT6Z3POSnrjE+mdzzlJ6oxOpnc85Q6oxPpjc85SeqMT6YOx5yU9cYn0xue8lPXFY1tYFuWKtk1kT1zzNQpCpqAkIuPeoHtHX8APWv9S+L4vGjVo/4+Bs6zHtquA3ZN1TphBNydgG0k9wEYfVR/Ao5qIw9qj+BRzURh/VWXDmojD6qsuHNRGH1VZcOaiMPqqy4c1EYf1Xlf1ZfVGH9WZX9VHVGH1WZX9WX1Rh9VeWfVl9UYf1blJ5qOqMP6tyo81HVGH1W5T9VHVGH1XZSeajqi0qSt+yGxdPrPXLkhQSV9pKgCd/ZJ+As6z3dpu5LVrKMybMNwA/7JOwDaYpun29PMBIRcufMuLib41bh/KNnq3iL4ECO6Bd6m0d0fiBWMp6ldj2esKkBX7xOGpage5Cd6RtPvhDRrPeOJTeRKVMnTFBKEDWSYpSmJNPNSVkLezUj9rM2Aa+wn5DadI9QQDovgQNAivK2S2TPsezZl80jsOZwP5AdaE/PeYJJ99KlrmrQhAJWSAABeSdwikaTRYklLp0Ap/MRcdolJOwfPeY1QDov0iBoBi+AdNb1l/k6FWcwX+/LR7ax/oAjZ/OYUpSiSSSSbyT3kn39BubFZv5860ZqJc5KB/h1zPyJO0/JW6PSanh/vTXjj0mp7OmvHAqens6a8celFO501449Kacztrxx6U05nbXjj0ppzPGnHHpTTeeNOOPSqnM8accelVN54044FVU3njTjj0rprPWnHAqums8accelVNZ4044qav7PYNDLsp0hy7mC4LR3oljxE7VbhE+dNcTVzpswrmLUVKUokqJOsknWfgAbovMXnfF/wAzHai+L4vMdo747R3x2jvgKO+O18zHa+cXnfBJ/rX/AP/EADQRAAEDAQUFBAkFAAAAAAAAAAIAAQQDBRIUU5IREzBCVBUjMkMGICExM0RQUqIQImFyof/aAAgBAgEBPwD6pTpnVK6A3iT2fJ+z/U8GQ3InhyG5FhqzcqehUbkW7qfYnE25eBTA6piADeIlCgNFD2/ELxIhRCiFEKIUQqq93gWXXs+NT3lQu+/qitWC/m/i6e04b+annxcxFOi5iKZGfmRSo78yORS2ftJETk+1+BRgTK4bylQMhT2XO6U12ZOb5c12dMyDTwJWQawUnKNYORlIo9YG2vS4NkWoUM92fwS/H+UziY3hRCiFEKIUQog2+9S4z0ivD4eDY9rYd9xXLu+UvtRWlA6oEVowepBFPhZ4IpsPPBFMiZ4IpUbNBHXjG2x6oKsICbsBXh4AAVQhAAvES7Om9Kel1gJnSnpdYGY3y56Vg5TeQelYSVkHpWGkZJ6Vh6+UaISF9hD64iREIj73Vh2Jg6bSKw98X4ohRCiFEKIUQqVWCPTvEq1YqxuRev6Nw4Aji5MgN5yARN7EU6D1YamRTYXVBqZFMh9QGpkUqJ1AamRSonUBqZFJi54amVaXGpgRb0FKlHKqXn8PLwNqvOrzra6vP+u36t//xAA2EQABBAEBAwkECwEAAAAAAAACAAEDBAWiEjFDBhETFDAyQkRSICFBkhYjM1BTVGBhcrHB0f/aAAgBAwEBPwD70llCGMpJC2RT5jHtxtLp85jm42l0/KDFtvsaXT8pMS3mdLp+U+HbzOl0/KvCN5vS6+l+Cbfb0uqOQq5KBp6x7Ufd7rt/ftkTA3O+5ZC0dk9lvsxRgjBGCMEYI41hMBLl7PpgDvn/AIq1aGpBHBCGzGDcw+3binmbZDuosbYfwo8VbfhosNdfhamR4PIPwtTIsBkX4GpkfJzKPug1MoOSuSmmAZI+jDxntMqVOvQrhBCGyI6v3fsHkAX95J7ELeNPbr/GVddqNxl1+m3HBPk6Db7QJ8tjvjaBRZOhNIMYWgci7GWPbZHGjBGCMFJGjBOxCTEKwmYG4HQTF9cOrsZYtv3sjryP4UdSV+EjpWH4SPH2X3QGjxlx+AaPE338qaHFZSIwOOuYkKoS2ZawPZi6OT4/97F3ZOYN4l0sbeNl08P4oJ7EDcUF1mv+YD5l1uq3mA+ZkMkcjc4GxD2DROze9GCMFICMEYIwVelJbl2B3KtWjqxDFHub260cXNtmYI3i9aNg9aMWRx86OE/Qjry+hdSnM+ZgVatHWjYQb+X6F//Z\" /></svg>';function xT(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function kT(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:xT(r),key:n}}}const IT=kT(\"Container\"),TT=kT(\"Box\"),_T=kT(\"Heading\"),CT=kT(\"Text\"),BT=kT(\"Section\"),PT=kT(\"Row\"),RT=kT(\"Address\"),NT=kT(\"Image\"),OT=kT(\"Footer\"),UT=kT(\"Button\"),MT=kT(\"Link\");function zT(e,t,n){const{cluster:r}=cf[e];return Cf({baseUrl:\"https://solscan.io\",path:`/${t}/${n}`,queryParams:r?{cluster:r}:void 0})}const LT=({domain:e,scope:t,address:n})=>AT(TT,{direction:\"horizontal\",alignment:\"center\",children:AT(MT,{href:zT(t,\"address\",n),children:e})});function jT(e,t){return`${e}:${t}`}const FT=JSON.parse('{\"D\":{\"send.title\":{\"message\":\"Send\"},\"send.balance\":{\"message\":\"Balance\"},\"send.maxButton\":{\"message\":\"Max\"},\"send.cancelButton\":{\"message\":\"Cancel\"},\"send.continueButton\":{\"message\":\"Continue\"},\"send.fromField\":{\"message\":\"From\"},\"send.toField\":{\"message\":\"To\"},\"send.amountField\":{\"message\":\"Amount\"},\"send.assetField\":{\"message\":\"Token\"},\"send.toPlaceholder\":{\"message\":\"Enter public address or domain name\"},\"send.fromRequiredError\":{\"message\":\"Account is required\"},\"send.amountRequiredError\":{\"message\":\"Amount is required\"},\"send.amountGreatherThanMinimumBalanceForRentExemptionError\":{\"message\":\"Amount must be greater than {minimumValue}\"},\"send.insuffientSolToCoverFee\":{\"message\":\"Insufficient SOL balance to cover the transaction fee\"},\"send.toRequiredError\":{\"message\":\"To address is required\"},\"send.toInvalidError\":{\"message\":\"Invalid Solana address or domain name\"},\"send.toInvalidErrorDomain\":{\"message\":\"Unable to resolve domain name\"},\"send.toDomainResolutionStatus.initial\":{\"message\":\"Domain\"},\"send.toDomainResolutionStatus.fetching\":{\"message\":\"Resolving domain name...\"},\"send.toDomainResolutionStatus.fetched\":{\"message\":\"Domain name resolved.\"},\"send.toDomainResolutionStatus.error\":{\"message\":\"Unable to resolve domain name.\"},\"send.insufficientBalance\":{\"message\":\"Insufficient balance\"},\"send.simulationTitleAPIError\":{\"message\":\"Because of an error, we couldn\\'t check for security alerts.\"},\"send.simulationMessageAPIError\":{\"message\":\"Only continue if you trust every address involved.\"},\"send.simulationTitleError\":{\"message\":\"Transaction simulation failed\"},\"send.simulationMessageError\":{\"message\":\"This transaction was reverted during simulation.\"},\"send.selectedTokenPriceNotAvailable\":{\"message\":\"Prices for tokens in {currency} are currently not available. You are still able to send tokens.\"},\"send.confirmation.title\":{\"message\":\"Review\"},\"send.confirmation.from\":{\"message\":\"From\"},\"send.confirmation.recipient\":{\"message\":\"Recipient\"},\"send.confirmation.network\":{\"message\":\"Network\"},\"send.confirmation.transactionSpeed\":{\"message\":\"Transaction speed\"},\"send.confirmation.fee\":{\"message\":\"Network fee\"},\"send.confirmation.sendButton\":{\"message\":\"Send\"},\"send.confirmation.cancelButton\":{\"message\":\"Cancel\"},\"send.confirmation.viewTransaction\":{\"message\":\"View transaction\"},\"send.send-pending.title\":{\"message\":\"Sending...\"},\"send.send-pending.subtitle\":{\"message\":\"Your transaction was submitted.\"},\"send.transaction-success.title\":{\"message\":\"Sent\"},\"send.transaction-success.subtitle\":{\"message\":\"{amount} {tokenSymbol} was successfully sent\"},\"send.transaction-failure.title\":{\"message\":\"Transaction failed\"},\"send.transaction-failure.subtitle\":{\"message\":\"Unable to send {amount} {tokenSymbol}\"},\"confirmation.account\":{\"message\":\"Account\"},\"confirmation.recipient\":{\"message\":\"Recipient\"},\"confirmation.network\":{\"message\":\"Network\"},\"confirmation.estimatedChanges\":{\"message\":\"Estimated changes\"},\"confirmation.estimatedChanges.send\":{\"message\":\"You send\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"You receive\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"Not available\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"No changes\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"},\"confirmation.advanced.show\":{\"message\":\"Show advanced\"},\"confirmation.advanced.hide\":{\"message\":\"Hide advanced\"},\"confirmation.cancelButton\":{\"message\":\"Cancel\"},\"confirmation.confirmButton\":{\"message\":\"Confirm\"},\"confirmation.signAndSendTransaction.title\":{\"message\":\"Transaction request\"},\"confirmation.signTransaction.title\":{\"message\":\"Signing request\"},\"confirmation.sendAndConfirmTransaction.title\":{\"message\":\"Sending and confirming transaction\"},\"confirmation.advanced.unknownInstruction\":{\"message\":\"Unknown\"},\"confirmation.advanced.programId\":{\"message\":\"Program ID\"},\"confirmation.advanced.data\":{\"message\":\"Data\"},\"confirmation.fee\":{\"message\":\"Network fee\"},\"confirmation.feeError\":{\"message\":\"Unable to estimate fee\"},\"confirmation.origin\":{\"message\":\"Request from\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"This transaction was reverted during simulation.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"This is a deceptive request\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"If you approve this request, a third party known for scams will take all your assets.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"Learn more\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Security advice by\"},\"confirmation.signMessage.title\":{\"message\":\"Sign message\"},\"confirmation.signMessage.message\":{\"message\":\"Message\"},\"confirmation.signIn.title\":{\"message\":\"Sign-in request\"},\"confirmation.signIn.description\":{\"message\":\"A site wants you to sign in to prove you own this account.\"},\"confirmation.signIn.domain\":{\"message\":\"Domain\"},\"confirmation.signIn.unknownDomain\":{\"message\":\"Unknown domain\"},\"confirmation.signIn.signingInWith\":{\"message\":\"Signing in with\"},\"confirmation.signIn.badAccount\":{\"message\":\"This site is asking you to sign in using the wrong account.\"},\"confirmation.signIn.message\":{\"message\":\"Message\"},\"confirmation.signIn.statement\":{\"message\":\"Statement\"},\"confirmation.signIn.version\":{\"message\":\"Version\"},\"confirmation.signIn.chainId\":{\"message\":\"Chain ID\"},\"confirmation.signIn.nonce\":{\"message\":\"Nonce\"},\"confirmation.signIn.issuedAt\":{\"message\":\"Issued at\"},\"confirmation.signIn.expirationTime\":{\"message\":\"Expiration time\"},\"confirmation.signIn.notBefore\":{\"message\":\"Not before\"},\"confirmation.signIn.requestId\":{\"message\":\"Request ID\"},\"confirmation.signIn.resources\":{\"message\":\"Resources\"},\"confirmation.signIn.badDomain\":{\"message\":\"This site is asking you to sign in using the wrong domain.\"},\"transactionScan.errors.accountAlreadyInUse\":{\"message\":\"An account with the same address already exists.\"},\"transactionScan.errors.insufficientSol\":{\"message\":\"Account does not have enough SOL to perform the operation.\"},\"transactionScan.errors.slippageToleranceExceeded\":{\"message\":\"The transaction was reverted because the slippage tolerance was exceeded.\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred.\"}}}'),DT=JSON.parse('{\"D\":{\"send.title\":{\"message\":\"Enviar\"},\"send.balance\":{\"message\":\"Saldo\"},\"send.maxButton\":{\"message\":\"Máx.\"},\"send.cancelButton\":{\"message\":\"Cancelar\"},\"send.continueButton\":{\"message\":\"Continuar\"},\"send.fromField\":{\"message\":\"De\"},\"send.toField\":{\"message\":\"Para\"},\"send.amountField\":{\"message\":\"Monto\"},\"send.assetField\":{\"message\":\"Token\"},\"send.toPlaceholder\":{\"message\":\"Introduzca la dirección pública\"},\"send.fromRequiredError\":{\"message\":\"La cuenta es obligatoria\"},\"send.amountRequiredError\":{\"message\":\"El monto es obligatorio\"},\"send.amountGreatherThanMinimumBalanceForRentExemptionError\":{\"message\":\"El valor debe ser superior a {minimumValue}\"},\"send.insuffientSolToCoverFee\":{\"message\":\"Saldo de SOL insuficiente para cubrir la tarifa de transacción\"},\"send.toRequiredError\":{\"message\":\"La dirección del destinatario es obligatoria\"},\"send.toInvalidError\":{\"message\":\"Dirección de Solana no válida\"},\"send.insufficientBalance\":{\"message\":\"Saldo insuficiente\"},\"send.simulationTitleAPIError\":{\"message\":\"Debido a un error, no pudimos verificar las alertas de seguridad.\"},\"send.simulationMessageAPIError\":{\"message\":\"Continúa solo si confías en todas las direcciones involucradas.\"},\"send.simulationTitleError\":{\"message\":\"Simulación de transacción fallida\"},\"send.simulationMessageError\":{\"message\":\"Esta transacción se revirtió durante la simulación.\"},\"send.selectedTokenPriceNotAvailable\":{\"message\":\"Los precios de los tokens en {currency} no están disponibles actualmente. Aún puede enviar tokens.\"},\"send.confirmation.title\":{\"message\":\"Revisar\"},\"send.confirmation.from\":{\"message\":\"De\"},\"send.confirmation.recipient\":{\"message\":\"Destinatario\"},\"send.confirmation.network\":{\"message\":\"Red\"},\"send.confirmation.transactionSpeed\":{\"message\":\"Velocidad de la transacción\"},\"send.confirmation.fee\":{\"message\":\"Tarifa de red\"},\"send.confirmation.sendButton\":{\"message\":\"Enviar\"},\"send.confirmation.cancelButton\":{\"message\":\"Cancelar\"},\"send.confirmation.viewTransaction\":{\"message\":\"Ver transacción\"},\"send.send-pending.title\":{\"message\":\"Enviando...\"},\"send.send-pending.subtitle\":{\"message\":\"Se envió su transacción.\"},\"send.transaction-success.title\":{\"message\":\"Enviado\"},\"send.transaction-success.subtitle\":{\"message\":\"El envío de {amount} {tokenSymbol} se realizó correctamente\"},\"send.transaction-failure.title\":{\"message\":\"Transacción fallida\"},\"send.transaction-failure.subtitle\":{\"message\":\"Error al enviar {amount} {tokenSymbol}\"},\"confirmation.account\":{\"message\":\"Cuenta\"},\"confirmation.network\":{\"message\":\"Red\"},\"confirmation.estimatedChanges\":{\"message\":\"Cambios estimados\"},\"confirmation.estimatedChanges.send\":{\"message\":\"Usted envía\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"Usted recibe\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"No disponible\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"Sin cambios\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Los cambios estimados son los que podrían producirse si sigue adelante con esta transacción. Esto es solo una predicción, no una garantía.\"},\"confirmation.advanced.show\":{\"message\":\"Mostrar avanzadas\"},\"confirmation.advanced.hide\":{\"message\":\"Ocultar avanzadas\"},\"confirmation.cancelButton\":{\"message\":\"Cancelar\"},\"confirmation.confirmButton\":{\"message\":\"Confirmar\"},\"confirmation.signAndSendTransaction.title\":{\"message\":\"Solicitud de transacción\"},\"confirmation.signTransaction.title\":{\"message\":\"Signing request\"},\"confirmation.sendAndConfirmTransaction.title\":{\"message\":\"Sending and confirming transaction\"},\"confirmation.advanced.unknownInstruction\":{\"message\":\"Desconocida\"},\"confirmation.advanced.programId\":{\"message\":\"ID del programa\"},\"confirmation.advanced.data\":{\"message\":\"Datos\"},\"confirmation.fee\":{\"message\":\"Tarifa de red\"},\"confirmation.feeError\":{\"message\":\"No se puede calcular la tarifa\"},\"confirmation.origin\":{\"message\":\"Solicitud de\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"Esta transacción se revirtió durante la simulación.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"Motivo: {reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"Esta es una solicitud engañosa\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"Si aprueba esta solicitud, un tercero conocido por sus estafas se quedará con todos sus activos.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"Conozca más\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Asesoramiento de seguridad por\"},\"confirmation.signMessage.title\":{\"message\":\"Firmar mensaje\"},\"confirmation.signMessage.message\":{\"message\":\"Mensaje\"},\"confirmation.signIn.title\":{\"message\":\"Solicitud de inicio de sesión\"},\"confirmation.signIn.description\":{\"message\":\"Un sitio quiere que inicie sesión para demostrar que usted es el titular de esta cuenta.\"},\"confirmation.signIn.domain\":{\"message\":\"Domain\"},\"confirmation.signIn.unknownDomain\":{\"message\":\"Dominio desconocido\"},\"confirmation.signIn.signingInWith\":{\"message\":\"Iniciar sesión con\"},\"confirmation.signIn.badAccount\":{\"message\":\"Este sitio le pide que inicie sesión con la cuenta incorrecta.\"},\"confirmation.signIn.message\":{\"message\":\"Mensaje\"},\"confirmation.signIn.statement\":{\"message\":\"Declaración\"},\"confirmation.signIn.version\":{\"message\":\"Versión\"},\"confirmation.signIn.chainId\":{\"message\":\"ID de cadena\"},\"confirmation.signIn.nonce\":{\"message\":\"Nonce\"},\"confirmation.signIn.issuedAt\":{\"message\":\"Emitido a las\"},\"confirmation.signIn.expirationTime\":{\"message\":\"Hora de caducidad\"},\"confirmation.signIn.notBefore\":{\"message\":\"No antes de\"},\"confirmation.signIn.requestId\":{\"message\":\"ID de solicitud\"},\"confirmation.signIn.resources\":{\"message\":\"Recursos\"},\"confirmation.signIn.badDomain\":{\"message\":\"This site is asking you to sign in using the wrong domain.\"},\"transactionScan.errors.accountAlreadyInUse\":{\"message\":\"Ya existe una cuenta con la misma dirección.\"},\"transactionScan.errors.insufficientSol\":{\"message\":\"La cuenta no tiene suficiente SOL para realizar la operación.\"},\"transactionScan.errors.slippageToleranceExceeded\":{\"message\":\"La transacción se revirtió porque se superó la tolerancia de deslizamiento.\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred.\"}}}'),$T={en:FT.D,es:DT.D};function KT(e){const t=$T[e]??$T.en;return(e,n)=>{let r=t?.[e]?.message??e;return n&&r&&Object.keys(n).forEach((e=>{const t=new RegExp(`\\\\{${e}\\\\}`,\"gu\");r=r.replace(t,n[e]??\"\")})),r}}function qT(e){if(e===ef)return\"MetaMask\";try{return new URL(e).hostname}catch(e){throw new Error(\"Invalid URL\")}}const WT=({label:e,value:t})=>null!=t?ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:e}),AT(CT,{children:t})]}):null,HT=1e-6,VT=new Mi(HT).decimalPlaces();function GT(e,t){const[n]=t.split(\"_\");try{const r=new Mi(e);if(r.isNaN())return\"0\";if(r.isZero())return\"0\";if(r.abs().lt(HT))return`<${function(e,t){const n=new Mi(t),r=n.decimalPlaces(),o=n.toFixed(r??0),[i]=e.split(\"_\"),[a,s]=o.split(\".\"),c=new Intl.NumberFormat(i).format(a);return s?`${c}.${s}`:c}(t,HT)}`;if(r.abs().lt(1))return new Intl.NumberFormat(n,{maximumSignificantDigits:3}).format(Number(r.toFixed(VT??0)));const o=r.abs().integerValue().toString().length,i=Math.max(0,3-o+1);return new Intl.NumberFormat(t,{maximumFractionDigits:i}).format(r.toFixed(i))}catch(e){return Zd.error(e),\"0\"}}function ZT(e,t,n){const r=new Mi(e).toNumber(),[o]=n.split(\"_\");return r.toLocaleString(o,{style:\"currency\",currency:t,maximumFractionDigits:2,minimumFractionDigits:2})}const JT=({asset:e,preferences:t})=>{const n=e.type;return ST(TT,{direction:\"vertical\",crossAlignment:\"end\",children:[ST(TT,{direction:\"horizontal\",alignment:\"center\",children:[ST(CT,{color:\"in\"===n?\"success\":\"error\",children:[\"in\"===n?\"+\":\"-\",GT(e.value??0,t.locale)]}),e.logo?AT(TT,{alignment:\"center\",center:!0,children:AT(NT,{borderRadius:\"full\",src:e.logo,width:16,height:16})}):null,AT(CT,{children:e.symbol??\"\"})]}),e.price?AT(CT,{color:\"muted\",children:ZT(e.price.toString(),t.currency,t.locale)}):null]})},YT=kT(\"Tooltip\");var QT;!function(e){e.Accessibility=\"accessibility\",e.Activity=\"activity\",e.AddCard=\"add-card\",e.AddCircle=\"add-circle\",e.AddSquare=\"add-square\",e.Add=\"add\",e.Ai=\"ai\",e.AlternateEmail=\"alternate-email\",e.Apple=\"apple\",e.Apps=\"apps\",e.Arrow2Down=\"arrow-2-down\",e.Arrow2Left=\"arrow-2-left\",e.Arrow2Right=\"arrow-2-right\",e.Arrow2UpRight=\"arrow-2-up-right\",e.Arrow2Up=\"arrow-2-up\",e.ArrowCircleDown=\"arrow-circle-down\",e.ArrowCircleUp=\"arrow-circle-up\",e.ArrowDoubleLeft=\"arrow-double-left\",e.ArrowDoubleRight=\"arrow-double-right\",e.ArrowDown=\"arrow-down\",e.ArrowDropDownCircle=\"arrow-drop-down-circle\",e.ArrowLeft=\"arrow-left\",e.ArrowRight=\"arrow-right\",e.ArrowUp=\"arrow-up\",e.Attachment=\"attachment\",e.Ban=\"ban\",e.BankAssured=\"bank-assured\",e.Bank=\"bank\",e.Bold=\"bold\",e.Book=\"book\",e.Bookmark=\"bookmark\",e.Bridge=\"bridge\",e.Briefcase=\"briefcase\",e.Bulb=\"bulb\",e.BuySell=\"buy-sell\",e.Cake=\"cake\",e.Calculator=\"calculator\",e.Calendar=\"calendar\",e.Call=\"call\",e.Camera=\"camera\",e.Campaign=\"campaign\",e.CardPos=\"card-pos\",e.Card=\"card\",e.Cash=\"cash\",e.Category=\"category\",e.Chart=\"chart\",e.CheckBold=\"check-bold\",e.Check=\"check\",e.CircleX=\"circle-x\",e.ClockFilled=\"clock-filled\",e.Clock=\"clock\",e.Close=\"close\",e.CloudDownload=\"cloud-download\",e.CloudUpload=\"cloud-upload\",e.Cloud=\"cloud\",e.CodeCircle=\"code-circle\",e.Code=\"code\",e.Coin=\"coin\",e.Collapse=\"collapse\",e.Confirmation=\"confirmation\",e.Connect=\"connect\",e.CopySuccess=\"copy-success\",e.Copy=\"copy\",e.CreditCheck=\"credit-check\",e.CurrencyFranc=\"currency-franc\",e.CurrencyLira=\"currency-lira\",e.CurrencyPound=\"currency-pound\",e.CurrencyYuan=\"currency-yuan\",e.Customize=\"customize\",e.Danger=\"danger\",e.DarkFilled=\"dark-filled\",e.Dark=\"dark\",e.Data=\"data\",e.Description=\"description\",e.Details=\"details\",e.Diagram=\"diagram\",e.DocumentCode=\"document-code\",e.Download=\"download\",e.Draft=\"draft\",e.EcoLeaf=\"eco-leaf\",e.EditSquare=\"edit-square\",e.Edit=\"edit\",e.EncryptedAdd=\"encrypted-add\",e.Eraser=\"eraser\",e.Error=\"error\",e.Ethereum=\"ethereum\",e.Exchange=\"exchange\",e.ExpandVertical=\"expand-vertical\",e.Expand=\"expand\",e.ExploreFilled=\"explore-filled\",e.Explore=\"explore\",e.Export=\"export\",e.Extension=\"extension\",e.EyeSlash=\"eye-slash\",e.Eye=\"eye\",e.FaceId=\"face-id\",e.Feedback=\"feedback\",e.File=\"file\",e.Filter=\"filter\",e.Fingerprint=\"fingerprint\",e.Fire=\"fire\",e.FirstPage=\"first-page\",e.Flag=\"flag\",e.FlashSlash=\"flash-slash\",e.Flash=\"flash\",e.Flask=\"flask\",e.Flower=\"flower\",e.Folder=\"folder\",e.Forest=\"forest\",e.FullCircle=\"full-circle\",e.Gas=\"gas\",e.Gift=\"gift\",e.GlobalSearch=\"global-search\",e.Global=\"global\",e.Graph=\"graph\",e.Hardware=\"hardware\",e.HashTag=\"hash-tag\",e.HeartFilled=\"heart-filled\",e.Heart=\"heart\",e.Hierarchy=\"hierarchy\",e.HomeFilled=\"home-filled\",e.Home=\"home\",e.Image=\"image\",e.Info=\"info\",e.Inventory=\"inventory\",e.Joystick=\"joystick\",e.KeepFilled=\"keep-filled\",e.Keep=\"keep\",e.Key=\"key\",e.LastPage=\"last-page\",e.LightFilled=\"light-filled\",e.Light=\"light\",e.Link=\"link\",e.Loading=\"loading\",e.Location=\"location\",e.LockSlash=\"lock-slash\",e.Lock=\"lock\",e.LockedFilled=\"locked-filled\",e.Login=\"login\",e.Logout=\"logout\",e.Mail=\"mail\",e.Map=\"map\",e.Menu=\"menu\",e.MessageQuestion=\"message-question\",e.Messages=\"messages\",e.Mic=\"mic\",e.MinusBold=\"minus-bold\",e.MinusSquare=\"minus-square\",e.Minus=\"minus\",e.Mobile=\"mobile\",e.MoneyBag=\"money-bag\",e.Money=\"money\",e.Monitor=\"monitor\",e.MoreHorizontal=\"more-horizontal\",e.MoreVertical=\"more-vertical\",e.MountainFlag=\"mountain-flag\",e.MusicNote=\"music-note\",e.Notification=\"notification\",e.PageInfo=\"page-info\",e.Palette=\"palette\",e.PasswordCheck=\"password-check\",e.Pending=\"pending\",e.People=\"people\",e.PersonCancel=\"person-cancel\",e.Pin=\"pin\",e.Plant=\"plant\",e.Plug=\"plug\",e.PlusAndMinus=\"plus-and-minus\",e.PolicyAlert=\"policy-alert\",e.Print=\"print\",e.PriorityHigh=\"priority-high\",e.PrivacyTip=\"privacy-tip\",e.ProgrammingArrows=\"programming-arrows\",e.Publish=\"publish\",e.QrCode=\"qr-code\",e.Question=\"question\",e.Receive=\"receive\",e.Received=\"received\",e.Refresh=\"refresh\",e.RemoveMinus=\"remove-minus\",e.Report=\"report\",e.Rocket=\"rocket\",e.SaveFilled=\"save-filled\",e.Save=\"save\",e.Saving=\"saving\",e.ScanBarcode=\"scan-barcode\",e.ScanFocus=\"scan-focus\",e.Scan=\"scan\",e.Search=\"search\",e.SecurityAlert=\"security-alert\",e.SecurityCross=\"security-cross\",e.SecurityKey=\"security-key\",e.SecuritySearch=\"security-search\",e.SecuritySlash=\"security-slash\",e.SecurityTick=\"security-tick\",e.SecurityTime=\"security-time\",e.SecurityUser=\"security-user\",e.Security=\"security\",e.Send=\"send\",e.SentimentDissatisfied=\"sentiment-dissatisfied\",e.SentimentNeutral=\"sentiment-neutral\",e.SentimentSatisfied=\"sentiment-satisfied\",e.SentimentVerySatisfied=\"sentiment-very-satisfied\",e.SettingFilled=\"setting-filled\",e.Setting=\"setting\",e.Share=\"share\",e.ShieldLock=\"shield-lock\",e.ShoppingBag=\"shopping-bag\",e.ShoppingCart=\"shopping-cart\",e.SignalCellular=\"signal-cellular\",e.Slash=\"slash\",e.Sms=\"sms\",e.SnapsMobile=\"snaps-mobile\",e.SnapsPlus=\"snaps-plus\",e.SnapsRound=\"snaps-round\",e.Snaps=\"snaps\",e.SortByAlpha=\"sort-by-alpha\",e.Sort=\"sort\",e.Sparkle=\"sparkle\",e.Speed=\"speed\",e.Speedometer=\"speedometer\",e.Square=\"square\",e.Stake=\"stake\",e.StarFilled=\"star-filled\",e.Star=\"star\",e.Start=\"start\",e.Storefront=\"storefront\",e.Student=\"student\",e.SwapHorizontal=\"swap-horizontal\",e.SwapVertical=\"swap-vertical\",e.TabClose=\"tab-close\",e.TableRow=\"table-row\",e.Tablet=\"tablet\",e.Tag=\"tag\",e.ThumbDownFilled=\"thumb-down-filled\",e.ThumbDown=\"thumb-down\",e.ThumbUpFilled=\"thumb-up-filled\",e.ThumbUp=\"thumb-up\",e.Tint=\"tint\",e.Tooltip=\"tooltip\",e.Translate=\"translate\",e.Trash=\"trash\",e.TrendDown=\"trend-down\",e.TrendUp=\"trend-up\",e.TriangleUp=\"triangle-up\",e.TriangleDown=\"triangle-down\",e.Undo=\"undo\",e.Unfold=\"unfold\",e.UnlockedFilled=\"unlocked-filled\",e.Unpin=\"unpin\",e.UploadFile=\"upload-file\",e.Upload=\"upload\",e.Usb=\"usb\",e.UserCheck=\"user-check\",e.UserCircleAdd=\"user-circle-add\",e.UserCircleRemove=\"user-circle-remove\",e.UserCircle=\"user-circle\",e.User=\"user\",e.VerifiedFilled=\"verified-filled\",e.Verified=\"verified\",e.Videocam=\"videocam\",e.ViewColumn=\"view-column\",e.ViewInAr=\"view-in-ar\",e.VolumeOff=\"volume-off\",e.VolumeUp=\"volume-up\",e.WalletFilled=\"wallet-filled\",e.Wallet=\"wallet\",e.Warning=\"warning\",e.WebTraffic=\"web-traffic\",e.Widgets=\"widgets\",e.WifiOff=\"wifi-off\",e.Wifi=\"wifi\",e.X=\"x\"}(QT||(QT={}));const XT=kT(\"Icon\"),e_=({preferences:e})=>{const t=KT(e.locale);return ST(TT,{direction:\"horizontal\",center:!0,children:[AT(CT,{fontWeight:\"medium\",children:t(\"confirmation.estimatedChanges\")}),AT(YT,{content:t(\"confirmation.estimatedChanges.tooltip\"),children:AT(XT,{name:\"info\"})})]})},t_=kT(\"Skeleton\"),n_=({preferences:e})=>ST(BT,{direction:\"vertical\",children:[AT(e_,{preferences:e}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(t_,{width:60,height:20}),AT(TT,{children:ST(TT,{direction:\"vertical\",crossAlignment:\"end\",children:[AT(t_,{width:100,height:20}),AT(t_,{width:40,height:20})]})})]})]}),r_=({changes:e,preferences:t,scanFetchStatus:n,scanStatus:r})=>{const o=KT(t.locale),i=\"fetched\"===n,a=\"error\"===n;if(\"fetching\"===n)return AT(n_,{preferences:t});if(a||i&&\"ERROR\"===r)return ST(BT,{direction:\"vertical\",children:[AT(e_,{preferences:t}),AT(CT,{color:\"alternative\",children:o(\"confirmation.estimatedChanges.notAvailable\")})]});const s=e?.assets.filter((e=>\"out\"===e.type))??[],c=e?.assets.filter((e=>\"in\"===e.type))??[],u=s.length>0||c.length>0;return ST(BT,i&&!u?{direction:\"vertical\",children:[AT(e_,{preferences:t}),AT(CT,{color:\"alternative\",children:o(\"confirmation.estimatedChanges.noChanges\")})]}:{children:[AT(e_,{preferences:t}),s?.length>0?ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.estimatedChanges.send\")}),AT(TT,{children:AT(TT,{children:s?.map((e=>AT(JT,{asset:e,preferences:t})))})})]}):null,AT(TT,{children:null}),c?.length>0?ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.estimatedChanges.receive\")}),AT(TT,{children:AT(TT,{children:c?.map((e=>AT(JT,{asset:e,preferences:t})))})})]}):null]})};var o_=function(e){return e.Cancel=\"confirm-sign-in-cancel\",e.Confirm=\"confirm-sign-in-confirm\",e}({});const i_={\"confirm-sign-in-cancel\":async function({id:e}){await PI(e,!1)},\"confirm-sign-in-confirm\":async function({id:e}){await PI(e,!0)}},a_=({params:e,origin:t,account:n,accountDomain:r,scope:o,preferences:i,networkImage:a})=>{const s=KT(i.locale),c=t?qT(t):null,{domain:u,statement:l,uri:d,version:f,chainId:h,nonce:p,issuedAt:g,expirationTime:m,notBefore:y,requestId:w,resources:v,address:b}=e,A=jT(o,n.address),S=b?jT(o,b):null,E=S!==A,x=u!==c;return ST(IT,{children:[ST(TT,{children:[ST(TT,{alignment:\"center\",center:!0,children:[AT(TT,{children:null}),AT(_T,{size:\"lg\",children:s(\"confirmation.signIn.title\")}),AT(CT,{color:\"muted\",alignment:\"center\",children:s(\"confirmation.signIn.description\")})]}),i.simulateOnChainActions?AT(r_,{changes:null,scanStatus:null,preferences:i,scanFetchStatus:\"fetched\"}):null,ST(BT,{children:[c?AT(PT,{label:s(\"confirmation.origin\"),tooltip:s(\"confirmation.origin.tooltip\"),children:AT(CT,{children:c})}):null,AT(PT,{variant:x?\"critical\":\"default\",label:s(\"confirmation.signIn.domain\"),tooltip:x?s(\"confirmation.signIn.badDomain\"):void 0,children:AT(CT,{children:u??s(\"confirmation.signIn.unknownDomain\")})}),AT(PT,{label:s(\"confirmation.signIn.signingInWith\"),tooltip:E?s(\"confirmation.signIn.badAccount\"):void 0,variant:E?\"warning\":\"default\",children:r?AT(LT,{domain:r,scope:o,address:n.address}):AT(RT,{address:A,truncate:!0,displayName:!0,avatar:!0})})]}),ST(BT,{children:[AT(CT,{fontWeight:\"medium\",children:s(\"confirmation.signIn.message\")}),AT(CT,{children:l??\"\"}),AT(WT,{label:\"URL\",value:d??\"\"}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.network\")}),ST(TT,{direction:\"horizontal\",alignment:\"center\",children:[AT(TT,{alignment:\"center\",center:!0,children:AT(NT,{borderRadius:\"medium\",src:a??ET})}),AT(CT,{children:cf[o].name})]})]}),S?ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.account\")}),AT(RT,{address:S,truncate:!0,displayName:!0,avatar:!0})]}):null,AT(WT,{label:s(\"confirmation.signIn.version\"),value:f??\"\"}),AT(WT,{label:s(\"confirmation.signIn.chainId\"),value:h??\"\"}),AT(WT,{label:s(\"confirmation.signIn.nonce\"),value:p??\"\"}),AT(WT,{label:s(\"confirmation.signIn.issuedAt\"),value:g??\"\"}),AT(WT,{label:s(\"confirmation.signIn.expirationTime\"),value:m??\"\"}),AT(WT,{label:s(\"confirmation.signIn.notBefore\"),value:y??\"\"}),AT(WT,{label:s(\"confirmation.signIn.requestId\"),value:w??\"\"}),v&&v.length>0?ST(TT,{alignment:\"space-between\",direction:\"vertical\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.signIn.resources\")}),AT(TT,{direction:\"vertical\",children:v.map((e=>AT(CT,{children:e},e)))})]}):null]})]}),ST(OT,{children:[AT(UT,{name:o_.Cancel,children:s(\"confirmation.cancelButton\")}),AT(UT,{name:o_.Confirm,variant:x?\"destructive\":\"primary\",children:s(\"confirmation.confirmButton\")})]})]})};var s_=function(e){return e.Cancel=\"confirm-sign-message-cancel\",e.Confirm=\"confirm-sign-message-confirm\",e}({});const c_={\"confirm-sign-message-cancel\":async function({id:e}){await PI(e,!1)},\"confirm-sign-message-confirm\":async function({id:e}){await PI(e,!0)}},u_=({message:e,account:t,accountDomain:n,scope:r,locale:o,networkImage:i,origin:a})=>{const s=KT(o),{address:c}=t,u=a?qT(a):null,l=jT(r,c);return ST(IT,{children:[ST(TT,{children:[ST(TT,{alignment:\"center\",center:!0,children:[AT(TT,{children:null}),AT(_T,{size:\"lg\",children:s(\"confirmation.signMessage.title\")})]}),ST(BT,{children:[AT(TT,{direction:\"horizontal\",center:!0,children:AT(CT,{fontWeight:\"medium\",children:s(\"confirmation.signMessage.message\")})}),AT(TT,{alignment:\"space-between\",children:AT(CT,{children:e})})]}),ST(BT,{children:[u?ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[ST(TT,{alignment:\"space-between\",direction:\"horizontal\",center:!0,children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.origin\")}),AT(YT,{content:s(\"confirmation.origin.tooltip\"),children:AT(XT,{name:\"question\",color:\"muted\"})})]}),AT(CT,{children:u})]}):null,ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.account\")}),n?AT(LT,{domain:n,scope:r,address:c}):AT(RT,{address:l,truncate:!0,displayName:!0,avatar:!0})]}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:s(\"confirmation.network\")}),ST(TT,{direction:\"horizontal\",alignment:\"center\",children:[AT(TT,{alignment:\"center\",center:!0,children:AT(NT,{borderRadius:\"medium\",src:i??ET})}),AT(CT,{children:cf[r].name})]})]})]})]}),ST(OT,{children:[AT(UT,{name:s_.Cancel,children:s(\"confirmation.cancelButton\")}),AT(UT,{name:s_.Confirm,children:s(\"confirmation.confirmButton\")})]})]})};const l_=new Set([\"TransferSol\",\"TransferSolWithSeed\",\"Transfer\",\"TransferChecked\",\"TransferCheckedWithFee\"]);var d_=function(e){return e.ShowAdvanced=\"confirm-sign-and-send-transaction-show-advanced\",e.Cancel=\"confirm-sign-and-send-transaction-cancel\",e.Confirm=\"confirm-sign-and-send-transaction-confirm\",e}({});const f_={\"confirm-sign-and-send-transaction-show-advanced\":async function({id:e,context:t}){const n={...t,advanced:{...t.advanced,shown:!t.advanced.shown}};await BI(e,AT(k_,{context:n}),n)},\"confirm-sign-and-send-transaction-cancel\":async function({id:e}){await PI(e,!1),await uP.deleteKey(`mapInterfaceNameToId.${_I}`)},\"confirm-sign-and-send-transaction-confirm\":async function({id:e}){await PI(e,!0),await uP.deleteKey(`mapInterfaceNameToId.${_I}`)}},h_=e=>e.replace(/([A-Z])/gu,\" $1\").trim().replace(/^./u,(e=>e.toUpperCase())),p_=({address:e,scope:t})=>AT(MT,{href:zT(t,\"address\",e),children:AT(RT,{avatar:!1,address:jT(t,e),truncate:!0})}),g_=({instruction:e,scope:t,locale:n})=>{const r=KT(n),{type:o,encoded:i,parsed:a}=e,{programAddress:s,dataBase58:c}=i,u=null!==a,l=h_(o);return ST(BT,{alignment:\"start\",children:[AT(CT,{color:\"alternative\",fontWeight:\"bold\",children:l}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{color:\"alternative\",alignment:\"start\",children:r(\"confirmation.advanced.programId\")}),AT(p_,{address:s,scope:t})]}),u&&Object.entries(a.accounts??{}).map((([e,n])=>ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{color:\"alternative\",children:h_(e)}),eu(n.address)?AT(p_,{address:n.address,scope:t}):AT(CT,{children:kI(n.address)?.toString()??\"\"})]}))),u&&Object.entries(a.data).map((([e,n])=>ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{color:\"alternative\",children:h_(e)}),eu(n)?AT(p_,{address:n,scope:t}):AT(CT,{children:kI(n)?.toString()??\"\"})]}))),!u&&ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{color:\"alternative\",children:r(\"confirmation.advanced.data\")}),AT(CT,{children:(d=c,d.length>12?`${d.slice(0,5)}...${d.slice(-5)}`:d)})]})]});var d},m_=({instructions:e,showInstructions:t,locale:n,scope:r})=>{const o=KT(n),i=t?\"hide\":\"show\",a=t?\"arrow-up\":\"arrow-down\";return ST(TT,{alignment:\"start\",children:[ST(UT,{name:d_.ShowAdvanced,children:[o(`confirmation.advanced.${i}`),\"&nbsp;\",AT(XT,{name:a,color:\"primary\"})]}),t&&AT(TT,{children:e.map((e=>AT(g_,{locale:n,scope:r,instruction:e})))})]})},y_=kT(\"Banner\"),w_={AccountAlreadyInUse:\"transactionScan.errors.accountAlreadyInUse\",ResultWithNegativeLamports:\"transactionScan.errors.insufficientSol\",SlippageToleranceExceeded:\"transactionScan.errors.slippageToleranceExceeded\",ExceededDesiredSlippageLimit:\"transactionScan.errors.slippageToleranceExceeded\"};function v_(e,t){const n=KT(t.locale),{code:r}=e;return n((r&&w_[r])??\"transactionScan.errors.unknownError\")}const b_={Malicious:\"danger\",Warning:\"warning\"},A_=({preferences:e,validation:t,error:n,scanFetchStatus:r})=>{const o=KT(e.locale);if(\"error\"===r)return AT(y_,{title:o(\"send.simulationTitleAPIError\"),severity:\"danger\",children:AT(CT,{children:o(\"send.simulationMessageAPIError\")})});if(!n&&!t)return AT(TT,{children:null});if(n)return AT(y_,{title:o(\"confirmation.simulationErrorTitle\"),severity:\"warning\",children:AT(CT,{children:o(\"confirmation.simulationErrorSubtitle\",{reason:v_(n,e)})})});if(!t)return AT(TT,{children:null});const i=t?.type?b_[t.type]:void 0;return i?ST(y_,{title:o(\"confirmation.validationErrorTitle\"),severity:i,children:[AT(CT,{children:o(\"confirmation.validationErrorSubtitle\")}),AT(CT,{size:\"sm\",children:AT(MT,{href:\"https://support.metamask.io/configure/wallet/how-to-turn-on-security-alerts/\",children:o(\"confirmation.validationErrorLearnMore\")})}),ST(CT,{size:\"sm\",children:[AT(XT,{color:\"primary\",name:\"security-tick\"}),\" \",o(\"confirmation.validationErrorSecurityAdviced\"),\" \",AT(MT,{href:\"https://www.blockaid.io\",children:\"Blockaid\"})]})]}):AT(TT,{children:null})};function S_(e,t,n){return`${GT(e,n)} ${t}`}function E_(e,t){return new Mi(e).multipliedBy(t).toString()}const x_=({origin:e,accountAddress:t,accountDomain:n,destinationAddress:r,destinationDomain:o,scope:i,feeInSol:a,nativePrice:s,fetchingPricesStatus:c,preferences:u,networkImage:l})=>{const{currency:d,locale:f}=u,h=KT(f),p=e&&!(e===ef)?qT(e):null,g=\"fetching\"===c,m=a&&s&&!(\"error\"===c)?ZT(E_(a,s),d,f):\"\";return ST(BT,{children:[p?ST(TT,{children:[ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[ST(TT,{alignment:\"space-between\",direction:\"horizontal\",center:!0,children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.origin\")}),AT(YT,{content:h(\"confirmation.origin.tooltip\"),children:AT(XT,{name:\"question\",color:\"muted\"})})]}),AT(CT,{children:p})]}),AT(TT,{children:null})]}):null,ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.account\")}),n&&t?AT(LT,{domain:n,scope:i,address:t}):null,!n&&t?AT(RT,{address:jT(i,t),truncate:!0,displayName:!0,avatar:!0}):null]}),r?ST(TT,{children:[AT(TT,{children:null}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.recipient\")}),o?AT(LT,{domain:o,scope:i,address:r}):AT(RT,{address:jT(i,r),truncate:!0,displayName:!0,avatar:!0})]})]}):null,AT(TT,{children:null}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.network\")}),ST(TT,{direction:\"horizontal\",alignment:\"center\",children:[AT(TT,{alignment:\"center\",center:!0,children:AT(NT,{borderRadius:\"medium\",src:l??\"\"})}),AT(CT,{children:cf[i].name})]})]}),AT(TT,{children:null}),ST(TT,{alignment:\"space-between\",direction:\"horizontal\",children:[AT(CT,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.fee\")}),a?ST(TT,{direction:\"horizontal\",alignment:\"center\",children:[g?AT(t_,{width:80}):AT(CT,{color:\"muted\",children:m}),AT(CT,{children:S_(a,cf[i].nativeToken.symbol,f)})]}):AT(YT,{content:h(\"confirmation.feeError\"),children:AT(XT,{name:\"warning\"})})]})]})},k_=({context:e})=>{const t=KT(e.preferences.locale),n=e.feeEstimatedInSol,{nativeToken:r}=cf[e.scope],o=e.tokenPrices[r.caip19Id]?.price??null,i=\"fetching\"===e.scanFetchStatus||\"ERROR\"===e.scan?.status;return ST(IT,{children:[ST(TT,{children:[e.preferences.useSecurityAlerts?AT(A_,{scanFetchStatus:e.scanFetchStatus,validation:e.scan?.validation??null,error:e.scan?.error??null,preferences:e.preferences}):null,ST(TT,{alignment:\"center\",center:!0,children:[AT(TT,{children:null}),AT(_T,{size:\"lg\",children:t(`confirmation.${e.method}.title`)}),AT(TT,{children:null})]}),e.preferences.simulateOnChainActions?AT(r_,{scanStatus:e.scan?.status??null,scanFetchStatus:e.scanFetchStatus,changes:e.scan?.estimatedChanges??null,preferences:e.preferences}):null,AT(x_,{accountAddress:e.account?.address??null,accountDomain:e.accountDomain??null,destinationAddress:e.destinationAddress??null,destinationDomain:e.destinationDomain??null,scope:e.scope,feeInSol:n,nativePrice:o,fetchingPricesStatus:e.tokenPricesFetchStatus,preferences:e.preferences,networkImage:e.networkImage,origin:e.origin}),AT(m_,{instructions:e.advanced.instructions,showInstructions:e.advanced.shown,locale:e.preferences.locale,scope:e.scope})]}),ST(OT,{children:[AT(UT,{name:d_.Cancel,children:t(\"confirmation.cancelButton\")}),AT(UT,{name:d_.Confirm,disabled:i,children:t(\"confirmation.confirmButton\")})]})]})},I_={method:Tn.SignAndSendTransaction,scope:tf.Mainnet,networkImage:ET,account:null,accountDomain:null,destinationAddress:null,destinationDomain:null,transaction:\"\",scan:null,scanFetchStatus:\"fetching\",feeEstimatedInSol:\"0\",tokenPrices:{},tokenPricesFetchStatus:\"fetching\",origin:\"\",preferences:{locale:\"en\",currency:\"usd\",hideBalances:!1,useSecurityAlerts:!0,useExternalPricingData:!0,simulateOnChainActions:!0,useTokenDetection:!0,batchCheckBalances:!0,displayNftMedia:!0,useNftDetection:!0},advanced:{shown:!1,instructions:[]}};async function T_(e){const t={...I_,...e},n=NI().then((e=>{t.preferences=e})).catch((()=>{t.preferences=I_.preferences})),r=(async(e,t)=>{const n=await Hm(t,e),r=\"instructions\"in n?n:await Km(n.messageBytes,e),{instructions:o}=r;return o.map(ny)})(hP.getRpc(t.scope),t.transaction).then((e=>{t.advanced.instructions=e;try{t.destinationAddress=function(e){for(const t of e){if(!t.parsed||!l_.has(t.type))continue;const e=t.parsed.accounts?.destination;if(e?.address)return e.address}return null}(e)}catch{t.destinationAddress=null}})).catch((e=>{Zd.error(e),t.advanced.instructions=[]})),o=t.account?.address?TP.resolveAddress(t.scope,t.account.address).then((e=>{t.accountDomain=e})):Promise.resolve().then((()=>{t.accountDomain=null}));await Promise.all([n,r,o]);const{currency:i,useExternalPricingData:a,useSecurityAlerts:s,simulateOnChainActions:c}=t.preferences,u=await CI(AT(k_,{context:t}),t),l=RI(u),d={...t},f=t.destinationAddress?TP.resolveAddress(t.scope,t.destinationAddress).then((e=>{d.destinationDomain=e})).catch((()=>{d.destinationDomain=null})):Promise.resolve(),h=[cf[t.scope].nativeToken.caip19Id],p=a?EP.getMultipleSpotPrices(h,i).then((e=>{d.tokenPrices=e,d.tokenPricesFetchStatus=\"fetched\"})).catch((()=>{d.tokenPricesFetchStatus=\"error\"})):Promise.resolve().then((()=>{d.tokenPricesFetchStatus=\"fetched\",d.tokenPrices={}}));await Promise.all([f,p]);let g=null;try{const{totalFee:e}=vy.calculateFee(t.transaction);g=by(e).toString()}catch{g=null}d.feeEstimatedInSol=g,await BI(u,AT(k_,{context:d}),d);const m={...d},y=[];if(c&&y.push(\"simulation\"),s&&y.push(\"validation\"),c||s){const e=MP.scanTransaction({method:m.method,accountAddress:m.account?.address??\"\",transaction:m.transaction,scope:m.scope,origin:m.origin,options:y}).then((async e=>{m.scan=e,m.scanFetchStatus=e?\"fetched\":\"error\"})).catch((()=>{m.scan=null,m.scanFetchStatus=\"error\"}));await Promise.all([e])}else m.scanFetchStatus=\"fetched\",m.scan=null;return await BI(u,AT(k_,{context:m}),m),await uP.setKey(`mapInterfaceNameToId.${_I}`,u),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT20S\",request:{method:\"refreshConfirmationEstimation\"}}}),l}var __=function(e){return e.OnTransactionAdded=\"onTransactionAdded\",e.OnTransactionApproved=\"onTransactionApproved\",e.OnTransactionRejected=\"onTransactionRejected\",e.RefreshSend=\"refreshSend\",e.RefreshConfirmationEstimation=\"refreshConfirmationEstimation\",e.CloseWebSocketConnections=\"closeWebSocketConnections\",e}({});function C_(e){return JSON.parse(function(e){const t=[];let n=!1;for(let r=0;r<e.length;r++){let o=!1;if(\"\\\\\"===e[r]&&(t.push(e[r++]),o=!o),'\"'!==e[r]){if(!n){const n=B_(e,r);if(n?.length){r+=n.length-1,n.match(/\\.|[eE]-/)?t.push(n):t.push(P_(n));continue}}t.push(e[r])}else t.push(e[r]),o||(n=!n)}return t.join(\"\")}(e),((e,t)=>function(e){return!!e&&\"object\"==typeof e&&\"$n\"in e&&\"string\"==typeof e.$n}(t)?function({$n:e}){if(e.match(/[eE]/)){const[t,n]=e.split(/[eE]/);return BigInt(t)*BigInt(10)**BigInt(n)}return BigInt(e)}(t):t))}function B_(e,t){if(!e[t]?.match(/[-\\d]/))return null;const n=e.slice(t).match(/^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/);return n?n[0]:null}function P_(e){return`{\"$n\":\"${e}\"}`}var R_=0n;function N_(){const e=R_;return R_++,e.toString()}function O_(e){return function(e){return new Proxy(e.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get:(t,n,r)=>function(...o){const i=n.toString(),a=Reflect.get(t,i,r);if(!a)throw new Ts(As,{method:i,params:o});const s=a(...o);return function({transport:e},t){return{send:async n=>await t.execute({signal:n?.abortSignal,transport:e})}}(e,s)}})}(e)}function U_(e){return new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...t){const[n,r]=t,o=r.toString();return function(...t){const n=Object.freeze({methodName:o,params:t}),r=e?.requestTransformer?e?.requestTransformer(n):n;return Object.freeze({execute:async({signal:t,transport:n})=>{const o=function(e){return{id:N_(),jsonrpc:\"2.0\",method:e.methodName,params:e.params}}(r),i=await n({payload:o,signal:t});return e?.responseTransformer?e.responseTransformer(i,r):i}})}}})}function M_(e){return null!=e&&\"object\"==typeof e&&!Array.isArray(e)&&(\"jsonrpc\"in e&&\"2.0\"===e.jsonrpc&&\"method\"in e&&\"string\"==typeof e.method&&\"params\"in e)}var z_={};function L_(e){return function t(n,r){if(Array.isArray(n))return n.map(((e,n)=>{const o={...r,keyPath:[...r.keyPath,n]};return t(e,o)}));if(\"object\"==typeof n&&null!==n){const e={};for(const o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const i={...r,keyPath:[...r.keyPath,o]};e[o]=t(n[o],i)}return e}return e.reduce(((e,t)=>t(e,r)),n)}}function j_(e,t){return n=>{const r=L_(e);return Object.freeze({...n,params:r(n.params,t)})}}function F_(e){return\"bigint\"==typeof e?Number(e):e}function D_({commitmentPropertyName:e,params:t,optionsObjectPositionInParams:n,overrideCommitment:r}){const o=t[n];if(void 0===o||o&&\"object\"==typeof o&&!Array.isArray(o))if(o&&e in o){if(!o[e]||\"finalized\"===o[e]){const r=[...t],{[e]:i,...a}=o;return Object.keys(a).length>0?r[n]=a:n===r.length-1?r.length--:r[n]=void 0,r}}else if(\"finalized\"!==r){const i=[...t];return i[n]={...o,[e]:r},i}return t}function $_(e){return(t,{keyPath:n})=>(\"bigint\"==typeof t&&e&&(t>Number.MAX_SAFE_INTEGER||t<-Number.MAX_SAFE_INTEGER)&&e(n,t),t)}var K_={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function q_(e){const t=e?.onIntegerOverflow;return n=>{return cl(n,t?(r=t,e=>j_([$_(((...t)=>r(e,...t)))],{keyPath:[]})(e)):e=>e,j_([F_],{keyPath:[]}),function({defaultCommitment:e,optionsObjectPositionByMethod:t}){return n=>{const{params:r,methodName:o}=n;if(!Array.isArray(r))return n;const i=t[o];return null==i?n:Object.freeze({methodName:o,params:D_({commitmentPropertyName:\"sendTransaction\"===o?\"preflightCommitment\":\"commitment\",optionsObjectPositionInParams:i,overrideCommitment:e,params:r})})}}({defaultCommitment:e?.defaultCommitment,optionsObjectPositionByMethod:K_}));var r}}function W_(e){return t=[H_(e)],n={keyPath:[]},e=>L_(t)(e,n);var t,n}function H_(e){return function(t,{keyPath:n}){return\"number\"==typeof t&&Number.isInteger(t)||\"bigint\"==typeof t?function(e,t){return t.some((t=>{if(t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--){const r=e[n],o=t[n];if(o!==r&&(o!==z_||\"number\"!=typeof r))return!1}return!0}))}(n,e)?Number(t):BigInt(t):t}}function V_(e){return(t,n)=>{const r=n.methodName,o=e?.allowedNumericKeyPaths&&r?e.allowedNumericKeyPaths[r]:void 0;return cl(t,(e=>(e=>{const t=e;if(\"error\"in t)throw Os(t.error);return t})(e)),(e=>e.result),(e=>W_(o??[])(e,n)))}}var G_,Z_=[[\"data\",\"parsed\",\"info\",\"tokenAmount\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"tokenAmount\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"rentExemptReserve\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"rentExemptReserve\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"delegatedAmount\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"delegatedAmount\",\"uiAmount\"],[\"data\",\"parsed\",\"info\",\"extensions\",z_,\"state\",\"olderTransferFee\",\"transferFeeBasisPoints\"],[\"data\",\"parsed\",\"info\",\"extensions\",z_,\"state\",\"newerTransferFee\",\"transferFeeBasisPoints\"],[\"data\",\"parsed\",\"info\",\"extensions\",z_,\"state\",\"preUpdateAverageRate\"],[\"data\",\"parsed\",\"info\",\"extensions\",z_,\"state\",\"currentRate\"]],J_=[...Z_,[\"data\",\"parsed\",\"info\",\"lastExtendedSlotStartIndex\"],[\"data\",\"parsed\",\"info\",\"slashPenalty\"],[\"data\",\"parsed\",\"info\",\"warmupCooldownRate\"],[\"data\",\"parsed\",\"info\",\"decimals\"],[\"data\",\"parsed\",\"info\",\"numRequiredSigners\"],[\"data\",\"parsed\",\"info\",\"numValidSigners\"],[\"data\",\"parsed\",\"info\",\"stake\",\"delegation\",\"warmupCooldownRate\"],[\"data\",\"parsed\",\"info\",\"exemptionThreshold\"],[\"data\",\"parsed\",\"info\",\"burnPercent\"],[\"data\",\"parsed\",\"info\",\"commission\"],[\"data\",\"parsed\",\"info\",\"votes\",z_,\"confirmationCount\"]],Y_=[[\"index\"],[\"instructions\",z_,\"accounts\",z_],[\"instructions\",z_,\"programIdIndex\"],[\"instructions\",z_,\"stackHeight\"]],Q_=[[\"addressTableLookups\",z_,\"writableIndexes\",z_],[\"addressTableLookups\",z_,\"readonlyIndexes\",z_],[\"header\",\"numReadonlySignedAccounts\"],[\"header\",\"numReadonlyUnsignedAccounts\"],[\"header\",\"numRequiredSignatures\"],[\"instructions\",z_,\"accounts\",z_],[\"instructions\",z_,\"programIdIndex\"],[\"instructions\",z_,\"stackHeight\"]];function X_(e){return U_({requestTransformer:q_(e),responseTransformer:V_({allowedNumericKeyPaths:eC()})})}function eC(){return G_||(G_={getAccountInfo:J_.map((e=>[\"value\",...e])),getBlock:[[\"transactions\",z_,\"meta\",\"preTokenBalances\",z_,\"accountIndex\"],[\"transactions\",z_,\"meta\",\"preTokenBalances\",z_,\"uiTokenAmount\",\"decimals\"],[\"transactions\",z_,\"meta\",\"postTokenBalances\",z_,\"accountIndex\"],[\"transactions\",z_,\"meta\",\"postTokenBalances\",z_,\"uiTokenAmount\",\"decimals\"],[\"transactions\",z_,\"meta\",\"rewards\",z_,\"commission\"],...Y_.map((e=>[\"transactions\",z_,\"meta\",\"innerInstructions\",z_,...e])),...Q_.map((e=>[\"transactions\",z_,\"transaction\",\"message\",...e])),[\"rewards\",z_,\"commission\"]],getClusterNodes:[[z_,\"featureSet\"],[z_,\"shredVersion\"]],getInflationGovernor:[[\"initial\"],[\"foundation\"],[\"foundationTerm\"],[\"taper\"],[\"terminal\"]],getInflationRate:[[\"foundation\"],[\"total\"],[\"validator\"]],getInflationReward:[[z_,\"commission\"]],getMultipleAccounts:J_.map((e=>[\"value\",z_,...e])),getProgramAccounts:J_.flatMap((e=>[[\"value\",z_,\"account\",...e],[z_,\"account\",...e]])),getRecentPerformanceSamples:[[z_,\"samplePeriodSecs\"]],getTokenAccountBalance:[[\"value\",\"decimals\"],[\"value\",\"uiAmount\"]],getTokenAccountsByDelegate:Z_.map((e=>[\"value\",z_,\"account\",...e])),getTokenAccountsByOwner:Z_.map((e=>[\"value\",z_,\"account\",...e])),getTokenLargestAccounts:[[\"value\",z_,\"decimals\"],[\"value\",z_,\"uiAmount\"]],getTokenSupply:[[\"value\",\"decimals\"],[\"value\",\"uiAmount\"]],getTransaction:[[\"meta\",\"preTokenBalances\",z_,\"accountIndex\"],[\"meta\",\"preTokenBalances\",z_,\"uiTokenAmount\",\"decimals\"],[\"meta\",\"postTokenBalances\",z_,\"accountIndex\"],[\"meta\",\"postTokenBalances\",z_,\"uiTokenAmount\",\"decimals\"],[\"meta\",\"rewards\",z_,\"commission\"],...Y_.map((e=>[\"meta\",\"innerInstructions\",z_,...e])),...Q_.map((e=>[\"transaction\",\"message\",...e]))],getVersion:[[\"feature-set\"]],getVoteAccounts:[[\"current\",z_,\"commission\"],[\"delinquent\",z_,\"commission\"]],simulateTransaction:[...J_.map((e=>[\"value\",\"accounts\",z_,...e])),...Y_.map((e=>[\"value\",\"innerInstructions\",z_,...e]))]}),G_}Object.assign({\"accept-charset\":!0,\"access-control-request-headers\":!0,\"access-control-request-method\":!0,connection:!0,\"content-length\":!0,cookie:!0,date:!0,dnt:!0,expect:!0,host:!0,\"keep-alive\":!0,origin:!0,\"permissions-policy\":!0,referer:!0,te:!0,trailer:!0,\"transfer-encoding\":!0,upgrade:!0,via:!0},{\"accept-encoding\":!0});var tC=[\"getAccountInfo\",\"getBalance\",\"getBlock\",\"getBlockCommitment\",\"getBlockHeight\",\"getBlockProduction\",\"getBlocks\",\"getBlocksWithLimit\",\"getBlockTime\",\"getClusterNodes\",\"getEpochInfo\",\"getEpochSchedule\",\"getFeeForMessage\",\"getFirstAvailableBlock\",\"getGenesisHash\",\"getHealth\",\"getHighestSnapshotSlot\",\"getIdentity\",\"getInflationGovernor\",\"getInflationRate\",\"getInflationReward\",\"getLargestAccounts\",\"getLatestBlockhash\",\"getLeaderSchedule\",\"getMaxRetransmitSlot\",\"getMaxShredInsertSlot\",\"getMinimumBalanceForRentExemption\",\"getMultipleAccounts\",\"getProgramAccounts\",\"getRecentPerformanceSamples\",\"getRecentPrioritizationFees\",\"getSignaturesForAddress\",\"getSignatureStatuses\",\"getSlot\",\"getSlotLeader\",\"getSlotLeaders\",\"getStakeMinimumDelegation\",\"getSupply\",\"getTokenAccountBalance\",\"getTokenAccountsByDelegate\",\"getTokenAccountsByOwner\",\"getTokenLargestAccounts\",\"getTokenSupply\",\"getTransaction\",\"getTransactionCount\",\"getVersion\",\"getVoteAccounts\",\"index\",\"isBlockhashValid\",\"minimumLedgerSlot\",\"requestAirdrop\",\"sendTransaction\",\"simulateTransaction\"];function nC(e){return M_(e)&&tC.includes(e.method)}function rC(e){return function(e){const{fromJson:t,headers:n,toJson:r,url:o}=e,i=n&&function(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}(n);return async function({payload:e,signal:n}){const a=r?r(e):JSON.stringify(e),s={body:a,headers:{...i,accept:\"application/json\",\"content-length\":a.length.toString(),\"content-type\":\"application/json; charset=utf-8\"},method:\"POST\",signal:n},c=await fetch(o,s);if(!c.ok)throw new Ts(bs,{headers:c.headers,message:c.statusText,statusCode:c.status});return t?t(await c.text(),e):await c.json()}}({...e,fromJson:(e,t)=>nC(t)?C_(e):JSON.parse(e),toJson:e=>{return nC(e)?(t=e,function(e){return e.replace(/\\{\\s*\"\\$n\"\\s*:\\s*\"(-?\\d+)\"\\s*\\}/g,\"$1\")}(JSON.stringify(t,((e,t)=>\"bigint\"==typeof t?function(e){return{$n:`${e}`}}(t):t),n))):JSON.stringify(e);var t,n}})}var oC=Object.prototype.toString,iC=Object.keys||function(e){const t=[];for(const n in e)t.push(n);return t};function aC(e,t){let n,r,o,i,a,s,c;if(!0===e)return\"true\";if(!1===e)return\"false\";switch(typeof e){case\"object\":if(null===e)return null;if(\"toJSON\"in e&&\"function\"==typeof e.toJSON)return aC(e.toJSON(),t);if(c=oC.call(e),\"[object Array]\"===c){for(o=\"[\",r=e.length-1,n=0;n<r;n++)o+=aC(e[n],!0)+\",\";return r>-1&&(o+=aC(e[n],!0)),o+\"]\"}if(\"[object Object]\"===c){for(i=iC(e).sort(),r=i.length,o=\"\",n=0;n<r;)a=i[n],s=aC(e[a],!1),void 0!==s&&(o&&(o+=\",\"),o+=JSON.stringify(a)+\":\"+s),n++;return\"{\"+o+\"}\"}return JSON.stringify(e);case\"function\":case\"undefined\":return t?null:void 0;case\"bigint\":return`${e.toString()}n`;case\"string\":return JSON.stringify(e);default:return isFinite(e)?e:null}}function sC(e){const t=aC(e,!1);if(void 0!==t)return\"\"+t}function cC(e,t,n){let r=\"\";if(\"number\"==typeof t[0]){const e=t[0]+1,n=e%10,o=e%100;r=1==n&&11!=o?e+\"st\":2==n&&12!=o?e+\"nd\":3==n&&13!=o?e+\"rd\":e+\"th\"}else r=`\\`${t[0].toString()}\\``;const o=t.length>1?t.slice(1).map((e=>\"number\"==typeof e?`[${e}]`:e)).join(\".\"):void 0,i=new Ts(vs,{argumentLabel:r,keyPath:t,methodName:e,optionalPathLabel:o?` at path \\`${o}\\``:\"\",value:n,...void 0!==o?{path:o}:void 0});return _s(i,cC),i}var uC,lC={defaultCommitment:\"confirmed\",onIntegerOverflow(e,t,n){throw cC(e.methodName,t,n)}},dC=globalThis.AbortController;function fC(e){return M_(e)?sC([e.method,e.params]):void 0}function hC(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}function pC(e){return cl(rC({...e,headers:{...e.headers?hC(e.headers):void 0,\"solana-client\":\"js/2.1.0\"}}),(e=>function(e,t){let n;return async function(r){const{payload:o,signal:i}=r,a=t(o);if(void 0===a)return await e(r);if(n||(queueMicrotask((()=>{n=void 0})),n={}),null==n[a]){const t=new dC,o=(async()=>{try{return await e({...r,signal:t.signal})}catch(e){if(e===(uC||={}))return;throw e}})();n[a]={abortController:t,numConsumers:0,responsePromise:o}}const s=n[a];if(s.numConsumers++,i){const e=s.responsePromise;return await new Promise(((t,n)=>{const r=e=>{i.removeEventListener(\"abort\",r),s.numConsumers-=1,queueMicrotask((()=>{0===s.numConsumers&&s.abortController.abort(uC||={})})),n(e.target.reason)};i.addEventListener(\"abort\",r),e.then(t).catch(n).finally((()=>{i.removeEventListener(\"abort\",r)}))}))}return await s.responsePromise}}(e,fC)))}function gC(e){return O_({api:X_(lC),transport:e})}const mC=Vd,yC=[\"getTransaction\",\"getSignaturesForAddress\"],wC=e=>{const t=pC({url:e}),n=pC({url:e,headers:{\"x-bigtable\":\"disabled\"}});return async(...e)=>{const{payload:r}=e[0],{method:o}=r,i=yC.includes(o);return mC.info(`[🚌 ToggleInfuraBigtableLookupsTransport] RPC method is ${o}. ${i?\"Enabling\":\"Disabling\"} BigTable lookups.`),i?t(...e):n(...e)}},vC=Vd;async function bC(e){try{await snap.request({method:\"snap_trackError\",params:{error:No(new Error(JSON.stringify(e)))}}),vC.info(`[🚌 ErrorTrackingTransport] Error tracked: ${e.method} - ${e.errorMessage}`)}catch(e){vC.warn(`[🚌 ErrorTrackingTransport] Failed to track error: ${e}`)}}function AC(e){return!(!G(e,Oy)&&!Ly(e))||!!Is(e)}const SC=e=>async(...t)=>{const{payload:n}=t[0],{method:r}=n;try{vC.info(`[🚌 ErrorTrackingTransport] Making RPC request: ${r}`);const o=await e(...t);if(AC(o)){const e={method:r,errorMessage:`RPC error in response: ${JSON.stringify(o)}`,responseData:o,requestParams:n};return await bC(e),o}return o}catch(e){const t=function(e,t){const n={method:t,errorMessage:\"Unknown error\"};return e?.currentUrl&&(n.url=e.currentUrl),e instanceof Error?(n.errorMessage=e.message,n.errorStack=e.stack):\"string\"==typeof e?n.errorMessage=e:e?.message?n.errorMessage=e.message:e?.error&&(n.errorMessage=\"string\"==typeof e.error?e.error:JSON.stringify(e.error)),e?.status?n.statusCode=e.status:e?.statusCode&&(n.statusCode=e.statusCode),e?.response?n.responseData=e.response:e?.data&&(n.responseData=e.data),n}(e,r);throw await bC(t),e instanceof Error?e:new Error(t.errorMessage)}},EC=Vd;async function xC(e){return new Promise((t=>setTimeout(t,e)))}const kC=Vd;const IC=e=>async(...t)=>{const{payload:n}=t[0],{method:r}=n;let o;for(let n=0;n<4;n++)try{return kC.info(`[🚌 RetryingTransport] Attempt \"${r}\" ${n+1} of 4`),await e(...t)}catch(e){if(kC.error(`[🚌 RetryingTransport] Error during attempt \"${r}\" ${n+1} of 4: ${e}`),o=e,n<3){const e=(i=n,Math.min(400*Math.pow(2,i),1500));kC.info(`[🚌 RetryingTransport] Sleeping for ${e}ms`),await xC(e)}}var i;throw o},TC=e=>{return cl(e,(t=wC,e=>e.map(t)),(t=>((e,t)=>async(...n)=>{let r;const o=e.length;for(const[i,a]of e.entries())try{const e=t[i];return EC.info(`[🚌 FailoverTransport] Attempting to use transport ${i+1} of ${o} (URL: ${e})`),await a(...n)}catch(e){const n=t[i];r=e;const a=i===o-1;EC.error(`[🚌 FailoverTransport] Transport failed (URL: ${n}): ${e}. ${a?\"No more transports to try.\":\"Trying next transport...\"}`),e instanceof Error&&(e.currentUrl=n)}throw r})(t,e)),IC,(e=>SC(e)));var t};var _C,CC=[\"u8\",\"u16\",\"u32\",\"u64\",\"u128\",\"i8\",\"i16\",\"i32\",\"i64\",\"i128\",\"f32\",\"f64\"],BC=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var n=t.substring(1),r=parseInt(n)/8;this.resize_if_necessary(r);var o=\"f\"===t[0]?\"setFloat\".concat(n):\"i\"===t[0]?\"setInt\".concat(n):\"setUint\".concat(n);this.view[o](this.offset,e,!0),this.offset+=r},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),PC=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error(\"Error in schema, the buffer is smaller than expected\")},e.prototype.consume_value=function(e){var t=e.substring(1),n=parseInt(t)/8;this.assert_enough_buffer(n);var r=\"f\"===e[0]?\"getFloat\".concat(t):\"i\"===e[0]?\"getInt\".concat(t):\"getUint\".concat(t),o=this.view[r](this.offset,!0);return this.offset+=n,o},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),RC=(_C=function(e,t){return _C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_C(e,t)},function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}_C(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function NC(e,t,n){if(typeof e!==t)throw new Error(\"Expected \".concat(t,\" not \").concat(typeof e,\"(\").concat(e,\") at \").concat(n.join(\".\")))}function OC(e,t,n){if(e!==t)throw new Error(\"Array length \".concat(e,\" does not match schema length \").concat(t,\" at \").concat(n.join(\".\")))}var UC=CC.concat([\"bool\",\"string\"]),MC=[\"option\",\"enum\",\"array\",\"set\",\"map\",\"struct\"],zC=function(e){function t(t,n){var r=\"Invalid schema: \".concat(JSON.stringify(t),\" expected \").concat(n);return e.call(this,r)||this}return RC(t,e),t}(Error);function LC(e){if(\"string\"!=typeof e||!UC.includes(e)){if(e&&\"object\"==typeof e){var t=Object.keys(e);if(1===t.length&&MC.includes(t[0])){var n=t[0];if(\"option\"===n)return LC(e[n]);if(\"enum\"===n)return function(e){if(!Array.isArray(e))throw new zC(e,\"Array\");for(var t=0,n=e;t<n.length;t++){var r=n[t];if(\"object\"!=typeof r||!(\"struct\"in r))throw new Error('Missing \"struct\" key in enum schema');if(\"object\"!=typeof r.struct||1!==Object.keys(r.struct).length)throw new Error('The \"struct\" in each enum must have a single key');LC({struct:r.struct})}}(e[n]);if(\"array\"===n)return function(e){if(\"object\"!=typeof e)throw new zC(e,\"{ type, len? }\");if(e.len&&\"number\"!=typeof e.len)throw new Error(\"Invalid schema: \".concat(e));if(\"type\"in e)return LC(e.type);throw new zC(e,\"{ type, len? }\")}(e[n]);if(\"set\"===n)return LC(e[n]);if(\"map\"===n)return function(e){if(\"object\"!=typeof e||!(\"key\"in e)||!(\"value\"in e))throw new zC(e,\"{ key, value }\");LC(e.key),LC(e.value)}(e[n]);if(\"struct\"===n)return function(e){if(\"object\"!=typeof e)throw new zC(e,\"object\");for(var t in e)LC(e[t])}(e[n])}}throw new zC(e,MC.join(\", \")+\" or \"+UC.join(\", \"))}}!function(){function e(e){this.encoded=new BC,this.fieldPath=[\"value\"],this.checkTypes=e}e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if(\"string\"==typeof t){if(CC.includes(t))return this.encode_integer(e,t);if(\"string\"===t)return this.encode_string(e);if(\"bool\"===t)return this.encode_boolean(e)}if(\"object\"==typeof t){if(\"option\"in t)return this.encode_option(e,t);if(\"enum\"in t)return this.encode_enum(e,t);if(\"array\"in t)return this.encode_array(e,t);if(\"set\"in t)return this.encode_set(e,t);if(\"map\"in t)return this.encode_map(e,t);if(\"struct\"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var n=parseInt(t.substring(1));n<=32||\"f64\"==t?(this.checkTypes&&NC(e,\"number\",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&function(e,t){if(!([\"number\",\"string\",\"bigint\",\"boolean\"].includes(typeof e)||\"object\"==typeof e&&null!==e&&\"toString\"in e))throw new Error(\"Expected bigint, number, boolean or string not \".concat(typeof e,\"(\").concat(e,\") at \").concat(t.join(\".\")))}(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},e.prototype.encode_bigint=function(e,t){for(var n=t/8,r=new Uint8Array(n),o=0;o<n;o++)r[o]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_string=function(e){this.checkTypes&&NC(e,\"string\",this.fieldPath);for(var t=e,n=[],r=0;r<t.length;r++){var o=t.charCodeAt(r);o<128?n.push(o):o<2048?n.push(192|o>>6,128|63&o):o<55296||o>=57344?n.push(224|o>>12,128|o>>6&63,128|63&o):(r++,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}this.encoded.store_value(n.length,\"u32\"),this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_boolean=function(e){this.checkTypes&&NC(e,\"boolean\",this.fieldPath),this.encoded.store_value(e?1:0,\"u8\")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,\"u8\"):(this.encoded.store_value(1,\"u8\"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&function(e,t){if(\"object\"!=typeof e||null===e)throw new Error(\"Expected object not \".concat(typeof e,\"(\").concat(e,\") at \").concat(t.join(\".\")))}(e,this.fieldPath);for(var n=Object.keys(e)[0],r=0;r<t.enum.length;r++){var o=t.enum[r];if(n===Object.keys(o.struct)[0])return this.encoded.store_value(r,\"u8\"),this.encode_struct(e,o)}throw new Error(\"Enum key (\".concat(n,\") not found in enum schema: \").concat(JSON.stringify(t),\" at \").concat(this.fieldPath.join(\".\")))},e.prototype.encode_array=function(e,t){if(function(e){return Array.isArray(e)||!!e&&\"object\"==typeof e&&\"length\"in e&&\"number\"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error(\"Expected Array-like not \".concat(typeof e,\"(\").concat(e,\") at \").concat(this.fieldPath.join(\".\")))},e.prototype.encode_arraylike=function(e,t){t.array.len?OC(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,\"u32\");for(var n=0;n<e.length;n++)this.encode_value(e[n],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?OC(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,\"u32\"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&NC(e,\"object\",this.fieldPath);var n=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(n.length,\"u32\");for(var r=0,o=n;r<o.length;r++){var i=o[r];this.encode_value(i,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&NC(e,\"object\",this.fieldPath);var n=e instanceof Map,r=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(r.length,\"u32\");for(var o=0,i=r;o<i.length;o++){var a=i[o];this.encode_value(a,t.map.key),this.encode_value(n?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&NC(e,\"object\",this.fieldPath);for(var n=0,r=Object.keys(t.struct);n<r.length;n++){var o=r[n];this.fieldPath.push(o),this.encode_value(e[o],t.struct[o]),this.fieldPath.pop()}}}();var jC=function(){function e(e){this.buffer=new PC(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if(\"string\"==typeof e){if(CC.includes(e))return this.decode_integer(e);if(\"string\"===e)return this.decode_string();if(\"bool\"===e)return this.decode_boolean()}if(\"object\"==typeof e){if(\"option\"in e)return this.decode_option(e);if(\"enum\"in e)return this.decode_enum(e);if(\"array\"in e)return this.decode_array(e);if(\"set\"in e)return this.decode_set(e);if(\"map\"in e)return this.decode_map(e);if(\"struct\"in e)return this.decode_struct(e)}throw new Error(\"Unsupported type: \".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||\"f64\"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith(\"i\"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var n=e/8,r=new Uint8Array(this.buffer.consume_bytes(n)),o=r.reduceRight((function(e,t){return e+t.toString(16).padStart(2,\"0\")}),\"\");return t&&r[n-1]?BigInt.asIntN(e,BigInt(\"0x\".concat(o))):BigInt(\"0x\".concat(o))},e.prototype.decode_string=function(){for(var e=this.decode_integer(\"u32\"),t=new Uint8Array(this.buffer.consume_bytes(e)),n=[],r=0;r<e;++r){var o=t[r];if(o<128)n.push(o);else if(o<224)n.push((31&o)<<6|63&t[++r]);else if(o<240)n.push((15&o)<<12|(63&t[++r])<<6|63&t[++r]);else{var i=(7&o)<<18|(63&t[++r])<<12|(63&t[++r])<<6|63&t[++r];n.push(i)}}return String.fromCodePoint.apply(String,n)},e.prototype.decode_boolean=function(){return this.buffer.consume_value(\"u8\")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value(\"u8\");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error(\"Invalid option \".concat(t));return null},e.prototype.decode_enum=function(e){var t,n=this.buffer.consume_value(\"u8\");if(n>e.enum.length)throw new Error(\"Enum option \".concat(n,\" is not available\"));var r=e.enum[n].struct,o=Object.keys(r)[0];return(t={})[o]=this.decode_value(r[o]),t},e.prototype.decode_array=function(e){for(var t=[],n=e.array.len?e.array.len:this.decode_integer(\"u32\"),r=0;r<n;++r)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer(\"u32\"),n=new Set,r=0;r<t;++r)n.add(this.decode_value(e.set));return n},e.prototype.decode_map=function(e){for(var t=this.decode_integer(\"u32\"),n=new Map,r=0;r<t;++r){var o=this.decode_value(e.map.key),i=this.decode_value(e.map.value);n.set(o,i)}return n},e.prototype.decode_struct=function(e){var t={};for(var n in e.struct)t[n]=this.decode_value(e.struct[n]);return t},e}();function FC(e,t,n){return void 0===n&&(n=!0),n&&LC(e),new jC(t).decode(e)}var DC=(e=>(e[e.Uninitialized=0]=\"Uninitialized\",e[e.Initialized=1]=\"Initialized\",e[e.Frozen=2]=\"Frozen\",e))(DC||{});const $C=iu(),KC=(jc(),Wc()),qC=Jc(),WC=Ks(tl([[\"mint\",ru()],[\"owner\",ru()],[\"amount\",bc()],[\"delegate\",uh(ru(),{prefix:wc(),noneValue:\"zeroes\"})],[\"state\",Gu(DC)],[\"isNative\",uh(bc(),{prefix:wc(),noneValue:\"zeroes\"})],[\"delegatedAmount\",bc()],[\"closeAuthority\",uh(ru(),{prefix:wc(),noneValue:\"zeroes\"})]]),nl([[\"mint\",ou()],[\"owner\",ou()],[\"amount\",Ac()],[\"delegate\",lh(ou(),{prefix:vc(),noneValue:\"zeroes\"})],[\"state\",Zu(DC)],[\"isNative\",lh(Ac(),{prefix:vc(),noneValue:\"zeroes\"})],[\"delegatedAmount\",Ac()],[\"closeAuthority\",lh(ou(),{prefix:vc(),noneValue:\"zeroes\"})]]));var HC;!function(e){e.SymbolNotFound=\"SymbolNotFound\",e.InvalidSubdomain=\"InvalidSubdomain\",e.PrimaryDomainNotFound=\"PrimaryDomainNotFound\",e.MissingParentOwner=\"MissingParentOwner\",e.U32Overflow=\"U32Overflow\",e.InvalidBufferLength=\"InvalidBufferLength\",e.U64Overflow=\"U64Overflow\",e.NoRecordData=\"NoRecordData\",e.InvalidRecordData=\"InvalidRecordData\",e.UnsupportedRecord=\"UnsupportedRecord\",e.InvalidEvmAddress=\"InvalidEvmAddress\",e.InvalidInjectiveAddress=\"InvalidInjectiveAddress\",e.InvalidARecord=\"InvalidARecord\",e.InvalidAAAARecord=\"InvalidAAAARecord\",e.InvalidRecordInput=\"InvalidRecordInput\",e.InvalidSignature=\"InvalidSignature\",e.AccountDoesNotExist=\"AccountDoesNotExist\",e.MultipleRegistries=\"MultipleRegistries\",e.InvalidReverseTwitter=\"InvalidReverseTwitter\",e.NoAccountData=\"NoAccountData\",e.InvalidInput=\"InvalidInput\",e.InvalidDomain=\"InvalidDomain\",e.InvalidCustomBg=\"InvalidCustomBackground\",e.UnsupportedSignature=\"UnsupportedSignature\",e.RecordDoestNotSupportGuardianSig=\"RecordDoestNotSupportGuardianSig\",e.RecordIsNotSigned=\"RecordIsNotSigned\",e.UnsupportedSignatureType=\"UnsupportedSignatureType\",e.InvalidSolRecordV2=\"InvalidSolRecordV2\",e.MissingVerifier=\"MissingVerifier\",e.PythFeedNotFound=\"PythFeedNotFound\",e.InvalidRoA=\"InvalidRoA\",e.InvalidPda=\"InvalidPda\",e.InvalidParent=\"InvalidParent\",e.NftAccountNotFound=\"NftRecordNotFound\",e.PdaOwnerNotAllowed=\"PdaOwnerNotAllowed\",e.DomainDoesNotExist=\"DomainDoesNotExist\",e.RecordMalformed=\"RecordMalformed\",e.CouldNotFindNftOwner=\"CouldNotFindNftOwner\",e.InvalidValidation=\"InvalidValidation\",e.InvalidSerializedData=\"InvalidSerializedData\"}(HC||(HC={}));class VC extends Error{type;constructor(e,t){super(t),this.name=\"SNSError\",this.type=e,Error.captureStackTrace&&Error.captureStackTrace(this,VC)}}class GC extends VC{constructor(e){super(HC.PrimaryDomainNotFound,e)}}class ZC extends VC{constructor(e){super(HC.NoRecordData,e)}}class JC extends VC{constructor(e){super(HC.AccountDoesNotExist,e)}}class YC extends VC{constructor(e){super(HC.NoAccountData,e)}}class QC extends VC{constructor(e){super(HC.InvalidInput,e)}}class XC extends VC{constructor(e){super(HC.InvalidRoA,e)}}class eB extends VC{constructor(e){super(HC.NftAccountNotFound,e)}}class tB extends VC{constructor(e){super(HC.PdaOwnerNotAllowed,e)}}class nB extends VC{constructor(e){super(HC.DomainDoesNotExist,e)}}class rB extends VC{constructor(e){super(HC.RecordMalformed,e)}}class oB extends VC{constructor(e){super(HC.CouldNotFindNftOwner,e)}}class iB extends VC{constructor(e){super(HC.InvalidValidation,e)}}class aB extends VC{constructor(e){super(HC.InvalidSerializedData,e)}}class sB{static HEADER_LEN=96;parentName;owner;class;data;static schema={struct:{parentName:{array:{type:\"u8\",len:32}},owner:{array:{type:\"u8\",len:32}},class:{array:{type:\"u8\",len:32}}}};constructor(e){this.parentName=$C.decode(e.parentName),this.owner=$C.decode(e.owner),this.class=$C.decode(e.class)}static deserialize(e){try{const t=new sB(FC(this.schema,e));return t.data=e?.slice(this.HEADER_LEN),t}catch{throw new Error(\"Failed to deserialize RegistryState data\")}}static async retrieve(e,t){const n=await dp(e,t);if(!n.exists)throw new JC(\"The domain account does not exist\");return this.deserialize(n.data)}static async _retrieveBatch(e,t){return(await fp(e,t)).map((e=>e.exists?this.deserialize(e.data):void 0))}static async retrieveBatch(e,t){const n=[],r=[...t];for(;r.length>0;)n.push(...await this._retrieveBatch(e,r.splice(0,100)));return n}}const cB=\"58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx\",uB=\"nftD3vbNkNqfj2Sd3HZwbpw4BxxKWr4AjGb9X38JeZk\",lB=\"33m47vH6Eav6jr5Ry86XjhRft2jRBLDnDgPSHoquXi2Z\",dB=\"2pMnqHvei2N5oDcVGCRdZx48gqti199wr5CsyTTafsbo\",fB=async(e,t,n)=>{const r=await(async e=>{const t=qC.encode(\"SPL Name Service\"+e),n=await crypto.subtle.digest(\"SHA-256\",t);return new Uint8Array(n)})(e);return await(async(e,t,n)=>{const r=[e];r.push(n?$C.encode(n):new Uint8Array(32)),r.push(t?$C.encode(t):new Uint8Array(32));const[o]=await gu({programAddress:\"namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX\",seeds:r});return o})(r,t,n)};var hB;!function(e){e[e.Uninitialized=0]=\"Uninitialized\",e[e.CentralState=1]=\"CentralState\",e[e.ActiveRecord=2]=\"ActiveRecord\",e[e.InactiveRecord=3]=\"InactiveRecord\"}(hB||(hB={}));class pB{tag;nonce;nameAccount;owner;nftMint;static LEN=98;static schema={struct:{tag:\"u8\",nonce:\"u8\",nameAccount:{array:{type:\"u8\",len:32}},owner:{array:{type:\"u8\",len:32}},nftMint:{array:{type:\"u8\",len:32}}}};constructor(e){this.tag=e.tag,this.nonce=e.nonce,this.nameAccount=$C.decode(e.nameAccount),this.owner=$C.decode(e.owner),this.nftMint=$C.decode(e.nftMint)}static deserialize(e){try{return new pB(FC(this.schema,e))}catch{throw new aB(\"Failed to deserialize NftState data\")}}static async retrieve(e,t){const n=await dp(e,t);if(!n.exists)throw new eB(`NFT not found: ${t}`);return this.deserialize(n.data)}static async retrieveFromMint(e,t){const n=await e.getProgramAccounts(uB,{encoding:\"base64\",filters:[{dataSize:BigInt(pB.LEN)},{memcmp:{offset:BigInt(0),bytes:\"3\",encoding:\"base58\"}},{memcmp:{offset:BigInt(66),bytes:t,encoding:\"base58\"}}]}).send();if(1!==n.length)throw new eB(`NFT not found: ${t}`);return this.deserialize(KC.encode(n[0].account.data[0]))}static async getAddress(e){const[t]=await gu({programAddress:uB,seeds:[qC.encode(\"nft_record\"),$C.encode(e)]});return t}}const gB=qC.encode(\"tokenized_name\"),mB=async(e,t)=>{try{const n=await(async e=>{const[t]=await gu({programAddress:uB,seeds:[gB,$C.encode(e)]});return t})(t),r=await e.getTokenLargestAccounts(n).send();if(0===r.value.length)return null;const o=await dp(e,r.value[0].address);if(!o.exists)return null;const i=WC.decode(o.data);return\"1\"===i.amount.toString()?i.owner:null}catch(e){if(Is(e,na))return null;throw e}};class yB{tag;nameAccount;static schema={struct:{tag:\"u8\",nameAccount:{array:{type:\"u8\",len:32}}}};constructor(e){this.tag=e.tag,this.nameAccount=$C.decode(e.nameAccount)}static deserialize(e){try{return new yB(FC(this.schema,e))}catch{throw new aB(\"Failed to deserialize PrimaryDomainState data\")}}static async retrieve(e,t){const n=await dp(e,t);if(!n.exists)throw new GC(\"The favourite account does not exist\");return this.deserialize(n.data)}static async _retrieveBatch(e,t){return(await fp(e,t)).map((e=>e.exists?this.deserialize(e.data):void 0))}static async retrieveBatch(e,t){const n=[],r=[...t];for(;r.length>0;)n.push(...await this._retrieveBatch(e,r.splice(0,100)));return n}static async getAddress(e,t){const[n]=await gu({programAddress:e,seeds:[qC.encode(\"favourite_domain\"),$C.encode(t)]});return n}}async function wB(e,t,n){const r=await(async(e,t)=>await fB(e,t,lB))(t,n),o=await sB.retrieve(e,r);if(!o.data)throw new YC(\"The registry data is empty\");return function(e,t=!1){if(!e)return;const n=new DataView(e.buffer).getUint32(0,!0);return qC.decode(e.subarray(4,4+n)).replace(/^\\0/,t?\"\":\"\\0\")}(o.data,!!n)}var vB;!function(e){e.IPFS=\"IPFS\",e.ARWV=\"ARWV\",e.SOL=\"SOL\",e.ETH=\"ETH\",e.BTC=\"BTC\",e.LTC=\"LTC\",e.DOGE=\"DOGE\",e.Email=\"email\",e.Url=\"url\",e.Discord=\"discord\",e.Github=\"github\",e.Reddit=\"reddit\",e.Twitter=\"twitter\",e.Telegram=\"telegram\",e.Pic=\"pic\",e.SHDW=\"SHDW\",e.POINT=\"POINT\",e.BSC=\"BSC\",e.Injective=\"INJ\",e.Backpack=\"backpack\",e.A=\"A\",e.AAAA=\"AAAA\",e.CNAME=\"CNAME\",e.TXT=\"TXT\",e.Background=\"background\",e.BASE=\"BASE\",e.IPNS=\"IPNS\"}(vB||(vB={}));new Map([[vB.SOL,96],[vB.ETH,20],[vB.BSC,20],[vB.Injective,20],[vB.A,4],[vB.AAAA,16],[vB.Background,32]]);var bB;!function(e){e[e.V1=1]=\"V1\",e[e.V2=2]=\"V2\"}(bB||(bB={}));const AB=async(e,t)=>{e.endsWith(\".sol\")&&(e=e.slice(0,-4));const n=t===bB.V2?dB:void 0,r={[bB.V2]:\"\u0002\",[bB.V1]:\"\u0001\"}[t]||\"\\0\",o=e.split(\".\");if(2===o.length){const e=await fB(o[1],cB);return{address:await fB(r+o[0],e,n),parentAddress:e,isSub:!0}}if(3===o.length&&t){const e=await fB(o[2],cB),t=await fB(\"\\0\"+o[1],e);return{address:await fB(r+o[0],t,n),parentAddress:e,isSub:!0,isSubRecord:!0}}if(o.length>=3)throw new QC(\"The domain is malformed\");return{address:await fB(e,cB),isSub:!1}};function SB(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function EB(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>\"string\"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function xB(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function kB(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function IB(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function TB(e,t){if(!EB(!0,t))throw new Error(`${e}: array of strings expected`)}function _B(e,t){if(!EB(!1,t))throw new Error(`${e}: array of numbers expected`)}const CB=(e,t)=>0===t?e:CB(t,e%t),BB=(e,t)=>e+(t-CB(e,t)),PB=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function RB(e,t,n,r){if(IB(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(BB(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${BB(t,n)}`);let o=0,i=0;const a=PB[t],s=PB[n]-1,c=[];for(const r of e){if(kB(r),r>=a)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(o=o<<t|r,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((o>>i-n&s)>>>0);const e=PB[i];if(void 0===e)throw new Error(\"invalid carry\");o&=e-1}if(o=o<<n-i&s,!r&&i>=t)throw new Error(\"Excess padding\");if(!r&&o>0)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&c.push(o>>>0),c}function NB(e){return function(e){if(\"function\"!=typeof e)throw new Error(\"function expected\")}(e),function(...t){try{return e.apply(null,t)}catch(e){}}}const OB=function(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}(function(e){const t=e.split(\"\"),n=t.length;TB(\"alphabet\",t);const r=new Map(t.map(((e,t)=>[e,t])));return{encode:r=>(IB(r),r.map((r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet \"${r}\". Allowed: ${e}`);return t[r]}))),decode:t=>(IB(t),t.map((t=>{xB(\"alphabet.decode\",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n})))}}(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),function(e=\"\"){return xB(\"join\",e),{encode:t=>(TB(\"join.decode\",t),t.join(e)),decode:t=>(xB(\"join.decode\",t),t.split(e))}}(\"\")),UB=[996825010,642813549,513874426,1027748829,705979059];function MB(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<UB.length;e++)1==(t>>e&1)&&(n^=UB[e]);return n}function zB(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=MB(o)^n>>5}o=MB(o);for(let t=0;t<r;t++)o=MB(o)^31&e.charCodeAt(t);for(let e of t)o=MB(o)^e;for(let e=0;e<6;e++)o=MB(o);return o^=n,OB.encode(RB([o%PB[30]],30,5,!1))}!function(){const e=function(e,t=!1){if(kB(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(BB(8,e)>32||BB(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!SB(n))throw new Error(\"radix2.encode input should be Uint8Array\");return RB(Array.from(n),8,e,!t)},decode:n=>(_B(\"radix2.decode\",n),Uint8Array.from(RB(n,e,8,t)))}}(5),t=e.decode,n=e.encode,r=NB(t);function o(e,t,n=90){xB(\"bech32.encode prefix\",e),SB(t)&&Array.from(t),_B(\"bech32.encode\",t);const r=e.length;if(0===r)throw new TypeError(`Invalid prefix length ${r}`);const o=r+7+t.length;if(!1!==n&&o>n)throw new TypeError(`Length ${o} exceeds limit ${n}`);const i=e.toLowerCase(),a=zB(i,t,1);return`${i}1${OB.encode(t)}${a}`}function i(e,t=90){xB(\"bech32.decode input\",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const o=r.lastIndexOf(\"1\");if(0===o||-1===o)throw new Error('Letter \"1\" must be present between prefix and data only');const i=r.slice(0,o),a=r.slice(o+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const s=OB.decode(a).slice(0,-6),c=zB(i,s,1);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected \"${c}\"`);return{prefix:i,words:s}}NB(i)}();var LB,jB={exports:{}},FB=jB.exports;!function(){return LB||(LB=1,e=jB,function(t){const n=\"(0?\\\\d+|0x[a-f0-9]+)\",r={fourOctet:new RegExp(`^${n}\\\\.${n}\\\\.${n}\\\\.${n}$`,\"i\"),threeOctet:new RegExp(`^${n}\\\\.${n}\\\\.${n}$`,\"i\"),twoOctet:new RegExp(`^${n}\\\\.${n}$`,\"i\"),longValue:new RegExp(`^${n}$`,\"i\")},o=new RegExp(\"^0[0-7]+$\",\"i\"),i=new RegExp(\"^0x[a-f0-9]+$\",\"i\"),a=\"%[0-9a-z]{1,}\",s=\"(?:[0-9a-f]+::?)+\",c={zoneIndex:new RegExp(a,\"i\"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${a})?$`,\"i\"),deprecatedTransitional:new RegExp(`^(?:::)(${n}\\\\.${n}\\\\.${n}\\\\.${n}(${a})?)$`,\"i\"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\\\.${n}\\\\.${n}\\\\.${n}(${a})?$`,\"i\")};function u(e,t){if(e.indexOf(\"::\")!==e.lastIndexOf(\"::\"))return null;let n,r,o=0,i=-1,a=(e.match(c.zoneIndex)||[])[0];for(a&&(a=a.substring(1),e=e.replace(/%.+$/,\"\"));(i=e.indexOf(\":\",i+1))>=0;)o++;if(\"::\"===e.substr(0,2)&&o--,\"::\"===e.substr(-2,2)&&o--,o>t)return null;for(r=t-o,n=\":\";r--;)n+=\"0:\";return\":\"===(e=e.replace(\"::\",n))[0]&&(e=e.slice(1)),\":\"===e[e.length-1]&&(e=e.slice(0,-1)),{parts:t=function(){const t=e.split(\":\"),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n}(),zoneId:a}}function l(e,t,n,r){if(e.length!==t.length)throw new Error(\"ipaddr: cannot match CIDR for objects with different lengths\");let o,i=0;for(;r>0;){if(o=n-r,o<0&&(o=0),e[i]>>o!=t[i]>>o)return!1;r-=n,i+=1}return!0}function d(e){if(i.test(e))return parseInt(e,16);if(\"0\"===e[0]&&!isNaN(parseInt(e[1],10))){if(o.test(e))return parseInt(e,8);throw new Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}const h={};h.IPv4=function(){function e(e){if(4!==e.length)throw new Error(\"ipaddr: ipv4 octet count should be 4\");let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw new Error(\"ipaddr: ipv4 octet should fit in 8 bits\");this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return\"ipv4\"},e.prototype.match=function(e,t){let n;if(void 0===t&&(n=e,e=n[0],t=n[1]),\"ipv4\"!==e.kind())throw new Error(\"ipaddr: cannot match ipv4 address with non-ipv4 one\");return l(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let r,o,i;for(r=3;r>=0;r-=1){if(o=this.octets[r],!(o in n))return null;if(i=n[o],t&&0!==i)return null;8!==i&&(t=!0),e+=i}return 32-e},e.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(\".\")},e}(),h.IPv4.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let i=0;for(;i<4;)o.push(parseInt(n[i],10)|255^parseInt(r[i],10)),i++;return new this(o)}catch(e){throw new Error(\"ipaddr: the address does not have IPv4 CIDR format\")}},h.IPv4.isIPv4=function(e){return null!==this.parser(e)},h.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch(e){return!1}},h.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch(e){return!1}},h.IPv4.isValidFourPartDecimal=function(e){return!(!h.IPv4.isValid(e)||!e.match(/^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(e){let t,n,r,o,i;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],n=0;n<4;)o.push(parseInt(r[n],10)&parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error(\"ipaddr: the address does not have IPv4 CIDR format\")}},h.IPv4.parse=function(e){const t=this.parser(e);if(null===t)throw new Error(\"ipaddr: string is not formatted like an IPv4 Address\");return new this(t)},h.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\\/(\\d+)$/)){const e=parseInt(t[2]);if(e>=0&&e<=32){const n=[this.parse(t[1]),e];return Object.defineProperty(n,\"toString\",{value:function(){return this.join(\"/\")}}),n}}throw new Error(\"ipaddr: string is not formatted like an IPv4 CIDR range\")},h.IPv4.parser=function(e){let t,n,o;if(t=e.match(r.fourOctet))return function(){const e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r}();if(t=e.match(r.longValue)){if(o=d(t[1]),o>4294967295||o<0)throw new Error(\"ipaddr: address outside defined range\");return function(){const e=[];let t;for(t=0;t<=24;t+=8)e.push(o>>t&255);return e}().reverse()}return(t=e.match(r.twoOctet))?function(){const e=t.slice(1,4),n=[];if(o=d(e[1]),o>16777215||o<0)throw new Error(\"ipaddr: address outside defined range\");return n.push(d(e[0])),n.push(o>>16&255),n.push(o>>8&255),n.push(255&o),n}():(t=e.match(r.threeOctet))?function(){const e=t.slice(1,5),n=[];if(o=d(e[2]),o>65535||o<0)throw new Error(\"ipaddr: address outside defined range\");return n.push(d(e[0])),n.push(d(e[1])),n.push(o>>8&255),n.push(255&o),n}():null},h.IPv4.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>32)throw new Error(\"ipaddr: invalid IPv4 prefix length\");const t=[0,0,0,0];let n=0;const r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},h.IPv6=function(){function e(e,t){let n,r;if(16===e.length)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else{if(8!==e.length)throw new Error(\"ipaddr: ipv6 part count should be 8 or 16\");this.parts=e}for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw new Error(\"ipaddr: ipv6 part should fit in 16 bits\");t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],\"6to4\":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32]]},e.prototype.isIPv4MappedAddress=function(){return\"ipv4Mapped\"===this.range()},e.prototype.kind=function(){return\"ipv6\"},e.prototype.match=function(e,t){let n;if(void 0===t&&(n=e,e=n[0],t=n[1]),\"ipv6\"!==e.kind())throw new Error(\"ipaddr: cannot match ipv6 address with non-ipv6 one\");return l(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1;const n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let r,o;for(let i=7;i>=0;i-=1){if(r=this.parts[i],!(r in n))return null;if(o=n[r],t&&0!==o)return null;16!==o&&(t=!0),e+=o}return 128-e},e.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e;const t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(255&e);return t},e.prototype.toFixedLengthString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}.call(this).join(\":\");let t=\"\";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error(\"ipaddr: trying to convert a generic ipv6 address to ipv4\");const e=this.parts.slice(-2),t=e[0],n=e[1];return new h.IPv4([t>>8,255&t,n>>8,255&n])},e.prototype.toNormalizedString=function(){const e=function(){const e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}.call(this).join(\":\");let t=\"\";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){const e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString();let n,r=0,o=-1;for(;n=e.exec(t);)n[0].length>o&&(r=n.index,o=n[0].length);return o<0?t:`${t.substring(0,r)}::${t.substring(r+o)}`},e.prototype.toString=function(){return this.toRFC5952String()},e}(),h.IPv6.broadcastAddressFromCIDR=function(e){try{const t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[];let i=0;for(;i<16;)o.push(parseInt(n[i],10)|255^parseInt(r[i],10)),i++;return new this(o)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},h.IPv6.isIPv6=function(e){return null!==this.parser(e)},h.IPv6.isValid=function(e){if(\"string\"==typeof e&&-1===e.indexOf(\":\"))return!1;try{const t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch(e){return!1}},h.IPv6.isValidCIDR=function(e){if(\"string\"==typeof e&&-1===e.indexOf(\":\"))return!1;try{return this.parseCIDR(e),!0}catch(e){return!1}},h.IPv6.networkAddressFromCIDR=function(e){let t,n,r,o,i;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],n=0;n<16;)o.push(parseInt(r[n],10)&parseInt(i[n],10)),n++;return new this(o)}catch(e){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},h.IPv6.parse=function(e){const t=this.parser(e);if(null===t.parts)throw new Error(\"ipaddr: string is not formatted like an IPv6 Address\");return new this(t.parts,t.zoneId)},h.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\\/(\\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,\"toString\",{value:function(){return this.join(\"/\")}}),r;throw new Error(\"ipaddr: string is not formatted like an IPv6 CIDR range\")},h.IPv6.parser=function(e){let t,n,r,o,i,a;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return u(e,8);if((r=e.match(c.transitional))&&(a=r[6]||\"\",t=r[1],r[1].endsWith(\"::\")||(t=t.slice(0,-1)),t=u(t+a,6),t.parts)){for(i=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<i.length;n++)if(o=i[n],!(0<=o&&o<=255))return null;return t.parts.push(i[0]<<8|i[1]),t.parts.push(i[2]<<8|i[3]),{parts:t.parts,zoneId:t.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>128)throw new Error(\"ipaddr: invalid IPv6 prefix length\");const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let n=0;const r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},h.fromByteArray=function(e){const t=e.length;if(4===t)return new h.IPv4(e);if(16===t)return new h.IPv6(e);throw new Error(\"ipaddr: the binary input is neither an IPv6 nor IPv4 address\")},h.isValid=function(e){return h.IPv6.isValid(e)||h.IPv4.isValid(e)},h.isValidCIDR=function(e){return h.IPv6.isValidCIDR(e)||h.IPv4.isValidCIDR(e)},h.parse=function(e){if(h.IPv6.isValid(e))return h.IPv6.parse(e);if(h.IPv4.isValid(e))return h.IPv4.parse(e);throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 format\")},h.parseCIDR=function(e){try{return h.IPv6.parseCIDR(e)}catch(t){try{return h.IPv4.parseCIDR(e)}catch(e){throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 CIDR format\")}}},h.process=function(e){const t=this.parse(e);return\"ipv6\"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t},h.subnetMatch=function(e,t,n){let r,o,i,a;for(o in null==n&&(n=\"unicast\"),t)if(Object.prototype.hasOwnProperty.call(t,o))for(i=t[o],!i[0]||i[0]instanceof Array||(i=[i]),r=0;r<i.length;r++)if(a=i[r],e.kind()===a[0].kind()&&e.match.apply(e,a))return o;return n},e.exports?e.exports=h:t.ipaddr=h}(FB)),jB.exports;var e}();Math.floor,String.fromCharCode;new Map([[vB.CNAME,\"ExXjtfdQe8JacoqP9Z535WzQKjF4CzW1TTRKRgpxvya3\"],[vB.Url,\"ExXjtfdQe8JacoqP9Z535WzQKjF4CzW1TTRKRgpxvya3\"]]),new Set([vB.BASE,vB.BSC,vB.ETH,vB.Injective]),new Set([vB.BASE,vB.BSC,vB.ETH]),new Set([vB.ARWV,vB.Backpack,vB.BTC,vB.CNAME,vB.Discord,vB.DOGE,vB.Email,vB.Github,vB.IPFS,vB.IPNS,vB.LTC,vB.Pic,vB.POINT,vB.Reddit,vB.SHDW,vB.Telegram,vB.Twitter,vB.TXT,vB.Url]),new Set([vB.BASE,vB.BSC,vB.ETH,vB.Injective,vB.SOL]);new Map([[\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",[234,160,32,198,28,196,121,113,40,19,70,28,225,83,137,74,150,166,192,11,33,237,12,252,39,152,209,249,169,233,201,74]],[\"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB\",[43,137,185,220,143,223,159,52,112,154,91,16,107,71,47,15,57,187,108,169,206,4,176,253,127,46,151,22,136,226,229,59]],[\"So11111111111111111111111111111111111111112\",[239,13,139,111,218,44,235,164,29,161,93,64,149,209,218,57,42,13,47,142,208,198,199,188,15,76,250,200,194,128,181,109]],[\"EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp\",[200,6,87,183,246,243,234,194,114,24,208,157,90,78,84,228,123,37,118,141,159,94,16,172,21,254,44,249,0,136,20,0]],[\"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So\",[194,40,154,106,67,210,206,145,198,245,92,174,195,112,244,172,195,138,46,212,119,245,136,19,51,76,109,3,116,159,242,164]],[\"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263\",[114,176,33,33,124,163,254,104,146,42,25,170,249,144,16,156,185,216,78,154,208,4,180,210,2,90,214,245,41,49,68,25]],[\"EPeUFDgHRxs9xxEPVaL6kfGQvCon7jmAWKVUHuux1Tpz\",[142,134,15,183,78,96,229,115,107,69,93,130,246,11,55,40,4,156,52,142,148,150,26,221,95,150,27,2,253,238,37,53]],[\"HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3\",[11,191,40,233,168,65,161,204,120,143,106,54,27,23,202,7,45,14,163,9,138,30,93,241,195,146,45,6,113,149,121,255]],[\"bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1\",[137,135,83,121,231,15,143,186,220,23,174,243,21,173,243,168,213,209,96,184,17,67,85,55,224,60,151,232,170,201,125,156]],[\"6McPRfPV6bY1e9hLxWyG54W9i9Epq75QBvXg2oetBVTB\",[122,91,193,210,181,106,208,41,4,140,214,57,100,179,173,39,118,234,223,129,46,220,26,67,163,20,6,203,84,191,245,146]],[\"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN\",[135,149,81,2,24,83,238,199,167,220,130,117,120,232,230,157,167,228,250,129,72,51,154,160,211,213,41,100,5,190,75,26]]]);var DB;!function(e){e[e.None=0]=\"None\",e[e.Solana=1]=\"Solana\",e[e.Ethereum=2]=\"Ethereum\",e[e.UnverifiedSolana=3]=\"UnverifiedSolana\"}(DB||(DB={}));const $B=e=>{switch(e){case DB.None:return 0;case DB.Ethereum:return 20;case DB.Solana:case DB.UnverifiedSolana:return 32;default:throw new Error(\"Invalid validation enum\")}};class KB{stalenessValidation;rightOfAssociationValidation;contentLength;static LEN=8;static schema={struct:{stalenessValidation:\"u16\",rightOfAssociationValidation:\"u16\",contentLength:\"u32\"}};constructor(e){this.stalenessValidation=e.stalenessValidation,this.rightOfAssociationValidation=e.rightOfAssociationValidation,this.contentLength=e.contentLength}static deserialize(e){return new KB(FC(this.schema,e,!0))}static async retrieve(e,t){const n=await dp(e,t);if(!n.exists)throw new Error(\"Record header account not found\");return this.deserialize(n.data.slice(96,96+this.LEN))}}class qB{header;data;constructor(e,t){this.data=t,this.header=e}static deserialize(e){const t=KB.deserialize(e.slice(96,96+KB.LEN));return new qB(t,e.slice(96+KB.LEN))}static async retrieve(e,t){const n=await dp(e,t);if(!n.exists)throw new ZC(\"Record account not found\");return this.deserialize(n.data)}static async retrieveBatch(e,t){return(await fp(e,t)).map((e=>e.exists?this.deserialize(e.data):void 0))}getContent(){const e=$B(this.header.stalenessValidation)+$B(this.header.rightOfAssociationValidation);return this.data.slice(e)}getStalenessId(){const e=$B(this.header.stalenessValidation);return this.data.slice(0,e)}getRoAId(){const e=$B(this.header.stalenessValidation),t=e+$B(this.header.rightOfAssociationValidation);return this.data.slice(e,t)}}const WB=57896044618658097711785492504343953926634992332820282019728792003956564819949n,HB=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function VB(e){const t=e%WB;return t>=0n?t:WB+t}function GB(e,t){let n=e;for(;t-- >0n;)n*=n,n%=WB;return n}function ZB(e,t){const n=VB(e*e),r=function(e,t){const n=VB(t*t*t),r=function(e){const t=e*e%WB*e%WB,n=GB(t,2n)*t%WB,r=GB(n,1n)*e%WB,o=GB(r,5n)*r%WB,i=GB(o,10n)*o%WB,a=GB(i,20n)*i%WB,s=GB(a,40n)*a%WB,c=GB(s,80n)*s%WB,u=GB(c,80n)*s%WB,l=GB(u,10n)*o%WB;return GB(l,2n)*e%WB}(e*VB(n*n*t));let o=VB(e*n*r);const i=VB(t*o*o),a=o,s=VB(o*HB),c=i===e,u=i===VB(-e),l=i===VB(-e*HB);return c&&(o=a),(u||l)&&(o=s),1n==(1n&VB(o))&&(o=VB(-o)),c||u?o:null}(VB(n-1n),VB(37095705934669439343138083508754565189542113879843219016388785533085940283555n*n+1n));return null!==r&&(0n!==r||!(128&t))}const JB=async(e,t,n={allowPda:!1})=>{const{address:r}=await AB(t),o=await pB.getAddress(r),i=await(async(e,t)=>{const{address:n}=await AB(t+\".\"+e,bB.V1);return n})(t,vB.SOL),a=await(async(e,t)=>{const{address:n}=await AB(e);return await fB(`\u0002${t}`,n,dB)})(t,vB.SOL),[s,c,u,l]=await fp(e,[r,o,i,a]);if(!s.exists)throw new nB(`Domain ${t} does not exist`);const d=sB.deserialize(s.data);if(c.exists&&pB.deserialize(c.data).tag===hB.ActiveRecord){const t=await mB(e,r);if(!t)throw new oB;return t}e:if(l.exists){const e=qB.deserialize(l.data),t=e.getStalenessId(),n=e.getRoAId(),r=e.getContent();if(32!==r.length)throw new rB(\"Record is malformed\");if(e.header.rightOfAssociationValidation!==DB.Solana||e.header.stalenessValidation!==DB.Solana)throw new iB;if(d.owner!==$C.decode(t))break e;if(((e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])))(n,r))return $C.decode(r);throw new XC(`The RoA ID shoudl be ${$C.decode(r)} but is ${$C.decode(n)} `)}if(u.exists){const e=new Uint8Array([...u.data.slice(sB.HEADER_LEN,sB.HEADER_LEN+32),...$C.encode(i)]),t=u.data.slice(sB.HEADER_LEN+32,sB.HEADER_LEN+32+64),n=await(async({data:e,signature:t,address:n})=>{const r=await async function(e){const t=ru().encode(e);return await crypto.subtle.importKey(\"raw\",t,{name:\"Ed25519\"},!0,[\"verify\"])}(n),o=qC.encode((e=>Array.from(e).map((e=>e.toString(16).padStart(2,\"0\"))).join(\"\"))(e));return await crypto.subtle.verify({name:\"Ed25519\"},r,t,o)})({data:e,signature:t,address:d.owner});if(n)return $C.decode(u.data.slice(sB.HEADER_LEN,sB.HEADER_LEN+32))}if(!function(e){const t=$C.encode(e);if(32!==t.byteLength)return!1;return ZB(function(e){const t=e.reduce(((e,t,n)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===n?-129&t:t)}${e}`),\"\");return BigInt(`0x${t}`)}(t),t[31])}(d.owner)){if(\"any\"===n.allowPda)return d.owner;if(n.allowPda){const t=await dp(e,d.owner);if(!t.exists)throw new tB(\"Invalid domain owner account\");const r=n.programIds?.some((e=>t.programAddress===e));if(r)return d.owner;throw new tB(`The program ${t.programAddress} is not allowed`)}throw new tB}return d.owner};new Error(\"timeout while waiting for mutex to become available\"),new Error(\"mutex already locked\");const YB=new Error(\"request for lock canceled\");var QB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};class XB{constructor(e,t=YB){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(((n,r)=>{const o={resolve:n,reject:r,weight:e,priority:t},i=eP(this._queue,(e=>t<=e.priority));-1===i&&e<=this._value?this._dispatchItem(o):this._queue.splice(i+1,0,o)}))}runExclusive(e){return QB(this,arguments,void 0,(function*(e,t=1,n=0){const[r,o]=yield this.acquire(t,n);try{return yield e(r)}finally{o()}}))}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise((n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const n=eP(e,(e=>t.priority<=e.priority));e.splice(n+1,0,t)}(this._weightedWaiters[e-1],{resolve:n,priority:t})}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach((e=>e.resolve())),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const n=this._weightedWaiters[t-1];if(!n)continue;const r=n.findIndex((t=>t.priority<=e));(-1===r?n:n.splice(0,r)).forEach((e=>e.resolve()))}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function eP(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}var tP=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};class nP{constructor(e){this._semaphore=new XB(1,e)}acquire(){return tP(this,arguments,void 0,(function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t}))}runExclusive(e,t=0){return this._semaphore.runExclusive((()=>e()),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class rP{#Oe=new nP;#Ue=new nP;#Me=0;#ze=null;async#Le(){this.#Ue.isLocked()||(this.#ze=await this.#Ue.acquire())}async wrapRegularStateOperation(e){await Promise.all([this.#Oe.waitForUnlock(),this.#Le()]);try{return this.#Me+=1,await e()}finally{this.#Me-=1,0===this.#Me&&this.#ze&&this.#ze()}}async wrapManageStateOperation(e){return await this.#Ue.waitForUnlock(),await this.#Oe.runExclusive(e)}}function oP(e){return e.includes(\"swift:0/iso4217:\")}var iP=function(e){return e.Benign=\"Benign\",e.Warning=\"Warning\",e.Malicious=\"Malicious\",e}({}),aP=function(e){return e.SUCCESS=\"SUCCESS\",e.ERROR=\"ERROR\",e}({});const sP=new HI,cP=new class{#i;#je=new Map;constructor(e){this.#i=Gd(e,\"[⚡ EventEmitter]\")}on(e,t){this.#i.info(`Adding listener for event ${e}`),this.#je.has(e)||this.#je.set(e,new Set),this.#je.get(e)?.add(t)}off(e,t){this.#i.info(`Removing listener for event ${e}`);const n=this.#je.get(e);n&&(n.delete(t),0===n.size&&this.#je.delete(e))}async emitSync(e,t){this.#i.info(`Emitting event ${e}`);const n=this.#je.get(e);if(n){const e=Array.from(n).map((async e=>await e(t)));await Promise.allSettled(e)}}removeAllListeners(e){e?(this.#i.info(`Removing all listeners for event ${e}`),this.#je.delete(e)):(this.#i.info(\"Removing all listeners for all events\"),this.#je.clear())}listenerCount(e){const t=this.#je.get(e);return t?t.size:0}eventNames(){return Array.from(this.#je.keys())}}(Zd),uP=new class{#Fe=new rP;#E;constructor(e,t){this.#E=t,e.on(\"onStart\",this.#De.bind(this)),e.on(\"onUpdate\",this.#De.bind(this)),e.on(\"onInstall\",this.#De.bind(this))}async#De(){await this.update((e=>(0,Bf.omit)(e,[\"assets\"])))}async#$e(){const e=await snap.request({method:\"snap_getState\",params:{encrypted:this.#E.encrypted}}),t=kI(e??{});var n,r;return n=this.#E.defaultState,r=t,{...n,...Object.fromEntries(Object.entries(r).filter((([e,t])=>null!=t&&(!t||\"object\"!=typeof t||Object.keys(t).length>0))))}}async get(){return this.#Fe.wrapRegularStateOperation((async()=>this.#$e()))}async getKey(e){return this.#Fe.wrapRegularStateOperation((async()=>{const t=await snap.request({method:\"snap_getState\",params:{key:e,encrypted:this.#E.encrypted}});if(null!==t)return kI(t)}))}async setKey(e,t){await this.#Fe.wrapRegularStateOperation((async()=>{await snap.request({method:\"snap_setState\",params:{key:e,value:II(t),encrypted:this.#E.encrypted}})}))}async setKeyWith(e,t){await this.#Fe.wrapManageStateOperation((async()=>{const n=await snap.request({method:\"snap_getState\",params:{key:e,encrypted:this.#E.encrypted}}),r=null===n?void 0:kI(n),o=t(r);await snap.request({method:\"snap_setState\",params:{key:e,value:II(o),encrypted:this.#E.encrypted}})}))}async update(e){return await this.#Fe.wrapManageStateOperation((async()=>{const t=await this.#$e(),n=e(t);return await snap.request({method:\"snap_manageState\",params:{operation:\"update\",newState:II(n),encrypted:this.#E.encrypted}}),n}))}async deleteKey(e){return this.setKey(e,void 0)}async deleteKeys(e){await this.update((t=>(e.forEach((e=>{(0,Bf.unset)(t,e)})),t)))}}(cP,{encrypted:!1,defaultState:{keyringAccounts:{},mapInterfaceNameToId:{},transactions:{},signatures:{},assetEntities:{},tokenPrices:{},subscriptions:{},webSocketConnections:{closeWebSocketConnectionsBackgroundEventId:null}}}),lP=new class{#Ke;prefix;logger;constructor(e,t=console,n=\"__cache__default\"){this.#Ke=e,this.logger=t,this.prefix=n}async get(e){return(await this.mget([e]))[e]}async set(e,t,n=Number.MAX_SAFE_INTEGER){this.#qe(n),await this.#Ke.setKey(`${this.prefix}.${e}`,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}#qe(e){if(void 0!==e){if(\"number\"!=typeof e)throw new Error(\"TTL must be a number\");if(e<0)throw new Error(\"TTL must be positive\");if(e>Number.MAX_SAFE_INTEGER)throw new Error(\"TTL must be less than 2^53 - 1\")}}async delete(e){return(await this.mdelete([e]))[e]??!1}async clear(){await this.#Ke.setKey(this.prefix,{})}async has(e){return void 0!==await this.get(e)}async keys(){const e=await this.#Ke.getKey(this.prefix);return Object.keys(e??{})}async size(){const e=await this.#Ke.getKey(this.prefix);return Object.keys(e??{}).length}async peek(e){const t=await this.#Ke.getKey(this.prefix),n=t?.[e];return n?.value}async mget(e){const t=await this.#Ke.getKey(this.prefix),n=Object.entries(t??{}).filter((([t])=>e.includes(t))),r=n.filter((([e,t])=>t&&t.expiresAt<Date.now()));return await this.mdelete(r.map((([e])=>e))),n.reduce(((e,[t,n])=>void 0===n?(this.logger.info(`[StateCache] ❌ Cache miss for key \"${t}\"`),e):(n.expiresAt<Date.now()?(this.logger.info(`[StateCache] ⌛ Cache expired for key \"${t}\"`),e[t]=void 0):(this.logger.info(`[StateCache] 🎉 Cache hit for key \"${t}\"`),e[t]=n.value),e)),{})}async mset(e){if(0!==e.length)if(1!==e.length)e.forEach((({ttlMilliseconds:e})=>{this.#qe(e)})),await this.#Ke.update((t=>{const n=t[this.prefix]??{};return e.forEach((({key:e,value:t,ttlMilliseconds:r})=>{void 0!==t&&(n[e]={value:t,expiresAt:Math.min(Date.now()+(r??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})})),t[this.prefix]=n,t}));else{Xi(e[0]);const{key:t,value:n,ttlMilliseconds:r}=e[0];await this.set(t,n,r)}}async mdelete(e){const t={};return await this.#Ke.update((n=>{const r=n[this.prefix]??{};return e.forEach((e=>{void 0===r[e]?t[e]=!1:(delete r[e],t[e]=!0)})),n[this.prefix]=r,n})),t}}(uP,Zd),dP=new class{#R=new Map;logger;constructor(e){this.logger=Gd(e,\"[💾 InMemoryCache]\")}#qe(e){if(void 0!==e){if(\"number\"!=typeof e)throw new Error(\"TTL must be a number\");if(e<0)throw new Error(\"TTL must be positive\");if(e>Number.MAX_SAFE_INTEGER)throw new Error(\"TTL must be less than 2^53 - 1\")}}#Ne(e){return e.expiresAt<Date.now()}async#We(){const e=[];for(const[t,n]of this.#R.entries())this.#Ne(n)&&e.push(t);await this.mdelete(e)}async get(e){return(await this.mget([e]))[e]}async set(e,t,n=Number.MAX_SAFE_INTEGER){this.#qe(n),this.#R.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}async delete(e){return(await this.mdelete([e]))[e]??!1}async clear(){this.#R.clear()}async has(e){const t=this.#R.get(e);return!!t&&(!this.#Ne(t)||(this.#R.delete(e),!1))}async keys(){return await this.#We(),Array.from(this.#R.keys())}async size(){return await this.#We(),this.#R.size}async peek(e){const t=this.#R.get(e);if(t){if(!this.#Ne(t))return t.value;this.#R.delete(e)}}async mget(e){await this.#We();const t={};for(const n of e){const e=this.#R.get(n);e?(this.logger.info(`🎉 Cache hit for key \"${n}\"`),t[n]=e.value):(this.logger.info(`❌ Cache miss for key \"${n}\"`),t[n]=void 0)}return t}async mset(e){if(0!==e.length)if(1!==e.length)e.forEach((({ttlMilliseconds:e})=>{this.#qe(e)})),e.forEach((({key:e,value:t,ttlMilliseconds:n})=>{void 0!==t&&this.#R.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}));else{Xi(e[0]);const{key:t,value:n,ttlMilliseconds:r}=e[0];await this.set(t,n,r)}}async mdelete(e){return Object.fromEntries(e.map((e=>[e,this.#R.delete(e)])))}}(Vd),fP=new class{#i;constructor(e=Zd){this.#i=Gd(e,\"[📣 AnalyticsService]\")}async#He(e,t){try{this.#i.log(`Tracking event ${e}`),await snap.request({method:\"snap_trackEvent\",params:{event:{event:e,properties:t}}})}catch(n){this.#i.warn(\"Error tracking event\",{error:n,event:e,properties:t})}}async trackEventTransactionAdded(e,t){await this.#He(\"Transaction Added\",{message:\"Snap transaction added\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventTransactionApproved(e,t){await this.#He(\"Transaction Approved\",{message:\"Snap transaction approved\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventTransactionSubmitted(e,t,n){await this.#He(\"Transaction Submitted\",{message:\"Snap transaction submitted\",origin:n.origin,account_type:e.type,chain_id_caip:n.scope})}async trackEventTransactionFinalized(e,t,n){await this.#He(\"Transaction Finalized\",{message:\"Snap transaction finalized\",origin:n.origin,account_type:e.type,chain_id_caip:t.chain,transaction_status:t.status,transaction_type:t.type})}async trackEventTransactionRejected(e,t){await this.#He(\"Transaction Rejected\",{message:\"Snap transaction rejected\",origin:t.origin,account_type:e.type,chain_id_caip:t.scope})}async trackEventSecurityAlertDetected(e,t,n,r,o,i){await this.#He(\"Security Alert Detected\",{message:\"Snap security alert detected\",origin:t,account_type:e.type,chain_id_caip:n,security_alert_response:r,security_alert_reason:o,security_alert_description:i})}async trackEventSecurityScanCompleted(e,t,n,r,o){await this.#He(\"Security Scan Completed\",{message:\"Snap security scan completed\",origin:t,account_type:e.type,chain_id_caip:n,scan_status:r,has_security_alerts:o})}async trackEventWebSocketConnectionClosedNotCleanly(e,t,n){await this.#He(\"WebSocket Connection Closed Not Cleanly\",{message:\"Snap WebSocket connection closed not cleanly\",origin:e,code:t,reason:n})}}(Zd),hP=new class{#_;#R;#Ve={fetchMint:LI.Minute,fetchJsonParsedAccount:LI.Minute};#Ge=new Map;constructor(e,t){this.#_=e,this.#R=t}#Ze(e){const t=this.#_.getNetworkBy(\"caip2Id\",e),n=gC(TC(t.rpcUrls));return this.#Ge.set(e,n),n}getRpc(e){return H(e,wf),this.#Ge.get(e)??this.#Ze(e)}async fetchJsonParsedAccount(e,t,n,r){const o=async(e,t,n)=>async function(e,t,n={}){const{abortSignal:r,...o}=n,{value:i}=await e.getAccountInfo(t,{...o,encoding:\"jsonParsed\"}).send({abortSignal:r});return i&&\"object\"==typeof i&&\"parsed\"in i.data?up(t,i):cp(t,i)}(this.getRpc(t),nu(e),n);if(r?.skipCache)return o(e,t,n);return Yd(o,this.#R,{ttlMilliseconds:this.#Ve.fetchJsonParsedAccount,functionName:\"SolanaConnection::fetchJsonParsedAccount\"})(e,t,n)}async fetchMint(e,t,n){return Yd((async(r,o,i)=>_p(this.getRpc(t),nu(e),n)),this.#R,{ttlMilliseconds:this.#Ve.fetchMint,functionName:\"SolanaConnection::fetchMint\"})(nu(e),t,n)}async getLatestBlockhash(e){return(await this.getRpc(e).getLatestBlockhash().send()).value}}(sP,dP),pP=new class{#_;constructor(e){this.#_=e}async getAll(){return(await snap.request({method:\"snap_getWebSockets\"})).map((e=>({...e,network:this.#Je(e.url)})))}async getById(e){return(await this.getAll()).find((t=>t.id===e))??null}async findByNetwork(e){return(await this.getAll()).find((t=>t.network===e))??null}async save(e){const{url:t,protocols:n}=e,r=await snap.request({method:\"snap_openWebSocket\",params:{url:t,...n?{protocols:n}:{}}});return{...e,id:r}}async delete(e){await snap.request({method:\"snap_closeWebSocket\",params:{id:e}})}#Je(e){const t=this.#_.getNetworkBy(\"webSocketUrl\",e);if(!t)throw new Error(`No network found for WebSocket URL: ${e}`);return t.caip2Id}}(sP),gP=new class{#Ye;#Qe;#_;#Ke;#ge;#i;#Xe;#et;#tt=new Map;#nt=new Map;#rt;#ot=\"webSocketConnections\";constructor(e,t,n,r,o,i){const{maxReconnectAttempts:a,reconnectDelayMilliseconds:s,closeConnectionsGracePeriodMilliseconds:c}=n.get().subscriptions;this.#Ye=e,this.#Qe=t,this.#_=n,this.#Ke=r,this.#ge=o,this.#i=Gd(i,\"[🔌 WebSocketConnectionService]\"),this.#Xe=a,this.#et=s,this.#rt=c,this.#te()}#te(){const e=this.#it.bind(this),t=this.#at.bind(this),n=this.#ye.bind(this),r=this.#st.bind(this),o=this.#we.bind(this);this.#ge.on(\"onStart\",e),this.#ge.on(\"onUpdate\",e),this.#ge.on(\"onInstall\",e),this.#ge.on(\"onActive\",t),this.#ge.on(\"onInactive\",n),this.#ge.on(\"onWebSocketEvent\",o),this.#ge.on(\"onListWebSockets\",r)}async#it(){this.#i.log(\"Setting up connections\");const{active:e}=await UI();e?await this.#ct():await this.closeAllConnections()}async#ct(){this.#i.log(\"Opening connections for active networks\");const e=await this.#_.getActiveNetworks();this.#nt.clear(),await Promise.allSettled(e.map((async e=>{await this.openConnection(e)})))}async openConnection(e){this.#i.log(`Opening connection for network ${e}`);const t=this.#_.getNetworkBy(\"caip2Id\",e),{webSocketUrl:n}=t;await this.#Ye.findByNetwork(e)?this.#i.log(`✅ Connection for network ${e} already exists`):await this.#Ye.save({network:e,url:n,protocols:[]})}async closeAllConnections(){this.#i.log(\"Closing all connections\");const e=await this.#Ye.getAll();await Promise.allSettled(e.map(this.#ut.bind(this))),await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,null)}async#ut(e){this.#i.log(`Closing connection for network ${e.network}`),await this.#Ye.delete(e.id)}onConnectionRecovery(e,t){const n=this.#tt.get(e)??[];this.#tt.set(e,[...n,t])}async findByNetwork(e){return await this.#Ye.findByNetwork(e)??null}async findById(e){return this.#Ye.getById(e)}async#we(e){if(\"open\"!==e.type&&\"close\"!==e.type)return;const{id:t,type:n}=e;switch(this.#i.log(`Handling connection event \"${n}\" for ${t}`,e),n){case\"open\":await this.#lt(e);break;case\"close\":await this.#dt(e);break;default:this.#i.warn(`Unknown connection event type: ${n}`)}}async#lt(e){const{id:t}=e,n=await this.#Ye.getById(t);if(!n)return void this.#i.warn(`No connection found with id: ${t}`);this.#i.log(`✅ Connected to ${t}`,e);const{network:r}=n;this.#nt.delete(r);const o=this.#tt.get(r)??[];this.#i.log(`Triggering ${o.length} connection recovery handlers`,r);const i=o.map((async e=>{try{await e(r)}catch(e){this.#i.error(\"Error in connection recovery handler\",e)}}))??[];await Promise.allSettled(i)}async#dt(e){const{wasClean:t,origin:n,code:r,reason:o}=e;if(t)return void this.#i.log(\"✅ Connection closed cleanly\",e);const{networks:i}=this.#_.get(),a=i.find((e=>e.webSocketUrl.startsWith(n)));a?(await this.#Qe.trackEventWebSocketConnectionClosedNotCleanly(n,r,o),await this.#ft(a.caip2Id)):this.#i.warn(\"No network found for origin\",n)}async#ft(e){const t=this.#nt.get(e)??0,n=t+1;if(this.#nt.set(e,n),n>this.#Xe)return void this.#i.error(`❌ Failed to reconnect to ${e} after ${this.#Xe}/${this.#Xe} attempts. Giving up.`);const r=this.#et*Math.pow(2,t);this.#i.warn(`❌ Disconnected from ${e}. Will try reconnecting in ${r}ms (attempt ${n}/${this.#Xe})`),await new Promise((t=>{setTimeout((()=>{this.openConnection(e).catch((t=>{this.#i.info(`Error opening connection for ${e}`,t)})).finally((()=>t()))}),r)}))}async#st(){const e=await this.#Ye.getAll();this.#i.log(\"All connections\",{connections:e,connectionRecoveryHandlers:this.#tt})}async#at(){this.#i.log(\"Client became active\"),await this.#ht(),await this.#ct()}async#ye(){this.#i.log(\"Client became inactive\"),await this.#ht();const e=Math.floor(this.#rt/1e3),t=await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:`PT${e}S`,request:{method:\"closeWebSocketConnections\"}}});await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,t),this.#i.log(`Scheduled background event to close connections after ${e}s`,t)}async#ht(){try{const e=await this.#Ke.getKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`);if(!e)return;await snap.request({method:\"snap_cancelBackgroundEvent\",params:{id:e}}),this.#i.log(\"🫸 Cancelled background event to close connections\",e)}catch(e){this.#i.warn(\"Failed to cancel background event\",e)}finally{await this.#Ke.setKey(`${this.#ot}.closeWebSocketConnectionsBackgroundEventId`,null)}}}(pP,fP,sP,uP,cP,Zd),mP=new class{#Ke;#ot=\"subscriptions\";constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(`${this.#ot}`);return Object.values(e??{})}async getById(e){return await this.#Ke.getKey(`${this.#ot}.${e}`)}async save(e){await this.#Ke.setKey(`${this.#ot}.${e.id}`,e)}async delete(e){await this.#Ke.deleteKey(`${this.#ot}.${e}`)}async deleteMany(e){const t=e.map((e=>`${this.#ot}.${e}`));await this.#Ke.deleteKeys(t)}async update(e){await this.#Ke.setKey(`${this.#ot}.${e.id}`,e)}async findBy(e,t){const n=await this.getAll();if(0!==n.length)return n.find((n=>e in n&&n[e]===t))}async clear(){await this.#Ke.deleteKey(`${this.#ot}`)}}(uP),yP=new bT(gP,mP,cP,Zd),wP=new class{#T;constructor(e){this.#T=e}async uiAmountToAmountForMint(e,t,n){const r=await this.#T.fetchMint(e,t);return this.#pt(r,n)}async amountToUiAmountForMint(e,t,n){const r=await this.#T.fetchMint(e,t);return this.#gt(r,n)}#pt(e,t){try{const o=(n=e.data?.extensions,ch(n)?n.value:r?r():null),{decimals:i}=e.data??{},a=o?.find((e=>\"InterestBearingConfig\"===e.__kind)),s=o?.find((e=>\"ScaledUiAmountConfig\"===e.__kind));if(!a&&!s)return sl(BigInt(Mi(t).multipliedBy(10**i).toFixed(0)));const c=Date.now()/1e3;if(a){return sl(Rm(t,i,Number(c),Number(a.lastUpdateTimestamp),Number(a.initializationTimestamp),a.preUpdateAverageRate,a.currentRate))}if(s){let{multiplier:e}=s;c>=s.newMultiplierEffectiveTimestamp&&(e=s.newMultiplier);return sl(Nm(t,i,e))}throw new Error(\"Unknown mint extension type\")}catch(n){const r=e?.data?.decimals??9;return sl(BigInt(Mi(t).multipliedBy(10**r).toFixed(0)))}var n,r}#gt(e,t){try{const n=1000000000n,r=Mi(this.#pt(e,n.toString()).toString()).dividedBy(n.toString());return Mi(t.toString()).dividedBy(r).toString()}catch(n){const r=e.data?.decimals??9;return Mi(t.toString()).dividedBy(10**r).toString()}}}(hP),vP=new mT(hP,Zd),bP=new class{#T;#i;#W=450;#H=10000n;constructor(e,t){this.#T=e,this.#i=t}async buildTransactionMessage(e){try{const{from:t,to:n,amount:r,network:o}=e,i=nu(t.address),a=BigInt(Ay(r).toString()),s=await this.#T.getLatestBlockhash(o),c=cl(Ll({version:0}),(e=>Wl(i,e)),(e=>ll(s,e)),(e=>Hl(function(e,t){const n=t?.programAddress??Id,r={source:{value:e.source??null,isWritable:!0},destination:{value:e.destination??null,isWritable:!0}},o={...e},i=Bd(n);return{accounts:[i(r.source),i(r.destination)],programAddress:n,data:Dd().encode(o)}}({amount:a,destination:n,source:gd(i)}),e)));return Gl([Xf({units:this.#W}),rh({microLamports:this.#H})],c)}catch(e){throw this.#i.error({error:e},\"Error building transaction message\"),e}}getComputeUnitLimit(){return this.#W}getComputeUnitPriceMicroLamportsPerComputeUnit(){return this.#H}}(hP,Zd),AP=new class{#T;#i;constructor(e,t){this.#T=e,this.#i=Gd(t,\"[👀 RecipientClassifier]\")}async classify(e,t){this.#i.info(\"Classifying recipient\",{recipientAddress:e,network:t});const n=await this.#T.fetchJsonParsedAccount(e,t);try{hp(n)}catch(e){return{type:\"SYSTEM\"}}const{programAddress:r}=n;if(r===Id)return{type:\"SYSTEM\"};const o=(0,Bf.get)(n,\"data.mint\"),i=(0,Bf.get)(n,\"data.owner\");return(r===bh||r===Rp)&&o&&i?{type:\"TOKEN_ACCOUNT\",mint:o}:{type:\"UNSUPPORTED\"}}}(hP,Zd),SP=new gT(wP,AP,hP,Zd),EP=new class{#o;#i;#a;#s;#R;cacheTtlsMilliseconds;constructor(e,t,n=globalThis.fetch,r=Zd){const{baseUrl:o,chunkSize:i,cacheTtlsMilliseconds:a}=e.get().priceApi;H(o,df),this.#o=n,this.#i=r,this.#a=o,this.#s=i,this.cacheTtlsMilliseconds=a,this.#R=t}async getFiatExchangeRates(){return Yd(this.#mt.bind(this),this.#R,{functionName:\"PriceApiClient:getFiatExchangeRates\",ttlMilliseconds:this.cacheTtlsMilliseconds.fiatExchangeRates})()}async#mt(){try{const e=await this.#o(`${this.#a}/v1/exchange-rates/fiat`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){throw this.#i.error(e,\"Error fetching fiat exchange rates\"),e}}async#yt(e,t=\"usd\"){try{if(H(e,Y(Gi)),H(t,Of),0===e.length)return{};const n=[...new Set(e)],r=[];for(let e=0;e<n.length;e+=this.#s)r.push(n.slice(e,e+this.#s));const o=await Promise.all(r.map((async e=>{const n=Cf({baseUrl:this.#a,path:\"/v3/spot-prices\",queryParams:{vsCurrency:t,assetIds:e.join(\",\"),includeMarketData:\"true\"}}),r=await this.#o(n);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return H(o,Nf),o}))),i=o.reduce(((e,t)=>({...e,...t})),{});return await this.#R.mset(e.map((e=>({key:`PriceApiClient:getMultipleSpotPrices:${e}:${t}`,value:i[e],ttlMilliseconds:this.cacheTtlsMilliseconds.spotPrices})))),i}catch(e){throw this.#i.error(e,\"Error fetching spot prices\"),e}}async#wt(e,t=\"usd\"){const n=[...new Set(e)],r=\"PriceApiClient:getMultipleSpotPrices\",o=e=>`${r}:${e}:${t}`,i=await this.#R.mget(n.map(o)),a=(0,Bf.mapKeys)(i,((e,t)=>(e=>{const t=new RegExp(`^${r}:(.+):(.+)$`,\"u\"),n=e.match(t);if(!n)throw new Error(\"Invalid cache key\");return n})(t)[1])),s=n.filter((e=>void 0===a[e]));if(0===s.length)return a;const c=await this.#yt(s,t);return await this.#R.mset(Object.entries(c).map((([e,t])=>({key:o(e),value:t,ttlMilliseconds:this.cacheTtlsMilliseconds.spotPrices})))),{...a,...c}}async getMultipleSpotPrices(e,t=\"usd\"){return this.#wt(e,t)}async#vt(e){H(e,Uf);const t=Cf({baseUrl:this.#a,path:\"/v3/historical-prices/{assetType}\",pathParams:{assetType:e.assetType},encodePathParams:!1,queryParams:{...e.timePeriod&&{timePeriod:e.timePeriod},...e.from&&{from:e.from.toString()},...e.to&&{to:e.to.toString()},...e.vsCurrency&&{vsCurrency:e.vsCurrency}}}),n=await this.#o(t),r=await n.json();return H(r,Mf),r}async getHistoricalPrices(e){return Yd(this.#vt.bind(this),this.#R,{functionName:\"PriceApiClient:getHistoricalPrices\",ttlMilliseconds:this.cacheTtlsMilliseconds.historicalPrices})(e)}}(sP,dP),xP=new qf(sP),kP=new class{#o;#i;#a;#R;#Ve;constructor(e,t,n=globalThis.fetch,r=Zd){const{baseUrl:o,cacheTtlsMilliseconds:i}=e.get().nftApi;H(o,df),this.#o=n,this.#i=r,this.#a=o,this.#Ve=i,this.#R=t}#bt(e){return{cursor:e.cursor,error:e.error,items:e.items.map((e=>({chain:e.chain,address:e.address,tokenAddress:e.token_address,tokenId:e.token_id,balance:e.balance,acquiredAt:e.acquired_at,isSpam:e.isSpam,nftToken:this.#At(e.nft_token)})))}}async#St(e){let t,n=[];do{const r=Cf({baseUrl:this.#a,path:`/users/${e}/solana-tokens`,queryParams:t?{cursor:t}:void 0}),o=await this.#o(r,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\",version:\"1\"}}),i=await o.json(),a=this.#bt(i);n=[...n,...a.items],t=a.cursor??void 0}while(t);return n}async listAddressSolanaNfts(e){return Yd(this.#St.bind(this),this.#R,{functionName:\"NftApiClient:listAddressSolanaNfts\",ttlMilliseconds:this.#Ve.listAddressSolanaNfts})(e)}#At(e){return{address:e.address,tokenId:e.token_id,tokenStandard:e.token_standard,name:e.name,description:e.description,metadata:e.metadata,imageUrl:e.image_url,mediaUrl:e.media_url,externalUrl:e.external_url,attributes:e.attributes.map((e=>({key:e.key,value:e.value}))),tokenAccountAddress:e.token_account_address,creators:e.creators.map((e=>({address:e.address,share:e.share,verified:e.verified}))),collectionName:e.collection_name,collectionSymbol:e.collection_symbol,collectionCount:e.collection_count,collectionImageUrl:e.collection_image_url,onchainCollectionAddress:e.onchain_collection_address,floorPrice:e.floor_price?{asset:{type:e.floor_price.asset.type,name:e.floor_price.asset.name,symbol:e.floor_price.asset.symbol,decimals:e.floor_price.asset.decimals,tokenId:e.floor_price.asset.token_id},amount:{rawAmount:e.floor_price.amount.raw_amount,amount:e.floor_price.amount.amount}}:null,lastSalePrice:e.last_sale_price?{asset:{type:e.last_sale_price.asset.type,name:e.last_sale_price.asset.name,symbol:e.last_sale_price.asset.symbol,decimals:e.last_sale_price.asset.decimals,tokenId:e.last_sale_price.asset.token_id},amount:{rawAmount:e.last_sale_price.amount.raw_amount,amount:e.last_sale_price.amount.amount}}:null,rarity:e.rarity?{ranking:{source:e.rarity.ranking.source,value:e.rarity.ranking.value},metadata:{howrare:{rank:e.rarity.metadata.howrare.rank},moonrank:{rank:e.rarity.metadata.moonrank.rank}}}:null}}async#Et(e){try{const t=Cf({baseUrl:this.#a,path:`/nfts/contracts/solana/${e}/1`}),n=await this.#o(t,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\",version:\"1\"}}),r=await n.json();return this.#At(r)}catch(e){return null}}async getNftMetadata(e){return Yd(this.#Et.bind(this),this.#R,{functionName:\"NftApiClient:getNftMetadata\",ttlMilliseconds:this.#Ve.getNftMetadata})(e)}async getNftsMetadata(e){return await Promise.all(e.map((async e=>this.getNftMetadata(e))))}}(sP,dP),IP=new class{#xt;#i;cacheTtlsMilliseconds;constructor({configProvider:e,priceApiClient:t,logger:n}){this.#xt=t,this.#i=n;const{cacheTtlsMilliseconds:r}=e.get().priceApi;this.cacheTtlsMilliseconds=r}#kt(e){if(!oP(e))throw new Error(\"Passed caipAssetType is not a fiat asset\");return Ji(e).assetReference.toLowerCase()}async#It(e){const t=e.filter((e=>!oP(e))),[n,r]=await Promise.all([this.#xt.getFiatExchangeRates(),this.#xt.getMultipleSpotPrices(t,\"usd\")]);return{fiatExchangeRates:n,cryptoPrices:r}}async getMultipleTokenConversions(e){if(0===e.length)return{};const t=e.flatMap((e=>[e.from,e.to])),{fiatExchangeRates:n,cryptoPrices:r}=await this.#It(t),o={};return e.forEach((e=>{const{from:t,to:i}=e;let a,s;if(o[t]||(o[t]={}),oP(t)){const e=n[this.#kt(t)]?.value;if(!e)return void(o[t][i]=null);a=new Mi(1).dividedBy(e)}else a=new Mi(r[t]?.price??0);if(oP(i)){const e=n[this.#kt(i)]?.value;if(!e)return void(o[t][i]=null);s=new Mi(1).dividedBy(e)}else s=new Mi(r[i]?.price??0);if(a.isZero()||s.isZero())return void(o[t][i]=null);const c=a.dividedBy(s).toString(),u=Date.now();o[t][i]={rate:c,conversionTime:u,expirationTime:u+this.cacheTtlsMilliseconds.historicalPrices}})),o}#Tt(e,t){const n=(0,Bf.pick)(e,[\"marketCap\",\"totalVolume\",\"circulatingSupply\",\"allTimeHigh\",\"allTimeLow\",\"pricePercentChange1h\",\"pricePercentChange1d\",\"pricePercentChange7d\",\"pricePercentChange14d\",\"pricePercentChange30d\",\"pricePercentChange200d\",\"pricePercentChange1y\"]),r=e=>null==e?\"\":new Mi(e).dividedBy(t).toString(),o=(e,t)=>null==t?{}:{[e]:t},i={...o(\"PT1H\",n.pricePercentChange1h),...o(\"P1D\",n.pricePercentChange1d),...o(\"P7D\",n.pricePercentChange7d),...o(\"P14D\",n.pricePercentChange14d),...o(\"P30D\",n.pricePercentChange30d),...o(\"P200D\",n.pricePercentChange200d),...o(\"P1Y\",n.pricePercentChange1y)};return{fungible:!0,marketCap:r(n.marketCap),totalVolume:r(n.totalVolume),circulatingSupply:(n.circulatingSupply??0).toString(),allTimeHigh:r(n.allTimeHigh),allTimeLow:r(n.allTimeLow),...Object.keys(i).length>0?{pricePercentChange:i}:{}}}async getMultipleTokensMarketData(e){if(0===e.length)return{};const t=e.flatMap((e=>[e.asset,e.unit])),{fiatExchangeRates:n,cryptoPrices:r}=await this.#It(t),o={};return e.forEach((e=>{const{asset:t,unit:i}=e;if(!r[t])return;let a;if(oP(i)){const e=n[this.#kt(i)]?.value;if(!e)return;a=new Mi(1).dividedBy(e)}else a=new Mi(r[i]?.price??0);a.isZero()||(o[t]||(o[t]={}),o[t][i]=this.#Tt(r[t],a))})),o}async getHistoricalPrice(e,t){H(e,kt),H(t,kt);const n=Ji(t).assetReference.toLowerCase();H(n,Of);const r=[\"1d\",\"7d\",\"1m\",\"3m\",\"1y\",\"1000y\"].map((async r=>this.#xt.getHistoricalPrices({assetType:e,timePeriod:r,vsCurrency:n}).then((e=>({timePeriod:r,response:e}))).catch((n=>(this.#i.warn(`Error fetching historical prices for ${e} to ${t} with time period ${r}. Returning null object.`,n),{timePeriod:r,response:zf}))))),o=(await Promise.all(r)).reduce(((e,{timePeriod:t,response:n})=>(e[`P${t.toUpperCase()}`]=n.prices.map((e=>[e[0],e[1].toString()])),e)),{}),i=Date.now();return{intervals:o,updateTime:i,expirationTime:i+this.cacheTtlsMilliseconds.historicalPrices}}}({configProvider:sP,priceApiClient:EP,logger:Zd}),TP=new class{#T;#i;tld=\".sol\";constructor(e,t){this.#T=e,this.#i=t}async resolveDomain(e,t){const n=this.#T.getRpc(e);return JB(n,t)}async resolveAddress(e,t){try{const n=this.#T.getRpc(e);return`${(await(async(e,t)=>{const n=await yB.getAddress(\"85iDfUvr3HJyLM2zcq5BXSiDvUWfw6cSE1FfNBo8Ap29\",t),r=await yB.retrieve(e,n),[o,i]=await Promise.all([sB.retrieve(e,r.nameAccount),mB(e,r.nameAccount)]),a=i||o.owner,s=o.parentName!==cB,c=[wB(e,r.nameAccount,s?o.parentName:void 0)];s&&c.push(wB(e,o.parentName));const u=(await Promise.all(c)).join(\".\");return{domainAddress:r.nameAccount,domainName:u,stale:t!==a}})(n,nu(t))).domainName}.sol`}catch(e){return this.#i.error(\"Error resolving address\",e),null}}}(hP,Zd),_P=new class{#Ke;constructor(e){this.#Ke=e}async findByKeyringAccountId(e){return await this.#Ke.getKey(`assetEntities.${e}`)??[]}async getAll(){const e=await this.#Ke.getKey(\"assetEntities\")??{};return Object.values(e).flat()}async saveMany(e){await this.#Ke.update((t=>{const n=(0,Bf.cloneDeep)(t);for(const t of e){const{keyringAccountId:e}=t,r=(0,Bf.cloneDeep)(n.assetEntities[e]??[]),o=r.findIndex((e=>e.assetType===t.assetType&&e.keyringAccountId===t.keyringAccountId));-1===o?r.push(t):r[o]=t,n.assetEntities[e]=r}return n}))}}(uP),CP=new cT({connection:hP,logger:Zd,configProvider:sP,assetsRepository:_P,tokenApiClient:xP,cache:dP,tokenPricesService:IP,nftApiClient:kP}),BP=new class{#Ke;constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(\"keyringAccounts\");return Object.values(e??{})}async findById(e){return await this.#Ke.getKey(`keyringAccounts.${e}`)??null}async findByAddress(e){return(await this.getAll()).find((t=>t.address===e))??null}async save(e){await this.#Ke.setKey(`keyringAccounts.${e.id}`,e)}async delete(e){await this.#Ke.deleteKey(`keyringAccounts.${e}`)}}(uP),PP=new class{#_t;constructor(e){this.#_t=e}async getAll(){return this.#_t.getAll()}async getAllSelected(){const[e,t]=await Promise.all([this.#_t.getAll(),mi(snap)]);return e.filter((e=>t.includes(e.id)))}async findById(e){return this.#_t.findById(e)}async findByAddress(e){return this.#_t.findByAddress(e)}async save(e){return this.#_t.save(e)}async delete(e){return this.#_t.delete(e)}}(BP),RP=new class{#Ke;#ot=\"transactions\";constructor(e){this.#Ke=e}async getAll(){const e=await this.#Ke.getKey(this.#ot);return Object.values(e??{}).flat()}async findByAccountId(e){return await this.#Ke.getKey(`${this.#ot}.${e}`)??[]}async save(e){await this.saveMany([e])}async saveMany(e){await this.#Ke.update((t=>{const n=t[this.#ot];return e.forEach((e=>{const r=e.id,o=e.account,i=n[o]??[],a=i.findIndex((e=>e.id===r));-1!==a&&(i[a]=e);const s=(0,Bf.chain)([...i,e]).uniqBy(\"id\").sortBy((e=>-(e.timestamp??0))).value();t[this.#ot][o]=s})),t}))}}(uP),NP=new class{#K;#Y;#i;constructor(e,t,n){this.#K=e,this.#Y=t,this.#i=n}async mapRpcTransaction(e,t,n,r){try{const{blockTime:o}=e,{id:i,address:a}=t,s=e.transaction.signatures[0];if(!s)throw new Error(\"Transaction ID is required\");const c=Number(o),u=this.#Ct(e);let l=[],d=[],f=[];const h=(u===Gt.Failed?this.#Bt.bind(this):this.#Pt.bind(this))({scope:n,transactionData:e});l=h.fees,d=h.from,f=h.to;const{from:p,to:g}=await this.#Rt({scope:n,transactionData:e});let m=[...p,...d],y=[...g,...f];const w=this.#Nt({address:nu(a),status:u,from:m,to:y});w===Zt.Swap&&(m=m.filter((e=>e.address===a)),y=y.filter((e=>e.address===a))),w===Zt.Receive&&(y=y.filter((e=>e.address===a)),l=[]);const v=[...new Set([...m,...y].filter((e=>e.asset?.fungible)).map((e=>e.asset.type)))],b=r??await this.#Y.getAssetsMetadata(v);return m.forEach((e=>{e.asset?.fungible&&b[e.asset.type]&&(e.asset.unit=b[e.asset.type]?.symbol??\"UNKNOWN\")})),y.forEach((e=>{e.asset?.fungible&&b[e.asset.type]&&(e.asset.unit=b[e.asset.type]?.symbol??\"UNKNOWN\")})),{id:s,account:i,timestamp:c,chain:n,status:u,type:w,from:m,to:y,fees:l,events:[{status:u,timestamp:c}]}}catch(e){return this.#i.warn(e,\"Error mapping transaction\"),null}}#Ct(e){return e.meta?.err||e.meta?.status&&\"Err\"in e.meta.status?Gt.Failed:Gt.Confirmed}#Nt({address:e,status:t,from:n,to:r}){if(0===n.length||0===r.length||t===Gt.Failed)return Zt.Unknown;const o=n.filter((t=>t.address===e)),i=r.filter((t=>t.address===e)),a=o.length>0,s=i.length>0,c=n.every((t=>r.some((n=>n.address===e&&!0===t.asset?.fungible&&!0===n.asset?.fungible&&t.asset.type===n.asset.type)))),u=r.every((t=>n.some((n=>n.address===e&&!0===n.asset?.fungible&&!0===t.asset?.fungible&&n.asset.type===t.asset.type))));return c&&u?Zt.Send:a&&s?Zt.Swap:a?Zt.Send:Zt.Receive}#Pt({scope:e,transactionData:t}){const n=this.#Ot({scope:e,transactionData:t}),r=[],o=[],i=new Map(t.meta?.preBalances?.map(((e,t)=>[t,new Mi(e.toString())]))??[]),a=new Map(t.meta?.postBalances?.map(((e,t)=>[t,new Mi(e.toString())]))??[]),s=[...t.transaction.message.accountKeys,...t.meta?.loadedAddresses?.writable??[],...t.meta?.loadedAddresses?.readonly??[]],c=new Set([...Array.from(i.keys()),...Array.from(a.keys())]);for(const n of c){const c=s[n]?.toString();if(!c)continue;const u=i.get(n)??new Mi(0),l=a.get(n)??new Mi(0),d=0===n?by(t.meta?.fee??0):new Mi(0),f=u.minus(l).dividedBy(new Mi(Xd)).minus(d);if(f.isZero())continue;const h=f.absoluteValue().toString();u.isGreaterThan(l)&&r.push({address:c,asset:{fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol,amount:h}}),u.isLessThan(l)&&o.push({address:c,asset:{fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol,amount:h}})}const u=this.#Ut({scope:e,transactionData:t});return u.from.length>0&&r.push(...u.from),u.to.length>0&&o.push(...u.to),{fees:n,from:r,to:o}}#Bt({scope:e,transactionData:t}){const n=this.#Ot({scope:e,transactionData:t}),r=[...t.transaction.message.accountKeys,...t.meta?.loadedAddresses?.writable??[],...t.meta?.loadedAddresses?.readonly??[]],o=[],i=[],{instructions:a}=t.transaction.message;a.forEach((t=>{const{accounts:n,data:a,programIdIndex:s}=t;if(r[s]!==Id)return;const[c,u]=n;if(void 0===c||void 0===u)return;const l=r[c],d=r[u];if(!l||!d)return;const f=jf.decode(a);if(2!==this.#Mt(f))return;const h=this.#zt(f);o.push({address:l,asset:{amount:h.toString(),fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol}}),i.push({address:d,asset:{amount:h.toString(),fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol}})}));return{fees:n,from:this.#Lt(o),to:this.#Lt(i)}}#Ut({scope:e,transactionData:t}){const{instructions:n}=t.transaction.message,r=[],o=[],i=t.transaction.message.accountKeys.findIndex((e=>e===Id));return-1===i||n.forEach((n=>{const{accounts:a,data:s,programIdIndex:c}=n;if(c!==i)return;const[u,l]=a;if(void 0===u||void 0===l||u!==l)return;const d=t.transaction.message.accountKeys[u],f=t.transaction.message.accountKeys[l];if(!d||!f||d!==f)return;const h=this.#zt(jf.decode(s));r.push({address:d,asset:{amount:h.toString(),fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol}}),o.push({address:f,asset:{amount:h.toString(),fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol}})})),{from:r,to:o}}async#Rt({scope:e,transactionData:t}){const n=[],r=[],o=new Map(t.meta?.preTokenBalances?.map((e=>[e.accountIndex,new Mi(e.uiTokenAmount.amount)]))??[]),i=new Map(t.meta?.postTokenBalances?.map((e=>[e.accountIndex,new Mi(e.uiTokenAmount.amount)]))??[]),a=new Set([...t.meta?.preTokenBalances?.map((e=>e.accountIndex))??[],...t.meta?.postTokenBalances?.map((e=>e.accountIndex))??[]]);for(const s of a){const a=o.get(s)??new Mi(0),c=(i.get(s)??new Mi(0)).minus(a);if(c.isZero())continue;const u=t.meta?.preTokenBalances?.find((e=>e.accountIndex===s))??t.meta?.postTokenBalances?.find((e=>e.accountIndex===s));if(!u)continue;const{mint:l,owner:d}=u;if(!d)continue;const f=sT(e,l),h=c.absoluteValue().toString(),p=(await this.#K.amountToUiAmountForMint(l,e,sl(BigInt(h)))).toString();c.isNegative()&&n.push({address:d,asset:{fungible:!0,type:f,unit:\"\",amount:p}}),c.isPositive()&&r.push({address:d,asset:{fungible:!0,type:f,unit:\"\",amount:p}})}const s=this.#jt({scope:e,transactionData:t});return s.from.length>0&&n.push(...s.from),s.to.length>0&&r.push(...s.to),{from:n,to:r}}#jt({scope:e,transactionData:t}){const{instructions:n}=t.transaction.message,r=[],o=[];return n.map((e=>ry(e,t))).map(ny).filter(this.#Ft.bind(this)).forEach((n=>{const i=(0,Bf.get)(n,\"parsed.accounts.authority.address\"),a=(0,Bf.get)(n,\"parsed.accounts.source.address\");if(!i||!a)return;const s=t.transaction.message.accountKeys.indexOf(nu(a)),{mint:c,uiTokenAmount:{decimals:u}={}}=t.meta?.preTokenBalances?.find((e=>e.accountIndex===s))??{};if(!c||void 0===u)return;const l=n.parsed?.data.amount,d=Mi(l).dividedBy(new Mi(10).pow(u)).toString(),f=sT(e,c);r.push({address:i,asset:{amount:d,fungible:!0,type:f,unit:\"\"}}),o.push({address:i,asset:{amount:d,fungible:!0,type:f,unit:\"\"}})})),{from:r,to:o}}#Ot({scope:e,transactionData:t}){const n=this.#Dt(t),r=this.#$t(t),o=n.minus(r),i=[{type:\"base\",asset:{fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol,amount:r.toString()}}];return o?.isGreaterThan(0)&&i.push({type:\"priority\",asset:{fungible:!0,type:cf[e].nativeToken.caip19Id,unit:cf[e].nativeToken.symbol,amount:o.toString()}}),i}#Dt(e){return new Mi(e.meta?.fee?.toString()??\"0\").dividedBy(Xd)}#$t(e){const t=e.transaction.signatures.length;return Mi(5e3).dividedBy(Xd).multipliedBy(t)}#Lt(e){return e.reduce(((e,t)=>{const n=e.find((e=>!0===e?.asset?.fungible&&!0===t.asset?.fungible&&e.asset.type===t.asset.type&&e.address===t.address));if(n&&!0===n.asset?.fungible&&!0===t.asset?.fungible){const e=new Mi(n.asset.amount).plus(t.asset.amount);n.asset.amount=e.toString()}else e.push(t);return e}),[])}#Mt(e){let t=BigInt(0);for(let n=0;n<4;n++)t|=BigInt(e[n]??0)<<BigInt(8*n);return Number(t)}#zt(e){let t=BigInt(0);for(let n=4;n<12;n++)t|=BigInt(e[n]??0)<<BigInt(8*(n-4));return Mi(t.toString()).dividedBy(Xd)}#Ft(e){if(\"Transfer\"!==e.type&&\"TransferChecked\"!==e.type)return!1;if(!e.parsed)return!1;const{source:t,destination:n,authority:r}=e.parsed.accounts??{};return!!(t&&n&&r)&&t.address===n.address}}(wP,CP,Zd),OP=new class{#Kt;#qt;#Wt;#Y;#T;#i;constructor(e,t,n,r,o,i){this.#Kt=e,this.#qt=t,this.#Wt=n,this.#Y=r,this.#T=o,this.#i=Gd(i,\"[💱 TransactionsService]\")}async fetchBySignature(e,t,n){const r=await this.#T.getRpc(n).getTransaction(Au(e),{maxSupportedTransactionVersion:0}).send();return r?this.#qt.mapRpcTransaction(r,t,n):null}async fetchAssetsTransactions(e,t){const n=await this.#Wt.getAll(),r=e.map((e=>e.assetType)),o=await this.#Y.getAssetsMetadata(r),i=await this.#Kt.getAll(),a=(await Promise.all(e.map((async e=>{const{network:t}=e,n=\"pubkey\"in e?e.pubkey:e.address,r=await(async e=>{const{network:t}=e,n=\"mint\"in e?e.mint:e.address,r=i.sort(((e,t)=>(t.timestamp??0)-(e.timestamp??0))).find((e=>e.from.some((e=>sT(t,n)===(0,Bf.get)(e,\"asset.type\")))||e.to.some((e=>sT(t,n)===(0,Bf.get)(e,\"asset.type\")))));return r||null})(e),o=r?Au(r?.id):void 0;return(await this.#T.getRpc(t).getSignaturesForAddress(nu(n),{limit:5,...o?{until:o}:{}}).send()).map((t=>({signatureResponse:{signature:t.signature,blockTime:Number(t.blockTime??0)},asset:e})))})))).flat(),s=t?.limit?a.sort(((e,t)=>(t.signatureResponse.blockTime??0)-(e.signatureResponse.blockTime??0))).slice(0,t.limit):a,c=(await Promise.all(s.map((async e=>{try{const{signatureResponse:t,asset:n}=e;return{transaction:await this.#T.getRpc(n.network).getTransaction(Au(t.signature),{maxSupportedTransactionVersion:0}).send(),asset:n}}catch(e){return null}})))).filter((e=>null!==e)),u=e=>n.find((t=>t.id===e));return(await Promise.all(c.map((async e=>{const{transaction:t,asset:n}=e;if(!t)return null;const r=u(n.keyringAccountId);return r?this.#qt.mapRpcTransaction(t,r,n.network,o):null})))).filter((e=>null!==e)).filter((e=>{const t=u(e.account);return!!t&&!wT(e,t)}))}async fetchLatestSignatures(e,t,n){return(await this.#T.getRpc(e).getSignaturesForAddress(t,n).send()).map((({signature:e})=>e))}async findByAccounts(e){return(await Promise.all(e.map((async e=>this.#Kt.findByAccountId(e.id))))).flat()}async save(e){await this.saveMany([e])}async saveMany(e){await this.#Kt.saveMany(e);const t=(0,Bf.groupBy)(e,\"account\");await gi(snap,hr.AccountTransactionsUpdated,{transactions:t})}}(RP,NP,PP,CP,hP,Zd),UP=new class{#Wt;#Y;#Q;#i;constructor(e,t,n,r){this.#Wt=e,this.#Y=t,this.#Q=n,this.#i=Gd(r,\"[🔄 AccountsSynchronizer]\")}async synchronize(e){const t=e??await this.#Wt.getAll();this.#i.info(\"Synchronizing accounts\",t);const n=(await Promise.allSettled(t.map((async e=>this.#Y.fetch(e))))).map((e=>\"fulfilled\"===e.status?e.value:[])).flat();await this.#Y.saveMany(n);const r=await this.#Q.fetchAssetsTransactions(n,{limit:20});await this.#Q.saveMany(r)}}(PP,CP,OP,Zd),MP=new class{#Ht;#i;#Qe;constructor(e,t,n){this.#Ht=e,this.#Qe=t,this.#i=n}async scanTransaction({method:e,accountAddress:t,transaction:n,scope:r,origin:o,options:i=[\"simulation\",\"validation\"],account:a}){try{const s=await this.#Ht.scanTransactions({method:e,accountAddress:t,transactions:[n],scope:r,origin:o===ef?\"https://metamask.io\":o,options:i}),c=this.#Vt(s);if(!c?.status)return this.#i.warn(\"Invalid scan result received from security alerts API\"),a&&await this.#Qe.trackEventSecurityScanCompleted(a,o,r,aP.ERROR,!1),null;if(a){const e=Object.values(aP).includes(c.status)?c.status:aP.ERROR,t=Boolean(c.validation?.type&&c.validation.type!==iP.Benign),n=[this.#Qe.trackEventSecurityScanCompleted(a,o,r,e,t)];if(t){const e=Object.values(iP).includes(c.validation.type)?c.validation.type:iP.Warning;n.push(this.#Qe.trackEventSecurityAlertDetected(a,o,r,e,c.validation.reason??\"unknown\",this.#Gt(c.validation)))}await Promise.all(n)}return c?.estimatedChanges?.assets?c:null}catch(e){return this.#i.error(e),a&&await this.#Qe.trackEventSecurityScanCompleted(a,o,r,aP.ERROR,!1),null}}#Gt(e){if(!e?.reason)return\"Security alert: Unknown reason\";return{unfair_trade:\"Unfair trade of assets, without adequate compensation to the owner's account\",transfer_farming:\"Substantial transfer of the account's assets to untrusted entities\",writable_accounts_farming:\"Transaction exposes unused writable account, can be utilized in BIT-FLIP attacks patterns\",native_ownership_change:\"The account transferred ownership of its native SOL to untrusted entities\",spl_token_ownership_change:\"The account transferred ownership of its SPL tokens to untrusted entities\",exposure_farming:\"The account delegates ownership, thereby exposing its assets to untrusted spenders\",known_attacker:\"A known attacker's account is involved in the transaction\",invalid_signature:\"One of the transactions provided contains non valid signatures, that can lead misleading simulation results\",honeypot:\"The account invests funds in a token that is part of an orchestrated honeypot scheme\",other:\"The transaction was marked as malicious for other reason, further details would be described in features field\"}[e.reason]??`Security alert: ${e.reason}`}#Vt(e){return e?{status:\"SUCCESS\"===e.status||\"ERROR\"===e.status?e.status:\"ERROR\",estimatedChanges:{assets:e.result?.simulation?.account_summary?.account_assets_diff?.map((e=>({type:e.in?\"in\":\"out\",symbol:\"symbol\"in e.asset?e.asset.symbol:e.asset_type,name:\"name\"in e.asset?e.asset.name:e.asset_type,logo:\"logo\"in e.asset?e.asset.logo:null,value:e.in?.value??e.out?.value??null,price:e.in?.usd_price??e.out?.usd_price??null})))??[]},validation:{type:e.result?.validation?.result_type??null,reason:e.result?.validation?.reason??null},error:e?.error_details?{type:\"type\"in e.error_details?e.error_details.type:null,code:\"code\"in e.error_details?e.error_details.code:null}:null}:null}}(new class{#o;#i;#a;constructor(e,t=globalThis.fetch,n=Zd){const{baseUrl:r}=e.get().securityAlertsApi;this.#o=t,this.#i=n,this.#a=r}async scanTransactions({method:e,accountAddress:t,transactions:n,scope:r,origin:o,options:i}){const a=Ff.from(jf.decode(t)).toString(\"base64\");this.#i.info(\"Scanning transaction\");return(await this.#o(`${this.#a}/solana/message/scan`,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\"},method:\"POST\",body:JSON.stringify({method:e,encoding:\"base64\",account_address:a,metadata:{url:o},chain:Df[r],transactions:n,options:i})})).json()}}(sP),fP,Zd),zP=new class{async handleKeyringRequest(e,t){const{request:{method:n}}=e;switch(n){case Tn.SignAndSendTransaction:case Tn.SignTransaction:return this.#Zt(e,t);case Tn.SignMessage:return this.#Jt(e,t);case Tn.SignIn:return this.#Yt(e,t);default:throw new Error(`Unsupported method: ${n}`)}}async#Zt(e,t){H(e.request,fe([aw,uw]));const{request:{method:n,params:{transaction:r}},scope:o,account:i,origin:a}=e;await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionAdded,params:{accountId:i,metadata:{scope:o,origin:a}}}}});return await T_({...I_,scope:o,method:n,origin:e.origin,transaction:r,account:t})?(await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionApproved,params:{accountId:i,metadata:{scope:o,origin:a}}}}}),!0):(await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionRejected,params:{accountId:i,metadata:{scope:o,origin:a}}}}}),!1)}async#Jt(e,t){const n=await async function(e,t){H(e.request,cw);const{request:{params:{message:n}},scope:r,origin:o}=e,i=Wc().encode(n),a=Jc().decode(i),[s,c]=await Promise.all([NI().then((e=>e.locale)).catch((()=>\"en\")),TP.resolveAddress(r,t.address)]);return RI(await CI(AT(u_,{message:a,account:t,accountDomain:c,scope:r,locale:s,networkImage:ET,origin:o}),{}))}(e,t);return Boolean(n)}async#Yt(e,t){const n=await async function(e,t){H(e.request,sw);const{request:{params:n},scope:r,origin:o}=e,[i,a]=await Promise.all([NI(),TP.resolveAddress(r,t.address)]);return RI(await CI(AT(a_,{params:n,account:t,accountDomain:a,scope:r,preferences:i,networkImage:ET,origin:o}),{}))}(e,t);return Boolean(n)}},LP=new class{#Z;#J;#Q;#Qe;#T;#_;#i;#Qt=new Map;#Xt=10*LI.Minute;constructor(e,t,n,r,o,i,a){this.#Z=e,this.#J=t,this.#Q=n,this.#Qe=r,this.#T=o,this.#_=i,this.#i=Gd(a,\"[✍️ SignatureMonitor]\"),this.#te()}#te(){DI.forEach((e=>{this.#Z.registerNotificationHandler(\"signatureSubscribe\",e,this.#en.bind(this)),this.#Z.registerConnectionRecoveryHandler(e,this.#oe.bind(this))}))}async monitor(e,t,n,r,o){this.#i.info(\"Monitoring signature\",{signature:e,accountId:t,commitment:n,network:r,origin:o});const i={method:\"signatureSubscribe\",network:r,expiryMilliseconds:this.#Xt,params:[e,{commitment:n,enableReceivedNotification:!1}],metadata:{accountId:t,origin:o}},a=await this.#Z.subscribe(i);this.#Qt.set(a,i)}async#en(e,t){try{const{network:e}=t,n=(0,Bf.get)(t,\"params[0]\");H(n,ue());const r=(0,Bf.get)(t,\"params[1].commitment\");H(r,ay);const o=t.metadata?.accountId;H(o,ue());const i=t.metadata?.origin;H(i,ue());const a=await this.#J.findById(o);if(!a)throw new Error(`Account not found: ${o}`);const s=await this.#Q.fetchBySignature(n,a,e);if(!s)throw new Error(`Transaction with signature ${n} not found on network ${e}`);switch(await this.#Q.save(s),r){case\"confirmed\":case\"finalized\":await this.#Qe.trackEventTransactionFinalized(a,s,{scope:e,origin:i});break;default:this.#i.warn(`⚠️ Commitment ${r} not supported`)}}catch(e){this.#i.error(\"Error handling signature notification\",e)}finally{await this.#Z.unsubscribe(t.id),this.#Qt.delete(t.id)}}async#oe(){this.#i.info(\"Handling connection recovery\"),await Promise.all(Array.from(this.#Qt.entries()).map((async([e,t])=>{await this.#tn(t,e)})))}async#tn(e,t){try{const{network:n}=e;H(n,ue());const r=(0,Bf.get)(e,\"params[0]\");H(r,ue());const o=(0,Bf.get)(e,\"params[1].commitment\");H(o,ay);const i=await this.#nn(r,n);if(!i)throw new Error(`Signature ${r} not found via HTTP fetch during connection recovery`);if(!this.#rn(i,o))return void this.#i.info(\"Signature did not reach the desired commitment while connection was down. Skipping.\");const a={jsonrpc:\"2.0\",method:\"signatureNotification\",params:{subscription:1,result:{context:{slot:BigInt(0)},value:{err:null}}}},s={...e,id:t};await this.#en(a,s),this.#Qt.delete(t)}catch(e){this.#i.error(\"Error handling connection recovery\",e)}}async#nn(e,t){const n=await this.#T.getRpc(t).getSignatureStatuses([Au(e)],{searchTransactionHistory:!0}).send(),r=n.value[0]?.confirmationStatus;if(!r)throw new Error(`Signature ${e} not found via HTTP fetch during connection recovery`);return r}#rn(e,t){return t===e||\"processed\"===t&&(\"confirmed\"===e||\"finalized\"===e)||\"confirmed\"===t&&\"finalized\"===e}}(yP,PP,OP,fP,hP,sP,Zd),jP=new vT(yP,PP,CP,OP,UP,wP,sP,Zd),FP=(new class{#Wt;#on;#ge;#i;constructor(e,t,n,r){this.#Wt=e,this.#on=t,this.#ge=n,this.#i=Gd(r,\"[🥾 MonitoredAccountsInitializer]\"),this.#te()}#te(){this.#ge.on(\"onActive\",this.#in.bind(this))}async#in(){this.#i.info(\"Starting to monitor the selected accounts\");const e=await this.#Wt.getAllSelected();await this.#on.setMonitoredAccounts(e.map((e=>e.id)))}}(PP,jP,cP,Zd),new class{#T;#an;#sn;#Qe;#i;constructor(e,t,n,r,o=Zd){this.#T=e,this.#an=t,this.#sn=n,this.#Qe=r,this.#i=Gd(o,\"[👛 WalletService]\")}async resolveAccountAddress(e,t,n){this.#i.log(\"Resolving account address\",{keyringAccounts:e,scope:t,request:n});const{method:r,params:o}=n,i=e.filter((e=>e.scopes.includes(t)));if(0===i.length)throw new Error(\"No accounts with this scope\");let a;switch(r){case Tn.SignIn:{const{address:e}=o;if(!e)throw new Error(\"No address\");a=e;break}case Tn.SignAndSendTransaction:case Tn.SignMessage:case Tn.SignTransaction:{const{account:e}=o;a=e.address;break}default:throw this.#i.warn({method:r},\"Unsupported method\"),new Error(\"Unsupported method\")}if(!i.find((e=>e.address===a)))throw new Error(\"Account not found\");return jT(t,a)}async signTransaction(e,t,n,r,o){this.#i.log(\"Signing transaction\",{account:e,transaction:t,scope:n,options:o});const i=o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:void 0,a=await this.#an.partiallySignBase64String(t,e,n,i),s={signedTransaction:qm(a)};H(s,dw);try{rd(a);const t=td(a);await this.#sn.monitor(t,e.id,\"confirmed\",n,r)}catch(e){this.#i.warn(\"Transaction is not fully signed, skipping monitoring\",{error:e})}return s}async signAndSendTransaction(e,t,n,r,o){this.#i.log(\"Signing and sending transaction\",e);const i=o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:void 0,a=await this.#an.partiallySignBase64String(t,e,n,i),s=td(a),c=function({rpc:e}){return async function(t,n){await Dm({...n,rpc:e,transaction:t})}}({rpc:this.#T.getRpc(n)}),u=zT(n,\"tx\",s);this.#i.info(`Sending transaction: ${u}`),rd(a);const l={...o?.preflightCommitment?{preflightCommitment:o.preflightCommitment}:{},...o?.minContextSlot?{minContextSlot:BigInt(o.minContextSlot)}:{},...o?.maxRetries?{maxRetries:BigInt(o.maxRetries)}:{},skipPreflight:o?.skipPreflight??!0,commitment:\"confirmed\"};await c(a,l),await this.#Qe.trackEventTransactionSubmitted(e,s,{scope:n,origin:r}),await this.#sn.monitor(s,e.id,o?.commitment??\"confirmed\",n,r);const d={signature:s};return H(d,lw),d}async signMessage(e,t){this.#i.log(\"Signing message\",e,t);const{address:n,entropySource:r,derivationPath:o}=e,i=nu(n),a=Wc().encode(t),s=function(e,t={}){return Object.freeze({content:\"string\"==typeof e?(new vd).encode(e):e,signatures:Object.freeze({...t})})}(Jc().decode(a)),{privateKeyBytes:c}=await EI({entropySource:r,derivationPath:o}),u=await pd(c),[l]=await u.signMessages([s]);H(l,ie());const d=l[i];var f;H(d,(f=Uint8Array,pe(\"instance\",(e=>e instanceof f||`Expected a \\`${f.name}\\` instance, but received: ${j(e)}`))));const h={signature:Lc().decode(d),signedMessage:t,signatureType:\"ed25519\"};return H(h,fw),h}async signIn(e,t){this.#i.log(\"Signing in\",e,t);const{address:n}=e,r=this.#cn(t),o=Jc().encode(r),i=Wc().decode(o),a={account:{address:n},...await this.signMessage(e,i)};return H(a,hw),a}async verifySignature(e,t,n){this.#i.log(\"Verifying signature\",{account:e,signatureBase58:t,messageBase64:n}),H(t,Af),H(n,Sf);const r=jc().encode(t),o=Wc().encode(n),{privateKeyBytes:i}=await EI({entropySource:e.entropySource,derivationPath:e.derivationPath}),a=await pd(i);return await Su(a.keyPair.publicKey,r,o)}#cn(e){const{domain:t,address:n,statement:r,uri:o,version:i,chainId:a,nonce:s,issuedAt:c,expirationTime:u,notBefore:l,requestId:d,resources:f}=e;let h=`${t??\"\"} wants you to sign in with your Solana account:\\n`;h+=`${n??\"\"}`,r&&(h+=`\\n\\n${r}`);const p=[];if(o&&p.push(`URI: ${o}`),i&&p.push(`Version: ${i}`),a&&p.push(`Chain ID: ${a}`),s&&p.push(`Nonce: ${s}`),c&&p.push(`Issued At: ${c}`),u&&p.push(`Expiration Time: ${u}`),l&&p.push(`Not Before: ${l}`),d&&p.push(`Request ID: ${d}`),f&&f.length>0){p.push(\"Resources:\");for(const e of f)p.push(`- ${e}`)}return p.length&&(h+=`\\n\\n${p.join(\"\\n\")}`),h}}(hP,vP,LP,fP,Zd)),DP=new class{#Ke;#i;#Q;#Y;#un;#ln;#on;#dn=\"Create Solana Account\";#fn=\"Create Solana Account Batch\";constructor({state:e,logger:t,transactionsService:n,assetsService:r,walletService:o,confirmationHandler:i,keyringAccountMonitor:a}){this.#Ke=e,this.#i=Gd(t,\"[🔑 Keyring]\"),this.#Q=n,this.#Y=r,this.#un=o,this.#ln=i,this.#on=a}async listAccounts(){return(await this.#hn()).map(oy)}async#hn(){try{const e=await this.#Ke.getKey(\"keyringAccounts\")??{};return(0,Bf.sortBy)(Object.values(e),[\"entropySource\",\"index\"])}catch(e){throw this.#i.error({error:e},\"Error listing accounts\"),new Error(\"Error listing accounts\")}}async getAccount(e){try{eT({accountId:e},ff);const t=await this.#pn(e);return t?oy(t):void 0}catch(e){throw this.#i.error({error:e},\"Error getting account\"),new Ro(e)}}async getAccountOrThrow(e){const t=await this.#pn(e);if(!t)throw new Error(`Account \"${e}\" not found`);return t}async#pn(e){try{return await this.#Ke.getKey(`keyringAccounts.${e}`)}catch(e){throw this.#i.error({error:e},\"Error getting account\"),new Ro(e)}}#gn(e,t){return function(e){if(0===e.length)return 0;const t=e.map((e=>e.index)).sort(((e,t)=>e-t));let n=0;for(const e of t){if(e!==n)break;n+=1}return n}(e.filter((e=>e.entropySource===t)))}#mn(e){return`m/44'/501'/${e}'/0'`}#yn(e){const t=e.split(\"/\")[3];if(!t)throw new Error(\"Invalid derivation path\");const n=parseInt(t.replace(\"'\",\"\"),10);return H(n,ee()),n}async#wn(){const e=(await async function(){return await snap.request({method:\"snap_listEntropySources\"})}()).find((({primary:e})=>e));if(!e)throw new Error(\"No default entropy source found - this can never happen\");return e.id}#vn({id:e,entropySource:t,derivationPath:n,index:r,publicKeyBytes:o}){const i=oT.decode(o.slice(1));return{id:e,entropySource:t,derivationPath:n,index:r,type:Pt.DataAccount,address:i,scopes:[kn.Mainnet,kn.Testnet,kn.Devnet],options:{entropySource:t,derivationPath:n,index:r},methods:[Tn.SignAndSendTransaction,Tn.SignTransaction,Tn.SignMessage,Tn.SignIn]}}async createAccount(e){const t=globalThis.crypto.randomUUID();try{await MI(this.#dn);const n=await this.#hn(),r=e?.entropySource??await this.#wn(),o=e?.derivationPath?this.#yn(e.derivationPath):this.#gn(n,r),i=e?.derivationPath?e.derivationPath:this.#mn(o),a=n.find((e=>e.derivationPath===i&&e.entropySource===r));if(a)return this.#i.warn(\"An account already exists with the same derivation path and entropy source. Skipping account creation.\"),oy(a);const{accountNameSuggestion:s,metamask:c}=e??{},{publicKeyBytes:u}=await EI({entropySource:r,derivationPath:i}),l=this.#vn({id:t,entropySource:r,derivationPath:i,index:o,publicKeyBytes:u}),d=oy(l);return await this.#Ke.setKey(`keyringAccounts.${l.id}`,l),await this.emitEvent(hr.AccountCreated,{account:d,accountNameSuggestion:s??`Solana Account ${o+1}`,displayAccountNameSuggestion:!s,displayConfirmation:!1,...c?{metamask:c}:{}}).catch((async e=>{throw this.#i.warn(\"Could not inform the client about the account creation. Rolling back the account creation operation.\",{error:e}),await this.#bn(t),e})),await zI(this.#dn),d}catch(e){throw this.#i.error({error:e},\"Error creating account\"),new Error(`Error creating account: ${e.message}`)}}async createAccounts(e){try{!function(e,t){const{type:n}=e;if(!t.includes(n))throw new Error(`Unsupported create account option type: ${n}`)}(e,[`${pn.Bip44DeriveIndex}`,`${pn.Bip44DeriveIndexRange}`]),await MI(this.#fn);const t=e.entropySource??await this.#wn(),n=new Map;for(const e of await this.#hn())e.entropySource===t&&n.set(e.index,e);let r;r=e.type===pn.Bip44DeriveIndex?{from:e.groupIndex,to:e.groupIndex}:e.range;const o=await SI({entropySource:t,path:[\"m\",\"44'\",\"501'\"],curve:\"ed25519\"}),i=await lI.fromJSON(o);let a=0;const s={};for(let e=r.from;e<=r.to;e++)if(!n.has(e)){const r=globalThis.crypto.randomUUID(),o=this.#mn(e),{publicKeyBytes:c}=await xI({coinTypeNode:i,accountIndex:e}),u=this.#vn({id:r,entropySource:t,derivationPath:o,index:e,publicKeyBytes:c});n.set(e,u),s[r]=u,a+=1}await this.#Ke.setKeyWith(\"keyringAccounts\",(e=>({...e,...s}))),await zI(this.#fn);const c=[];for(let e=r.from;e<=r.to;e++){const t=n.get(e);t&&c.push(oy(t))}return this.#i.info(`Created ${a} new accounts, returned ${c.length} total accounts`),c}catch(e){throw this.#i.error({error:e},\"Error creating accounts batch\"),new Error(`Error creating accounts: ${e.message}`)}}async#bn(e){await Promise.all([this.#Ke.deleteKey(`keyringAccounts.${e}`),this.#Ke.deleteKey(`transactions.${e}`),this.#Ke.deleteKey(`assets.${e}`)])}async deleteAccount(e){try{eT({accountId:e},hf),await this.emitEvent(hr.AccountDeleted,{id:e}),await this.#bn(e)}catch(e){throw this.#i.error({error:e},\"Error deleting account\"),e}}async listAccountAssets(e){try{eT({accountId:e},pf);const t=await this.getAccountOrThrow(e),n=(await this.#Y.findByAccount(t)).filter((e=>e.assetType.endsWith(af.SOL)||Number(e.rawAmount)>0)).map((e=>e.assetType));return tT(n,tr),n}catch(e){throw this.#i.error({error:e},\"Error listing account assets\"),e}}async getAccountBalances(e,t){try{eT({accountId:e,assets:t},gf);const n=await this.getAccountOrThrow(e),r=(await this.#Y.findByAccount(n)).filter((e=>t.includes(e.assetType))).filter((e=>e.assetType.endsWith(af.SOL)||Number(e.rawAmount)>0)).reduce(((e,t)=>(e[t.assetType]={unit:t.symbol,amount:t.uiAmount},e)),{});return tT(r,yf),r}catch(e){throw this.#i.error({error:e},\"Error getting account balances\"),e}}async emitEvent(e,t){await gi(snap,e,t)}async filterAccountChains(e,t){throw new Error(`Implement me! ${e} ${t.toString()}`)}async updateAccount(e){throw new Error(`Implement me! ${JSON.stringify(e)}`)}async submitRequest(e){return{pending:!1,result:await this.#An(e)}}async#An(e){H(e,nT);const{request:{method:t,params:n},scope:r,account:o,origin:i}=e,a=await this.getAccountOrThrow(o);if(!a.scopes.includes(r))throw new Error(`Scope \"${r}\" is not allowed for this account`);if(!a.methods.includes(t))throw new Error(`Method \"${t}\" is not allowed for this account`);if(\"scope\"in n&&r!==n.scope)throw new Error(`Scope \"${r}\" does not match \"${n.scope}\" in request.params`);H(r,wf);if(!await this.#ln.handleKeyringRequest(e,a))throw new Jo;switch(t){case Tn.SignAndSendTransaction:{const{transaction:e,options:t}=n;return this.#un.signAndSendTransaction(a,e,r,i,t)}case Tn.SignTransaction:{this.#Sn(a,e);const{transaction:t,options:o}=n;return this.#un.signTransaction(a,t,r,i,o)}case Tn.SignMessage:{this.#Sn(a,e);const{message:t}=n;return this.#un.signMessage(a,t)}case Tn.SignIn:return this.#un.signIn(a,n);default:throw new Fo(`Unsupported method: ${t}`)}}#Sn(e,t){const{address:n}=e,{account:r}=t.request.params;try{nu(r.address)}catch{throw new Error(\"Invalid Solana address format\")}if(r.address!==n)throw new Error(\"The requested account and/or method has not been authorized by the user.\")}async listAccountTransactions(e,t){try{eT({accountId:e,pagination:t},mf);const{limit:n,next:r}=t,o=await this.#pn(e);if(!o)throw new Error(\"Account not found\");const i=await this.#Q.findByAccounts([o]),a=r?i.findIndex((e=>e.id===r)):0,s=i.slice(a,a+n),c=a+t.limit<i.length;return{data:s,next:c?i[a+t.limit]?.id??null:null}}catch(e){throw this.#i.error({error:e},\"Error listing account transactions\"),e}}async resolveAccountAddress(e,t){try{H(e,wf);const{method:n,params:r}=t,o={method:n,params:r};H(o,pw);const i=await this.#hn();return{address:await this.#un.resolveAccountAddress(i,e,o)}}catch(e){return this.#i.error({error:e},\"Error resolving account address\"),null}}async discoverAccounts(e,t,n){try{H({scopes:e,entropySource:t,groupIndex:n},rT);const r=this.#mn(n),{publicKeyBytes:o}=await EI({entropySource:t,derivationPath:r}),i=oT.decode(o.slice(1)),a=[];for(const t of e)a.push(this.#Q.fetchLatestSignatures(t,i,{limit:1}));const s=await Promise.all(a);return s.some((e=>e.length>0))?[{type:\"bip44\",scopes:e,derivationPath:r}]:[]}catch(e){throw this.#i.error({error:e},\"Error discovering accounts\"),e}}async setSelectedAccounts(e){eT(e,Y(uf)),await this.#on.setMonitoredAccounts(e)}}({state:uP,transactionsService:OP,logger:Zd,assetsService:CP,walletService:FP,confirmationHandler:zP,keyringAccountMonitor:jP}),$P=new class{#T;#i;constructor(e,t=Zd){this.#T=e,this.#i=t}static isMaybeNonFungible(e){const{tokenAmount:t}=e,{decimals:n}=t;return!1}}(hP,Zd),KP=new class{#T;#En;#i;#R;#q;#xn;#kn;#Y;#Ve={minimumBalanceForRentExemption:5*LI.Minute};constructor(e,t,n,r,o,i,a,s){this.#T=e,this.#En=t,this.#R=r,this.#i=Gd(n,\"[📬 SendService]\"),this.#q=o,this.#xn=i,this.#kn=a,this.#Y=s}async#In(e){return Yd((async t=>this.#T.getRpc(e).getMinimumBalanceForRentExemption(BigInt(0)).send().then((e=>Ui(e.toString())))),this.#R,{functionName:\"SendService:getMinimumBalanceForRentExemption\",ttlMilliseconds:this.#Ve.minimumBalanceForRentExemption,generateCacheKey:(e,t)=>{const[n]=t;return`${e}:${n}`}})(e)}async confirmSend(e){this.#i.log(\"Confirming send transaction\",e);const{fromAccountId:t,toAddress:n,amount:r,assetId:o}=e.params,i=await this.#En.getAccountOrThrow(t),{chainId:a,assetReference:s}=Ji(o),c=a,u=o===cf[c].nativeToken.caip19Id,l=u?this.#xn:this.#kn,d={from:i,to:nu(n),amount:r,network:c,...u?{}:{mint:nu(s)}},f=ed(await l.buildTransactionMessage(d)),h=qm(f),p={id:globalThis.crypto.randomUUID(),scope:c,account:t,origin:ef,request:{method:Tn.SignAndSendTransaction,params:{account:{address:i.address},transaction:h,scope:c}}};return this.#i.log(\"Submitting keyring request\",p),this.#En.submitRequest(p)}async onAddressInput(e,t){if(\"\"===e)return{valid:!1,errors:[{code:jy.Required}]};try{nu(e);if(\"UNSUPPORTED\"===(await this.#q.classify(e,t)).type)throw new Error(\"Unsupported recipient\");return{valid:!0,errors:[]}}catch(e){return{valid:!1,errors:[{code:jy.Invalid}]}}}async onAmountInput(e){const{params:{value:t,accountId:n,assetId:r}}=e,o=await this.#En.getAccountOrThrow(n),{chainId:i}=Ji(r),a=i,s=cf[a].nativeToken.caip19Id,c=r===s,u=await this.#Y.findByAccount(o),l=u.find((e=>e.assetType===r)),d=u.find((e=>e.assetType===s));if(!l)throw new Error(`Balance not found for asset ${r} and account ${n}`);if(\"\"===t)return{valid:!1,errors:[{code:jy.Required}]};const f=Ay(l.uiAmount??\"0\"),h=Ay(d?.uiAmount??\"0\"),p=Ay(t),g=await this.#In(a),m=c?this.#xn:this.#kn,y=new lT(m).getFee(),w=Ui(y.toString());if(h.isZero())return{valid:!1,errors:[{code:jy.InsufficientBalance}]};if(c){if(p.gt(h))return{valid:!1,errors:[{code:jy.InsufficientBalance}]};if(p.plus(w).plus(g).gt(h))return{valid:!1,errors:[{code:jy.InsufficientBalanceToCoverFee}]}}else{if(p.gt(f))return{valid:!1,errors:[{code:jy.InsufficientBalance}]};if(w.plus(g).gt(h))return{valid:!1,errors:[{code:jy.InsufficientBalanceToCoverFee}]}}return{valid:!0,errors:[]}}}(hP,DP,Zd,dP,AP,bP,SP,CP),qP=new class{#T;#K;#i;#W=4e4;#H=10000n;constructor(e,t,n){this.#T=e,this.#K=t,this.#i=Gd(n,\"[🔐 ApproveTokenService]\")}async buildApprovalTransactionMessage(e){this.#i.log(\"Building token approval transaction\",{mint:e.mint,delegate:e.delegate,amount:e.amount,network:e.network});const{account:{entropySource:t,derivationPath:n},mint:r,delegate:o,amount:i,network:a}=e,[s,c,{privateKeyBytes:u}]=await Promise.all([this.#T.fetchMint(r,a),this.#T.getLatestBlockhash(a),EI({entropySource:t,derivationPath:n})]),{programAddress:l}=s,d=await pd(u),f=(await Uh({mint:r,owner:d.address,tokenProgram:l}))[0],[h,p]=await Promise.all([this.#K.uiAmountToAmountForMint(r,a,i),this.#T.fetchJsonParsedAccount(f,a,void 0,{skipCache:!0})]);let g=!1;try{hp(p),g=!0}catch{}const m=l===Rp,y=[];if(!g){const e=m?ng:zh;y.push(e({ata:f,mint:r,owner:d.address,payer:d,tokenProgram:l}))}const w=m?Kp:Bh;y.push(w({source:f,delegate:o,owner:d,amount:h}));const v=[rh({microLamports:this.#H}),...y,Xf({units:this.#W})];return cl(Ll({version:0}),(e=>Wl(d.address,e)),(e=>ll(c,e)),(e=>Vl(v,e)))}}(hP,wP,Zd),WP=new class{#Wt;#un;#i;#Tn;#_n;constructor(e,t,n,r,o){this.#Wt=e,this.#un=t,this.#i=Gd(n,\"[👋 ClientRequestHandler]\"),this.#Tn=r,this.#_n=o}async handle(e){this.#i.log(\"Handling client request\",e);const{method:t}=e;switch(t){case Sy.SignAndSendTransactionWithoutConfirmation:return this.#Cn(e);case Sy.ConfirmSend:return this.#Bn(e);case Sy.SignAndSendTransaction:return this.#Pn(e);case Sy.ComputeFee:return this.#Rn(e);case Sy.OnAddressInput:return this.#Nn(e);case Sy.OnAmountInput:return this.#On(e);case Sy.SignRewardsMessage:return this.#Un(e);case Sy.SignCardMessage:return this.#Mn(e);case Sy.ApproveCardAmount:return this.#zn(e);default:throw new Fo}}async#Cn(e){try{H(e,gw)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{transaction:t,options:n,account:{address:r},scope:o}}=e,i=await this.#Wt.findByAddress(r);if(!i)throw new zo(`Account not found: ${r}`);return this.#un.signAndSendTransaction(i,t,o,ef,n)}async#Pn(e){try{H(e,yw)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{transaction:t,options:n,accountId:r,scope:o}}=e,i=await this.#Wt.findById(r);if(!i)throw new zo(`Account not found: ${r}`);const{signature:a}=await this.#un.signAndSendTransaction(i,t,o,ef,n),s={transactionId:a};return H(s,ww),s}async#Bn(e){try{H(e,bw)}catch(e){const t=new zo;throw t.cause=e,t}return await this.#Tn.confirmSend(e)}async#Rn(e){try{H(e,Lw)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{transaction:t,scope:n}}=e,{baseFee:r,priorityFee:o}=vy.calculateFee(t),i=cf[n].nativeToken.symbol,a=cf[n].nativeToken.caip19Id,s=[{type:Ht.Base,asset:{unit:i,type:a,amount:by(r).toString(),fungible:!0}},{type:Ht.Priority,asset:{unit:i,type:a,amount:by(o).toString(),fungible:!0}}];return H(s,jw),s}async#Nn(e){let t;try{t=V(e,Sw)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{value:n,scope:r}}=t,o=await this.#Tn.onAddressInput(n,r);return H(o,Mw),o}async#On(e){try{H(e,xw)}catch(e){const t=new zo;throw t.cause=e,t}const t=await this.#Tn.onAmountInput(e);return H(t,Mw),t}async#Un(e){H(e,_w);const{params:{accountId:t,message:n}}=e,r=await this.#Wt.findById(t);if(!r)throw new zo(`Account not found: ${t}`);const{address:o}=kw(n);if(o!==r.address)throw new zo(`Address in rewards message (${o}) does not match signing account address (${r.address})`);return await this.#un.signMessage(r,n)}async#Mn(e){try{H(e,Rw)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{accountId:t,message:n}}=e,r=await this.#Wt.findById(t);if(!r)throw new zo(`Account not found: ${t}`);const{address:o}=Cw(n);if(o!==r.address)throw new zo(`Address in card message (${o}) does not match signing account address (${r.address})`);return await this.#un.signMessage(r,n)}async#zn(e){try{H(e,Ow)}catch(e){const t=new zo;throw t.cause=e,t}const{params:{accountId:t,amount:n,mint:r,delegate:o,scope:i}}=e,a=await this.#Wt.findById(t);if(!a)throw new zo(`Account not found: ${t}`);const s=i,c=ed(await this.#_n.buildApprovalTransactionMessage({account:a,mint:nu(r),delegate:nu(o),amount:n,network:s})),u=qm(c),{signature:l}=await this.#un.signAndSendTransaction(a,u,s,ef),d={signature:l};return H(d,Uw),d}}(PP,FP,Zd,KP,qP),HP={configProvider:sP,connection:hP,keyring:DP,priceApiClient:EP,state:uP,cache:lP,assetsService:CP,tokenPricesService:IP,signer:vP,transactionsService:OP,sendSolBuilder:bP,sendSplTokenBuilder:SP,walletService:FP,transactionScanService:MP,analyticsService:fP,confirmationHandler:zP,nftService:$P,clientRequestHandler:WP,webSocketConnectionService:gP,subscriptionService:yP,eventEmitter:cP,nameResolutionService:TP,accountsService:PP,accountsSynchronizer:UP,tokenHelper:wP},VP=ie({id:ue(),jsonrpc:te(\"2.0\"),method:te(__.OnTransactionAdded),params:ie({accountId:uf,metadata:ie({scope:wf,origin:ue()})})}),GP=ie({id:ue(),jsonrpc:te(\"2.0\"),method:te(__.OnTransactionApproved),params:ie({accountId:uf,metadata:ie({scope:wf,origin:ue()})})}),ZP=ie({id:ue(),jsonrpc:te(\"2.0\"),method:te(__.OnTransactionRejected),params:ie({accountId:uf,metadata:ie({scope:wf,origin:ue()})})}),JP=kT(\"Form\"),YP=kT(\"Field\"),QP=kT(\"AccountSelector\"),XP=kT(\"AssetSelector\"),eR=({title:e,backButtonName:t})=>ST(TT,{direction:\"horizontal\",alignment:\"space-between\",center:!0,children:[t?AT(UT,{name:t,children:AT(XT,{name:\"arrow-left\",color:\"primary\",size:\"md\"})}):null,AT(_T,{size:\"sm\",children:e}),ST(TT,{direction:\"horizontal\",children:[AT(TT,{children:null}),AT(TT,{children:null}),AT(TT,{children:null}),AT(TT,{children:null})]})]}),tR=kT(\"Input\");var nR=function(e){return e.Form=\"send-form\",e.DestinationAccountInput=\"send-to\",e.BackButton=\"send-back-button\",e.SourceAccountSelector=\"send-account-selector\",e.AmountInput=\"send-amount-input\",e.AssetSelector=\"send-asset-selector\",e.SwapCurrencyButton=\"send-swap-currency\",e.MaxAmountButton=\"send-amount-input-max\",e.CancelButton=\"send-cancel-button\",e.SendButton=\"send-submit-button\",e.ClearButton=\"send-clear-button\",e.CloseButton=\"send-close-button\",e}({}),rR=function(e){return e.TOKEN=\"TOKEN\",e.FIAT=\"USD\",e}({});const oR=({name:e,value:t,tokenSymbol:n,currency:r,currencyType:o,locale:i,swapCurrencyButtonDisabled:a=!1})=>{const s=KT(i),c=o===rR.FIAT?r.toUpperCase():n;return ST(YP,{label:s(\"send.amountField\"),children:[AT(tR,{name:e,type:\"number\",min:0,placeholder:\"0\",step:.01,value:t??void 0}),ST(TT,{direction:\"horizontal\",center:!0,children:[AT(TT,{direction:\"vertical\",alignment:\"center\",children:AT(CT,{size:\"sm\",children:c})}),AT(UT,{name:nR.SwapCurrencyButton,disabled:a,children:AT(XT,{name:\"swap-vertical\",color:a?\"muted\":\"primary\",size:\"md\"})})]})]})},iR={initial:null,fetching:\"default\",fetched:\"success\",error:null},aR=({name:e,value:t,error:n,locale:r,showClearButton:o,disabled:i,domainResolutionStatus:a})=>{const s=KT(r);return ST(TT,{children:[ST(YP,{label:s(\"send.toField\"),error:n,children:[AT(tR,{name:e,placeholder:i?\"\":s(\"send.toPlaceholder\"),value:t??void 0,disabled:i}),o?AT(TT,{children:AT(UT,{name:nR.ClearButton,children:AT(XT,{name:QT.Close,color:\"primary\"})})}):null]}),a&&null!==iR[a]&&AT(CT,{size:\"sm\",color:iR[a],children:s(`send.toDomainResolutionStatus.${a}`)})]})},sR=e=>{const{amount:t,tokenPrices:n,tokenCaipId:r,currencyType:o}=e,i=n?.[r]?.price;if(o===rR.TOKEN)return t;if(void 0===i)throw new Error(\"Token price is undefined, cannot convert to fiat amount.\");return null===t?null:Mi(t).dividedBy(Mi(i)).toString()},cR=e=>{const{selectedTokenMetadata:t}=e;return{...t??{},tokenSymbol:t?.symbol??\"UNKNOWN\",tokenImage:t?.imageUrl??'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\" width=\"48\" height=\"48\">\\n  <path fill=\"#999999\" d=\"M42.75 24c0 10.59375-8.53125 19.21875-19.125 19.21875-10.6875 0-19.21875-8.625-19.21875-19.21875 0-10.59375 8.53125-19.21875 19.21875-19.21875 10.59375 0 19.125 8.625 19.125 19.21875zM23.625 14.0625c-3.09375 0-5.90625 2.25-5.90625 5.4375 0 0.84375 0.75 1.59375 1.59375 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375 0-1.125 1.03125-2.25 2.71875-2.25 1.59375 0 2.625 1.125 2.625 2.25 0 0.5625-0.375 1.03125-1.3125 1.59375l0 0c-1.125 0.75-3 1.96875-3 4.5l0 0.46875c0 0.84375 0.75 1.59375 1.6875 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375l0-0.46875c0-0.65625 0.28125-1.125 1.40625-1.78125 1.03125-0.65625 2.8125-1.875 2.8125-4.3125 0-3.1875-2.8125-5.4375-5.8125-5.4375zM23.53125 31.875c-0.84375 0-1.59375 0.65625-1.59375 1.59375 0 0.84375 0.75 1.59375 1.59375 1.59375l0.09375 0c0.84375 0 1.59375-0.75 1.59375-1.59375 0-0.9375-0.75-1.59375-1.59375-1.59375z\"/>\\n</svg>'}},uR=e=>{const{tokenCaipId:t,tokenPrices:n}=e;return n?.[t]?.price},lR=e=>{const{balances:t,fromAccountId:n,tokenCaipId:r}=e;return t?.[n]?.[r]?.amount??\"0\"},dR=e=>{const{tokenCaipId:t,scope:n}=e;return t===cf[n]?.nativeToken?.caip19Id},fR=kT(\"Spinner\"),hR=({title:e,subtitle:t,iconSrc:n,isLoading:r})=>ST(TT,{alignment:\"center\",center:!0,children:[ST(TT,{direction:\"horizontal\",center:!0,children:[r?AT(fR,{}):null,n&&!r?AT(NT,{borderRadius:\"full\",src:n,width:16,height:16}):null]}),AT(_T,{size:\"lg\",children:e}),t?AT(CT,{color:\"muted\",children:t}):null]}),pR=kT(\"Value\"),gR=({context:e})=>{const{scope:t,fromAccountId:n,toAddress:r,accounts:o,feeEstimatedInSol:i,preferences:{locale:a,currency:s},transaction:c,feePaidInSol:u,tokenPrices:l,fromDomain:d,toDomain:f}=e,h=KT(a),p=cf[t],g=o.find((e=>e.id===n))?.address,m=jT(t,g),y=p.name,w=p.nativeToken.symbol,v=l[p.nativeToken.caip19Id]?.price,b=c?u:i,A=b?S_(b,w,a):\"\",S=void 0===v||null===b?\"\":ZT(E_(b,v),s,a);return ST(TT,{children:[ST(BT,{children:[AT(PT,{label:h(\"send.confirmation.from\"),children:d?AT(LT,{domain:d,scope:t,address:g}):AT(MT,{href:zT(t,\"address\",g),children:AT(RT,{address:m,displayName:!0})})}),r?AT(PT,{label:h(\"send.confirmation.recipient\"),children:f?AT(LT,{domain:f,scope:t,address:r}):AT(MT,{href:zT(t,\"address\",r),children:AT(RT,{address:jT(t,r),displayName:!0})})}):null]}),ST(BT,{children:[AT(PT,{label:h(\"send.confirmation.network\"),children:AT(CT,{children:y})}),AT(PT,{label:h(\"send.confirmation.transactionSpeed\"),children:AT(CT,{children:\"<1s\"})}),AT(PT,{label:h(\"send.confirmation.fee\"),children:AT(pR,{extra:S,value:A})})]})]})};var mR=function(e){return e.BackButton=\"transaction-confirmation-back-button\",e.CancelButton=\"transaction-confirmation-cancel-button\",e.ConfirmButton=\"transaction-confirmation-submit-button\",e}({});const yR={\"send-form\":({context:e,inputToAddress:t,inputAmount:n})=>{const{accounts:r,fromAccountId:o,amount:i,destinationAddressOrDomain:a,domainResolutionStatus:s,validation:c,currencyType:u,tokenCaipId:l,scope:d,balances:f,tokenPricesFetchStatus:h,buildingTransaction:p,error:g,loading:m,transactionMessage:y,preferences:{locale:w,currency:v}}=e,b=KT(w),A=f[o]?.[l],S=A?.amount,E=A?.unit??\"\",x=void 0!==S,k=r.find((e=>e.id===o)),I=k?.address?jT(d,k.address):void 0,T=uR(e),_=void 0===S||\"0\"===S,C=void 0===T,B=\"error\"===h||\"fetched\"===h&&C,P=(x?{[rR.FIAT]:ZT(E_(S,T??0),v,w),[rR.TOKEN]:S_(S,E,w)}:{[rR.FIAT]:\"\",[rR.TOKEN]:\"\"})[u],R=o.length>0&&!!a&&a.length>0&&xy(c?.[nR.DestinationAccountInput]),N=!xy(y)&&\"\"!==y,O=Boolean(a&&a.length>0),U=Boolean(c?.[nR.AmountInput]?.message),M=U?c?.[nR.AmountInput]?.message??\"\":`${b(\"send.balance\")}: ${P}`,z=o.length>0&&!!i&&i.length>0&&!!a&&a.length>0&&Object.values(c).every(xy)&&x&&!p&&N;return ST(IT,{backgroundColor:\"alternative\",children:[ST(TT,{children:[AT(eR,{title:b(\"send.title\"),backButtonName:nR.BackButton}),ST(JP,{name:nR.Form,children:[B&&AT(y_,{title:\"\",severity:\"info\",children:AT(CT,{children:b(\"send.selectedTokenPriceNotAvailable\",{currency:v})})}),AT(TT,{children:null}),AT(TT,{children:null}),AT(TT,{children:null}),AT(YP,{label:b(\"send.fromField\"),error:c?.[nR.SourceAccountSelector]?.message??\"\",children:AT(QP,{name:nR.SourceAccountSelector,chainIds:[d],value:I??void 0,hideExternalAccounts:!0,switchGlobalAccount:!0})}),AT(TT,{children:null}),AT(TT,{children:null}),AT(TT,{children:null}),AT(aR,{locale:w,disabled:m,name:nR.DestinationAccountInput,value:t??null,showClearButton:O,domainResolutionStatus:s,error:c?.[nR.DestinationAccountInput]?.message??\"\"}),R&&ST(TT,{children:[AT(TT,{children:null}),AT(TT,{children:null}),AT(TT,{children:null}),ST(TT,{direction:\"horizontal\",children:[AT(YP,{label:b(\"send.assetField\"),children:AT(XP,{chainIds:[d],value:l,name:nR.AssetSelector,addresses:I?[I]:[]})}),AT(oR,{name:nR.AmountInput,currencyType:u,tokenSymbol:E,currency:v,value:n??null,locale:w,swapCurrencyButtonDisabled:C||_})]}),ST(TT,{direction:\"horizontal\",alignment:\"space-between\",crossAlignment:\"start\",children:[AT(TT,{direction:\"vertical\",alignment:\"start\",children:AT(CT,{size:\"sm\",color:U?\"error\":\"muted\",children:M})}),AT(UT,{size:\"sm\",name:nR.MaxAmountButton,disabled:_,children:b(\"send.maxButton\")})]})]}),g&&ST(TT,{children:[AT(TT,{children:null}),AT(y_,{title:b(g.title),severity:\"warning\",children:AT(CT,{children:b(g.message)})})]})]})]}),ST(OT,{children:[AT(UT,{name:nR.CancelButton,children:b(\"send.cancelButton\")}),AT(UT,{name:nR.SendButton,disabled:!z,loading:p,children:b(\"send.continueButton\")})]})]})},\"transaction-confirmation\":({context:e})=>{const{preferences:{currency:t,locale:n}}=e,r=KT(n),{tokenImage:o,tokenSymbol:i}=cR(e),a=sR(e),s=uR(e),c=void 0===s?\"\":ZT(E_(a??\"0\",s),t,n);return ST(IT,{children:[ST(TT,{children:[AT(eR,{title:r(\"send.confirmation.title\"),backButtonName:\"transaction-confirmation-back-button\"}),AT(hR,{title:S_(a??\"0\",i,n),subtitle:c,iconSrc:o}),AT(gR,{context:e})]}),ST(OT,{children:[AT(UT,{name:\"transaction-confirmation-cancel-button\",children:r(\"send.confirmation.cancelButton\")}),AT(UT,{name:\"transaction-confirmation-submit-button\",loading:e.loading,disabled:e.loading,children:r(\"send.confirmation.sendButton\")})]})]})},\"send-pending\":({context:e})=>{const t=KT(e.preferences.locale);return AT(IT,{children:ST(TT,{children:[AT(TT,{children:null}),AT(hR,{title:t(\"send.send-pending.title\"),subtitle:t(\"send.send-pending.subtitle\"),isLoading:!0}),AT(gR,{context:e})]})})},\"transaction-success\":({context:e})=>{const{preferences:t,transaction:n,scope:r}=e,o=KT(t.locale),{tokenSymbol:i}=cR(e),a=sR(e);return AT(IT,{children:ST(TT,{children:[AT(TT,{children:null}),AT(hR,{title:o(\"send.transaction-success.title\"),subtitle:o(\"send.transaction-success.subtitle\",{amount:GT(a??\"0\",t.locale),tokenSymbol:i}),iconSrc:'<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n<path d=\"M24.0002 3.99902C12.9802 3.99902 4.00024 12.979 4.00024 23.999C4.00024 35.019 12.9802 43.999 24.0002 43.999C35.0202 43.999 44.0002 35.019 44.0002 23.999C44.0002 12.979 35.0202 3.99902 24.0002 3.99902ZM33.5602 19.399L22.2202 30.739C21.9402 31.019 21.5602 31.179 21.1602 31.179C20.7602 31.179 20.3802 31.019 20.1002 30.739L14.4402 25.079C13.8602 24.499 13.8602 23.539 14.4402 22.959C15.0202 22.379 15.9802 22.379 16.5602 22.959L21.1602 27.559L31.4402 17.279C32.0202 16.699 32.9802 16.699 33.5602 17.279C34.1402 17.859 34.1402 18.799 33.5602 19.399Z\" fill=\"#1C8234\"/>\\n</svg>\\n'}),AT(gR,{context:e}),n?.signature?AT(TT,{alignment:\"center\",center:!0,children:AT(MT,{href:zT(r,\"tx\",n?.signature),children:o(\"send.confirmation.viewTransaction\")})}):null]})})},\"transaction-failure\":({context:e})=>{const{preferences:t}=e,n=KT(t.locale),{tokenSymbol:r}=cR(e),o=sR(e);return AT(IT,{children:ST(TT,{children:[AT(TT,{children:null}),AT(hR,{title:n(\"send.transaction-failure.title\"),subtitle:n(\"send.transaction-failure.subtitle\",{amount:o??\"0\",tokenSymbol:r}),iconSrc:'<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n<path d=\"M40.8277 29.5283L29.7931 8.40143C28.3104 5.55884 26.2586 4 24 4C21.7414 4 19.6896 5.55884 18.2069 8.40143L7.17228 29.5283C5.77572 32.2241 5.62055 34.81 6.74125 36.8456C7.86194 38.8813 10.0689 40 12.9654 40H35.0346C37.9311 40 40.1381 38.8813 41.2588 36.8456C42.3795 34.81 42.2243 32.2058 40.8277 29.5283ZM22.7069 16.8375C22.7069 16.0856 23.2931 15.462 24 15.462C24.7069 15.462 25.2931 16.0856 25.2931 16.8375V26.0071C25.2931 26.759 24.7069 27.3826 24 27.3826C23.2931 27.3826 22.7069 26.759 22.7069 26.0071V16.8375ZM25.2241 32.811C25.1379 32.8844 25.0517 32.9577 24.9655 33.0311C24.8621 33.1044 24.7586 33.1595 24.6552 33.1961C24.5517 33.2511 24.4483 33.2878 24.3276 33.3062C24.2241 33.3245 24.1034 33.3428 24 33.3428C23.8965 33.3428 23.7759 33.3245 23.6552 33.3062C23.5517 33.2878 23.4483 33.2511 23.3448 33.1961C23.2414 33.1595 23.1379 33.1044 23.0345 33.0311C22.9483 32.9577 22.8621 32.8844 22.7759 32.811C22.4655 32.4626 22.2758 31.9857 22.2758 31.5089C22.2758 31.0321 22.4655 30.5553 22.7759 30.2068C22.8621 30.1335 22.9483 30.0601 23.0345 29.9868C23.1379 29.9134 23.2414 29.8584 23.3448 29.8217C23.4483 29.7667 23.5517 29.73 23.6552 29.7117C23.8793 29.6567 24.1207 29.6567 24.3276 29.7117C24.4483 29.73 24.5517 29.7667 24.6552 29.8217C24.7586 29.8584 24.8621 29.9134 24.9655 29.9868C25.0517 30.0601 25.1379 30.1335 25.2241 30.2068C25.5345 30.5553 25.7241 31.0321 25.7241 31.5089C25.7241 31.9857 25.5345 32.4626 25.2241 32.811Z\" fill=\"#BF5208\"/>\\n</svg>\\n'}),AT(gR,{context:e})]})})}},wR=({context:e,inputToAddress:t,inputAmount:n})=>{const r=e.stage??\"send-form\";return AT(yR[r],{context:e,inputToAddress:t,inputAmount:n})};function vR(e){if(!e)return!1;return/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*\\.sol$/u.test(e)}function bR(e,t,n){return n[e]?n[e]?.map((e=>e(t))).find((e=>null!==e))??null:null}function AR(e){const t=IR(e),n={[nR.SourceAccountSelector]:e.fromAccountId,[nR.AmountInput]:e.amount,[nR.DestinationAccountInput]:e.toAddress};return Object.entries(t).every((([e,t])=>{const r=n[e];return!!r&&t.every((e=>null===e(r)))}))}const SR=(e,t)=>{const n=KT(t);return t=>{const r=\"\"===t?{message:n(e),value:t}:null;return r?{message:r.message,value:t}:null}},ER=(e,t)=>{const n=KT(t);return t=>{try{return vR(t)||nu(t),null}catch{return{message:n(e),value:t}}}},xR=e=>{const{minimumBalanceForRentExemptionSol:t,preferences:{locale:n},feeEstimatedInSol:r,selectedTokenMetadata:o}=e,i=KT(n);return n=>{if(\"\"===n)return{message:\"\",value:n};const a=sR({...e,amount:n}),s=Ay(a??\"0\"),c=lR(e),u=Ay(c),l=Ay(r??\"0\"),d=Ay(t??\"0\"),f=(e=>lR({...e,tokenCaipId:cf[e.scope].nativeToken.caip19Id}))(e),h=Ay(f),p=dR(e);if(s.gt(u))return{message:`${i(\"send.insufficientBalance\")}: ${c} ${o?.symbol??\"\"}`,value:n};if(p){if(s.lt(d))return{message:i(\"send.amountGreatherThanMinimumBalanceForRentExemptionError\",{minimumValue:t}),value:n};if(s.plus(l).plus(d).gt(u))return{message:i(\"send.insuffientSolToCoverFee\"),value:n}}else{if(l.plus(d).gt(h))return{message:i(\"send.insuffientSolToCoverFee\"),value:n}}return s.isZero()?{message:\"\",value:n}:h.isZero()?{message:i(\"send.insuffientSolToCoverFee\"),value:n}:null}},kR=ie({scope:X([...Object.values(tf)]),account:uf,assetId:ae(Gi)}),IR=e=>({[nR.SourceAccountSelector]:[SR(\"send.fromRequiredError\",e.preferences.locale)],[nR.AmountInput]:[xR(e),SR(\"send.amountRequiredError\",e.preferences.locale)],[nR.DestinationAccountInput]:[SR(\"send.toRequiredError\",e.preferences.locale),ER(\"send.toInvalidError\",e.preferences.locale)]}),TR={scope:tf.Mainnet,fromAccountId:\"\",fromDomain:null,amount:\"\",destinationAddressOrDomain:null,toDomain:null,toAddress:null,domainResolutionStatus:null,feeEstimatedInSol:\"0\",feePaidInSol:\"0\",tokenCaipId:nf.SolMainnet,accounts:[],currencyType:rR.TOKEN,validation:{},balances:{},assets:[],tokenPrices:{},selectedTokenMetadata:null,tokenPricesFetchStatus:\"initial\",preferences:{locale:\"en\",currency:\"usd\",hideBalances:!1,useSecurityAlerts:!0,useExternalPricingData:!0,simulateOnChainActions:!0,useTokenDetection:!0,batchCheckBalances:!0,displayNftMedia:!0,useNftDetection:!0},error:null,buildingTransaction:!1,transactionMessage:null,transaction:null,stage:\"send-form\",minimumBalanceForRentExemptionSol:\"0.002\",loading:!0},_R={[__.OnTransactionAdded]:async({request:e})=>{try{Zd.info(\"[onTransactionAdded] Cronjob triggered\",e),H(e,VP);const{accountId:t,metadata:n}=e.params,r=await DP.getAccountOrThrow(t);await fP.trackEventTransactionAdded(r,n)}catch(e){throw Zd.error(e),new Uo(e)}},[__.OnTransactionApproved]:async({request:e})=>{try{Zd.info(\"[onTransactionApproved] Cronjob triggered\",e),H(e,GP);const{accountId:t,metadata:n}=e.params,r=await DP.getAccountOrThrow(t);await fP.trackEventTransactionApproved(r,n)}catch(e){throw Zd.error(e),new Uo(e)}},[__.OnTransactionRejected]:async({request:e})=>{try{Zd.info(\"[onTransactionRejected] Cronjob triggered\",e),H(e,ZP);const{accountId:t,metadata:n}=e.params,r=await DP.getAccountOrThrow(t);await fP.trackEventTransactionRejected(r,n)}catch(e){throw Zd.error(e),new Uo(e)}},[__.RefreshSend]:async()=>{const e=Gd(Zd,\"[refreshSend]\");e.info(\"Background event triggered\");const[t,n,r]=await Promise.all([CP.getAll(),uP.getKey(\"mapInterfaceNameToId\"),NI().catch((()=>TR.preferences))]),o=t.flatMap((e=>e.assetType)),i=n?.[TI];if(!i)return void e.info(\"No send form interface found\");if(await OI(i))try{const t=await EP.getMultipleSpotPrices(o,r.currency);await uP.setKey(\"tokenPrices\",t);const n=await OI(i);if(!n)return void e.info(\"Interface context no longer exists after fetching prices, skipping update\");const a={...n,tokenPrices:{...n.tokenPrices,...t}};await BI(i,AT(wR,{context:a}),a),e.info(\"✅ Background event suceeded\"),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT30S\",request:{method:\"refreshSend\"}}})}catch(t){e.warn({error:t},\"Could not refresh send interface\")}else e.info(\"Interface context no longer exists, skipping refresh\")},[__.RefreshConfirmationEstimation]:async()=>{const e=Gd(Zd,\"[refreshConfirmationEstimation]\");e.info(\"Background event triggered\");const t=(await uP.getKey(\"mapInterfaceNameToId\")??{})[_I];if(!t)return void e.info(\"No interface context found\");const n=await OI(t);if(n)try{if(!(n.account?.address&&n.transaction&&n.scope&&n.method))return void e.info(\"Context is missing required fields\");if(!n.preferences?.simulateOnChainActions)return void e.info(\"Transaction simulation is disabled in preferences\");const r={...n,scanFetchStatus:\"fetching\"};await BI(t,AT(k_,{context:II(r)}),r);const[o,i]=await Promise.all([MP.scanTransaction({method:n.method,accountAddress:n.account.address,transaction:n.transaction,scope:n.scope,origin:n.origin,account:n.account}),OI(t)]);if(!i)return void e.info(\"Interface context no longer exists after scan, skipping update\");const a={...i,scanFetchStatus:\"fetched\",scan:o};e.info(\"New scan fetched\"),await BI(t,AT(k_,{context:II(a)}),a),e.info(\"Background event suceeded\"),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT20S\",request:{method:\"refreshConfirmationEstimation\"}}})}catch(n){const r=await OI(t);if(!r)return void e.info(\"Interface context no longer exists, skipping rollback\");const o={...r,scanFetchStatus:\"fetched\"};await BI(t,AT(k_,{context:II(o)}),o),e.warn({error:n},\"Could not update the interface. But rolled back status to fetched.\")}else e.info(\"Interface context no longer exists, skipping refresh\")},[__.CloseWebSocketConnections]:async()=>{Zd.info(\"Closing all WebSocket connections via background event\"),await gP.closeAllConnections()}},CR={..._R};var BR={};const PR=ie({chainId:wf,domain:ae(ue()),address:ae(ue())}),RR=\"Solana Name Service\";var NR=function(e){return e.GetGenesisHash=\"getGenesisHash\",e.GetLatestBlockhash=\"getLatestBlockhash\",e.GetMinimumBalanceForRentExemption=\"getMinimumBalanceForRentExemption\",e}({});const OR=ie({jsonrpc:Ry,id:Ny,method:te(\"getGenesisHash\"),params:ae(Y())}),UR=ie({jsonrpc:Ry,id:Ny,method:te(\"getLatestBlockhash\")}),MR=ie({jsonrpc:Ry,id:Ny,method:te(\"getMinimumBalanceForRentExemption\"),params:le([oe(),ae(ie())])}),zR={[jI.GetFeeForTransaction]:async({request:e})=>{H(e.params,vf);const{transaction:t}=e.params;try{const{totalFee:e}=vy.calculateFee(t),n={value:e.toString()};return H(n,bf),n}catch(e){throw Zd.error(e),new Uo(e)}},[jI.StartSendTransactionFlow]:async({request:e})=>{const{params:t}=e;H(t,kR);const{scope:n,account:r}=t,o=t.assetId??cf[n].nativeToken.caip19Id,i={...TR,scope:n,fromAccountId:r,tokenCaipId:o,loading:!0},[a,s,c,u]=await Promise.all([CP.getAll(),PP.getAll(),uP.getKey(\"tokenPrices\"),NI().catch((()=>TR.preferences))]);i.balances=function(e,t){return t.filter((t=>{const n=t.assetType===cf[e].nativeToken.caip19Id,r=t.assetType.startsWith(e),o=\"0\"!==t.rawAmount;return n||r&&o})).reduce(((e,t)=>(e[t.keyringAccountId]={...e[t.keyringAccountId],[t.assetType]:{unit:t.symbol,amount:t.uiAmount}},e)),{})}(n,a),i.assets=a.map((e=>e.assetType)),i.accounts=s,i.preferences=u,i.tokenPrices=c??{};const l=await CI(AT(wR,{context:i}),i),d=RI(l),f=CP.getAssetsMetadata([i.tokenCaipId]).then((e=>{const t=e[i.tokenCaipId];t?.symbol&&t?.name&&(i.selectedTokenMetadata={symbol:t.symbol,name:t.name,asset:i.tokenCaipId,imageUrl:null})})).catch((()=>null));let h;i.preferences.useExternalPricingData?h=EP.getMultipleSpotPrices(i.assets,i.preferences.currency).then((e=>{i.tokenPrices={...i.tokenPrices,...e},i.tokenPricesFetchStatus=\"fetched\"})).catch((()=>{i.tokenPricesFetchStatus=\"error\"})):i.tokenPricesFetchStatus=\"fetched\";const p=hP.getRpc(n).getMinimumBalanceForRentExemption(BigInt(0)).send().then((e=>{i.minimumBalanceForRentExemptionSol=by(e).toString()})).catch((()=>{}));return i.loading=!0,await BI(l,AT(wR,{context:i}),i),i.loading=!1,await Promise.all([h,f,p]),await BI(l,AT(wR,{context:i}),i),await uP.setKey(`mapInterfaceNameToId.${TI}`,l),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT30S\",request:{method:\"refreshSend\"}}}),d},[FI.ListWebSockets]:async()=>(await cP.emitSync(\"onListWebSockets\"),null),[FI.ListSubscriptions]:async()=>(await cP.emitSync(\"onListSubscriptions\"),null),[FI.TestOnStart]:async()=>(await cP.emitSync(\"onStart\"),null),[FI.TestOnInstall]:async()=>(await cP.emitSync(\"onInstall\"),null),[FI.TestOnUpdate]:async()=>(await cP.emitSync(\"onUpdate\"),null),[FI.SynchronizeAccounts]:async()=>(await UP.synchronize(),null),[FI.SetAccountSelected]:async({request:e})=>(await DP.setSelectedAccounts(e.params.accountIds),null),[FI.ConfirmSend]:async({request:e})=>(await WP.handle(e),null),[FI.SignRewardsMessage]:async({request:e})=>WP.handle({...e,method:Sy.SignRewardsMessage})};const LR=async e=>{try{return await e()}catch(e){const t=function(e){return[Ro,Fo,Jo,Do,Fo,$o,Ko,qo,Wo,Ho,Vo,Go,Zo,Uo,Mo,zo,Lo,jo].some((t=>e instanceof t))}(e)?e:new Ro(e);throw Zd.error({error:t},`[SnapError] ${JSON.stringify(t.toJSON(),null,2)}`),t}};var jR=n(4255),FR=n.n(jR),DR=n(3804),$R=n.n(DR);class KR extends Error{constructor(e=\"Operation cancelled\"){super(e),this.name=\"CancellationError\"}}const qR=async e=>{const{fromAccountId:t,tokenCaipId:n,scope:r,toAddress:o}=e,i=sR(e),a=await DP.getAccountOrThrow(t);if(!o||!i)throw new Error(\"Invalid transaction parameters\");const s=n===cf[r].nativeToken.caip19Id,c=s?bP:SP,u=new lT(c),l={from:a,to:nu(o),amount:i,network:r,...s?{}:{mint:nu(Ji(n).assetReference)}},d=await c.buildTransactionMessage(l),f=await(async e=>cl(e,zl,Cl().encode,qc().decode))(d);return{feeInLamports:u.getFee(),base64EncodedTransactionMessage:f}},WR=$R()((async(e,t)=>{try{if(!AR(t))return;const n={buildingTransaction:!0,transactionMessage:null,feeEstimatedInSol:null};await BI(e,AT(wR,{context:{...t,...n}}),{...t,...n});const{feeInLamports:r,base64EncodedTransactionMessage:o}=await qR(t),i={transactionMessage:o,feeEstimatedInSol:r?by(r).toString():null,buildingTransaction:!1},a=await OI(e);if(!a)return;await BI(e,AT(wR,{context:{...a,...i}}),{...a,...i})}catch(t){Zd.error(\"Could not build the send transaction\",t);const n={error:{title:\"send.simulationTitleError\",message:\"send.simulationMessageError\"},transactionMessage:null,feeEstimatedInSol:null,buildingTransaction:!1},r=await OI(e);if(!r)return;await BI(e,AT(wR,{context:{...r,...n}}),{...r,...n})}}),(function(e){const t=(e=>(...t)=>{const n=new AbortController,r=[...t];r.some((e=>e instanceof AbortSignal))||r.push(n.signal);const o=Promise.race([e(...r),new Promise(((e,t)=>{n.signal.addEventListener(\"abort\",(()=>{t(new KR)}))}))]);return o.cancel=()=>n.abort(),o})(e);let n=null;return async(...e)=>{if(n&&\"function\"==typeof n.cancel){const e=\"Cancelling previous task\";Zd.warn(e),n.cancel()}const r=t(...e);n=r;try{return await r}finally{n===r&&(n=null)}}}),FR()(500));const HR={[nR.BackButton]:async function({id:e}){await PI(e,!1),await uP.deleteKey(`mapInterfaceNameToId.${TI}`)},[nR.SourceAccountSelector]:async function({id:e,event:t,context:n}){const r=t.value;n.fromAccountId=r.accountId,n.error=null,n.validation[nR.SourceAccountSelector]=bR(nR.SourceAccountSelector,n.fromAccountId,IR(n)),n.amount&&(n.validation[nR.AmountInput]=bR(nR.AmountInput,n.amount,IR(n))),await BI(e,AT(wR,{context:n}),n),await WR(e,n)},[nR.AmountInput]:async function({id:e,event:t,context:n}){const r={...n};r.amount=t.value,r.error=null;const o=bR(nR.AmountInput,r.amount,IR(r));if(o&&r.validation[nR.AmountInput]?.message!==o?.message)return r.validation[nR.AmountInput]=o,void await BI(e,AT(wR,{context:r}),r);null===o&&(r.validation[nR.AmountInput]=null,await BI(e,AT(wR,{context:r}),r),await WR(e,r))},[nR.AssetSelector]:async function({id:e,event:t,context:n}){if(\"object\"!=typeof t.value||!t.value||!(\"asset\"in t.value))return;const r=t.value.asset;if(n.tokenCaipId===r)return;const o=r===cf[n.scope].nativeToken.caip19Id?bP:SP,i=new lT(o).getFee(),a={tokenCaipId:r,feeEstimatedInSol:by(i).toString(),selectedTokenMetadata:{symbol:t.value.symbol,name:t.value.name,asset:t.value.asset,imageUrl:null},amount:\"\",error:null},s=(0,Bf.merge)(n,a);await BI(e,AT(wR,{context:s,inputAmount:\"\"}),s),await WR(e,n)},[nR.SwapCurrencyButton]:async function({id:e,context:t}){if(t.error=null,t.currencyType=t.currencyType===rR.TOKEN?rR.FIAT:rR.TOKEN,!t.amount)return void await BI(e,AT(wR,{context:t}),t);const n=Mi(t.amount??\"0\"),{price:r}=t.tokenPrices[t.tokenCaipId]??{price:0};t.currencyType===rR.TOKEN&&(t.amount=n.dividedBy(r).toString()),t.currencyType===rR.FIAT&&(t.amount=n.multipliedBy(r).toString()),await BI(e,AT(wR,{context:t,inputAmount:t.amount}),t)},[nR.MaxAmountButton]:async function({id:e,context:t}){const{currencyType:n,minimumBalanceForRentExemptionSol:r,tokenCaipId:o,tokenPrices:i}=t,a={...t},s=lR(t);if(dR(t)){const e=Ay(s),t=new lT(bP).getFee().toString(),n=Ay(r),o=e.minus(t).minus(n).minus(1),i=Mi.maximum(o,o.isNegative()?e:Mi(0)),c=by(i);a.amount=c.toString()}else a.amount=s;if(n===rR.FIAT){const{price:e}=i[o]??{price:0};a.amount=E_(a.amount,e)}a.error=null,a.validation[nR.AmountInput]=bR(nR.AmountInput,a.amount,IR(a)),await BI(e,AT(wR,{context:a,inputAmount:a.amount}),a),await WR(e,a)},[nR.DestinationAccountInput]:async function({id:e,event:t,context:n}){const r={...n};r.destinationAddressOrDomain=t.value,r.domainResolutionStatus=null,r.error=null;const o=bR(nR.DestinationAccountInput,r.destinationAddressOrDomain,IR(r));r.validation[nR.DestinationAccountInput]=o,vR(r?.destinationAddressOrDomain)?(r.domainResolutionStatus=\"fetching\",await BI(e,AT(wR,{context:r}),r),r.toAddress=await TP.resolveDomain(r.scope,r.destinationAddressOrDomain).catch((()=>{const e=KT(r.preferences.locale);return r.validation[nR.DestinationAccountInput]={message:e(\"send.toInvalidErrorDomain\"),value:r.destinationAddressOrDomain??\"\"},null})),r.domainResolutionStatus=r.toAddress?\"fetched\":\"error\"):r.toAddress=r.destinationAddressOrDomain,await BI(e,AT(wR,{context:r}),r),null===o&&await WR(e,r)},[nR.ClearButton]:async function({id:e,context:t}){t.destinationAddressOrDomain=\"\",t.toAddress=\"\",t.domainResolutionStatus=null,t.error=null,t.validation[nR.DestinationAccountInput]=null,await BI(e,AT(wR,{context:t,inputToAddress:t.toAddress}),t)},[nR.CancelButton]:async function({id:e}){await PI(e,!1),await uP.deleteKey(`mapInterfaceNameToId.${TI}`)},[nR.SendButton]:async function({id:e,context:t}){if(!AR(t))return;const n={...t};n.stage=\"transaction-confirmation\",n.loading=!0,await BI(e,AT(wR,{context:n}),n);const r=t.accounts.find((e=>e.id===t.fromAccountId))?.address,[o,i,a]=await Promise.all([r?TP.resolveAddress(t.scope,r):null,t.toAddress?TP.resolveAddress(t.scope,t.toAddress):null,EP.getMultipleSpotPrices(t.assets,t.preferences.currency).then((e=>e)).catch((()=>null))]);if(n.fromDomain=o,n.toDomain=i,a&&(n.tokenPrices=a),t.selectedTokenMetadata){const e=Cf({baseUrl:sP.get().staticApi.baseUrl,path:\"/api/v2/tokenIcons/assets/{assetId}.png\",pathParams:{assetId:t.selectedTokenMetadata.asset.replace(/:/gu,\"/\")},encodePathParams:!1});n.selectedTokenMetadata={...t.selectedTokenMetadata,imageUrl:e}}n.loading=!1,await BI(e,AT(wR,{context:n}),n),await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionAdded,params:{accountId:t.fromAccountId,metadata:{scope:t.scope,origin:ef}}}}})}};const VR={[mR.BackButton]:async function({id:e,context:t}){const n={...t,stage:\"send-form\"};await BI(e,AT(wR,{context:n,inputAmount:t.amount??\"\",inputToAddress:t.destinationAddressOrDomain??\"\"}),n)},[mR.CancelButton]:async function({id:e,context:t}){const{fromAccountId:n,transactionMessage:r,scope:o}=t;await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionRejected,params:{accountId:n,metadata:{scope:o,origin:ef}}}}}),await PI(e,!1),await uP.deleteKey(`mapInterfaceNameToId.${TI}`)},[mR.ConfirmButton]:async function({id:e,context:t}){const{scope:n,fromAccountId:r,feeEstimatedInSol:o,transactionMessage:i}=t;if(t.error=null,!i)return t.stage=\"send-form\",void await BI(e,AT(wR,{context:t}),t);await snap.request({method:\"snap_scheduleBackgroundEvent\",params:{duration:\"PT1S\",request:{method:__.OnTransactionApproved,params:{accountId:t.fromAccountId,metadata:{scope:t.scope,origin:ef}}}}});const a={...t,stage:\"send-pending\"};await BI(e,AT(wR,{context:a}),a);let s=null;try{const e=await DP.getAccountOrThrow(r);s=(await FP.signAndSendTransaction(e,i,n,ef)).signature}catch(e){Zd.error({error:e},\"Error submitting request\")}const c={...t,stage:s?\"transaction-success\":\"transaction-failure\",feePaidInSol:o,transaction:{result:s?\"success\":\"failure\",signature:s}};await BI(e,AT(wR,{context:c}),c),await uP.deleteKey(`mapInterfaceNameToId.${TI}`)}};const GR=2n**255n-19n,ZR=2n**252n+27742317777372353535851937790883648493n,JR=0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,YR=0x6666666666666666666666666666666666666666666666666666666666666658n,QR={a:-1n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,p:GR,n:ZR,h:8,Gx:JR,Gy:YR},XR=(e=\"\")=>{throw new Error(e)},eN=e=>\"string\"==typeof e,tN=(e,t)=>!(e=>e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name)(e)||\"number\"==typeof t&&t>0&&e.length!==t?XR(\"Uint8Array of valid length expected\"):e,nN=e=>new Uint8Array(e),rN=(e,t)=>tN(eN(e)?dN(e):nN(tN(e)),t),oN=(e,t=GR)=>{let n=e%t;return n>=0n?n:t+n},iN=e=>e instanceof aN?e:XR(\"Point expected\");class aN{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r}static fromAffine(e){return new aN(e.x,e.y,1n,oN(e.x*e.y))}static fromHex(e,t=!1){const{d:n}=QR,r=(e=rN(e,32)).slice(),o=e[31];r[31]=-129&o;const i=hN(r);!t||0n<=i&&i<2n**256n||XR(\"bad y coord 1\"),t||0n<=i&&i<GR||XR(\"bad y coord 2\");const a=oN(i*i),s=oN(a-1n),c=oN(n*a+1n);let{isValid:u,value:l}=wN(s,c);u||XR(\"bad y coordinate 3\");const d=1n==(1n&l),f=!!(128&o);return!t&&0n===l&&f&&XR(\"bad y coord 3\"),f!==d&&(l=oN(-l)),new aN(l,i,1n,oN(l*i))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){const{ex:t,ey:n,ez:r}=this,{ex:o,ey:i,ez:a}=iN(e),s=oN(t*a),c=oN(o*r),u=oN(n*a),l=oN(i*r);return s===c&&u===l}is0(){return this.equals(cN)}negate(){return new aN(oN(-this.ex),this.ey,this.ez,oN(-this.et))}double(){const{ex:e,ey:t,ez:n}=this,{a:r}=QR,o=oN(e*e),i=oN(t*t),a=oN(2n*oN(n*n)),s=oN(r*o),c=e+t,u=oN(oN(c*c)-o-i),l=s+i,d=l-a,f=s-i,h=oN(u*d),p=oN(l*f),g=oN(u*f),m=oN(d*l);return new aN(h,p,m,g)}add(e){const{ex:t,ey:n,ez:r,et:o}=this,{ex:i,ey:a,ez:s,et:c}=iN(e),{a:u,d:l}=QR,d=oN(t*i),f=oN(n*a),h=oN(o*l*c),p=oN(r*s),g=oN((t+n)*(i+a)-d-f),m=oN(p-h),y=oN(p+h),w=oN(f-u*d),v=oN(g*m),b=oN(y*w),A=oN(g*w),S=oN(m*y);return new aN(v,b,S,A)}mul(e,t=!0){if(0n===e)return!0===t?XR(\"cannot multiply by 0\"):cN;if(\"bigint\"==typeof e&&0n<e&&e<ZR||XR(\"invalid scalar, must be < L\"),!t&&this.is0()||1n===e)return this;if(this.equals(sN))return UN(e).p;let n=cN,r=sN;for(let o=this;e>0n;o=o.double(),e>>=1n)1n&e?n=n.add(o):t&&(r=r.add(o));return n}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(QR.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(ZR/2n,!1).double();return e=e.add(this),e.is0()}toAffine(){const{ex:e,ey:t,ez:n}=this;if(this.equals(cN))return{x:0n,y:1n};const r=gN(n);return 1n!==oN(n*r)&&XR(\"invalid inverse\"),{x:oN(e*r),y:oN(t*r)}}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=fN(t);return n[31]|=1n&e?128:0,n}toHex(){return lN(this.toRawBytes())}}aN.BASE=new aN(JR,YR,1n,oN(JR*YR)),aN.ZERO=new aN(0n,1n,1n,0n);const{BASE:sN,ZERO:cN}=aN,uN=(e,t)=>e.toString(16).padStart(t,\"0\"),lN=e=>Array.from(e).map((e=>uN(e,2))).join(\"\"),dN=e=>{const t=e.length;(!eN(e)||t%2)&&XR(\"hex invalid 1\");const n=nN(t/2);for(let t=0;t<n.length;t++){const r=2*t,o=e.slice(r,r+2),i=Number.parseInt(o,16);(Number.isNaN(i)||i<0)&&XR(\"hex invalid 2\"),n[t]=i}return n},fN=e=>dN(uN(e,64)).reverse(),hN=e=>BigInt(\"0x\"+lN(nN(tN(e)).reverse())),pN=(...e)=>{const t=nN(e.reduce(((e,t)=>e+tN(t).length),0));let n=0;return e.forEach((e=>{t.set(e,n),n+=e.length})),t},gN=(e,t=GR)=>{(0n===e||t<=0n)&&XR(\"no inverse n=\"+e+\" mod=\"+t);let n=oN(e,t),r=t,o=0n,i=1n,a=1n,s=0n;for(;0n!==n;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}return 1n===r?oN(o,t):XR(\"no inverse\")},mN=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=GR;return n},yN=19681161376707505956807079304988542015446066515923890162744021073123829784752n,wN=(e,t)=>{const n=oN(t*t*t),r=(e=>{const t=e*e%GR*e%GR,n=mN(t,2n)*t%GR,r=mN(n,1n)*e%GR,o=mN(r,5n)*r%GR,i=mN(o,10n)*o%GR,a=mN(i,20n)*i%GR,s=mN(a,40n)*a%GR,c=mN(s,80n)*s%GR,u=mN(c,80n)*s%GR,l=mN(u,10n)*o%GR;return{pow_p_5_8:mN(l,2n)*e%GR,b2:t}})(e*oN(n*n*t)).pow_p_5_8;let o=oN(e*n*r);const i=oN(t*o*o),a=o,s=oN(o*yN),c=i===e,u=i===oN(-e),l=i===oN(-e*yN);return c&&(o=a),(u||l)&&(o=s),1n==(1n&oN(o))&&(o=oN(-o)),{isValid:c||u,value:o}},vN=e=>oN(hN(e),ZR);let bN;const AN=(...e)=>RN.sha512Async(...e),SN=(...e)=>\"function\"==typeof bN?bN(...e):XR(\"etc.sha512Sync not set\"),EN=e=>{const t=e.slice(0,32);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(32,64),r=vN(t),o=sN.mul(r),i=o.toRawBytes();return{head:t,prefix:n,scalar:r,point:o,pointBytes:i}},xN=e=>AN(rN(e,32)).then(EN),kN=e=>EN(SN(rN(e,32))),IN=e=>xN(e).then((e=>e.pointBytes));function TN(e,t){return e?AN(t.hashable).then(t.finish):t.finish(SN(t.hashable))}const _N=(e,t,n)=>{const{pointBytes:r,scalar:o}=e,i=vN(t),a=sN.mul(i).toRawBytes();return{hashable:pN(a,r,n),finish:e=>{const t=oN(i+vN(e)*o,ZR);return tN(pN(a,fN(t)),64)}}},CN={zip215:!0},BN=(e,t,n,r=CN)=>{t=rN(t),e=rN(e,64);const{zip215:o}=r;let i,a,s,c,u=new Uint8Array;try{i=aN.fromHex(n,o),a=aN.fromHex(e.slice(0,32),o),s=hN(e.slice(32,64)),c=sN.mul(s,!1),u=pN(a.toRawBytes(),i.toRawBytes(),t)}catch(e){}return{hashable:u,finish:e=>{if(null==c)return!1;if(!o&&i.isSmallOrder())return!1;const t=vN(e);return a.add(i.mul(t,!1)).add(c.negate()).clearCofactor().is0()}}},PN=()=>\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0,RN={bytesToHex:lN,hexToBytes:dN,concatBytes:pN,mod:oN,invert:gN,randomBytes:(e=32)=>{const t=PN();return t&&t.getRandomValues||XR(\"crypto.getRandomValues must be defined\"),t.getRandomValues(nN(e))},sha512Async:async(...e)=>{const t=PN();t&&t.subtle||XR(\"crypto.subtle or etc.sha512Async must be defined\");const n=pN(...e);return nN(await t.subtle.digest(\"SHA-512\",n.buffer))},sha512Sync:void 0};Object.defineProperties(RN,{sha512Sync:{configurable:!1,get:()=>bN,set(e){bN||(bN=e)}}});const NN={getExtendedPublicKeyAsync:xN,getExtendedPublicKey:kN,randomPrivateKey:()=>RN.randomBytes(32),precompute:(e=8,t=sN)=>(t.multiply(3n),t)};let ON;const UN=e=>{const t=ON||(ON=(()=>{const e=[];let t=sN,n=t;for(let r=0;r<33;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})()),n=(e,t)=>{let n=t.negate();return e?n:t};let r=cN,o=sN;const i=BigInt(255),a=BigInt(8);for(let s=0;s<33;s++){const c=128*s;let u=Number(e&i);e>>=a,u>128&&(u-=256,e+=1n);const l=c,d=c+Math.abs(u)-1,f=s%2!=0,h=u<0;0===u?o=o.add(n(f,t[l])):r=r.add(n(h,t[d]))}return{p:r,f:o}};function MN(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var zN=n(1048).hp;const LN=\"8d9df0f7-1363-4d2c-8152-ce4ed78f27d8\",jN=[48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32];function FN(e){return zN.from(e).toString(\"base64\").replace(/\\+/gu,\"-\").replace(/\\//gu,\"_\").replace(/[=]/gu,\"\")}function DN(e){const t=e.replace(/-/gu,\"+\").replace(/_/gu,\"/\");return new Uint8Array(zN.from(t,\"base64\"))}async function $N(e,t,n){if(\"private\"!==t.type)throw new DOMException(\"Key is not private\",\"NotAllowedError\");if(!t.usages.includes(\"sign\"))throw new DOMException(\"Key usage not allowed\",\"NotAllowedError\");const r=MN(n),o=t[LN],i=function(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteLength)}(await(async(e,t)=>{const n=rN(e),r=await xN(t),o=await AN(r.prefix,n);return TN(!0,_N(r,o,n))})(r,o));return i}async function KN(e,t,n,r){if(\"public\"!==t.type)throw new DOMException(\"Key is not public\",\"NotAllowedError\");if(!t.usages.includes(\"verify\"))throw new DOMException(\"Key usage not allowed\",\"NotAllowedError\");const o=MN(n),i=MN(r),a=t[LN];return await(async(e,t,n,r=CN)=>TN(!0,BN(e,t,n,r)))(o,i,a)}function qN(e){return\"Ed25519\"===e||\"object\"==typeof e&&\"Ed25519\"===e.name}function WN(){const{subtle:e}=globalThis.crypto;Object.defineProperty(globalThis,\"isSecureContext\",{value:!0,writable:!0,configurable:!0}),Object.defineProperty(e,\"generateKey\",{value:async(...e)=>qN(e[0])?await async function(e,t,n){const r=NN.randomPrivateKey(),o=await IN(r),i=Array.from(n);return{privateKey:{algorithm:{name:\"Ed25519\"},extractable:t,type:\"private\",usages:i,[LN]:r},publicKey:{algorithm:{name:\"Ed25519\"},extractable:!0,type:\"public\",usages:i,[LN]:o}}}(...e):await globalThis.crypto.subtle.generateKey(...e),writable:!0,configurable:!0}),Object.defineProperty(e,\"exportKey\",{value:async(...e)=>qN(e[1].algorithm)?await async function(e,t){if(!t.extractable)throw new DOMException(\"key is not extractable\",\"InvalidAccessException\");const n=t[LN];switch(e){case\"raw\":if(\"public\"!==t.type)throw new DOMException(\"Unable to export a raw Ed25519 private key\",\"InvalidAccessError\");return n.buffer;case\"pkcs8\":if(\"private\"!==t.type)throw new DOMException(\"Unable to export a pkcs8 Ed25519 public key\",\"InvalidAccessError\");return new Uint8Array([...jN,...n]).buffer;case\"jwk\":{const e={crv:\"Ed25519\",ext:t.extractable,key_ops:t.usages,kty:\"OKP\"};if(\"private\"===t.type){const t=await IN(n);return Object.freeze({...e,d:FN(n),x:FN(t)})}return Object.freeze({...e,x:FN(n)})}case\"spki\":{if(\"public\"!==t.type)throw new DOMException(\"Only public keys can be exported as SPKI\",\"InvalidAccessError\");const e=new Uint8Array([48,5,6,3,43,101,112]),r=new Uint8Array([3,n.length+1,0,...n]);return new Uint8Array([48,e.length+r.length,...e,...r]).buffer}default:throw new Error(`Unsupported export format: ${e}`)}}(...e):await globalThis.crypto.subtle.exportKey(...e),writable:!0,configurable:!0}),Object.defineProperty(e,\"sign\",{value:async(...e)=>{const[t,n]=e;return qN(t)&&qN(n.algorithm)?await $N(...e):await globalThis.crypto.subtle.sign(...e)},writable:!0,configurable:!0}),Object.defineProperty(e,\"verify\",{value:async(...e)=>{const[t,n]=e;return qN(t)&&qN(n.algorithm)?await KN(...e):await globalThis.crypto.subtle.verify(...e)},writable:!0,configurable:!0}),Object.defineProperty(e,\"importKey\",{value:async(...e)=>qN(e[2])?await async function(e,t,n,r,o){const i=Array.from(o);switch(e){case\"raw\":{const e=MN(t);if(32!==e.length)throw new DOMException(\"Ed25519 raw keys must be exactly 32-bytes\",\"DataError\");return{algorithm:{name:\"Ed25519\"},extractable:r,type:\"public\",usages:i.filter((e=>\"verify\"===e)),[LN]:e}}case\"pkcs8\":{const e=MN(t);if(48!==e.length)throw new DOMException(\"Invalid PKCS8 key data length\",\"DataError\");if(!e.slice(0,16).every(((e,t)=>e===jN[t])))throw new DOMException(\"Invalid PKCS8 header\",\"DataError\");return{algorithm:{name:\"Ed25519\"},extractable:r,type:\"private\",usages:i.filter((e=>\"sign\"===e)),[LN]:e.slice(16)}}case\"jwk\":{const e=t;if(\"OKP\"!==e.kty||\"Ed25519\"!==e.crv)throw new DOMException(\"Invalid Ed25519 JWK\",\"DataError\");const n=\"d\"in e?\"private\":\"public\";if(\"public\"===n&&!e.x)throw new DOMException(\"Ed25519 JWK is missing public key\",\"DataError\");if(!(\"private\"!==n||e.d&&e.x))throw new DOMException(\"Ed25519 JWK is missing key data\",\"DataError\");const o=\"private\"===n?e.d:e.x;return{algorithm:{name:\"Ed25519\"},extractable:r,type:n,usages:i.filter((e=>\"private\"===n?\"sign\"===e:\"verify\"===e)),[LN]:DN(o)}}case\"spki\":{const e=MN(t);if(48!==e[0])throw new DOMException(\"Invalid SPKI format\",\"DataError\");const n=2;if(48!==e[n]||6!==e[n+2]||3!==e[n+3]||43!==e[n+4]||101!==e[n+5]||112!==e[n+6])throw new DOMException(\"Not an Ed25519 key\",\"DataError\");const r=n+7+2;return{algorithm:{name:\"Ed25519\"},extractable:!0,type:\"public\",usages:i.filter((e=>\"verify\"===e)),[LN]:e.slice(r)}}default:throw new Error(`Unsupported import format: ${e}`)}}(...e):await globalThis.crypto.subtle.importKey(...e),writable:!0,configurable:!0})}const HN=async e=>Promise.resolve().then(e);Object.defineProperty(globalThis,\"DOMException\",{value:Error,writable:!0,configurable:!0,enumerable:!0}),WN(),Object.defineProperty(globalThis,\"queueMicrotask\",{value:HN,writable:!0,configurable:!0,enumerable:!0}),Mi.config({EXPONENTIAL_AT:16});const VN=async({origin:e,request:t})=>{Zd.log(\"[🔄 onRpcRequest]\",t.method,t);const{method:n}=t;XI(e,n);const r=zR[n];if(!r)throw new Fo(`RpcRequest method ${n} not found. Available methods: ${Object.values(jI).toString()}`);return await LR((async()=>r({origin:e,request:t})))??null},GN=async({origin:e,request:t})=>{Zd.log(\"[🔑 onKeyringRequest]\",t.method,t),XI(e,t.method),t.method===Wn.SubmitRequest&&t.params&&!(\"origin\"in t.params)&&(t.params.origin=\"https://metamask.io\");return await LR((async()=>fi(DP,t)))??null},ZN=async({id:e,event:t,context:n})=>{if(Zd.log(\"[👇 onUserInput]\",e,t),!t.name)return;const r={...HR,...VR,...f_,...c_,...i_}[t.name];r&&await LR((async()=>r({id:e,event:t,context:n,snapContext:HP})))},JN=async({request:e})=>{const t=Gd(Zd,\"[⏱️ onCronjob]\");t.log(e.method,e);const{method:n}=e;H(n,X([...Object.values(BR),...Object.values(__)]));return await LR((async()=>{t.log(\"Running cronjob\",{method:n});const r=CR[n];if(!r)throw new Fo(`Cronjob / ScheduleBackgroundEvent method ${n} not found. Available methods: ${Object.values([...Object.values(BR),...Object.values(__)]).toString()}`);return r({request:e})}))??null},YN=async e=>{const t=await LR((async()=>(async e=>{Zd.log(\"[🔍 onAssetsLookup]\",e);const{assets:t}=e,n=t.filter((e=>{const{assetNamespace:t}=Ji(e);return\"token\"===t||\"slip44\"===t}));return{assets:await CP.getAssetsMetadata(n)}})(e)));return t??null},QN=async e=>{const t=await LR((async()=>(async e=>{Zd.log(\"[💱 onAssetsConversion]\",e);const{conversions:t}=e;return{conversionRates:await IP.getMultipleTokenConversions(t)}})(e)));return t??null},XN=async e=>await LR((async()=>(async({scope:e,request:t})=>{switch(H(e,wf),t.method){case NR.GetGenesisHash:return H(t,OR),hP.getRpc(e).getGenesisHash().send();case NR.GetLatestBlockhash:return H(t,UR),(await hP.getLatestBlockhash(e)).blockhash;case NR.GetMinimumBalanceForRentExemption:return H(t,MR),(await hP.getRpc(e).getMinimumBalanceForRentExemption(BigInt(t.params[0]),t.params[1]).send()).toString();default:throw new Error(`Unsupported method: ${t.method}`)}})(e)))??null,eO=async e=>{const t=await LR((async()=>(async e=>{Zd.log(\"[📈 onAssetHistoricalPrice]\",e);const{from:t,to:n}=e;return H(t,Gi),H(n,Gi),{historicalPrice:await IP.getHistoricalPrice(t,n)}})(e)));return t??null},tO=async({request:e})=>await LR((async()=>WP.handle(e)))??null,nO=async({event:e})=>LR((async()=>{await cP.emitSync(\"onWebSocketEvent\",e)})),rO=async()=>LR((async()=>{await cP.emitSync(\"onStart\")})),oO=async()=>LR((async()=>{await cP.emitSync(\"onUpdate\")})),iO=async()=>LR((async()=>{await cP.emitSync(\"onInstall\")})),aO=async()=>LR((async()=>{await cP.emitSync(\"onActive\")})),sO=async()=>LR((async()=>{await cP.emitSync(\"onInactive\")})),cO=async e=>{const t=await LR((async()=>(async e=>{H(e,PR);const{chainId:t,domain:n,address:r}=e,o=new RegExp(`^.+\\\\${TP.tld}$`,\"u\");if(n&&o.test(n)){const e=await TP.resolveDomain(t,n);if(e)return{resolvedAddresses:[{resolvedAddress:e,protocol:RR,domainName:n}]}}if(r){const e=await TP.resolveAddress(t,r);if(e)return{resolvedDomains:[{resolvedDomain:e,protocol:RR}]}}return null})(e)));return t??null},uO=async e=>{const t=await LR((async()=>(async e=>{Zd.log(\"[💰 onAssetsMarketData]\",e);const{assets:t}=e;return{marketData:await CP.fetchAssetsMarketData(t)}})(e)));return t??null}})(),module.exports=r})();"},{"path":"locales/en.json","value":"{\n  \"locale\": \"en\",\n  \"messages\": {\n    \"send.title\": {\n      \"message\": \"Send\"\n    },\n    \"send.balance\": {\n      \"message\": \"Balance\"\n    },\n    \"send.maxButton\": {\n      \"message\": \"Max\"\n    },\n    \"send.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"send.continueButton\": {\n      \"message\": \"Continue\"\n    },\n    \"send.fromField\": {\n      \"message\": \"From\"\n    },\n    \"send.toField\": {\n      \"message\": \"To\"\n    },\n    \"send.amountField\": {\n      \"message\": \"Amount\"\n    },\n    \"send.assetField\": {\n      \"message\": \"Token\"\n    },\n    \"send.toPlaceholder\": {\n      \"message\": \"Enter public address or domain name\"\n    },\n    \"send.fromRequiredError\": {\n      \"message\": \"Account is required\"\n    },\n    \"send.amountRequiredError\": {\n      \"message\": \"Amount is required\"\n    },\n    \"send.amountGreatherThanMinimumBalanceForRentExemptionError\": {\n      \"message\": \"Amount must be greater than {minimumValue}\"\n    },\n    \"send.insuffientSolToCoverFee\": {\n      \"message\": \"Insufficient SOL balance to cover the transaction fee\"\n    },\n    \"send.toRequiredError\": {\n      \"message\": \"To address is required\"\n    },\n    \"send.toInvalidError\": {\n      \"message\": \"Invalid Solana address or domain name\"\n    },\n    \"send.toInvalidErrorDomain\": {\n      \"message\": \"Unable to resolve domain name\"\n    },\n    \"send.toDomainResolutionStatus.initial\": {\n      \"message\": \"Domain\"\n    },\n    \"send.toDomainResolutionStatus.fetching\": {\n      \"message\": \"Resolving domain name...\"\n    },\n    \"send.toDomainResolutionStatus.fetched\": {\n      \"message\": \"Domain name resolved.\"\n    },\n    \"send.toDomainResolutionStatus.error\": {\n      \"message\": \"Unable to resolve domain name.\"\n    },\n    \"send.insufficientBalance\": {\n      \"message\": \"Insufficient balance\"\n    },\n    \"send.simulationTitleAPIError\": {\n      \"message\": \"Because of an error, we couldn't check for security alerts.\"\n    },\n    \"send.simulationMessageAPIError\": {\n      \"message\": \"Only continue if you trust every address involved.\"\n    },\n    \"send.simulationTitleError\": {\n      \"message\": \"Transaction simulation failed\"\n    },\n    \"send.simulationMessageError\": {\n      \"message\": \"This transaction was reverted during simulation.\"\n    },\n    \"send.selectedTokenPriceNotAvailable\": {\n      \"message\": \"Prices for tokens in {currency} are currently not available. You are still able to send tokens.\"\n    },\n    \"send.confirmation.title\": {\n      \"message\": \"Review\"\n    },\n    \"send.confirmation.from\": {\n      \"message\": \"From\"\n    },\n    \"send.confirmation.recipient\": {\n      \"message\": \"Recipient\"\n    },\n    \"send.confirmation.network\": {\n      \"message\": \"Network\"\n    },\n    \"send.confirmation.transactionSpeed\": {\n      \"message\": \"Transaction speed\"\n    },\n    \"send.confirmation.fee\": {\n      \"message\": \"Network fee\"\n    },\n    \"send.confirmation.sendButton\": {\n      \"message\": \"Send\"\n    },\n    \"send.confirmation.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"send.confirmation.viewTransaction\": {\n      \"message\": \"View transaction\"\n    },\n    \"send.send-pending.title\": {\n      \"message\": \"Sending...\"\n    },\n    \"send.send-pending.subtitle\": {\n      \"message\": \"Your transaction was submitted.\"\n    },\n    \"send.transaction-success.title\": {\n      \"message\": \"Sent\"\n    },\n    \"send.transaction-success.subtitle\": {\n      \"message\": \"{amount} {tokenSymbol} was successfully sent\"\n    },\n    \"send.transaction-failure.title\": {\n      \"message\": \"Transaction failed\"\n    },\n    \"send.transaction-failure.subtitle\": {\n      \"message\": \"Unable to send {amount} {tokenSymbol}\"\n    },\n    \"confirmation.account\": {\n      \"message\": \"Account\"\n    },\n    \"confirmation.recipient\": {\n      \"message\": \"Recipient\"\n    },\n    \"confirmation.network\": {\n      \"message\": \"Network\"\n    },\n    \"confirmation.estimatedChanges\": {\n      \"message\": \"Estimated changes\"\n    },\n    \"confirmation.estimatedChanges.send\": {\n      \"message\": \"You send\"\n    },\n    \"confirmation.estimatedChanges.receive\": {\n      \"message\": \"You receive\"\n    },\n    \"confirmation.estimatedChanges.notAvailable\": {\n      \"message\": \"Not available\"\n    },\n    \"confirmation.estimatedChanges.noChanges\": {\n      \"message\": \"No changes\"\n    },\n    \"confirmation.estimatedChanges.tooltip\": {\n      \"message\": \"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"\n    },\n    \"confirmation.advanced.show\": {\n      \"message\": \"Show advanced\"\n    },\n    \"confirmation.advanced.hide\": {\n      \"message\": \"Hide advanced\"\n    },\n    \"confirmation.cancelButton\": {\n      \"message\": \"Cancel\"\n    },\n    \"confirmation.confirmButton\": {\n      \"message\": \"Confirm\"\n    },\n    \"confirmation.signAndSendTransaction.title\": {\n      \"message\": \"Transaction request\"\n    },\n    \"confirmation.signTransaction.title\": {\n      \"message\": \"Signing request\"\n    },\n    \"confirmation.sendAndConfirmTransaction.title\": {\n      \"message\": \"Sending and confirming transaction\"\n    },\n    \"confirmation.advanced.unknownInstruction\": {\n      \"message\": \"Unknown\"\n    },\n    \"confirmation.advanced.programId\": {\n      \"message\": \"Program ID\"\n    },\n    \"confirmation.advanced.data\": {\n      \"message\": \"Data\"\n    },\n    \"confirmation.fee\": {\n      \"message\": \"Network fee\"\n    },\n    \"confirmation.feeError\": {\n      \"message\": \"Unable to estimate fee\"\n    },\n    \"confirmation.origin\": {\n      \"message\": \"Request from\"\n    },\n    \"confirmation.origin.tooltip\": {\n      \"message\": \"This is the site asking for your confirmation.\"\n    },\n    \"confirmation.simulationErrorTitle\": {\n      \"message\": \"This transaction was reverted during simulation.\"\n    },\n    \"confirmation.simulationErrorSubtitle\": {\n      \"message\": \"{reason}\"\n    },\n    \"confirmation.validationErrorTitle\": {\n      \"message\": \"This is a deceptive request\"\n    },\n    \"confirmation.validationErrorSubtitle\": {\n      \"message\": \"If you approve this request, a third party known for scams will take all your assets.\"\n    },\n    \"confirmation.validationErrorLearnMore\": {\n      \"message\": \"Learn more\"\n    },\n    \"confirmation.validationErrorSecurityAdviced\": {\n      \"message\": \"Security advice by\"\n    },\n    \"confirmation.signMessage.title\": {\n      \"message\": \"Sign message\"\n    },\n    \"confirmation.signMessage.message\": {\n      \"message\": \"Message\"\n    },\n    \"confirmation.signIn.title\": {\n      \"message\": \"Sign-in request\"\n    },\n    \"confirmation.signIn.description\": {\n      \"message\": \"A site wants you to sign in to prove you own this account.\"\n    },\n    \"confirmation.signIn.domain\": {\n      \"message\": \"Domain\"\n    },\n    \"confirmation.signIn.unknownDomain\": {\n      \"message\": \"Unknown domain\"\n    },\n    \"confirmation.signIn.signingInWith\": {\n      \"message\": \"Signing in with\"\n    },\n    \"confirmation.signIn.badAccount\": {\n      \"message\": \"This site is asking you to sign in using the wrong account.\"\n    },\n    \"confirmation.signIn.message\": {\n      \"message\": \"Message\"\n    },\n    \"confirmation.signIn.statement\": {\n      \"message\": \"Statement\"\n    },\n    \"confirmation.signIn.version\": {\n      \"message\": \"Version\"\n    },\n    \"confirmation.signIn.chainId\": {\n      \"message\": \"Chain ID\"\n    },\n    \"confirmation.signIn.nonce\": {\n      \"message\": \"Nonce\"\n    },\n    \"confirmation.signIn.issuedAt\": {\n      \"message\": \"Issued at\"\n    },\n    \"confirmation.signIn.expirationTime\": {\n      \"message\": \"Expiration time\"\n    },\n    \"confirmation.signIn.notBefore\": {\n      \"message\": \"Not before\"\n    },\n    \"confirmation.signIn.requestId\": {\n      \"message\": \"Request ID\"\n    },\n    \"confirmation.signIn.resources\": {\n      \"message\": \"Resources\"\n    },\n    \"confirmation.signIn.badDomain\": {\n      \"message\": \"This site is asking you to sign in using the wrong domain.\"\n    },\n    \"transactionScan.errors.accountAlreadyInUse\": {\n      \"message\": \"An account with the same address already exists.\"\n    },\n    \"transactionScan.errors.insufficientSol\": {\n      \"message\": \"Account does not have enough SOL to perform the operation.\"\n    },\n    \"transactionScan.errors.slippageToleranceExceeded\": {\n      \"message\": \"The transaction was reverted because the slippage tolerance was exceeded.\"\n    },\n    \"transactionScan.errors.unknownError\": {\n      \"message\": \"An unknown error occurred.\"\n    }\n  }\n}"}],"removable":false,"hideSnapBranding":true}