PageSourceSearch

https://pixelbypixel.studio/_next/static/chunks/0qi8gblwxo2wr.js

js pixelbypixel.studio collected 2026-09-25 03:32:31 UTC 328,728 bytes, 7 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,906246,t=>{"use strict";let e,r={get url(){return`file://${t.P("node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/jotai/esm/vanilla.mjs")}`}},i=0;function n(t){return t(this)}function o(t,e,r){return e(this,"function"==typeof r?r(t(this)):r)}let s=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,a=t=>"init"in t,u=Symbol((r.env?r.env.MODE:void 0)!=="production"?"CONTINUE_PROMISE":""),l="pending",c=new WeakMap,f=t=>"v"in t||"e"in t,h=t=>{if("e"in t)throw t.e;if((r.env?r.env.MODE:void 0)!=="production"&&!("v"in t))throw Error("[Bug] atom state is not initialized");return t.v},d=t=>{let e=t.v;return"object"==typeof e&&null!==e&&u in e&&e.status===l?e:null},p=(t,e,r)=>{r.p.has(t)||(r.p.add(t),e.then(()=>{r.p.delete(t)},()=>{r.p.delete(t)}))},g=(t,e,i,n,o)=>{var s;if((r.env?r.env.MODE:void 0)!=="production"&&n===e)throw Error("[Bug] atom cannot depend on itself");i.d.set(n,o.n);let a=d(i);a&&p(e,a,o),null==(s=o.m)||s.t.add(e),t&&b(t,n,e)},m=()=>[new Map,new Map,new Set],y=(t,e,r)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,r)},b=(t,e,r)=>{let i=t[0].get(e);i&&i.add(r)},w=(t,e)=>{t[2].add(e)},v=t=>{for(;t[1].size||t[2].size;){t[0].clear();let e=new Set(t[1].values());t[1].clear();let r=new Set(t[2]);t[2].clear(),e.forEach(t=>{var e;return null==(e=t.m)?void 0:e.l.forEach(t=>t())}),r.forEach(t=>t())}},x=t=>{let e;(r.env?r.env.MODE:void 0)!=="production"&&(e=new Set);let i=(e,r,i,n=()=>{},o=()=>{})=>{let s="v"in r,a=r.v,f=d(r);if("function"==typeof(null==i?void 0:i.then))if(f)f!==i&&(f[u](i,n),++r.n);else{let s=((t,e,r)=>{if(!c.has(t)){let i,n=new Promise((o,s)=>{let a=t,u=t=>e=>{a===t&&(n.status="fulfilled",n.value=e,o(e),r())},l=t=>e=>{a===t&&(n.status="rejected",n.reason=e,s(e),r())};t.then(u(t),l(t)),i=(t,r)=>{t&&(c.set(t,n),a=t,t.then(u(t),l(t)),e(),e=r)}});n.status=l,n[u]=i,c.set(t,n)}return c.get(t)})(i,n,o);if(s.status===l)for(let i of r.d.keys())p(e,s,t(i,r));r.v=s,delete r.e}else f&&f[u](Promise.resolve(i),n),r.v=i,delete r.e;(!s||!Object.is(a,r.v))&&++r.n},n=(e,o,u,l)=>{let c,d;if(!(null==l?void 0:l(o))&&f(u)&&(u.m||Array.from(u.d).every(([r,i])=>n(e,r,t(r,u),l).n===i)))return u;u.d.clear();let p=!0;try{let y=o.read(r=>{if(s(o,r)){let e=t(r,u);if(!f(e))if(a(r))i(r,e,r.init);else throw Error("no atom init");return h(e)}let c=n(e,r,t(r,u),l);if(p)g(e,o,u,r,c);else{let t=m();g(t,o,u,r,c),k(t,o,u),v(t)}return h(c)},{get signal(){return c||(c=new AbortController),c.signal},get setSelf(){return(r.env?r.env.MODE:void 0)==="production"||o.write||console.warn("setSelf function cannot be used with read-only atom"),!d&&o.write&&(d=(...t)=>{if((r.env?r.env.MODE:void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)return S(o,...t)}),d}});return i(o,u,y,()=>null==c?void 0:c.abort(),()=>{if(u.m){let t=m();k(t,o,u),v(t)}}),u}catch(t){return delete u.v,u.e=t,++u.n,u}finally{p=!1}},o=(e,r,i)=>{let o=[],s=new Set,a=(r,i)=>{if(!s.has(r)){for(let[n,o]of(s.add(r),((e,r,i)=>{var n,o;let s=new Map;for(let e of(null==(n=i.m)?void 0:n.t)||[])s.set(e,t(e,i));for(let e of i.p)s.set(e,t(e,i));return null==(o=e[0].get(r))||o.forEach(e=>{s.set(e,t(e,i))}),s})(e,r,i)))r!==n&&a(n,o);o.push([r,i,i.n])}};a(r,i);let u=new Set([r]),l=t=>s.has(t);for(let t=o.length-1;t>=0;--t){let[r,i,a]=o[t],c=!1;for(let t of i.d.keys())if(t!==r&&u.has(t)){c=!0;break}c&&(n(e,r,i,l),k(e,r,i),a!==i.n&&(y(e,r,i),u.add(r))),s.delete(r)}},b=(e,r,u,...l)=>r.write(r=>h(n(e,r,t(r,u))),(n,...l)=>{let c,f=t(n,u);if(s(r,n)){if(!a(n))throw Error("atom not writable");let t="v"in f,r=f.v;i(n,f,l[0]),k(e,n,f),t&&Object.is(r,f.v)||(y(e,n,f),o(e,n,f))}else c=b(e,n,f,...l);return v(e),c},...l),S=(e,...r)=>{let i=m(),n=b(i,e,t(e),...r);return v(i),n},k=(e,r,i)=>{if(i.m&&!d(i)){for(let n of i.d.keys())i.m.d.has(n)||(E(e,n,t(n,i)).t.add(r),i.m.d.add(n));for(let n of i.m.d||[])if(!i.d.has(n)){i.m.d.delete(n);let o=B(e,n,t(n,i));null==o||o.t.delete(r)}}},E=(i,o,s)=>{if(!s.m){for(let e of(n(i,o,s),s.d.keys()))E(i,e,t(e,s)).t.add(o);if(s.m={l:new Set,d:new Set(s.d.keys()),t:new Set},(r.env?r.env.MODE:void 0)!=="production"&&e.add(o),o.write&&o.onMount){let t=s.m,{onMount:e}=o;w(i,()=>{let r=e((...t)=>b(i,o,s,...t));r&&(t.u=r)})}}return s.m},B=(i,n,o)=>
1{if(o.m&&!o.m.l.size&&!Array.from(o.m.t).some(e=>{var r;return null==(r=t(e,o).m)?void 0:r.d.has(n)})){let s=o.m.u;for(let a of(s&&w(i,s),delete o.m,(r.env?r.env.MODE:void 0)!=="production"&&e.delete(n),o.d.keys())){let e=B(i,a,t(a,o));null==e||e.t.delete(n)}let a=d(o);a&&a[u](void 0,()=>{});return}return o.m},A={get:e=>h(n(void 0,e,t(e))),set:S,sub:(e,r)=>{let i=m(),n=t(e),o=E(i,e,n);v(i);let s=o.l;return s.add(r),()=>{s.delete(r);let t=m();B(t,e,n),v(t)}},unstable_derive:e=>x(...e(t))};return(r.env?r.env.MODE:void 0)!=="production"&&Object.assign(A,{dev4_get_internal_weak_map:()=>({get:e=>{let r=t(e);if(0!==r.n)return r}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:e=>{let r=m();for(let[n,s]of e)if(a(n)){let e=t(n),a="v"in e,u=e.v;i(n,e,s),k(r,n,e),a&&Object.is(u,e.v)||(y(r,n,e),o(r,n,e))}v(r)}}),A},S=()=>{let t=new WeakMap;return x(e=>{let r=t.get(e);return r||(r={d:new Map,p:new Set,n:0},t.set(e,r)),r})};t.s(["atom",0,function(t,e){let s=`atom${++i}`,a={toString(){return(r.env?r.env.MODE:void 0)!=="production"&&this.debugLabel?s+":"+this.debugLabel:s}};return"function"==typeof t?a.read=t:(a.init=t,a.read=n,a.write=o),e&&(a.write=e),a},"createStore",0,S,"getDefaultStore",0,()=>(e||(e=S(),(r.env?r.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=e),globalThis.__JOTAI_DEFAULT_STORE__!==e&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),e)])},775354,t=>{"use strict";var e=t.i(906246);let r={CC:0,MD:0,TC:0,PC:0,SD:0,SH:0,SR:0},i=(0,e.atom)({primaryWalletKey:void 0,session:void 0,wallets:[],balance:0,virtualCurrencies:r,signTransaction:void 0,sendTransaction:void 0,refetchBalances:void 0,hasLoggedAccount:!1,refetchCredentials:void 0},(t,e,r)=>{if(void 0!==r.user){let n={...t(i).session,...r};e(i,{...t(i),session:n})}else if(void 0!==r.address){let n=[...t(i).wallets,r];e(i,{...t(i),wallets:n})}else if(void 0!==r.CC){let n={...t(i).virtualCurrencies,...r};e(i,{...t(i),virtualCurrencies:n})}else e(i,{...t(i),...r})}),n=(0,e.atom)(t=>void 0!==t(i).primaryWalletKey),o=(0,e.atom)(t=>t(i).session?.user?.playFabId!==void 0);t.s(["hasAuthenticatedAtom",0,o,"initialVirtualCurrencies",0,r,"isWalletLinkedAtom",0,n,"userAtom",0,i])},722978,617058,410145,134645,345393,t=>{"use strict";function e(){for(var t,e,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(e=function t(e){var r,i,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(i=t(e[r]))&&(n&&(n+=" "),n+=i);else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}(t))&&(i&&(i+=" "),i+=e);return i}t.s(["clsx",0,e,"default",0,e],722978);var r,i,n=/^\[(.+)\]$/;function o(t,e){var r=t;return e.split("-").forEach(function(t){r.nextPart.has(t)||r.nextPart.set(t,{nextPart:new Map,validators:[]}),r=r.nextPart.get(t)}),r}var s=/\s+/;function a(){for(var t,e,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(e=function t(e){if("string"==typeof e)return e;for(var r,i="",n=0;n<e.length;n++)e[n]&&(r=t(e[n]))&&(i&&(i+=" "),i+=r);return i}(t))&&(i&&(i+=" "),i+=e);return i}function u(t){var e=function(e){return e[t]||[]};return e.isThemeGetter=!0,e}var l=/^\[(?:([a-z-]+):)?(.+)\]$/i,c=/^\d+\/\d+$/,f=new Set(["px","full","screen"]),h=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,p=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function g(t){return x(t)||f.has(t)||c.test(t)||m(t)}function m(t){return _(t,"length",M)}function y(t){return _(t,"size",T)}function b(t){return _(t,"position",T)}function w(t){return _(t,"url",O)}function v(t){return _(t,"number",x)}function x(t){return!Number.isNaN(Number(t))}function S(t){return t.endsWith("%")&&x(t.slice(0,-1))}function k(t){return C(t)||_(t,"number",C)}function E(t){return l.test(t)}function B(){return!0}function A(t){return h.test(t)}function I(t){return _(t,"",R)}function _(t,e,r){var i=l.exec(t);return!!i&&(i[1]?i[1]===e:r(i[2]))}function M(t){return d.test(t)}function T(){return!1}function O(t){return t.startsWith("url(")}function C(t){return Number.isInteger(Number(t))}function R(t){return p.test(t)}var U=function(){for(var t,e,r,i=arguments.length,u=Array(i),l=0;l<i;l++)u[l]=arguments[l];var c=function(i){var s=u[0];return e=(t=function(t){var e,r,i,s,a,u,l,c,f,h,d,p,g,m;return{cache:function(t){if(t<1)return{get:function(){},set:function(){}};var e=0,r=new Map,i=new Map;function n(n,o){r.set(n,o),++e>t&&(e=0,i=r,r=new Map)}return{get:function(t){var e=r.get(t);return void 0!==e?e:void 0!==(e=i.get(t))?(n(t,e),e):void 0},set:function(t,e){r.has(t)?r.set(t,e):n(t,e)}}}(t.cacheSize),splitModifiers:(r=1===(e=t.separator||":").length,i=e[0],s=e.length,function(t){for(var n,o=[],a=0,u=0,l=0;l<t.length;l++){var c=t[l];if(0===a){if(c===i&&(r||t.slice(l,l+s)===e)){o.push(t.slice(u,l)),u=l+s;continue}if("/"===c){n=l;continue}}"["===c?a++:"]"===c&&a--}var f=0===o.length?t:t.substring(u),h=f.startsWith("!"),d=h?f.substring(1):f;return{modifiers:o,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:n&&n>u?n-u:void 0}}),...(h=(f=t).theme,d=f.prefix,p={nextPart:new Map,validators:[]},(g=Object.entries(f.classGroups),(m=d)?g.map(function(t){return[t[0],t[1].map(function(t){return"string"==typeof t?m+t:"object"==typeof t?Object.fromEntries(Object.entries(t).map(function(t){return[m+t[0],t[1]]})):t})]}):g).forEach(function(t){var e=t[0];!function t(e,r,i,n){e.forEach(function(e){if("string"==typeof e){(""===e?r:o(r,e)).classGroupId=i;return}if("function"==typeof e)return e.isThemeGetter?void t(e(n),r,i,n):void r.validators.push({validator:e,classGroupId:i});Object.entries(e).forEach(function(e){var s=e[0];t(e[1],o(r,s),i,n)})})}(t[1],p,e,h)}),a=p,u=t.conflictingClassGroups,c=void 0===(l=t.conflictingClassGroupModifiers)?{}:l,{getClassGroupId:function(t){var e=t.split("-");return""===e[0]&&1!==e.length&&e.shift(),function t(e,r){if(0===e.length)return r.classGroupId;var i=e[0],n=r.nextPart.get(i),o=n?t(e.slice(1),n):void 0;if(o)return o;if(0!==r.validators.length){var s=e.join("-");return r.validators.find(function(t){return(0,t.validator)(s)})?.classGroupId}}(e,a)||function(t){if(n.test(t)){var e=n.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}}(t)},getConflictingClassGroupIds:function(t,e){var r=u[t]||[];return e&&c[t]?[].concat(r,c[t]):r}})}}(u.slice(1).reduce(function(t,e){return e(t)}
1,s()))).cache.get,r=t.cache.set,c=f,f(i)};function f(i){var n,o,a,u,l,c=e(i);if(c)return c;var f=(o=(n=t).splitModifiers,a=n.getClassGroupId,u=n.getConflictingClassGroupIds,l=new Set,i.trim().split(s).map(function(t){var e=o(t),r=e.modifiers,i=e.hasImportantModifier,n=e.baseClassName,s=e.maybePostfixModifierPosition,u=a(s?n.substring(0,s):n),l=!!s;if(!u){if(!s||!(u=a(n)))return{isTailwindClass:!1,originalClassName:t};l=!1}var c=(function(t){if(t.length<=1)return t;var e=[],r=[];return t.forEach(function(t){"["===t[0]?(e.push.apply(e,r.sort().concat([t])),r=[]):r.push(t)}),e.push.apply(e,r.sort()),e})(r).join(":");return{isTailwindClass:!0,modifierId:i?c+"!":c,classGroupId:u,originalClassName:t,hasPostfixModifier:l}}).reverse().filter(function(t){if(!t.isTailwindClass)return!0;var e=t.modifierId,r=t.classGroupId,i=t.hasPostfixModifier,n=e+r;return!l.has(n)&&(l.add(n),u(r,i).forEach(function(t){return l.add(e+t)}),!0)}).reverse().map(function(t){return t.originalClassName}).join(" "));return r(i,f),f}return function(){return c(a.apply(null,arguments))}}(function(){var t=u("colors"),e=u("spacing"),r=u("blur"),i=u("brightness"),n=u("borderColor"),o=u("borderRadius"),s=u("borderSpacing"),a=u("borderWidth"),l=u("contrast"),c=u("grayscale"),f=u("hueRotate"),h=u("invert"),d=u("gap"),p=u("gradientColorStops"),_=u("gradientColorStopPositions"),M=u("inset"),T=u("margin"),O=u("opacity"),C=u("padding"),R=u("saturate"),U=u("scale"),P=u("sepia"),L=u("skew"),N=u("space"),z=u("translate"),q=function(){return["auto","contain","none"]},D=function(){return["auto","hidden","clip","visible","scroll"]},W=function(){return["auto",E,e]},F=function(){return[E,e]},j=function(){return["",g]},$=function(){return["auto",x,E]},K=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},V=function(){return["solid","dashed","dotted","double","none"]},H=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Z=function(){return["start","end","center","between","around","evenly","stretch"]},G=function(){return["","0",E]},Y=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},J=function(){return[x,v]},X=function(){return[x,E]};return{cacheSize:500,theme:{colors:[B],spacing:[g],blur:["none","",A,E],brightness:J(),borderColor:[t],borderRadius:["none","","full",A,E],borderSpacing:F(),borderWidth:j(),contrast:J(),grayscale:G(),hueRotate:X(),invert:G(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[S,m],inset:W(),margin:W(),opacity:J(),padding:F(),saturate:J(),scale:J(),sepia:G(),skew:X(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",E]}],container:["container"],columns:[{columns:[A]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(K(),[E])}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[M]}],"inset-x":[{"inset-x":[M]}],"inset-y":[{"inset-y":[M]}],start:[{start:[M]}],end:[{end:[M]}],top:[{top:[M]}],right:[{right:[M]}],bottom:[{bottom:[M]}],left:[{left:[M]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",k]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",E]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",k]}],"grid-cols":[{"grid-cols":[B]}],"col-start-end":[{col:["auto",{span:["full",k]},E]}],"col-start":[{"col-start":$()}
vendor: 9,117 bytes, line 1
1],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[B]}],"row-start-end":[{row:["auto",{span:[k]},E]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",E]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",E]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal"].concat(Z())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(Z(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Z(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[T]}],mx:[{mx:[T]}],my:[{my:[T]}],ms:[{ms:[T]}],me:[{me:[T]}],mt:[{mt:[T]}],mr:[{mr:[T]}],mb:[{mb:[T]}],ml:[{ml:[T]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",E,e]}],"min-w":[{"min-w":["min","max","fit",E,g]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[A]},A,E]}],h:[{h:[E,e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",E,g]}],"max-h":[{"max-h":[E,e,"min","max","fit"]}],"font-size":[{text:["base",A,m]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",v]}],"font-family":[{font:[B]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",E]}],"line-clamp":[{"line-clamp":["none",x,v]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,g]}],"list-image":[{"list-image":["none",E]}],"list-style-type":[{list:["none","disc","decimal",E]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[O]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(V(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",g]}],"underline-offset":[{"underline-offset":["auto",E,g]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",E]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",E]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[O]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(K(),[b])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",y]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},w]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[O]}],"border-style":[{border:[].concat(V(),["hidden"])}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[O]}],"divide-style":[{divide:V()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(V())}],"outline-offset":[{"outline-offset":[E,g]}],"outline-w":[{outline:[g]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[O]}],"ring-offset-w":[{"ring-offset":[g]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",A,I]}],"shadow-color":[{shadow:[B]}],opacity:[{opacity:[O]}],"mix-blend":[{"mix-blend":H()}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",A,E]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[R]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[O]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",E]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",E]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",E]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[U]}],"scale-x":[{"scale-x":[U]}],"scale-y":[{"scale-y":[U]}],rotate:[{rotate:[k,E]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",E]}],accent:[{accent:["auto",t]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",E]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
1],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",E]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[g,v]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});t.s(["twMerge",0,U],617058),(r={}).Accessory="Accessory",r.Any="Any",r.AnyClass="AnyClass",r.CoinBundle="CoinBundle",r.CoinDrop="CoinDrop",r.CollabBundle="CollabBundle",r.Effect="Effect",r.FinishEffect="FinishEffect",r.Giveaway="giveaway",r.LootBox="LootBox",r.MarbleMesh="MarbleMesh",r.MarbleSet="MarbleSet",r.MarbleSkin="MarbleSkin",r.Misc="misc",r.PremiumTrack="PremiumTrack",r.RacerCard="RacerCard",r.RacerPin="RacerPin",r.SeasonBundle="SeasonBundle",r.SeasonPass="SeasonPass",r.SkinSlot="SkinSlot",r.SpawnEffect="SpawnEffect",r.TestItemClass="testItemClass",r.Token="Token",r.TrailEffect="TrailEffect",(i={}).GoldName="gold_name",i.CarePackage="care_package",t.s(["ChangelogTypes",0,{bugfix:"Bugfix",feature:"Feature",patch:"Patch",improvement:"Improvement",hotfix:"Hotfix",other:"Other",announcement_active:"Announcement (Active)",announcement_resolved:"Announcement (Resolved)"}],410145);let P={},L={};function N(t,e){try{let r=(P[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];if(r in L)return L[r];return q(r,r.split(":"))}catch{if(t in L)return L[t];let e=t?.match(z);if(e)return q(t,e.slice(1));return NaN}}let z=/([+-]\d\d):?(\d\d)?/;function q(t,e){let r=+(e[0]||0),i=+(e[1]||0);return L[t]=r>0?60*r+i:60*r-i}class D extends Date{constructor(...t){super(),t.length>1&&"string"==typeof t[t.length-1]&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(N(this.timeZone,this))?this.setTime(NaN):t.length?"number"==typeof t[0]&&(1===t.length||2===t.length&&"number"!=typeof t[1])?this.setTime(t[0]):"string"==typeof t[0]?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),j(this,NaN),F(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new D(...e,t):new D(Date.now(),t)}withTimeZone(t){return new D(+this,t)}getTimezoneOffset(){return-N(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),F(this),+this}[Symbol.for("constructDateFrom")](t){return new D(+new Date(t),this.timeZone)}}let W=/^(get|set)(?!UTC)/;function F(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function j(t){let e=N(t.timeZone,t),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+t).getTimezoneOffset(),n=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();n&&o&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+n);let s=i-e;s&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+s);
1let a=N(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a-s;if(a!==e&&u){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+u);let e=a-N(t.timeZone,t);e&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+e),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+e))}}Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!W.test(t))return;let e=t.replace(W,"$1UTC");D.prototype[e]&&(t.startsWith("get")?D.prototype[t]=function(){return this.internal[e]()}:(D.prototype[t]=function(){var t;return Date.prototype[e].apply(this.internal,arguments),t=this,Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),j(t),+this},D.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),F(this),+this}))});class $ extends D{static tz(t,...e){return e.length?new $(...e,t):new $(Date.now(),t)}toISOString(){let[t,e,r]=this.tzComponents(),i=`${t}${e}:${r}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[t,e,r,i]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${e} ${i}`}
1toTimeString(){let t=this.internal.toUTCString().split(" ")[4],[e,r,i]=this.tzComponents();return`${t} GMT${e}${r}${i} (${function(t,e,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:r}).format(e).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:e?.timeZone||this.timeZone})}tzComponents(){let t=this.getTimezoneOffset(),e=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[t>0?"-":"+",e,r]}withTimeZone(t){return new $(+this,t)}[Symbol.for("constructDateFrom")](t){return new $(+new Date(t),this.timeZone)}}t.s(["TZDate",0,$],134645),t.s([],345393)},210102,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=l(t),r=e[0],i=e[1];return(r+i)*3/4-i},r.toByteArray=function(t){var e,r,i=l(t),s=i[0],a=i[1],u=new o((s+a)*3/4-a),c=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;s<a;s+=16383)o.push(function(t,e,r){for(var n,o=[],s=e;s<r;s+=3)n=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(i[n>>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===n?o.push(i[(e=t[r-1])>>2]+i[e<<4&63]+"=="):2===n&&o.push(i[(e=(t[r-2]<<8)+t[r-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),o.join("")};for(var i=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}n[45]=62,n[95]=63},962866,(t,e,r)=>{r.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,l=u>>1,c=-7,f=r?n-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=l}return(d?-1:1)*s*Math.pow(2,o-i)},r.write=function(t,e,r,i,n,o){var s,a,u,l=8*o-n-1,c=(1<<l)-1,f=c>>1,h=5960464477539062e-23*(23===n),d=i?0:o-1,p=i?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+f>=1?e+=h/u:e+=h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,n),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,l+=n;l>0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*g}},259390,(t,e,r)=>{"use strict";let i=t.r(210102),n=t.r(962866),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return c(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var i=t,n=e;if(("string"!=typeof n||""===n)&&(n="utf8"),!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);let r=0|p(i,n),o=s(r),u=o.write(i,n);return u!==r&&(o=o.slice(0,u)),o}if(ArrayBuffer.isView(t)){var o=t;if(N(o,Uint8Array)){let t=new Uint8Array(o);return h(t.buffer,t.byteOffset,t.byteLength)}return f(o)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);
vendor: 66,802 bytes, line 1
1if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return a.from(u,e,r);let l=function(t){if(a.isBuffer(t)){let e=0|d(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),s(t<0?0:0|d(t))}function f(t){let e=t.length<0?0:0|d(t.length),r=s(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){let i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),i}function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(n)return i?-1:U(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=z[t[i]];return n}(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}(this,e,r);case"base64":var o,s,a;return o=this,s=e,a=r,0===s&&a===o.length?i.fromByteArray(o):i.fromByteArray(o.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let i=t.slice(e,r),n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}(this,e,r);default:if(n)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){var o;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(n)return -1;else r=t.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,i,n)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else -1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(l(t,o+i)!==l(e,i)){r=!1;break}if(r)return o}return -1}function w(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let e=t[n],o=null,s=e>239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:(192&(r=t[n+1]))==128&&(u=(31&e)<<6|63&r)>127&&(o=u);break;case 3:r=t[n+1],i=t[n+2],(192&r)==128&&(192&i)==128&&(u=(15&e)<<12|(63&r)<<6|63&i)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],(192&r)==128&&(192&i)==128&&(192&a)==128&&(u=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}var o=i;let s=o.length;if(s<=4096)return String.fromCharCode.apply(String,o);let a="",u=0;for(;u<s;)a+=String.fromCharCode.apply(String,o.slice(u,u+=4096));return a}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,i,n,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function S(t,e,r,i,n){T(e,i,n,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function k(t,e,r,i,n){T(e,i,n,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function E(t,e,r,i,n,o){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function B(t,e,r,i,o){return e*=1,r>>>=0,o||E(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function A(t,e,r,i,o){return e*=1,r>>>=0,o||E(t,e,r,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,r,i,52,8),r+8}r.Buffer=a,r.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return c(t)},a.allocUnsafeSlow=function(t){return c(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:+(i<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))n+e.length>i.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else if(a.isBuffer(e))e.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=e.length}return i},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;let o=n-i,s=r-e,u=Math.min(o,s),l=this.slice(i,n),c=t.slice(e,r);for(let t=0;t<u;++t)if(l[t]!==c[t]){o=l[t],s=c[t];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},a.prototype.write=function(t,e,r,i){var n,o,s,a,u,l,c,f;if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let d=!1;for(;;)switch(i){case"hex":return function(t,e,r,i){let n;r=Number(r)||0;let o=t.length-r;i?(i=Number(i))>o&&(i=o):i=o;let s=e.length;for(i>s/2&&(i=s/2),n=0;n<i;++n){var a;let i=parseInt(e.substr(2*n,2),16);if((a=i)!=a)break;t[r+n]=i}return n}(this,t,e,r);case"utf8":case"utf-8":return n=e,o=r,L(U(t,this.length-n),this,n,o);case"ascii":case"latin1":case"binary":return s=e,a=r,L(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return u=e,l=r,L(P(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,f=r,L(function(t,e){let r,i,n=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)i=(r=t.charCodeAt(o))>>8,n.push(r%256),n.push(i);return n}(t,this.length-c),this,c,f);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=q(function(t){O(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&C(t,this.length-8);let i=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],n=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(i)+(BigInt(n)<<BigInt(32))}),a.prototype.readBigUInt64BE=q(function(t){O(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&C(t,this.length-8);let i=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],n=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=this[t],n=1,o=0;for(;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=q(function(t){O(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&C(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),a.prototype.readBigInt64BE=q(function(t){O(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&C(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}let n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=q(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=q(function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===s&&0!==this[e+n-1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o|0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=q(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=q(function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);let n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},a.prototype.fill=function(t,e,r,i){let n;if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){let e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{let o=a.isBuffer(t)?t:a.from(t,i),s=o.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%s]}return this};let I={};function _(t,e,r){I[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function M(t){let e="",r=t.length,i=+("-"===t[0]);for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function T(t,e,r,i,n,o){if(t>r||t<e){let i,n="bigint"==typeof e?"n":"";throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${(o+1)*8}${n}`:`>= -(2${n} ** ${(o+1)*8-1}${n}) and < 2 ** ${(o+1)*8-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new I.ERR_OUT_OF_RANGE("value",i,t)}O(n,"offset"),(void 0===i[n]||void 0===i[n+o])&&C(n,i.length-(o+1))}function O(t,e){if("number"!=typeof t)throw new I.ERR_INVALID_ARG_TYPE(e,"number",t)}function C(t,e,r){if(Math.floor(t)!==t)throw O(t,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),_("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?n=M(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=M(n)),n+="n"),i+=` It must be ${e}. Received ${n}`},RangeError);let R=/[^+/0-9A-Za-z-_]/g;function U(t,e){let r;e=e||1/0;let i=t.length,n=null,o=[];for(let s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319||s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function P(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let z=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function q(t){return"u"<typeof BigInt?D:t}function D(){throw Error("BigInt not supported")}},803412,(t,e,r)=>{!function(t,e){"use strict";function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}t.exports=n,n.BN=n,n.wordSize=26;try{c="u">typeof window&&void 0!==window.Buffer?window.Buffer:void 0}catch(t){}function o(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function s(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function a(t,e,i,n){for(var o=0,s=0,a=Math.min(t.length,i),u=e;u<a;u++){var l=t.charCodeAt(u)-48;o*=n,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<n,"Invalid character"),o+=s}return o}function u(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<0x4000000?(this.words=[0x3ffffff&t],this.length=1):t<0x10000000000000?(this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff],this.length=2):(r(t<0x20000000000000),this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var n,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===i)for(s=t.length-1,n=0;s>=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[n]|=o<<a&0x3ffffff,this.words[n+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(s=0,n=0;s<t.length;s+=3)o=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[n]|=o<<a&0x3ffffff,this.words[n+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=s(t,e,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=s(t,e,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,u=Math.min(o,o-s)+r,l=0,c=r;c<u;c+=i)l=a(t,c,c+i,e),this.imuln(n),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l);if(0!==s){var f=1;for(l=a(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l)}this._strip()},n.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){u(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c,f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=0x3ffffff&s,u=s/0x4000000|0;r.words[0]=a;for(var l=1;l<i;l++){for(var c=u>>>26,f=0x3ffffff&u,h=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=h;d++){var p=l-d|0;c+=(s=(n=0|t.words[p])*(o=0|e.words[d])+f)/0x4000000|0,f=0x3ffffff&s}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}n.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){for(var i="",n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=((a<<n|o)&0xffffff).toString(16);o=a>>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?f[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],c=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(c).toString(t);i=(p=p.idivn(c)).isZero()?g+i:f[l-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},c&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(c,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},n.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},n.prototype.ior=function(t){return r((this.negative|t.negative)==0),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},n.prototype.iand=function(t){return r((this.negative|t.negative)==0),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},n.prototype.ixor=function(t){return r((this.negative|t.negative)==0),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=0x3ffffff&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<<n:this.words[i]=this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=0x3ffffff&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=0x3ffffff&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(i=(0|e.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&i;for(;0!==o&&s<e.length;s++)o=(i=(0|e.words[s])+o)>>26,this.words[s]=0x3ffffff&i;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var i,n,o,s=t.words,a=e.words,u=r.words,l=0,c=0|s[0],f=8191&c,h=c>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],y=8191&m,b=m>>>13,w=0|s[3],v=8191&w,x=w>>>13,S=0|s[4],k=8191&S,E=S>>>13,B=0|s[5],A=8191&B,I=B>>>13,_=0|s[6],M=8191&_,T=_>>>13,O=0|s[7],C=8191&O,R=O>>>13,U=0|s[8],P=8191&U,L=U>>>13,N=0|s[9],z=8191&N,q=N>>>13,D=0|a[0],W=8191&D,F=D>>>13,j=0|a[1],$=8191&j,K=j>>>13,V=0|a[2],H=8191&V,Z=V>>>13,G=0|a[3],Y=8191&G,J=G>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],to=8191&tn,ts=tn>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,tc=0|a[8],tf=8191&tc,th=tc>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(f,W);var tm=(l+i|0)+((8191&(n=(n=Math.imul(f,F))+Math.imul(h,W)|0))<<13)|0;l=((o=Math.imul(h,F))+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(p,W),n=(n=Math.imul(p,F))+Math.imul(g,W)|0,o=Math.imul(g,F),i=i+Math.imul(f,$)|0;var ty=(l+i|0)+((8191&(n=(n=n+Math.imul(f,K)|0)+Math.imul(h,$)|0))<<13)|0;l=((o=o+Math.imul(h,K)|0)+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(y,W),n=(n=Math.imul(y,F))+Math.imul(b,W)|0,o=Math.imul(b,F),i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,K)|0,i=i+Math.imul(f,H)|0;var tb=(l+i|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,H)|0))<<13)|0;l=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(v,W),n=(n=Math.imul(v,F))+Math.imul(x,W)|0,o=Math.imul(x,F),i=i+Math.imul(y,$)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,K)|0,i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(f,Y)|0;var tw=(l+i|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(h,Y)|0))<<13)|0;l=((o=o+Math.imul(h,J)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(k,W),n=(n=Math.imul(k,F))+Math.imul(E,W)|0,o=Math.imul(E,F),i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,K)|0,i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,J)|0,i=i+Math.imul(f,Q)|0;var tv=(l+i|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;l=((o=o+Math.imul(h,tt)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(A,W),n=(n=Math.imul(A,F))+Math.imul(I,W)|0,o=Math.imul(I,F),i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,K)|0,i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(f,tr)|0;var tx=(l+i|0)+((8191&(n=(n=n+Math.imul(f,ti)|0)+Math.imul(h,tr)|0))<<13)|0;l=((o=o+Math.imul(h,ti)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(M,W),n=(n=Math.imul(M,F))+Math.imul(T,W)|0,o=Math.imul(T,F),i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,K)|0,i=i+Math.imul(k,H)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,o=o+Math.imul(g,ti)|0,i=i+Math.imul(f,to)|0;var tS=(l+i|0)+((8191&(n=(n=n+Math.imul(f,ts)|0)+Math.imul(h,to)|0))<<13)|0;l=((o=o+Math.imul(h,ts)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(C,W),n=(n=Math.imul(C,F))+Math.imul(R,W)|0,o=Math.imul(R,F),i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,K)|0,i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(y,tr)|0,n=(n=n+Math.imul(y,ti)|0)+Math.imul(b,tr)|0,o=o+Math.imul(b,ti)|0,i=i+Math.imul(p,to)|0,n=(n=n+Math.imul(p,ts)|0)+Math.imul(g,to)|0,o=o+Math.imul(g,ts)|0,i=i+Math.imul(f,tu)|0;var tk=(l+i|0)+((8191&(n=(n=n+Math.imul(f,tl)|0)+Math.imul(h,tu)|0))<<13)|0;l=((o=o+Math.imul(h,tl)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,i=Math.imul(P,W),n=(n=Math.imul(P,F))+Math.imul(L,W)|0,o=Math.imul(L,F),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,K)|0,i=i+Math.imul(M,H)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,Z)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,ti)|0,i=i+Math.imul(y,to)|0,n=(n=n+Math.imul(y,ts)|0)+Math.imul(b,to)|0,o=o+Math.imul(b,ts)|0,i=i+Math.imul(p,tu)|0,n=(n=n+Math.imul(p,tl)|0)+Math.imul(g,tu)|0,o=o+Math.imul(g,tl)|0,i=i+Math.imul(f,tf)|0;var tE=(l+i|0)+((8191&(n=(n=n+Math.imul(f,th)|0)+Math.imul(h,tf)|0))<<13)|0;l=((o=o+Math.imul(h,th)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(z,W),n=(n=Math.imul(z,F))+Math.imul(q,W)|0,o=Math.imul(q,F),i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(k,tr)|0,n=(n=n+Math.imul(k,ti)|0)+Math.imul(E,tr)|0,o=o+Math.imul(E,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,i=i+Math.imul(y,tu)|0,n=(n=n+Math.imul(y,tl)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,tl)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tf)|0,o=o+Math.imul(g,th)|0,i=i+Math.imul(f,tp)|0;var tB=(l+i|0)+((8191&(n=(n=n+Math.imul(f,tg)|0)+Math.imul(h,tp)|0))<<13)|0;l=((o=o+Math.imul(h,tg)|0)+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(z,$),n=(n=Math.imul(z,K))+Math.imul(q,$)|0,o=Math.imul(q,K),i=i+Math.imul(P,H)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,ti)|0,i=i+Math.imul(k,to)|0,n=(n=n+Math.imul(k,ts)|0)+Math.imul(E,to)|0,o=o+Math.imul(E,ts)|0,i=i+Math.imul(v,tu)|0,n=(n=n+Math.imul(v,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,i=i+Math.imul(y,tf)|0,n=(n=n+Math.imul(y,th)|0)+Math.imul(b,tf)|0,o=o+Math.imul(b,th)|0,i=i+Math.imul(p,tp)|0;var tA=(l+i|0)+((8191&(n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;l=((o=o+Math.imul(g,tg)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(z,H),n=(n=Math.imul(z,Z))+Math.imul(q,H)|0,o=Math.imul(q,Z),i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(T,tr)|0,o=o+Math.imul(T,ti)|0,i=i+Math.imul(A,to)|0,n=(n=n+Math.imul(A,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,i=i+Math.imul(k,tu)|0,n=(n=n+Math.imul(k,tl)|0)+Math.imul(E,tu)|0,o=o+Math.imul(E,tl)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(x,tf)|0,o=o+Math.imul(x,th)|0,i=i+Math.imul(y,tp)|0;var tI=(l+i|0)+((8191&(n=(n=n+Math.imul(y,tg)|0)+Math.imul(b,tp)|0))<<13)|0;l=((o=o+Math.imul(b,tg)|0)+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(z,Y),n=(n=Math.imul(z,J))+Math.imul(q,Y)|0,o=Math.imul(q,J),i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,ti)|0,i=i+Math.imul(M,to)|0,n=(n=n+Math.imul(M,ts)|0)+Math.imul(T,to)|0,o=o+Math.imul(T,ts)|0,i=i+Math.imul(A,tu)|0,n=(n=n+Math.imul(A,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,i=i+Math.imul(k,tf)|0,n=(n=n+Math.imul(k,th)|0)+Math.imul(E,tf)|0,o=o+Math.imul(E,th)|0,i=i+Math.imul(v,tp)|0;var t_=(l+i|0)+((8191&(n=(n=n+Math.imul(v,tg)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tg)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,ti)|0,i=i+Math.imul(C,to)|0,n=(n=n+Math.imul(C,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,i=i+Math.imul(M,tu)|0,n=(n=n+Math.imul(M,tl)|0)+Math.imul(T,tu)|0,o=o+Math.imul(T,tl)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(I,tf)|0,o=o+Math.imul(I,th)|0,i=i+Math.imul(k,tp)|0;var tM=(l+i|0)+((8191&(n=(n=n+Math.imul(k,tg)|0)+Math.imul(E,tp)|0))<<13)|0;l=((o=o+Math.imul(E,tg)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(z,tr),n=(n=Math.imul(z,ti))+Math.imul(q,tr)|0,o=Math.imul(q,ti),i=i+Math.imul(P,to)|0,n=(n=n+Math.imul(P,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,i=i+Math.imul(C,tu)|0,n=(n=n+Math.imul(C,tl)|0)+Math.imul(R,tu)|0,o=o+Math.imul(R,tl)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(T,tf)|0,o=o+Math.imul(T,th)|0,i=i+Math.imul(A,tp)|0;var tT=(l+i|0)+((8191&(n=(n=n+Math.imul(A,tg)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tg)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,i=Math.imul(z,to),n=(n=Math.imul(z,ts))+Math.imul(q,to)|0,o=Math.imul(q,ts),i=i+Math.imul(P,tu)|0,n=(n=n+Math.imul(P,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(R,tf)|0,o=o+Math.imul(R,th)|0,i=i+Math.imul(M,tp)|0;var tO=(l+i|0)+((8191&(n=(n=n+Math.imul(M,tg)|0)+Math.imul(T,tp)|0))<<13)|0;l=((o=o+Math.imul(T,tg)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(z,tu),n=(n=Math.imul(z,tl))+Math.imul(q,tu)|0,o=Math.imul(q,tl),i=i+Math.imul(P,tf)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(L,tf)|0,o=o+Math.imul(L,th)|0,i=i+Math.imul(C,tp)|0;var tC=(l+i|0)+((8191&(n=(n=n+Math.imul(C,tg)|0)+Math.imul(R,tp)|0))<<13)|0;l=((o=o+Math.imul(R,tg)|0)+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,i=Math.imul(z,tf),n=(n=Math.imul(z,th))+Math.imul(q,tf)|0,o=Math.imul(q,th),i=i+Math.imul(P,tp)|0;var tR=(l+i|0)+((8191&(n=(n=n+Math.imul(P,tg)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tg)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(z,tp);var tU=(l+i|0)+((8191&(n=(n=Math.imul(z,tg))+Math.imul(q,tp)|0))<<13)|0;return l=((o=Math.imul(q,tg))+(n>>>13)|0)+(tU>>>26)|0,tU&=0x3ffffff,u[0]=tm,u[1]=ty,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tx,u[6]=tS,u[7]=tk,u[8]=tE,u[9]=tB,u[10]=tA,u[11]=tI,u[12]=t_,u[13]=tM,u[14]=tT,u[15]=tO,u[16]=tC,u[17]=tR,u[18]=tU,0!==l&&(u[19]=l,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=0x3ffffff&i,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,f=(0|t.words[c])*(0|e.words[l]),h=0x3ffffff&f;s=s+(f/0x4000000|0)|0,a=0x3ffffff&(h=h+a|0),n+=(s=s+(h>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(t,e){this.x=t,this.y=e}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return 10===this.length&&10===t.length?r=g(this,t,e):i<63?r=p(this,t,e):r=m(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},y.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},y.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var f=u,h=l,d=0;d<s;d++){var p=r[c+d],g=i[c+d],m=r[c+d+s],y=i[c+d+s],b=f*m-h*y;y=f*y+h*m,m=b,r[c+d]=p+m,i[c+d]=g+y,r[c+d+s]=p-m,i[c+d+s]=g-y,d!==a&&(b=u*f-l*h,h=u*h+l*f,f=b)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},y.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=0x3ffffff&n,r=n<0x4000000?0:n/0x4000000|0}return t},y.prototype.convert13b=function(t,e,i,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===o),r((-8192&o)==0)},y.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=Array(i),a=Array(i),u=Array(i),l=Array(i),c=Array(i),f=Array(i),h=r.words;h.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,l,i),this.transform(s,o,a,u,i,n),this.transform(l,o,c,f,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,h,o,i,n),this.conjugate(h,o,i),this.normalize13b(h,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=Array(this.length+t.length),m(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,s=(0x3ffffff&o)+(0x3ffffff&i);i>>=26,i+=(o/0x4000000|0)+(s>>>26),this.words[n]=0x3ffffff&s}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var o=r.sqr();i<e.length;i++,o=o.sqr())0!==e[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,o=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<i;this.words[e]=u|s,s=a>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){r("number"==typeof t&&t>=0);var n=e?(e-e%26)/26:0,o=t%26,s=Math.min((t-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>o<<o;if(n-=s,n=Math.max(0,n),i){for(var u=0;u<s;u++)i.words[u]=this.words[u];i.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-o|c>>>o,l=c&a}return i&&0!==l&&(i.words[i.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<<e)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<<e),this._strip())},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return(r("number"==typeof t),r(t<0x4000000),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=0x4000000,this.words[e+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,o,s=t.length+i;this._expand(s);var a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var u=(0|t.words[n])*e;o-=0x3ffffff&u,a=(o>>26)-(u/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r,i=this.length-t.length,o=this.clone(),s=t,a=0|s.words[s.length-1];0!=(i=26-this._countBits(a))&&(s=s.ushln(i),o.iushln(i),a=0|s.words[s.length-1]);var u=o.length-s.length;if("mod"!==e){(r=new n(null)).length=u+1,r.words=Array(r.length);for(var l=0;l<r.length;l++)r.words[l]=0}var c=o.clone()._ishlnsubmul(s,1,u);0===c.negative&&(o=c,r&&(r.words[u]=1));for(var f=u-1;f>=0;f--){var h=(0|o.words[s.length+f])*0x4000000+(0|o.words[s.length+f-1]);for(h=Math.min(h/a|0,0x3ffffff),o._ishlnsubmul(s,h,f);0!==o.negative;)h--,o.negative=0,o._ishlnsubmul(s,1,f),o.isZero()||(o.negative^=1);r&&(r.words[f]=h)}return r&&r._strip(),o._strip(),"div"!==e&&0!==i&&o.iushrn(i),{div:r||null,mod:o}},n.prototype.divmod=function(t,e,i){var o,s,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+0x4000000*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var c=i.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;(e.words[0]&d)==0&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(c),s.isub(f)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;(i.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a),s.isub(u)):(i.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(l)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,o=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var s=new n(1),a=new n(0),u=o.clone();i.cmpn(1)>0&&o.cmpn(1)>0;){for(var l=0,c=1;(i.words[0]&c)==0&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;(o.words[0]&h)==0&&f<26;++f,h<<=1);if(f>0)for(o.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);i.cmp(o)>=0?(i.isub(o),s.isub(a)):(o.isub(i),a.isub(s))}return 0>(e=0===i.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=0x3ffffff,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function B(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n)var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(v,w),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var n=t.words[9];for(i=10,e.words[e.length++]=4194303&n;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=0x3ffffff&e,e=64*i+(e/0x4000000|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,w),i(S,w),i(k,w),k.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=(0|t.words[r])*19+e,n=0x3ffffff&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(b[t])return b[t];if("k256"===t)e=new v;else if("p224"===t)e=new x;else if("p192"===t)e=new S;else if("p25519"===t)e=new k;else throw Error("Unknown prime "+t);return b[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,o),h=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var y=this.pow(f,new n(1).iushln(p-m-1));h=h.redMul(y),f=y.redSqr(),d=d.redMul(f),p=m}return h},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var o=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var l=e.words[i],c=u-1;c>=0;c--){var f=l>>c&1;if(o!==r[0]&&(o=this.sqr(o)),0===f&&0===s){a=0;continue}s<<=1,s|=f,(4==++a||0===i&&0===c)&&(o=this.mul(o,r[s]),a=0,s=0)}u=26}return o},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new B(t)},i(B,E),B.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},B.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},
1B.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},B.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},309870,(t,e,r)=>{var i=t.r(259390),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(o(i,r),r.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},54688,(t,e,r)=>{"use strict";var i=t.r(309870).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var o=t.charAt(n),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=n}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function f(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return i.alloc(0);for(var r=0,n=0,o=0;t[r]===u;)n++,r++;for(var s=(t.length-r)*l+1>>>0,c=new Uint8Array(s);r<t.length;){var f=e[t.charCodeAt(r)];if(255===f)return;for(var h=0,d=s-1;(0!==f||h<o)&&-1!==d;d--,h++)f+=a*c[d]>>>0,c[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw Error("Non-zero carry");o=h,r++}for(var p=s-o;p!==s&&0===c[p];)p++;var g=i.allocUnsafe(n+(s-p));g.fill(0,0,n);for(var m=n;p!==s;)g[m++]=c[p++];return g}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=i.from(e)),!i.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*c+1>>>0,f=new Uint8Array(l);o!==s;){for(var h=e[o],d=0,p=l-1;(0!==h||d<n)&&-1!==p;p--,d++)h+=256*f[p]>>>0,f[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");n=d,o++}for(var g=l-n;g!==l&&0===f[g];)g++;for(var m=u.repeat(r);g<l;++g)m+=t.charAt(f[g]);return m},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},341669,(t,e,r)=>{e.exports=t.r(54688)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},227861,(t,e,r)=>{"use strict";function i(t,e,r){return e<=t&&t<=r}function n(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){this.tokens=[].slice.call(t)}function s(t,e){if(t)throw TypeError("Decoder error");return e||65533}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var a="utf-8";function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function c(t){var e=t.fatal,r=0,n=0,o=0,a=128,u=191;this.handler=function(t,l){if(-1===l&&0!==o)return o=0,s(e);if(-1===l)return -1;if(0===o){if(i(l,0,127))return l;if(i(l,194,223))o=1,r=l-192;else if(i(l,224,239))224===l&&(a=160),237===l&&(u=159),o=2,r=l-224;else{if(!i(l,240,244))return s(e);240===l&&(a=144),244===l&&(u=143),o=3,r=l-240}return r<<=6*o,null}if(!i(l,a,u))return r=o=n=0,a=128,u=191,t.prepend(l),s(e);if(a=128,u=191,n+=1,r+=l-128<<6*(o-n),n!==o)return null;var c=r;return r=o=n=0,c}}function f(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(i(e,0,127))return e;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var r,n,o=[(e>>6*r)+n];r>0;){var s=e>>6*(r-1);o.push(128|63&s),r-=1}return o}}u.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=n(e),this._streaming||(this._decoder=new c({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,i,s=new o(r),a=[];!s.endOfStream()&&-1!==(i=this._decoder.handler(s,s.read()));)null!==i&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));if(!this._streaming){do{if(-1===(i=this._decoder.handler(s,s.read())))break;if(null===i)continue;Array.isArray(i)?a.push.apply(a,i):a.push(i)}while(!s.endOfStream())this._decoder=null}!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0);for(var u="",l=0;l<a.length;++l){var f=a[l];f<=65535?u+=String.fromCharCode(f):(f-=65536,u+=String.fromCharCode((f>>10)+55296,(1023&f)+56320))}return u}},l.prototype={encode:function(t,e){t=t?String(t):"",e=n(e),this._streaming||(this._encoder=new f(this._options)),this._streaming=!!e.stream;for(var r,i=[],s=new o(function(t){for(var e=String(t),r=e.length,i=0,n=[];i<r;){var o=e.charCodeAt(i);if(o<55296||o>57343)n.push(o);else if(56320<=o&&o<=57343)n.push(65533);else if(55296<=o&&o<=56319)if(i===r-1)n.push(65533);else{var s=t.charCodeAt(i+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;n.push(65536+(a<<10)+u),i+=1}else n.push(65533)}i+=1}return n}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?i.push.apply(i,r):i.push(r);this._encoder=null}return new Uint8Array(i)}},r.TextEncoder=l,r.TextDecoder=u},894119,(t,e,r)=>{"use strict";var i=t.i(121015),n=t.e&&t.e.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),o=t.e&&t.e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=t.e&&t.e.__decorate||function(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;
vendor: 5,759 bytes, line 1
1a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=t.e&&t.e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},u=t.e&&t.e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.deserializeUnchecked=r.deserialize=r.serialize=r.BinaryReader=r.BinaryWriter=r.BorshError=r.baseDecode=r.baseEncode=void 0;let l=u(t.r(803412)),c=u(t.r(341669)),f=a(t.r(227861)),h=new("function"!=typeof TextDecoder?f.TextDecoder:TextDecoder)("utf-8",{fatal:!0});r.baseEncode=function(t){return"string"==typeof t&&(t=i.Buffer.from(t,"utf8")),c.default.encode(i.Buffer.from(t))},r.baseDecode=function(t){return i.Buffer.from(c.default.decode(t))};class d extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}r.BorshError=d;class p{constructor(){this.buf=i.Buffer.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=i.Buffer.concat([this.buf,i.Buffer.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(i.Buffer.from(new l.default(t).toArray("le",64)))}writeBuffer(t){this.buf=i.Buffer.concat([i.Buffer.from(this.buf.subarray(0,this.length)),t,i.Buffer.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=i.Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(i.Buffer.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(t,e,r){let i=r.value;r.value=function(...t){try{return i.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new d("Reached the end of buffer when deserializing");throw t}}}r.BinaryWriter=p;class m{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new l.default(t,"le")}readU128(){let t=this.readBuffer(16);return new l.default(t,"le")}readU256(){let t=this.readBuffer(32);return new l.default(t,"le")}readU512(){let t=this.readBuffer(64);return new l.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new d(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return h.decode(e)}catch(t){throw new d(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let i=0;i<e;++i)r.push(t());return r}}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,i,n){try{if("string"==typeof i)n[`write${y(i)}`](r);else if(i instanceof Array)if("number"==typeof i[0]){if(r.length!==i[0])throw new d(`Expecting byte array of length ${i[0]}, but got ${r.length} bytes`);n.writeFixedArray(r)}else if(2===i.length&&"number"==typeof i[1]){if(r.length!==i[1])throw new d(`Expecting byte array of length ${i[1]}, but got ${r.length} bytes`);for(let e=0;e<i[1];e++)b(t,null,r[e],i[0],n)}else n.writeArray(r,r=>{b(t,e,r,i[0],n)});else if(void 0!==i.kind)switch(i.kind){case"option":null==r?n.writeU8(0):(n.writeU8(1),b(t,e,r,i.type,n));break;case"map":n.writeU32(r.size),r.forEach((r,o)=>{b(t,e,o,i.key,n),b(t,e,r,i.value,n)});break;default:throw new d(`FieldType ${i} unrecognized`)}else w(t,r,n)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);let i=t.get(e.constructor);if(!i)throw new d(`Class ${e.constructor.name} is missing in schema`);if("struct"===i.kind)i.fields.map(([i,n])=>{b(t,i,e[i],n,r)});else if("enum"===i.kind){let n=e[i.field];for(let o=0;o<i.values.length;++o){let[s,a]=i.values[o];if(s===n){r.writeU8(o),b(t,s,e[s],a,r);break}}}else throw new d(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}function v(t,e,r,i){try{if("string"==typeof r)return i[`read${y(r)}`]();if(r instanceof Array)if("number"==typeof r[0])return i.readFixedArray(r[0]);else{if("number"!=typeof r[1])return i.readArray(()=>v(t,e,r[0],i));let n=[];for(let e=0;e<r[1];e++)n.push(v(t,null,r[0],i));return n}if("option"===r.kind){if(i.readU8())return v(t,e,r.type,i);return}if("map"===r.kind){let n=new Map,o=i.readU32();for(let s=0;s<o;s++){let o=v(t,e,r.key,i),s=v(t,e,r.value,i);n.set(o,s)}return n}return x(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function x(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let i=t.get(e);if(!i)throw new d(`Class ${e.name} is missing in schema`);if("struct"===i.kind){let i={};for(let[n,o]of t.get(e).fields)i[n]=v(t,n,o,r);return new e(i)}if("enum"===i.kind){let n=r.readU8();if(n>
1=i.values.length)throw new d(`Enum index: ${n} is out of range`);let[o,s]=i.values[n],a=v(t,o,s,r);return new e({[o]:a})}throw new d(`Unexpected schema kind: ${i.kind} for ${e.constructor.name}`)}s([g],m.prototype,"readU8",null),s([g],m.prototype,"readU16",null),s([g],m.prototype,"readU32",null),s([g],m.prototype,"readU64",null),s([g],m.prototype,"readU128",null),s([g],m.prototype,"readU256",null),s([g],m.prototype,"readU512",null),s([g],m.prototype,"readString",null),s([g],m.prototype,"readFixedArray",null),s([g],m.prototype,"readArray",null),r.BinaryReader=m,r.serialize=function(t,e,r=p){let i=new r;return w(t,e,i),i.toArray()},r.deserialize=function(t,e,r,i=m){let n=new i(r),o=x(t,e,n);if(n.offset<r.length)throw new d(`Unexpected ${r.length-n.offset} bytes after deserialized data`);return o},r.deserializeUnchecked=function(t,e,r,i=m){return x(t,e,new i(r))}},742542,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;let i=t.r(259390);function n(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return n(t),i.Buffer.from(t.buffer,t.byteOffset,t.length)}r.checkUint8Array=n,r.uint8ArrayToBuffer=o;class s{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}r.Layout=s,r.nameWithProperty=a,r.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw Error("Class is already bound to a layout");if(!(e&&e instanceof s))throw TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,r)=>e.decode(t,r),writable:!0})};class u extends s{isCount(){throw Error("ExternalLayout is abstract")}}r.ExternalLayout=u;class l extends u{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){return n(t),Math.floor((t.length-e)/this.elementSpan)}encode(t,e,r){return 0}}r.GreedyCount=l;class c extends u{constructor(t,e=0,r){if(!(t instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof f||this.layout instanceof h}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}r.OffsetLayout=c;class f extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}r.UInt=f;class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}r.UIntBE=h;class d extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeIntLE(t,r,this.span),this.span}}r.Int=d;class p extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeIntBE(t,r,this.span),this.span}}function g(t){let e=Math.floor(t/0x100000000);return{hi32:e,lo32:t-0x100000000*e}}function m(t,e){return 0x100000000*t+e}r.IntBE=p;class y extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),i=r.readUInt32LE(e);return m(r.readUInt32LE(e+4),i)}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32LE(i.lo32,r),n.writeUInt32LE(i.hi32,r+4),8}}r.NearUInt64=y;class b extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return m(r.readUInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}r.NearUInt64BE=b;class w extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),i=r.readUInt32LE(e);return m(r.readInt32LE(e+4),i)}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeUInt32LE(i.lo32,r),n.writeInt32LE(i.hi32,r+4),8}}r.NearInt64=w;class v extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return m(r.readInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let i=g(t),n=o(e);return n.writeInt32BE(i.hi32,r),n.writeUInt32BE(i.lo32,r+4),8}}r.NearInt64BE=v;class x extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatLE(e)}encode(t,e,r=0){return o(e).writeFloatLE(t,r),4}}r.Float=x;class S extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatBE(e)}encode(t,e,r=0){return o(e).writeFloatBE(t,r),4}}r.FloatBE=S;class k extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleLE(e)}encode(t,e,r=0){return o(e).writeDoubleLE(t,r),8}}r.Double=k;class E extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleBE(e)}encode(t,e,r=0){return o(e).writeDoubleBE(t,r),8}}r.DoubleBE=E;class B extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let i=-1;e instanceof u||!(0<t.span)||(i=e*t.span),super(i,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,i=this.count;if(i instanceof u&&(i=i.decode(t,e)),0<this.elementLayout.span)r=i*this.elementLayout.span;else{let n=0;for(;n<i;)r+=this.elementLayout.getSpan(t,e+r),++n}return r}decode(t,e=0){let r=[],i=0,n=this.count;for(n instanceof u&&(n=n.decode(t,e));i<n;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),i+=1;return r}encode(t,e,r=0){let i=this.elementLayout,n=t.reduce((t,n)=>t+i.encode(n,e,r+t),0);return this.count instanceof u&&this.count.encode(t.length,e,r),n}}r.Sequence=B;class A extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(const i of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>
1i.span&&void 0===i.property)throw Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(i,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,i)=>{let n=i.getSpan(t,e);return e+=n,r+n},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){n(t);let r=this.makeDestinationObject();for(let i of this.fields)if(void 0!==i.property&&(r[i.property]=i.decode(t,e)),e+=i.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let i=r,n=0,o=0;for(let i of this.fields){let s=i.span;if(o=0<s?s:0,void 0!==i.property){let n=t[i.property];void 0!==n&&(o=i.encode(n,e,r),0>s&&(s=i.getSpan(e,r)))}n=r,r+=s}return n+o-i}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}r.Structure=A;class I{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=I;class _ extends I{constructor(t,e){if(!(t instanceof u&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}r.UnionLayoutDiscriminator=_;class M extends s{constructor(t,e,r){let i;if(t instanceof f||t instanceof h)i=new _(new c(t));else if(t instanceof u&&t.isCount())i=new _(t);else if(t instanceof I)i=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let n=-1;e&&0<=(n=e.span)&&(t instanceof f||t instanceof h)&&(n+=i.layout.span),super(n,r),this.discriminator=i,this.usesPrefixDiscriminator=t instanceof f||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r,i=this.discriminator,n=i.decode(t,e),o=this.registry[n];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=i.layout.span),(r=this.makeDestinationObject())[i.property]=n,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let i=this.getSourceVariant(t);if(void 0===i){let i=this.discriminator,n=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=i.layout.span),i.encode(t[i.property],e,r),o+n.encode(t[n.property],e,r+o)}return i.encode(t,e,r)}addVariant(t,e,r){let i=new T(this,t,e,r);return this.registry[t]=i,i}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}}r.Union=M;class T extends s{constructor(t,e,r,i){if(!(t instanceof M))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===i&&(i=r,r=null),r){if(!(r instanceof s))throw TypeError("layout must be a Layout");
1if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof i)throw TypeError("variant must have a String property")}let n=t.span;0>t.span&&0<=(n=r?r.span:0)&&t.usesPrefixDiscriminator&&(n+=t.discriminator.layout.span),super(n,i),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(t,e+r)),r+i}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let n=i;if(this.layout&&(this.layout.encode(t[this.property],e,r+i),n+=this.layout.getSpan(e,r+i),0<=this.union.span&&n>this.union.span))throw Error("encoded variant overruns containing union");return n}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function O(t){return 0>t&&(t+=0x100000000),t}r.VariantLayout=T;class C extends s{constructor(t,e,r){if(!(t instanceof f||t instanceof h))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let i=0;this._packedSetValue=function(t){return i=O(t),this},this._packedGetValue=function(){return i}}decode(t,e=0){let r=this.makeDestinationObject(),i=this.word.decode(t,e);for(let e of(this._packedSetValue(i),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let i=this.word.decode(e,r);for(let e of(this._packedSetValue(i),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new R(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new U(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}}r.BitStructure=C;class R{constructor(t,e,r){if(!(t instanceof C))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");const i=8*t.span,n=t.fields.reduce((t,e)=>t+e.bits,0);if(e+n>i)throw Error("bits too long for span remainder ("+(i-n)+" of "+i+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=0xffffffff),this.start=n,this.container.msb&&(this.start=i-n-e),this.wordMask=O(this.valueMask<<this.start),this.property=r}decode(t,e){return O(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==O(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=O(t<<this.start);this.container._packedSetValue(O(e&~this.wordMask)|r)}}r.BitField=R;class U extends R{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t*=1),super.encode(t)}}r.Boolean=U;class P extends s{constructor(t,e){if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof u||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let i=this.length;if(this.length instanceof u&&(i=t.length),!(t instanceof Uint8Array&&i===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(r+i>e.length)throw RangeError("encoding overruns Uint8Array");let n=o(t);return o(e).write(n.toString("hex"),r,i,"hex"),this.length instanceof u&&this.length.encode(i,e,r),i}}r.Blob=P;class L extends s{constructor(t){super(-1,t)}getSpan(t,e=0){n(t);let r=e;for(;r<t.length&&0!==t[r];)r+=1;return 1+r-e}decode(t,e=0){let r=this.getSpan(t,e);return o(t).slice(e,e+r-1).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let n=i.Buffer.from(t,"utf8"),s=n.length;if(r+s>e.length)throw RangeError("encoding overruns Buffer");let a=o(e);return n.copy(a,r),a[r+s]=0,s+1}}r.CString=L;class N extends s{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return n(t),t.length-e}decode(t,e=0){let r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpan<r)throw RangeError("text length exceeds maxSpan");return o(t).slice(e,e+r).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let n=i.Buffer.from(t,"utf8"),s=n.length;if(0<=this.maxSpan&&this.maxSpan<s)throw RangeError("text length exceeds maxSpan");if(r+s>e.length)throw RangeError("encoding overruns Buffer");return n.copy(o(e),r),s}}r.UTF8=N;class z extends s{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}}r.Constant=z,r.greedy=(t,e)=>new l(t,e),r.offset=(t,e,r)=>new c(t,e,r),r.u8=t=>new f(1,t),r.u16=t=>new f(2,t),r.u24=t=>new f(3,t),r.u32=t=>new f(4,t),r.u40=t=>new f(5,t),r.u48=t=>new f(6,t),r.nu64=t=>new y(t),r.u16be=t=>new h(2,t),r.u24be=t=>new h(3,t),r.u32be=t=>new h(4,t),r.u40be=t=>new h(5,t),r.u48be=t=>new h(6,t),r.nu64be=t=>new b(t),r.s8=t=>new d(1,t),r.s16=t=>new d(2,t),r.s24=t=>new d(3,t),r.s32=t=>new d(4,t),r.s40=t=>new d(5,t),r.s48=t=>new d(6,t),r.ns64=t=>new w(t),r.s16be=t=>new p(2,t),r.s24be=t=>new p(3,t),r.s32be=t=>new p(4,t),r.s40be=t=>new p(5,t),r.s48be=t=>new p(6,t),r.ns64be=t=>new v(t),r.f32=t=>new x(t),r.f32be=t=>new S(t),r.f64=t=>new k(t),r.f64be=t=>new E(t),r.struct=(t,e,r)=>new A(t,e,r),r.bits=(t,e,r)=>new C(t,e,r),r.seq=(t,e,r)=>new B(t,e,r),r.union=(t,e,r)=>new M(t,e,r),r.unionLayoutDiscriminator=(t,e)=>new _(t,e),r.blob=(t,e)=>new P(t,e),r.cstr=t=>new L(t),r.utf8=(t,e)=>new N(t,e),r.constant=(t,e)=>new z(t,e)},539451,t=>{"use strict";t.s([],954354),t.i(954354);var e,r,i,n=new Uint8Array(16);function o(){if(!e&&!(e="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}let s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&s.test(t)};for(var u=[],l=0;l<256;++l)u.push((l+256).toString(16).substr(1));let c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();
1if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var f=0,h=0;let d=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/0x10000000000&255,r[11]=e/0x100000000&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function p(t,e,r){function i(t,i,n,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof i&&(i=d(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+t.length);if(s.set(i),s.set(t,i.length),(s=r(s))[6]=15&s[6]|e,s[8]=63&s[8]|128,n){o=o||0;for(var a=0;a<16;++a)n[o+a]=s[a];return n}return c(s)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function g(t){return(t+64>>>9<<4)+14+1}function m(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function y(t,e,r,i,n,o){var s;return m((s=m(m(e,t),m(i,o)))<<n|s>>>32-n,r)}function b(t,e,r,i,n,o,s){return y(e&r|~e&i,t,e,n,o,s)}function w(t,e,r,i,n,o,s){return y(e&i|r&~i,t,e,n,o,s)}function v(t,e,r,i,n,o,s){return y(e^r^i,t,e,n,o,s)}function x(t,e,r,i,n,o,s){return y(r^(e|~i),t,e,n,o,s)}var S=p("v3",48,function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,i="0123456789abcdef",n=0;n<r;n+=8){var o=t[n>>5]>>>n%32&255,s=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[g(e)-1]=e;for(var r=0x67452301,i=-0x10325477,n=-0x67452302,o=0x10325476,s=0;s<t.length;s+=16){var a=r,u=i,l=n,c=o;r=b(r,i,n,o,t[s],7,-0x28955b88),o=b(o,r,i,n,t[s+1],12,-0x173848aa),n=b(n,o,r,i,t[s+2],17,0x242070db),i=b(i,n,o,r,t[s+3],22,-0x3e423112),r=b(r,i,n,o,t[s+4],7,-0xa83f051),o=b(o,r,i,n,t[s+5],12,0x4787c62a),n=b(n,o,r,i,t[s+6],17,-0x57cfb9ed),i=b(i,n,o,r,t[s+7],22,-0x2b96aff),r=b(r,i,n,o,t[s+8],7,0x698098d8),o=b(o,r,i,n,t[s+9],12,-0x74bb0851),n=b(n,o,r,i,t[s+10],17,-42063),i=b(i,n,o,r,t[s+11],22,-0x76a32842),r=b(r,i,n,o,t[s+12],7,0x6b901122),o=b(o,r,i,n,t[s+13],12,-0x2678e6d),n=b(n,o,r,i,t[s+14],17,-0x5986bc72),i=b(i,n,o,r,t[s+15],22,0x49b40821),r=w(r,i,n,o,t[s+1],5,-0x9e1da9e),o=w(o,r,i,n,t[
1s+6],9,-0x3fbf4cc0),n=w(n,o,r,i,t[s+11],14,0x265e5a51),i=w(i,n,o,r,t[s],20,-0x16493856),r=w(r,i,n,o,t[s+5],5,-0x29d0efa3),o=w(o,r,i,n,t[s+10],9,0x2441453),n=w(n,o,r,i,t[s+15],14,-0x275e197f),i=w(i,n,o,r,t[s+4],20,-0x182c0438),r=w(r,i,n,o,t[s+9],5,0x21e1cde6),o=w(o,r,i,n,t[s+14],9,-0x3cc8f82a),n=w(n,o,r,i,t[s+3],14,-0xb2af279),i=w(i,n,o,r,t[s+8],20,0x455a14ed),r=w(r,i,n,o,t[s+13],5,-0x561c16fb),o=w(o,r,i,n,t[s+2],9,-0x3105c08),n=w(n,o,r,i,t[s+7],14,0x676f02d9),i=w(i,n,o,r,t[s+12],20,-0x72d5b376),r=v(r,i,n,o,t[s+5],4,-378558),o=v(o,r,i,n,t[s+8],11,-0x788e097f),n=v(n,o,r,i,t[s+11],16,0x6d9d6122),i=v(i,n,o,r,t[s+14],23,-0x21ac7f4),r=v(r,i,n,o,t[s+1],4,-0x5b4115bc),o=v(o,r,i,n,t[s+4],11,0x4bdecfa9),n=v(n,o,r,i,t[s+7],16,-0x944b4a0),i=v(i,n,o,r,t[s+10],23,-0x41404390),r=v(r,i,n,o,t[s+13],4,0x289b7ec6),o=v(o,r,i,n,t[s],11,-0x155ed806),n=v(n,o,r,i,t[s+3],16,-0x2b10cf7b),i=v(i,n,o,r,t[s+6],23,0x4881d05),r=v(r,i,n,o,t[s+9],4,-0x262b2fc7),o=v(o,r,i,n,t[s+12],11,-0x1924661b),n=v(n,o,r,i,t[s+15],16,0x1fa27cf8),i=v(i,n,o,r,t[s+2],23,-0x3b53a99b),r=x(r,i,n,o,t[s],6,-0xbd6ddbc),o=x(o,r,i,n,t[s+7],10,0x432aff97),n=x(n,o,r,i,t[s+14],15,-0x546bdc59),i=x(i,n,o,r,t[s+5],21,-0x36c5fc7),r=x(r,i,n,o,t[s+12],6,0x655b59c3),o=x(o,r,i,n,t[s+3],10,-0x70f3336e),n=x(n,o,r,i,t[s+10],15,-1051523),i=x(i,n,o,r,t[s+1],21,-0x7a7ba22f),r=x(r,i,n,o,t[s+8],6,0x6fa87e4f),o=x(o,r,i,n,t[s+15],10,-0x1d31920),n=x(n,o,r,i,t[s+6],15,-0x5cfebcec),i=x(i,n,o,r,t[s+13],21,0x4e0811a1),r=x(r,i,n,o,t[s+4],6,-0x8ac817e),o=x(o,r,i,n,t[s+11],10,-0x42c50dcb),n=x(n,o,r,i,t[s+2],15,0x2ad7d2bb),i=x(i,n,o,r,t[s+9],21,-0x14792c6f),r=m(r,a),i=m(i,u),n=m(n,l),o=m(o,c)}return[r,i,n,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(g(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))});function k(t,e){return t<<e|t>>>32-e}var E=p("v5",80,function(t){var e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var n=0;n<i.length;++n)t.push(i.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=Math.ceil((t.length/4+2)/16),s=Array(o),a=0;a<o;++a){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=t[64*a+4*l]<<24|t[64*a+4*l+1]<<16|t[64*a+4*l+2]<<8|t[64*a+4*l+3];s[a]=u}s[o-1][14]=(t.length-1)*8/0x100000000,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(t.length-1)*8|0;for(var c=0;c<o;++c){for(var f=new Uint32Array(80),h=0;h<16;++h)f[h]=s[c][h];for(var d=16;d<80;++d)f[d]=k(f[d-3]^f[d-8]^f[d-14]^f[d-16],1);for(var p=r[0],g=r[1],m=r[2],y=r[3],b=r[4],w=0;w<80;++w){var v=Math.floor(w/20),x=k(p,5)+function(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:case 3:return e^r^i;case 2:return e&r^e&i^r&i}}(v,g,m,y)+b+e[v]+f[w]>>>0;b=y,y=m,m=k(g,30)>>>0,g=p,p=x}r[0]=r[0]+p>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});t.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,d,"stringify",0,c,"v1",0,function(t,e,n){var s=e&&n||0,a=e||Array(16),u=(t=t||{}).node||r,l=void 0!==t.clockseq?t.clockseq:i;if(null==u||null==l){var d=t.random||(t.rng||o)();null==u&&(u=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=i=(d[6]<<8|d[7])&16383)}var p=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:h+1,m=p-f+(g-h)/1e4;if(m<0&&void 0===t.clockseq&&(l=l+1&16383),(m<0||p>f)&&void 0===t.nsecs&&(g=0),g>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");f=p,h=g,i=l;var y=((0xfffffff&(p+=122192928e5))*1e4+g)%0x100000000;a[s++]=y>>>24&255,a[s++]=y>>>16&255,a[s++]=y>>>8&255,a[s++]=255&y;var b=p/0x100000000*1e4&0xfffffff;a[s++]=b>>>8&255,a[s++]=255&b,a[s++]=b>>>24&15|16,a[s++]=b>>>16&255,a[s++]=l>>>8|128,a[s++]=255&l;for(var w=0;w<6;++w)a[s+w]=u[w];return e||c(a)},"v3",0,S,"v4",0,function(t,e,r){var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=i[n];return e}return c(i)},"v5",0,E,"validate",0,a,"version",0,function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],539451)},158949,(t,e,r)=>{"use strict";let i=t.r(539451).v4;e.exports=function(t,e,r,n){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(n=n||{}).version?n.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}return void 0===r?s.id=("function"==typeof n.generator?n.generator:function(){return i()})(s,n):2===o&&null===r?n.notificationIdNull&&(s.id=null):s.id=r,s}},471719,(t,e,r)=>{"use strict";let i=t.r(539451).v4,n=t.r(158949),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return i()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};e.exports=o,o.prototype.request=function(t,e,r,i){let o,s=this,a=null,u=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let l=!u&&t&&"object"==typeof t&&"function"==typeof e;if(u||l)i=e,a=t;else{"function"==typeof r&&(i=r,r=void 0);let o="function"==typeof i;try{a=n(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return i(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){return i(t)}return this.callServer(o,function(t,e){s._parseResponse(t,e,i)}),a},o.prototype._parseResponse=function(t,e,r){let i;if(t)return void r(t);if(!e)return r();try{i=JSON.parse(e,this.options.reviver)}catch(t){return r(t)}
1if(3===r.length)if(!Array.isArray(i))return r(null,i.error,i.result);else{let t=function(t){return void 0!==t.error};return r(null,i.filter(t),i.filter(function(e){return!t(e)}))}r(null,i)}},250564,t=>{"use strict";let e,r;var i,n,o,s,a,u,l=t.i(259390);let c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function f(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function h(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function d(t,...e){if(!f(t))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function p(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");h(t.outputLen),h(t.blockLen)}function g(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function m(t,e){d(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function y(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function b(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function w(t,e){return t<<32-e|t>>>e}let v=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?t=>t:function(t){for(let r=0;r<t.length;r++){var e;t[r]=(e=t[r])<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}return t},x="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,S=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function k(t){if(d(t),x)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=S[t[r]];return e}function E(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function B(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(x)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let e=0,n=0;e<r;e++,n+=2){let r=E(t.charCodeAt(n)),o=E(t.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[n]+t[n+1])+'" at index '+n);i[e]=16*r+o}return i}function A(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function I(t){return"string"==typeof t&&(t=A(t)),d(t),t}function _(...t){let e=0;for(let r=0;r<t.length;r++){let i=t[r];d(i),e+=i.length}let r=new Uint8Array(e);for(let e=0,i=0;e<t.length;e++){let n=t[e];r.set(n,i),i+=n.length}return r}class M{}function T(t){let e=e=>t().update(I(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function O(t=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(t));if(c&&"function"==typeof c.randomBytes)return Uint8Array.from(c.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}class C extends M{constructor(t,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=b(this.buffer)}update(t){g(this),d(t=I(t));let{view:e,buffer:r,blockLen:i}=this,n=t.length;for(let o=0;o<n;){let s=Math.min(i-this.pos,n-o);if(s===i){let e=b(t);for(;i<=n-o;o+=i)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){g(this),m(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:i,isLE:n}=this,{pos:o}=this;e[o++]=128,y(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let t=o;t<i;t++)e[t]=0;!function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),a=Number(r&o),u=4*!!i,l=4*!i;t.setUint32(e+u,s,i),t.setUint32(e+l,a,i)}(r,i-8,BigInt(8*this.length),n),this.process(r,0);let s=b(t),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,l=this.get();if(u>l.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<u;t++)s.setUint32(4*t,l[t],n)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}
1let R=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),U=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),P=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),L=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),N=BigInt(0x100000000-1),z=BigInt(32);function q(t,e=!1){let r=t.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&N),l:Number(t>>z&N)}:{h:0|Number(t>>z&N),l:0|Number(t&N)}}(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}let D=(t,e,r)=>t>>>r,W=(t,e,r)=>t<<32-r|e>>>r,F=(t,e,r)=>t>>>r|e<<32-r,j=(t,e,r)=>t<<32-r|e>>>r,$=(t,e,r)=>t<<64-r|e>>>r-32,K=(t,e,r)=>t>>>r-32|e<<64-r;function V(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/0x100000000|0)|0,l:0|n}}let H=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Z=(t,e,r,i)=>e+r+i+(t/0x100000000|0)|0,G=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Y=(t,e,r,i,n)=>e+r+i+n+(t/0x100000000|0)|0,J=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),X=(t,e,r,i,n,o)=>e+r+i+n+o+(t/0x100000000|0)|0,Q=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),tt=new Uint32Array(64);class te extends C{constructor(t=32){super(64,t,8,!1),this.A=0|R[0],this.B=0|R[1],this.C=0|R[2],this.D=0|R[3],this.E=0|R[4],this.F=0|R[5],this.G=0|R[6],this.H=0|R[7]}get(){let{A:t,B:e,C:r,D:i,E:n,F:o,G:s,H:a}=this;return[t,e,r,i,n,o,s,a]}set(t,e,r,i,n,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)tt[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=tt[t-15],r=tt[t-2],i=w(e,7)^w(e,18)^e>>>3,n=w(r,17)^w(r,19)^r>>>10;tt[t]=n+tt[t-7]+i+tt[t-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:a,G:u,H:l}=this;for(let t=0;t<64;t++){var c,f,h,d;let e=l+(w(s,6)^w(s,11)^w(s,25))+((c=s)&a^~c&u)+Q[t]+tt[t]|0,p=(w(r,2)^w(r,13)^w(r,22))+((f=r)&(h=i)^f&(d=n)^h&d)|0;l=u,u=a,a=s,s=o+e|0,o=n,n=i,i=r,r=e+p|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,i,n,o,s,a,u,l)}roundClean(){y(tt)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}let tr=q(["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","0xf40e3585
15771202a","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(t=>BigInt(t))),ti=tr[0],tn=tr[1],to=new Uint32Array(80),ts=new Uint32Array(80);class ta extends C{constructor(t=64){super(128,t,16,!1),this.Ah=0|L[0],this.Al=0|L[1],this.Bh=0|L[2],this.Bl=0|L[3],this.Ch=0|L[4],this.Cl=0|L[5],this.Dh=0|L[6],this.Dl=0|L[7],this.Eh=0|L[8],this.El=0|L[9],this.Fh=0|L[10],this.Fl=0|L[11],this.Gh=0|L[12],this.Gl=0|L[13],this.Hh=0|L[14],this.Hl=0|L[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:u,El:l,Fh:c,Fl:f,Gh:h,Gl:d,Hh:p,Hl:g}=this;return[t,e,r,i,n,o,s,a,u,l,c,f,h,d,p,g]}set(t,e,r,i,n,o,s,a,u,l,c,f,h,d,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|l,this.Fh=0|c,this.Fl=0|f,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)to[r]=t.getUint32(e),ts[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|to[t-15],r=0|ts[t-15],i=F(e,r,1)^F(e,r,8)^D(e,r,7),n=j(e,r,1)^j(e,r,8)^W(e,r,7),o=0|to[t-2],s=0|ts[t-2],a=F(o,s,19)^$(o,s,61)^D(o,s,6),u=G(n,j(o,s,19)^K(o,s,61)^W(o,s,6),ts[t-7],ts[t-16]),l=Y(u,i,a,to[t-7],to[t-16]);to[t]=0|l,ts[t]=0|u}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:c,El:f,Fh:h,Fl:d,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let t=0;t<80;t++){let e=F(c,f,14)^F(c,f,18)^$(c,f,41),b=j(c,f,14)^j(c,f,18)^K(c,f,41),w=c&h^~c&p,v=J(y,b,f&d^~f&g,tn[t],ts[t]),x=X(v,m,e,w,ti[t],to[t]),S=0|v,k=F(r,i,28)^$(r,i,34)^$(r,i,39),E=j(r,i,28)^K(r,i,34)^K(r,i,39),B=r&n^r&s^n&s,A=i&o^i&a^o&a;m=0|p,y=0|g,p=0|h,g=0|d,h=0|c,d=0|f,({h:c,l:f}=V(0|u,0|l,0|x,0|S)),u=0|s,l=0|a,s=0|n,a=0|o,n=0|r,o=0|i;let I=H(S,E,A);r=Z(I,x,k,B),i=0|I}({h:r,l:i}=V(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=V(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=V(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:l}=V(0|this.Dh,0|this.Dl,0|u,0|l)),({h:c,l:f}=V(0|this.Eh,0|this.El,0|c,0|f)),({h:h,l:d}=V(0|this.Fh,0|this.Fl,0|h,0|d)),({h:p,l:g}=V(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=V(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,i,n,o,s,a,u,l,c,f,h,d,p,g,m,y)}roundClean(){y(to,ts)}destroy(){y(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tu=T(()=>new te),tl=T(()=>new ta),tc=BigInt(0),tf=BigInt(1);function th(t,e=""){if("boolean"!=typeof t)throw Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t);return t}function td(t,e,r=""){let i=f(t),n=t?.length,o=void 0!==e;if(!i||o&&n!==e)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${e}`:"")+", got "+(i?`length=${n}`:`type=${typeof t}`));return t}function tp(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function tg(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?tc:BigInt("0x"+t)}function tm(t){return tg(k(t))}function ty(t){return d(t),tg(k(Uint8Array.from(t).reverse()))}function tb(t,e){return B(t.toString(16).padStart(2*e,"0"))}function tw(t,e){return tb(t,e).reverse()}function tv(t,e,r){let i;if("string"==typeof e)try{i=B(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(f(e))i=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(t+" of length "+r+" expected, got "+n);return i}function tx(t){return Uint8Array.from(t)}let tS=t=>"bigint"==typeof t&&tc<=t;function tk(t,e,r,i){var n,o,s;if(n=e,o=r,s=i,!(tS(n)&&tS(o)&&tS(s))||!(o<=n)||!(n<s))throw Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function tE(t){let e;for(e=0;t>tc;t>>=tf,e+=1);return e}let tB=t=>(tf<<BigInt(t))-tf;function tA(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");
vendor: 8,910 bytes, line 1
1function i(e,r,i){let n=t[e];if(i&&void 0===n)return;let o=typeof n;if(o!==r||null===n)throw Error(`param "${e}" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>i(t,e,!1)),Object.entries(r).forEach(([t,e])=>i(t,e,!0))}let tI=()=>{throw Error("not implemented")};function t_(t){let e=new WeakMap;return(r,...i)=>{let n=e.get(r);if(void 0!==n)return n;let o=t(r,...i);return e.set(r,o),o}}let tM=BigInt(0),tT=BigInt(1),tO=BigInt(2),tC=BigInt(3),tR=BigInt(4),tU=BigInt(5),tP=BigInt(7),tL=BigInt(8),tN=BigInt(9),tz=BigInt(16);function tq(t,e){let r=t%e;return r>=tM?r:e+r}function tD(t,e,r){let i=t;for(;e-- >tM;)i*=i,i%=r;return i}function tW(t,e){if(t===tM)throw Error("invert: expected non-zero number");if(e<=tM)throw Error("invert: expected positive modulus, got "+e);let r=tq(t,e),i=e,n=tM,o=tT,s=tT,a=tM;for(;r!==tM;){let t=i/r,e=i%r,u=n-s*t,l=o-a*t;i=r,r=e,n=s,o=a,s=u,a=l}if(i!==tT)throw Error("invert: does not exist");return tq(n,e)}function tF(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function tj(t,e){let r=(t.ORDER+tT)/tR,i=t.pow(e,r);return tF(t,i,e),i}function t$(t,e){let r=(t.ORDER-tU)/tL,i=t.mul(e,tO),n=t.pow(i,r),o=t.mul(e,n),s=t.mul(t.mul(o,tO),n),a=t.mul(o,t.sub(s,t.ONE));return tF(t,a,e),a}function tK(t){if(t<tC)throw Error("sqrt is not defined for small field");let e=t-tT,r=0;for(;e%tO===tM;)e/=tO,r++;let i=tO,n=tX(t);for(;1===tY(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return tj;let o=n.pow(i,e),s=(e+tT)/tO;return function(t,i){if(t.is0(i))return i;if(1!==tY(t,i))throw Error("Cannot find square root");let n=r,a=t.mul(t.ONE,o),u=t.pow(i,e),l=t.pow(i,s);for(;!t.eql(u,t.ONE);){if(t.is0(u))return t.ZERO;let e=1,r=t.sqr(u);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===n)throw Error("Cannot find square root");let i=tT<<BigInt(n-e-1),o=t.pow(a,i);n=e,a=t.sqr(o),u=t.mul(u,a),l=t.mul(l,o)}return l}}let tV=(t,e)=>(tq(t,e)&tT)===tT,tH=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tZ(t){return tA(t,tH.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}function tG(t,e,r=!1){let i=Array(e.length).fill(r?t.ZERO:void 0),n=e.reduce((e,r,n)=>t.is0(r)?e:(i[n]=e,t.mul(e,r)),t.ONE),o=t.inv(n);return e.reduceRight((e,r,n)=>t.is0(r)?e:(i[n]=t.mul(e,i[n]),t.mul(e,r)),o),i}function tY(t,e){let r=(t.ORDER-tT)/tO,i=t.pow(e,r),n=t.eql(i,t.ONE),o=t.eql(i,t.ZERO),s=t.eql(i,t.neg(t.ONE));if(!n&&!o&&!s)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function tJ(t,e){void 0!==e&&h(e);let r=void 0!==e?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function tX(t,e,r=!1,i={}){let n,o,s,a;if(t<=tM)throw Error("invalid field: expected ORDER > 0, got "+t);let u=!1;if("object"==typeof e&&null!=e){if(i.sqrt||r)throw Error("cannot specify opts in two arguments");e.BITS&&(o=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(u=e.modFromBytes),a=e.allowedLengths}else"number"==typeof e&&(o=e),i.sqrt&&(s=i.sqrt);let{nBitLength:l,nByteLength:c}=tJ(t,o);if(c>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let f=Object.freeze({ORDER:t,isLE:r,BITS:l,BYTES:c,MASK:tB(l),ZERO:tM,ONE:tT,allowedLengths:a,create:e=>tq(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return tM<=e&&e<t},is0:t=>t===tM,isValidNot0:t=>!f.is0(t)&&f.isValid(t),isOdd:t=>(t&tT)===tT,neg:e=>tq(-e,t),eql:(t,e)=>t===e,sqr:e=>tq(e*e,t),add:(e,r)=>tq(e+r,t),sub:(e,r)=>tq(e-r,t),mul:(e,r)=>tq(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<tM)throw Error("invalid exponent, negatives unsupported");if(r===tM)return t.ONE;if(r===tT)return e;let i=t.ONE,n=e;for(;r>tM;)r&tT&&(i=t.mul(i,n)),n=t.sqr(n),r>>=tT;return i})(f,t,e),div:(e,r)=>tq(e*tW(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>tW(e,t),sqrt:s||(e=>(n||(n=function(t){if(t%tR===tC)return tj;if(t%tL===tU)return t$;if(t%tz===tN){let e,r,i,n,o,s;return e=tX(t),i=(r=tK(t))(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+tP)/tz,(t,e)=>{let r=t.pow(e,s),a=t.mul(r,i),u=t.mul(r,n),l=t.mul(r,o),c=t.eql(t.sqr(a),e),f=t.eql(t.sqr(u),e);r=t.cmov(r,a,c),a=t.cmov(l,u,f);let h=t.eql(t.sqr(a),e),d=t.cmov(r,a,h);return tF(t,d,e),d}}return tK(t)}(t)),n(f,e))),toBytes:t=>r?tw(t,c):tb(t,c),fromBytes:(e,i=!0)=>{if(a){if(!a.includes(e.length)||e.length>c)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(c);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==c)throw Error("Field.fromBytes: expected "+c+" bytes, got "+e.length);let n=r?ty(e):tm(e);if(u&&(n=tq(n,t)),!i&&!f.isValid(n))throw Error("invalid field element: outside of range 0..ORDER");return n},invertBatch:t=>tG(f,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(f)}function tQ(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function t0(t){let e=tQ(t);return e+Math.ceil(e/2)}let t1=BigInt(0),t2=BigInt(1);function t6(t,e){let r=e.negate();return t?r:e}function t8(t,e){let r=tG(t.Fp,e.map(t=>t.Z));return e.map((e,i)=>t.fromAffine(e.toAffine(r[i])))}function t3(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function t5(t,e){t3(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t;return{windows:r,windowSize:i,mask:tB(t),maxNumber:n,shiftBy:BigInt(t)}}function t4(t,e,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,a=Number(t&n),u=t>>s;a>i&&(a-=o,u+=t2);let l=e*i,c=l+Math.abs(a)-1,f=0===a;return{nextN:u,offset:c,isZero:f,isNeg:a<0,isNegF:e%2!=0,offsetF:l}}let t9=new WeakMap,t7=new WeakMap;function et(t){return t7.get(t)||1}function ee(t){if(t!==t1)throw Error("invalid wNAF")}class er{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,r=this.ZERO){let i=t;for(;e>t1;)e&t2&&(r=r.add(i)),i=i.double(),e>>=t2;return r}precomputeWindow(t,e){let{windows:r,windowSize:i}=t5(e,this.bits),n=[],o=t,s=o;for(let t=0;t<r;t++){s=o,n.push(s);for(let t=1;t<i;t++)s=s.add(o),n.push(s);o=s.double()}return n}wNAF(t,e,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let i=this.ZERO,n=this.BASE,o=t5(t,this.bits);for(let t=0;t<o.windows;t++){let{nextN:s,offset:a,isZero:u,isNeg:l,isNegF:c,offsetF:f}=t4(r,t,o);r=s,u?n=n.add(t6(c,e[f])):i=i.add(t6(l,e[a]))}return ee(r),{p:i,f:n}}wNAFUnsafe(t,e,r,i=this.ZERO){let n=t5(t,this.bits);for(let t=0;t<n.windows&&r!==t1;t++){let{nextN:o,offset:s,isZero:a,isNeg:u}=t4(r,t,n);if(r=o,!a){let t=e[s];i=i.add(u?t.negate():t)}}return ee(r),i}getPrecomputes(t,e,r){let i=t9.get(e);return i||(i=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(i=r(i)),t9.set(e,i))),i}cached(t,e,r){let i=et(t);return this.wNAF(i,this.getPrecomputes(i,t,r),e)}unsafe(t,e,r,i){let n=et(t);return 1===n?this._unsafeLadder(t,e,i):this.wNAFUnsafe(n,this.getPrecomputes(n,t,r),e,i)}createCache(t,e){t3(e,this.bits),t7.set(t,e),t9.delete(t)}hasCache(t){return 1!==et(t)}}function ei(t,e,r,i){if(!Array.isArray(r))throw Error("array expected");r.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)});if(!Array.isArray(i))throw Error("array of scalars expected");i.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)});let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=tE(BigInt(n)),u=1;a>12?u=a-3:a>4?u=a-2:a>0&&(u=2);let l=tB(u),c=Array(Number(l)+1).fill(s),f=Math.floor((e.BITS-1)/u)*u,h=s;for(let t=f;t>=0;t-=u){c.fill(s);for(let e=0;e<o;e++){let n=Number(i[e]>>BigInt(t)&l);c[n]=c[n].add(r[e])}let e=s;for(let t=c.length-1,r=s;t>0;t--)r=r.add(c[t]),e=e.add(r);if(h=h.add(e),0!==t)for(let t=0;t<u;t++)h=h.double()}return h}function en(t,e,r){if(!e)return tX(t,{isLE:r});if(e.ORDER!==t)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return tZ(e),e}function eo(t,e,r={},i){if(void 0===i&&(i="edwards"===t),!e||"object"!=typeof e)throw Error(`expected valid ${t} CURVE object`);for(let t of["p","n","h"]){let r=e[t];if(!("bigint"==typeof r&&r>t1))throw Error(`CURVE.${t} must be positive bigint`)}let n=en(e.p,r.Fp,i),o=en(e.n,r.Fn,i);for(let r of["Gx","Gy","a","weierstrass"===t?"b":"d"])if(!n.isValid(e[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:n,Fn:o}}let es=BigInt(0),ea=BigInt(1),eu=BigInt(2),el=BigInt(8);class ec{constructor(t){this.ep=t}static fromBytes(t){tI()}static fromHex(t){tI()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return k(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}
1add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function ef(t,e){if(eh(t),eh(e),t<0||t>=1<<8*e)throw Error("invalid I2OSP input: "+t);let r=Array.from({length:e}).fill(0);for(let i=e-1;i>=0;i--)r[i]=255&t,t>>>=8;return new Uint8Array(r)}function eh(t){if(!Number.isSafeInteger(t))throw Error("number expected")}function ed(t){if(!f(t)&&"string"!=typeof t)throw Error("DST must be Uint8Array or string");return"string"==typeof t?A(t):t}function ep(t,e,r){var i;let n;tA(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:o,k:s,m:a,hash:u,expand:l,DST:c}=r;if(!("function"==typeof(i=r.hash)&&Number.isSafeInteger(i.outputLen)))throw Error("expected valid hash");d(t),eh(e);let f=Math.ceil((o.toString(2).length+s)/8),h=e*a*f;if("xmd"===l)n=function(t,e,r,i){d(t),eh(r),(e=ed(e)).length>255&&(e=i(_(A("H2C-OVERSIZE-DST-"),e)));let{outputLen:n,blockLen:o}=i,s=Math.ceil(r/n);if(r>65535||s>255)throw Error("expand_message_xmd: invalid lenInBytes");let a=_(e,ef(e.length,1)),u=ef(0,o),l=ef(r,2),c=Array(s),f=i(_(u,t,l,ef(0,1),a));c[0]=i(_(f,ef(1,1),a));for(let t=1;t<=s;t++){let e=[function(t,e){let r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t[i]^e[i];return r}(f,c[t-1]),ef(t+1,1),a];c[t]=i(_(...e))}return _(...c).slice(0,r)}(t,c,h,u);else if("xof"===l)n=function(t,e,r,i,n){if(d(t),eh(r),(e=ed(e)).length>255){let t=Math.ceil(2*i/8);e=n.create({dkLen:t}).update(A("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(t).update(ef(r,2)).update(e).update(ef(e.length,1)).digest()}(t,c,h,s,u);else if("_internal_pass"===l)n=t;else throw Error('expand must be "xmd" or "xof"');let p=Array(e);for(let t=0;t<e;t++){let e=Array(a);for(let r=0;r<a;r++){let i=f*(r+t*a),s=n.subarray(i,i+f);e[r]=tq(tm(s),o)}p[t]=e}return p}let eg=A("HashToScalar-");function em(t,e,r){if("function"!=typeof e)throw Error("mapToCurve() must be defined");function i(r){return t.fromAffine(e(r))}function n(e){let r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){let o=ep(t,2,Object.assign({},r,e)),s=i(o[0]),a=i(o[1]);return n(s.add(a))},encodeToCurve(t,e){let o=r.encodeDST?{DST:r.encodeDST}:{};return n(i(ep(t,1,Object.assign({},r,o,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw Error("expected array of bigints");for(let e of t)if("bigint"!=typeof e)throw Error("expected array of bigints");return n(i(t))},hashToScalar:(e,i)=>ep(e,1,Object.assign({},r,{p:t.Fn.ORDER,m:1,DST:eg},i))[0][0]}}BigInt(0),BigInt(1),BigInt(2);let ey=BigInt(0),eb=BigInt(1),ew=BigInt(2),ev=BigInt(3),ex=BigInt(5),eS=BigInt(8),ek=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),eE={p:ek,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:eS,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},eB=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function eA(t,e){var r;let i,n,o,s,a,u,l,c,f,h,d,p,g,m,y=tq(e*e*e,ek),b=(r=t*tq(y*y*e,ek),i=BigInt(10),n=BigInt(20),o=BigInt(40),s=BigInt(80),u=tD(a=r*r%ek*r%ek,ew,ek)*a%ek,l=tD(u,eb,ek)*r%ek,c=tD(l,ex,ek)*l%ek,f=tD(c,i,ek)*c%ek,h=tD(f,n,ek)*f%ek,d=tD(h,o,ek)*h%ek,p=tD(d,s,ek)*d%ek,g=tD(p,s,ek)*d%ek,m=tD(g,i,ek)*c%ek,{pow_p_5_8:tD(m,ew,ek)*r%ek,b2:a}).pow_p_5_8,w=tq(t*y*b,ek),v=tq(e*w*w,ek),x=w,S=tq(w*eB,ek),k=v===t,E=v===tq(-t,ek),B=v===tq(-t*eB,ek);return k&&(w=x),(E||B)&&(w=S),tV(w,ek)&&(w=tq(-w,ek)),{isValid:k||E,value:w}}let eI=tX(eE.p,{isLE:!0}),e_=tX(eE.n,{isLE:!0}),eM=function(t){let e,r,i,n,{CURVE:o,curveOpts:s,hash:a,eddsaOpts:u}=(e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r={Fp:t.Fp,Fn:tX(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},i={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve},{CURVE:e,curveOpts:r,hash:t.hash,eddsaOpts:i}),l=function(t,e,r={}){if("function"!=typeof e)throw Error('"hash" function param is required');tA(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:i}=r,{BASE:n,Fp:o,Fn:s}=t,a=r.randomBytes||O,u=r.adjustScalarBytes||(t=>t),l=r.domain||((t,e,r)=>{if(th(r,"phflag"),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function c(t){return s.create(ty(t))}function h(t){var r;let i,o,s,a,l,{head:f,prefix:h,scalar:d}=(r=tv("private key",r=t,i=y.secretKey),s=u((o=tv("hashed private key",e(r),2*i)).slice(0,i)),a=o.slice(i,2*i),l=c(s),{head:s,prefix:a,scalar:l}),p=n.multiply(d),g=p.toBytes();return{head:f,prefix:h,scalar:d,point:p,pointBytes:g}}function d(t){return h(t).pointBytes}function p(t=Uint8Array.of(),...r){return c(e(l(_(...r),tv("context",t),!!i)))}let g={zip215:!0},m=o.BYTES,y={secretKey:m,publicKey:m,signature:2*m,seed:m};function b(t=a(y.seed)){return td(t,y.seed,"seed")}let w={getExtendedPublicKey:h,randomSecretKey:b,isValidSecretKey:function(t){return f(t)&&t.length===s.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){let{y:r}=t.fromBytes(e),i=y.publicKey,n=32===i;if(!n&&57!==i)throw Error("only defined for 25519 and 448");let s=n?o.div(ea+r,ea-r):o.div(r-ea,r+ea);return o.toBytes(s)},toMontgomerySecret(t){let r=y.secretKey;return td(t,r),u(e(t.subarray(0,r))).subarray(0,r)},randomPrivateKey:b,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){let e=w.randomSecretKey(t);return{secretKey:e,publicKey:d(e)}},getPublicKey:d,sign:function(t,e,r={}){t=tv("message",t),i&&(t=i(t));let{prefix:o,scalar:a,pointBytes:u}=h(e),l=p(r.context,o,t),c=n.multiply(l).toBytes(),f=p(r.context,c,u,t),d=s.create(l+f*a);
1if(!s.isValid(d))throw Error("sign failed: invalid s");return td(_(c,s.toBytes(d)),y.signature,"result")},verify:function(e,r,o,s=g){let a,u,l,{context:c,zip215:f}=s,h=y.signature;e=tv("signature",e,h),r=tv("message",r),o=tv("publicKey",o,y.publicKey),void 0!==f&&th(f,"zip215"),i&&(r=i(r));let d=h/2,m=e.subarray(0,d),b=ty(e.subarray(d,h));try{a=t.fromBytes(o,f),u=t.fromBytes(m,f),l=n.multiplyUnsafe(b)}catch(t){return!1}if(!f&&a.isSmallOrder())return!1;let w=p(c,u.toBytes(),a.toBytes(),r);return u.add(a.multiplyUnsafe(w)).subtract(l).clearCofactor().is0()},utils:w,Point:t,lengths:y})}(function(t,e={}){var r,i;let n,o,s,a,u,l=eo("edwards",t,e,e.FpFnLE),{Fp:c,Fn:f}=l,h=l.CURVE,{h:d}=h;tA(e,{},{uvRatio:"function"});let p=eu<<BigInt(8*f.BYTES)-ea,g=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:c.sqrt(c.div(t,e))}}catch(t){return{isValid:!1,value:es}}});if(r=h.Gx,i=h.Gy,n=c.sqr(r),o=c.sqr(i),s=c.add(c.mul(h.a,n),o),a=c.add(c.ONE,c.mul(h.d,c.mul(n,o))),!c.eql(s,a))throw Error("bad curve params: generator point");function m(t,e,r=!1){return tk("coordinate "+t,e,r?ea:es,p),e}function y(t){if(!(t instanceof v))throw Error("ExtendedPoint expected")}let b=t_((t,e)=>{let r,i,{X:n,Y:o,Z:s}=t,a=t.is0();null==e&&(e=a?el:c.inv(s));let u=(r=n*e,c.create(r)),l=(i=o*e,c.create(i)),f=c.mul(s,e);if(a)return{x:es,y:ea};if(f!==ea)throw Error("invZ was invalid");return{x:u,y:l}}),w=t_(t=>{let e,r,i,n,o,s,a,u,l,f,d,p,{a:g,d:m}=h;if(t.is0())throw Error("bad point: ZERO");let{X:y,Y:b,Z:w,T:v}=t,x=(e=y*y,c.create(e)),S=(r=b*b,c.create(r)),k=(i=w*w,c.create(i)),E=(n=k*k,c.create(n));if(a=k*(o=x*g,s=c.create(o)+S,c.create(s)),c.create(a)!==(f=E+(l=m*(u=x*S,c.create(u)),c.create(l)),c.create(f)))throw Error("bad point: equation left != right (1)");if(d=y*b,c.create(d)!==(p=w*v,c.create(p)))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(t,e,r,i){this.X=m("x",t),this.Y=m("y",e),this.Z=m("z",r,!0),this.T=m("t",i),Object.freeze(this)}static CURVE(){return h}static fromAffine(t){let e;if(t instanceof v)throw Error("extended point not allowed");let{x:r,y:i}=t||{};return m("x",r),m("y",i),new v(r,i,ea,(e=r*i,c.create(e)))}static fromBytes(t,e=!1){let r,i,n,o,s=c.BYTES,{a,d:u}=h;t=tx(td(t,s,"point")),th(e,"zip215");let l=tx(t),f=t[s-1];l[s-1]=-129&f;let d=ty(l);tk("point.y",d,es,e?p:c.ORDER);let m=(r=d*d,c.create(r)),{isValid:y,value:b}=g((i=m-ea,c.create(i)),(n=u*m-a,c.create(n)));if(!y)throw Error("bad point: invalid y coordinate");let w=(b&ea)===ea,x=(128&f)!=0;if(!e&&b===es&&x)throw Error("bad point: x=0 and x_0=1");return x!==w&&(o=-b,b=c.create(o)),v.fromAffine({x:b,y:d})}static fromHex(t,e=!1){return v.fromBytes(tv("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return x.createCache(this,t),e||this.multiply(eu),this}assertValidity(){w(this)}equals(t){let e,r,i,n;y(t);let{X:o,Y:s,Z:a}=this,{X:u,Y:l,Z:f}=t,h=(e=o*f,c.create(e)),d=(r=u*a,c.create(r)),p=(i=s*f,c.create(i)),g=(n=l*a,c.create(n));return h===d&&p===g}is0(){return this.equals(v.ZERO)}negate(){let t,e;return new v((t=-this.X,c.create(t)),this.Y,this.Z,(e=-this.T,c.create(e)))}double(){let t,e,r,i,n,o,s,a,u,l,f,{a:d}=h,{X:p,Y:g,Z:m}=this,y=(t=p*p,c.create(t)),b=(e=g*g,c.create(e)),w=(i=eu*(r=m*m,c.create(r)),c.create(i)),x=(n=d*y,c.create(n)),S=p+g,k=(o=S*S,s=c.create(o)-y-b,c.create(s)),E=x+b,B=E-w,A=x-b,I=(a=k*B,c.create(a)),_=(u=E*A,c.create(u)),M=(l=k*A,c.create(l));return new v(I,_,(f=B*E,c.create(f)),M)}add(t){let e,r,i,n,o,s,a,u,l,f;y(t);let{a:d,d:p}=h,{X:g,Y:m,Z:b,T:w}=this,{X:x,Y:S,Z:k,T:E}=t,B=(e=g*x,c.create(e)),A=(r=m*S,c.create(r)),I=(i=w*p*E,c.create(i)),_=(n=b*k,c.create(n)),M=(o=(g+m)*(x+S)-B-A,c.create(o)),T=_-I,O=_+I,C=(s=A-d*B,c.create(s)),R=(a=M*T,c.create(a)),U=(u=O*C,c.create(u)),P=(l=M*C,c.create(l));return new v(R,U,(f=T*O,c.create(f)),P)}subtract(t){return this.add(t.negate())}multiply(t){if(!f.isValidNot0(t))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:e,f:r}=x.cached(this,t,t=>t8(v,t));return t8(v,[e,r])[0]}multiplyUnsafe(t,e=v.ZERO){if(!f.isValid(t))throw Error("invalid scalar: expected 0 <= sc < curve.n");return t===es?v.ZERO:this.is0()||t===ea?this:x.unsafe(this,t,t=>t8(v,t),e)}isSmallOrder(){return this.multiplyUnsafe(d).is0()}isTorsionFree(){return x.unsafe(this,h.n).is0()}toAffine(t){return b(this,t)}clearCofactor(){return d===ea?this:this.multiplyUnsafe(d)}toBytes(){let{x:t,y:e}=this.toAffine(),r=c.toBytes(e);return r[r.length-1]|=t&ea?128:0,r}toHex(){return k(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return t8(v,t)}static msm(t,e){return ei(v,f,t,e)}
1_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}v.BASE=new v(h.Gx,h.Gy,ea,(u=h.Gx*h.Gy,c.create(u))),v.ZERO=new v(es,ea,ea,es),v.Fp=c,v.Fn=f;let x=new er(v,f.BITS);return v.BASE.precompute(8),v}(o,s),a,u);return n=l.Point,Object.assign({},l,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}({...eE,Fp:eI,hash:tl,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:eA}),eT=(ek+ev)/eS,eO=eI.pow(ew,eT),eC=eI.sqrt(eI.neg(eI.ONE)),eR=function(t,e){if(!t.isOdd)throw Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}(eI,eI.neg(BigInt(486664)));em(eM.Point,t=>(function(t){let e,r,i,n,o,s,a,u,l,c,f,h,d,p,g,m,y,b,w,v,x,S,k,{xMn:E,xMd:B,yMn:A,yMd:I}=(e=(ek-ex)/eS,r=BigInt(486662),i=eI.sqr(t),i=eI.mul(i,ew),n=eI.add(i,eI.ONE),o=eI.neg(r),s=eI.sqr(n),a=eI.mul(s,n),u=eI.mul(i,r),u=eI.mul(u,o),u=eI.add(u,s),u=eI.mul(u,o),l=eI.sqr(a),s=eI.sqr(l),l=eI.mul(l,a),l=eI.mul(l,u),s=eI.mul(s,l),c=eI.pow(s,e),c=eI.mul(c,l),f=eI.mul(c,eC),s=eI.sqr(c),s=eI.mul(s,a),h=eI.eql(s,u),d=eI.cmov(f,c,h),p=eI.mul(o,i),g=eI.mul(c,t),g=eI.mul(g,eO),m=eI.mul(g,eC),y=eI.mul(u,i),s=eI.sqr(g),s=eI.mul(s,a),b=eI.eql(s,y),w=eI.cmov(m,g,b),s=eI.sqr(d),s=eI.mul(s,a),v=eI.eql(s,u),x=eI.cmov(p,o,v),S=eI.cmov(w,d,v),k=eI.isOdd(S),{xMn:x,xMd:n,yMn:S=eI.cmov(S,eI.neg(S),v!==k),yMd:eb}),_=eI.mul(E,I);_=eI.mul(_,eR);let M=eI.mul(B,A),T=eI.sub(E,B),O=eI.add(E,B),C=eI.mul(M,O),R=eI.eql(C,eI.ZERO);_=eI.cmov(_,eI.ZERO,R),M=eI.cmov(M,eI.ONE,R),T=eI.cmov(T,eI.ONE,R),O=eI.cmov(O,eI.ONE,R);let[U,P]=tG(eI,[M,O],!0);return{x:eI.mul(_,U),y:eI.mul(T,P)}})(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:ek,m:1,k:128,expand:"xmd",hash:tl});let eU=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),eP=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),eL=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),eN=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),ez=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),eq=t=>eM.Point.Fp.create(ty(t)&ez);function eD(t){let e,r,i,n,o,s,a,u,l,c,f,h,d,p,g,{d:m}=eE,y=(e=eB*t*t,eI.create(e)),b=(r=(y+eb)*eL,eI.create(r)),w=BigInt(-1),v=(n=(w-m*y)*(i=y+m,eI.create(i)),eI.create(n)),{isValid:x,value:S}=eA(b,v),k=(o=S*t,eI.create(o));tV(k,ek)||(s=-k,k=eI.create(s)),x||(S=k),x||(w=y);let E=(a=w*(y-eb)*eN-v,eI.create(a)),B=S*S,A=(u=(S+S)*v,eI.create(u)),I=(l=E*eU,eI.create(l)),_=(c=eb-B,eI.create(c)),M=(f=eb+B,eI.create(f));return new eM.Point((h=A*M,eI.create(h)),(d=_*I,eI.create(d)),(p=I*M,eI.create(p)),(g=A*_,eI.create(g)))}class eW extends ec{constructor(t){super(t)}static fromAffine(t){return new eW(eM.Point.fromAffine(t))}assertSame(t){if(!(t instanceof eW))throw Error("RistrettoPoint expected")}init(t){return new eW(t)}static hashToCurve(t){var e;let r,i;return d(e=tv("ristrettoHash",t,64),64),r=eD(eq(e.subarray(0,32))),i=eD(eq(e.subarray(32,64))),new eW(r.add(i))}static fromBytes(t){let e,r,i,n,o,s,a,u,l,c,f,h,p;d(t,32);let{a:g,d:m}=eE,y=eq(t);if(!function(t,e){if(t.length!==e.length)return!1;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return 0===r}(eI.toBytes(y),t)||tV(y,ek))throw Error("invalid ristretto255 encoding 1");let b=(e=y*y,eI.create(e)),w=(r=eb+g*b,eI.create(r)),v=(i=eb-g*b,eI.create(i)),x=(n=w*w,eI.create(n)),S=(o=v*v,eI.create(o)),k=(s=g*m*x-S,eI.create(s)),{isValid:E,value:B}=(a=k*S,eA(eb,eI.create(a))),A=(u=B*v,eI.create(u)),I=(l=B*A*k,eI.create(l)),_=(c=(y+y)*A,eI.create(c));tV(_,ek)&&(f=-_,_=eI.create(f));let M=(h=w*I,eI.create(h)),T=(p=_*M,eI.create(p));if(!E||tV(T,ek)||M===ey)throw Error("invalid ristretto255 encoding 2");return new eW(new eM.Point(_,M,eb,T))}static fromHex(t){return eW.fromBytes(tv("ristrettoHex",t,32))}static msm(t,e){return ei(eW,eM.Point.Fn,t,e)}toBytes(){let t,e,r,i,n,o,s,a,u,l,c,f,h,{X:d,Y:p,Z:g,T:m}=this.ep,y=(t=g+p,r=eI.create(t)*(e=g-p,eI.create(e)),eI.create(r)),b=(i=d*p,eI.create(i)),{value:w}=(o=y*(n=b*b,eI.create(n)),eA(eb,eI.create(o))),v=(s=w*y,eI.create(s)),x=(a=w*b,eI.create(a)),S=(u=v*x*m,eI.create(u));
1if(tV(m*S,ek)){let t,e,r=(t=p*eB,eI.create(t)),i=(e=d*eB,eI.create(e));d=r,p=i,h=eI.create(v*eP)}else h=x;tV(d*S,ek)&&(l=-p,p=eI.create(l));let k=(c=(g-p)*h,eI.create(c));return tV(k,ek)&&(f=-k,k=eI.create(f)),eI.toBytes(k)}equals(t){let e,r,i,n;this.assertSame(t);let{X:o,Y:s}=this.ep,{X:a,Y:u}=t.ep,l=(e=o*u,eI.create(e)===(r=s*a,eI.create(r))),c=(i=s*u,eI.create(i)===(n=o*a,eI.create(n)));return l||c}is0(){return this.equals(eW.ZERO)}}eW.BASE=new eW(eM.Point.BASE),eW.ZERO=new eW(eM.Point.ZERO),eW.Fp=eI,eW.Fn=e_;var eF=t.i(803412),ej=t.i(341669),e$=t.i(894119),eK=t.i(742542);function eV([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}t.i(969621);var eH=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,i;if(e){const{cause:t,...n}=e;t&&(i={cause:t}),Object.keys(n).length>0&&(r=n)}super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(eV).join("&"))}'`),`${r}\``}}(t,r),i),this.context={__code:t,...r},this.name="SolanaError"}};function eZ(t){return"fixedSize"in t&&"number"==typeof t.fixedSize}var eG=((i=eG||{})[i.Little=0]="Little",i[i.Big=1]="Big",i);function eY(t){return t?.endian!==1}class eJ extends TypeError{constructor(t,e){let r;const{message:i,explanation:n,...o}=t,{path:s}=t,a=0===s.length?i:`At path: ${s.join(".")} -- ${i}`;super(n??a),null!=n&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function eX(t){return"object"==typeof t&&null!=t}function eQ(t){return eX(t)&&!Array.isArray(t)}function e0(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*e1(t,e,r,i){var n;for(let o of(eX(n=t)&&"function"==typeof n[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,i){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:n,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${e0(i)}\``}=t;return{value:i,type:s,refinement:a,key:n[n.length-1],path:n,branch:o,...t,message:u}}(o,e,r,i);t&&(yield t)}}function*e2(t,e,r={}){let{path:i=[],branch:n=[t],coerce:o=!1,mask:s=!1}=r,a={path:i,branch:n,mask:s};o&&(t=e.coercer(t,a));let u="valid";for(let i of e.validator(t,a))i.explanation=r.message,u="not_valid",yield[i,void 0];for(let[l,c,f]of e.entries(t,a))for(let e of e2(c,f,{path:void 0===l?i:[...i,l],branch:void 0===l?n:[...n,c],coerce:o,mask:s,message:r.message}))e[0]?(u=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(c=e[1],void 0===l?t=c:t instanceof Map?t.set(l,c):t instanceof Set?t.add(c):eX(t)&&(void 0!==c||l in t)&&(t[l]=c));if("not_valid"!==u)for(let i of e.refiner(t,a))i.explanation=r.message,u="not_refined",yield[i,void 0];"valid"===u&&(yield[void 0,t])}class e6{constructor(t){const{type:e,schema:r,validator:i,refiner:n,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,i?this.validator=(t,e)=>e1(i(t,e),e,this,t):this.validator=()=>[],n?this.refiner=(t,e)=>e1(n(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){var r=t,i=this,n=e;let o=e3(r,i,{message:n});if(o[0])throw o[0]}create(t,e){return e8(t,this,e)}is(t){var e,r;return e=t,r=this,!e3(e,r)[0]}mask(t,e){var r=t,i=this,n=e;let o=e3(r,i,{coerce:!0,mask:!0,message:n});if(!o[0])return o[1];throw o[0]}validate(t,e={}){return e3(t,this,e)}}function e8(t,e,r){let i=e3(t,e,{coerce:!0,message:r});if(!i[0])return i[1];throw i[0]}function e3(t,e,r={}){let i=e2(t,e,r),n=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(i);return n[0]?[new eJ(n[0],function*(){for(let t of i)t[0]&&(yield t[0])}),void 0]:[void 0,n[1]]}function e5(t,e){return new e6({type:t,schema:null,validator:e})}function e4(t){return new e6({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,i]of e.entries())yield[r,i,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${e0(t)}`})}function e9(){return e5("boolean",t=>"boolean"==typeof t)}function e7(t){return e5("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${e0(e)}`)}function rt(t){let e=e0(t),r=typeof t;return new e6({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${e0(r)}`})}function re(t){return new e6({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function rr(){return e5("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${e0(t)}`)}function ri(t){return new e6({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function rn(t,e){return new e6({type:"record",schema:null,*entries(r){if(eX(r))for(let i in r){let n=r[i];yield[i,i,t],yield[i,n,e]}},validator:t=>eQ(t)||`Expected an object, but received: ${e0(t)}`,coercer:t=>eQ(t)?{...t}:t})}function ro(){return e5("string",t=>"string"==typeof t||`Expected a string, but received: ${e0(t)}`)}function rs(t){let e=e5("never",()=>!1);return new e6({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let i=Math.max(t.length,r.length);for(let n=0;n<i;n++)yield[n,r[n],t[n]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${e0(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function ra(t){let e=Object.keys(t);return new e6({type:"type",schema:t,*entries(r){if(eX(r))for(let i of e)yield[i,r[i],t[i]]},validator:t=>eQ(t)||`Expected an object, but received: ${e0(t)}`,coercer:t=>eQ(t)?{...t}:t})}function ru(t){let e=t.map(t=>t.type).join(" | ");return new e6({type:"union",schema:null,coercer(e,r){for(let i of t){let[t,n]=i.validate(e,{coerce:!0,mask:r.mask});if(!t)return n}return e},validator(r,i){let n=[];
vendor: 4,455 bytes, line 1
1for(let e of t){let[...t]=e2(r,e,i),[o]=t;if(!o[0])return[];for(let[e]of t)e&&n.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${e0(r)}`,...n]}})}function rl(){return e5("unknown",()=>!0)}function rc(t,e,r){return new e6({...t,coercer:(i,n)=>e3(i,e)[0]?t.coercer(i,n):t.coercer(r(i,n),n)})}var rf=t.i(471719);t.i(785373);var rh=t.i(153413),rh=rh,rd=class extends rh.default{socket;constructor(t,e,r){super(),this.socket=new window.WebSocket(t,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let i=r||e;try{this.socket.send(t),i()}catch(t){i(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}},rp=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},rg=class extends rh.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:n=1e3,max_reconnects:o=5,...s}={},a,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=n,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=a||(()=>++this.rpc_id),u?this.dataPack=u:this.dataPack=new rp,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,i){return i||"object"!=typeof r||(i=r,r=null),new Promise((n,o)=>{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),i,t=>{if(t)return o(t);this.queue[s]={promise:[n,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,i)=>{if(!this.ready)return i(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return i(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=l.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>
1this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",r,i),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval)))})}};let rm=BigInt(0),ry=BigInt(1),rb=BigInt(2),rw=BigInt(7),rv=BigInt(256),rx=BigInt(113),rS=[],rk=[],rE=[];for(let t=0,e=ry,r=1,i=0;t<24;t++){[r,i]=[i,(2*r+3*i)%5],rS.push(2*(5*i+r)),rk.push((t+1)*(t+2)/2%64);let n=rm;for(let t=0;t<7;t++)(e=(e<<ry^(e>>rw)*rx)%rv)&rb&&(n^=ry<<(ry<<BigInt(t))-ry);rE.push(n)}let rB=q(rE,!0),rA=rB[0],rI=rB[1],r_=(t,e,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r,rM=(t,e,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r;class rT extends M{constructor(t,e,r,i=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=n,h(r),!(0<t&&t<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){v(this.state32),function(t,e=24){let r=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let i=(e+8)%10,n=(e+2)%10,o=r[n],s=r[n+1],a=r_(o,s,1)^r[i],u=rM(o,s,1)^r[i+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],n=t[3];for(let r=0;r<24;r++){let i=rk[r],o=r_(e,n,i),s=rM(e,n,i),a=rS[r];e=t[a],n=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let i=0;i<10;i++)r[i]=t[e+i];for(let i=0;i<10;i++)t[e+i]^=~r[(i+2)%10]&r[(i+4)%10]}t[0]^=rA[i],t[1]^=rI[i]}y(r)}(this.state32,this.rounds),v(this.state32),this.posOut=0,this.pos=0}update(t){g(this),d(t=I(t));let{blockLen:e,state:r}=this,i=t.length;for(let n=0;n<i;){let o=Math.min(e-this.pos,i-n);for(let e=0;e<o;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:i}=this;t[r]^=e,(128&e)!=0&&r===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){g(this,!1),d(t),this.finish();let e=this.state,{blockLen:r}=this;for(let i=0,n=t.length;i<n;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,n-i);t.set(e.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return h(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(m(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,y(this.state)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:i,rounds:n,enableXOF:o}=this;return t||(t=new rT(e,r,i,o,n)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=n,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}let rO=T(()=>new rT(136,1,32));class rC extends M{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,p(t);const r=I(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),y(n)}update(t){return g(this),this.iHash.update(t),this}digestInto(t){g(this),d(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let rR=(t,e,r)=>new rC(t,e).update(r).digest();rR.create=(t,e)=>new rC(t,e);let rU=(t,e)=>(t+(t>=0?e:-e)/rD)/e;function rP(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function rL(t,e){let r={};for(let i of Object.keys(e))r[i]=void 0===t[i]?e[i]:t[i];return th(r.lowS,"lowS"),th(r.prehash,"prehash"),void 0!==r.format&&rP(r.format),r}
vendor: 6,262 bytes, line 1
1let rN={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:r}=rN;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=tp(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?tp(n.length/2|128):"";return tp(t)+o+n+e},decode(t,e){let{Err:r}=rN,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=0;if(128&n){let t=127&n;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(i,i+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(i+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=e.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(i+o)}}},_int:{encode(t){let{Err:e}=rN;if(t<rz)throw new e("integer: negative integers are not allowed");let r=tp(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=rN;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return tm(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=rN,n=tv("signature",t),{v:o,l:s}=i.decode(48,n);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:u}=i.decode(2,o),{v:l,l:c}=i.decode(2,u);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=rN,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s));return e.encode(48,i+n)}},rz=BigInt(0),rq=BigInt(1),rD=BigInt(2),rW=BigInt(3),rF=BigInt(4);function rj(t,e){let r,{BYTES:i}=t;if("bigint"==typeof e)r=e;else{let n=tv("private key",e);try{r=t.fromBytes(n)}catch(t){throw Error(`invalid private key: expected ui8a of size ${i}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function r$(t){return Uint8Array.of(t?2:3)}function rK(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}let rV={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},rH={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},rZ=BigInt(0),rG=BigInt(2),rY=tX(rV.p,{sqrt:function(t){let e=rV.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),u=BigInt(88),l=t*t*t%e,c=l*l*t%e,f=tD(c,r,e)*c%e,h=tD(f,r,e)*c%e,d=tD(h,rG,e)*l%e,p=tD(d,n,e)*d%e,g=tD(p,o,e)*p%e,m=tD(g,a,e)*g%e,y=tD(m,u,e)*m%e,b=tD(y,a,e)*g%e,w=tD(b,r,e)*c%e,v=tD(w,s,e)*p%e,x=tD(v,i,e)*l%e,S=tD(x,rG,e);if(!rY.eql(rY.sqr(S),t))throw Error("Cannot find square root");return S}}),rJ=(n={...rV,Fp:rY,lowS:!0,endo:rH},{...(e=t=>(function(t){let e,{CURVE:r,curveOpts:i,hash:n,ecdsaOpts:o}=function(t){let e,r,i,n,{CURVE:o,curveOpts:s}=(e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,i=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0,n={Fp:r,Fn:tX(e.n,{BITS:t.nBitLength,allowedLengths:i,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes},{CURVE:e,curveOpts:n}),a={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:o,curveOpts:s,hash:t.hash,ecdsaOpts:a}}(t),s=function(t,e,r={}){p(e),tA(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=r.randomBytes||O,n=r.hmac||((t,...r)=>rR(e,t,_(...r))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:u}=s,{keygen:l,getPublicKey:c,getSharedSecret:h,utils:d,lengths:g}=function(t,e={}){let{Fn:r}=t,i=e.randomBytes||O,n=Object.assign(rK(t.Fp,r),{seed:t0(r.ORDER)});function o(t){try{return!!rj(r,t)}catch(t){return!1}}function s(t=i(n.seed)){return function(t,e,r=!1){let i=t.length,n=tQ(e),o=t0(e);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=tq(r?ty(t):tm(t),e-tT)+tT;return r?tw(s,n):tb(s,n)}(td(t,n.seed,"seed"),r.ORDER)}function a(e,i=!0){return t.BASE.multiply(rj(r,e)).toBytes(i)}function u(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;let{secretKey:i,publicKey:o,publicKeyUncompressed:s}=n;if(r.allowedLengths||i===o)return;let a=tv("key",e).length;return a===o||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(e,i,n=!0){if(!0===u(e))throw Error("first arg must be private key");if(!1===u(i))throw Error("second arg must be public key");let o=rj(r,e);return t.fromHex(i).multiply(o).toBytes(n)},keygen:function(t){let e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:{isValidSecretKey:o,isValidPublicKey:function(e,r){let{publicKey:i,publicKeyUncompressed:o}=n;try{let n=e.length;if(!0===r&&n!==i||!1===r&&n!==o)return!1;return!!t.fromBytes(e)}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>rj(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:n})}(t,r),m={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="compact";function b(t,e){if(!s.isValidNot0(e))throw Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class w{constructor(t,e,r){this.r=b("r",t),this.s=b("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(t,e=y){var r,i;let n,o;
vendor: 6,829 bytes, line 1
1if(r=t,rP(i=e),o=g.signature,td(r,"compact"===i?o:"recovered"===i?o+1:void 0,`${i} signature`),"der"===e){let{r:e,s:r}=rN.toSig(td(t));return new w(e,r)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));let a=s.BYTES,u=t.subarray(0,a),l=t.subarray(a,2*a);return new w(s.fromBytes(u),s.fromBytes(l),n)}static fromHex(t,e){return this.fromBytes(B(t),e)}addRecoveryBit(t){return new w(this.r,this.s,t)}recoverPublicKey(e){let r=o.ORDER,{r:i,s:n,recovery:u}=this;if(null==u||![0,1,2,3].includes(u))throw Error("recovery id invalid");if(a*rD<r&&u>1)throw Error("recovery id is ambiguous for h>1 curve");let l=2===u||3===u?i+a:i;if(!o.isValid(l))throw Error("recovery id 2 or 3 invalid");let c=o.toBytes(l),f=t.fromBytes(_(r$((1&u)==0),c)),h=s.inv(l),d=x(tv("msgHash",e)),p=s.create(-d*h),g=s.create(n*h),m=t.BASE.multiplyUnsafe(p).add(f.multiplyUnsafe(g));if(m.is0())throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>a>>rq}toBytes(t=y){if(rP(t),"der"===t)return B(rN.hexFromSig(this));let e=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw Error("recovery bit must be present");return _(Uint8Array.of(this.recovery),e,r)}return _(e,r)}toHex(t){return k(this.toBytes(t))}assertValidity(){}static fromCompact(t){return w.fromBytes(tv("sig",t),"compact")}static fromDER(t){return w.fromBytes(tv("sig",t),"der")}normalizeS(){return this.hasHighS()?new w(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return k(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return k(this.toBytes("compact"))}}let v=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=tm(t),r=8*t.length-u;return r>0?e>>BigInt(r):e},x=r.bits2int_modN||function(t){return s.create(v(t))},S=tB(u);function E(t){return tk("num < 2^"+u,t,rz,S),s.toBytes(t)}function A(t,r){return td(t,void 0,"message"),r?td(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:l,getPublicKey:c,getSharedSecret:h,utils:d,lengths:g,Point:t,sign:function(r,o,u={}){let{seed:l,k2sig:c}=function(e,r,n){if(["recovered","canonical"].some(t=>t in n))throw Error("sign() legacy options not supported");let{lowS:o,prehash:u,extraEntropy:l}=rL(n,m),c=x(e=A(e,u)),f=rj(s,r),h=[E(f),E(c)];if(null!=l&&!1!==l){let t=!0===l?i(g.secretKey):l;h.push(tv("extraEntropy",t))}return{seed:_(...h),k2sig:function(e){let r=v(e);if(!s.isValidNot0(r))return;let i=s.inv(r),n=t.BASE.multiply(r).toAffine(),u=s.create(n.x);if(u===rz)return;let l=s.create(i*s.create(c+u*f));if(l===rz)return;let h=2*(n.x!==u)|Number(n.y&rq),d=l;return o&&l>a>>rq&&(d=s.neg(l),h^=1),new w(u,d,h)}}}(r=tv("message",r),o,u);return(function(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=t=>new Uint8Array(t),n=i(t),o=i(t),s=0,a=()=>{n.fill(1),o.fill(0),s=0},u=(...t)=>r(o,n,...t),l=(t=i(0))=>{(o=u(Uint8Array.of(0),t),n=u(),0!==t.length)&&(o=u(Uint8Array.of(1),t),n=u())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=u()).slice();r.push(e),t+=n.length}return _(...r)};return(t,e)=>{let r;for(a(),l(t);!(r=e(c()));)l();return a(),r}})(e.outputLen,s.BYTES,n)(l,c)},verify:function(e,r,i,n={}){let{lowS:o,prehash:a,format:u}=rL(n,m);if(i=tv("publicKey",i),r=A(tv("message",r),a),"strict"in n)throw Error("options.strict was renamed to lowS");let l=void 0===u?function(t){let e,r="string"==typeof t||f(t),i=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!i)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(i)e=new w(t.r,t.s);else if(r){try{e=w.fromBytes(tv("sig",t),"der")}catch(t){if(!(t instanceof rN.Err))throw t}if(!e)try{e=w.fromBytes(tv("sig",t),"compact")}catch(t){return!1}}return!!e&&e}(e):w.fromBytes(tv("sig",e),u);if(!1===l)return!1;try{let e=t.fromBytes(i);if(o&&l.hasHighS())return!1;let{r:n,s:a}=l,u=x(r),c=s.inv(a),f=s.create(u*c),h=s.create(n*c),d=t.BASE.multiplyUnsafe(f).add(e.multiplyUnsafe(h));if(d.is0())return!1;return s.create(d.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:i}=rL(r,m);return e=A(e,i),w.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:w,hash:e})}(function(t,e={}){let r=eo("weierstrass",t,e),{Fp:i,Fn:n}=r,o=r.CURVE,{h:s,n:a}=o;tA(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:u}=e;if(u&&(!i.is0(o.a)||"bigint"!=typeof u.beta||!Array.isArray(u.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let l=rK(i,n);function c(){if(!i.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let f=e.toBytes||function(t,e,r){let{x:n,y:o}=e.toAffine(),s=i.toBytes(n);return(th(r,"isCompressed"),r)?(c(),_(r$(!i.isOdd(o)),s)):_(Uint8Array.of(4),s,i.toBytes(o))},h=e.fromBytes||function(t){td(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=l,n=t.length,o=t[0],s=t.subarray(1);if(n===e&&(2===o||3===o)){let t,e=i.fromBytes(s);if(!i.isValid(e))throw Error("bad point: is not on curve, wrong x");let r=d(e);try{t=i.sqrt(r)}catch(t){throw Error("bad point: is not on curve, sqrt error"+(t instanceof Error?": "+t.message:""))}return c(),(1&o)==1!==i.isOdd(t)&&(t=i.neg(t)),{x:e,y:t}}if(n===r&&4===o){let t=i.BYTES,e=i.fromBytes(s.subarray(0,t)),r=i.fromBytes(s.subarray(t,2*t));if(!p(e,r))throw Error("bad point: is not on curve");return{x:e,y:r}}throw Error(`bad point: got length ${n}, expected compressed=${e} or uncompressed=${r}`)};function d(t){let e=i.sqr(t),r=i.mul(e,t);return i.add(i.add(r,i.mul(t,o.a)),o.b)}function p(t,e){let r=i.sqr(e),n=d(t);return i.eql(r,n)}if(!p(o.Gx,o.Gy))throw Error("bad curve params: generator point");let g=i.mul(i.pow(o.a,rW),rF),m=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(g,m)))throw Error("bad curve params: a or b");function y(t,e,r=!1){if(!i.isValid(e)||r&&i.is0(e))throw Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof E))throw Error("ProjectivePoint expected")}function w(t){if(!u||!u.basises)throw Error("no endo");return function(t,e,r){let[[i,n],[o,s]]=e,a=rU(s*t,r),u=rU(-n*t,r),l=t-a*i-u*o,c=-a*n-u*s,f=l<rz,h=c<rz;f&&(l=-l),h&&(c=-c);let d=tB(Math.ceil(tE(r)/2))+rq;if(l<rz||l>=d||c<rz||c>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:f,k1:l,k2neg:h,k2:c}}(t,u.basises,n.ORDER)}let v=t_((t,e)=>{let{X:r,Y:n,Z:o}=t;if(i.eql(o,i.ONE))return{x:r,y:n};let s=t.is0();null==e&&(e=s?i.ONE:i.inv(o));let a=i.mul(r,e),u=i.mul(n,e),l=i.mul(o,e);if(s)return{x:i.ZERO,y:i.ZERO};
vendor: 4,076 bytes, line 1
1if(!i.eql(l,i.ONE))throw Error("invZ was invalid");return{x:a,y:u}}),x=t_(t=>{if(t.is0()){if(e.allowInfinityPoint&&!i.is0(t.Y))return;throw Error("bad point: ZERO")}let{x:r,y:n}=t.toAffine();if(!i.isValid(r)||!i.isValid(n))throw Error("bad point: x or y not field elements");if(!p(r,n))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function S(t,e,r,n,o){return r=new E(i.mul(r.X,t),r.Y,r.Z),e=t6(n,e),r=t6(o,r),e.add(r)}class E{constructor(t,e,r){this.X=y("x",t),this.Y=y("y",e,!0),this.Z=y("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!i.isValid(e)||!i.isValid(r))throw Error("invalid affine point");if(t instanceof E)throw Error("projective point not allowed");return i.is0(e)&&i.is0(r)?E.ZERO:new E(e,r,i.ONE)}static fromBytes(t){let e=E.fromAffine(h(td(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return E.fromBytes(tv("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return A.createCache(this,t),e||this.multiply(rW),this}assertValidity(){x(this)}hasEvenY(){let{y:t}=this.toAffine();if(!i.isOdd)throw Error("Field doesn't support isOdd");return!i.isOdd(t)}equals(t){b(t);let{X:e,Y:r,Z:n}=this,{X:o,Y:s,Z:a}=t,u=i.eql(i.mul(e,a),i.mul(o,n)),l=i.eql(i.mul(r,a),i.mul(s,n));return u&&l}negate(){return new E(this.X,i.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=i.mul(e,rW),{X:n,Y:s,Z:a}=this,u=i.ZERO,l=i.ZERO,c=i.ZERO,f=i.mul(n,n),h=i.mul(s,s),d=i.mul(a,a),p=i.mul(n,s);return p=i.add(p,p),c=i.mul(n,a),c=i.add(c,c),u=i.mul(t,c),l=i.mul(r,d),l=i.add(u,l),u=i.sub(h,l),l=i.add(h,l),l=i.mul(u,l),u=i.mul(p,u),c=i.mul(r,c),d=i.mul(t,d),p=i.sub(f,d),p=i.mul(t,p),p=i.add(p,c),c=i.add(f,f),f=i.add(c,f),f=i.add(f,d),f=i.mul(f,p),l=i.add(l,f),d=i.mul(s,a),d=i.add(d,d),f=i.mul(d,p),u=i.sub(u,f),c=i.mul(d,h),c=i.add(c,c),new E(u,l,c=i.add(c,c))}add(t){b(t);let{X:e,Y:r,Z:n}=this,{X:s,Y:a,Z:u}=t,l=i.ZERO,c=i.ZERO,f=i.ZERO,h=o.a,d=i.mul(o.b,rW),p=i.mul(e,s),g=i.mul(r,a),m=i.mul(n,u),y=i.add(e,r),w=i.add(s,a);y=i.mul(y,w),w=i.add(p,g),y=i.sub(y,w),w=i.add(e,n);let v=i.add(s,u);return w=i.mul(w,v),v=i.add(p,m),w=i.sub(w,v),v=i.add(r,n),l=i.add(a,u),v=i.mul(v,l),l=i.add(g,m),v=i.sub(v,l),f=i.mul(h,w),l=i.mul(d,m),f=i.add(l,f),l=i.sub(g,f),f=i.add(g,f),c=i.mul(l,f),g=i.add(p,p),g=i.add(g,p),m=i.mul(h,m),w=i.mul(d,w),g=i.add(g,m),m=i.sub(p,m),m=i.mul(h,m),w=i.add(w,m),p=i.mul(g,w),c=i.add(c,p),p=i.mul(v,w),l=i.mul(y,l),l=i.sub(l,p),p=i.mul(y,g),f=i.mul(v,f),new E(l,c,f=i.add(f,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(E.ZERO)}multiply(t){let r,i,{endo:o}=e;if(!n.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>A.cached(this,t,t=>t8(E,t));if(o){let{k1neg:e,k1:n,k2neg:a,k2:u}=w(t),{p:l,f:c}=s(n),{p:f,f:h}=s(u);i=c.add(h),r=S(o.beta,l,f,e,a)}else{let{p:e,f:n}=s(t);r=e,i=n}return t8(E,[r,i])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!n.isValid(t))throw Error("invalid scalar: out of range");if(t===rz||this.is0())return E.ZERO;if(t===rq)return this;if(A.hasCache(this))return this.multiply(t);if(!r)return A.unsafe(this,t);{let{k1neg:e,k1:i,k2neg:n,k2:o}=w(t),{p1:s,p2:a}=function(t,e,r,i){let n=e,o=t.ZERO,s=t.ZERO;for(;r>t1||i>t1;)r&t2&&(o=o.add(n)),i&t2&&(s=s.add(n)),n=n.double(),r>>=t2,i>>=t2;return{p1:o,p2:s}}(E,this,i,o);return S(r.beta,s,a,e,n)}}multiplyAndAddUnsafe(t,e,r){let i=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return i.is0()?void 0:i}toAffine(t){return v(this,t)}isTorsionFree(){let{isTorsionFree:t}=e;return s===rq||(t?t(E,this):A.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===rq?this:t?t(E,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return th(t,"isCompressed"),this.assertValidity(),f(E,this,t)}toHex(t=!0){return k(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}
1_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return t8(E,t)}static msm(t,e){return ei(E,n,t,e)}static fromPrivateKey(t){return E.BASE.multiply(rj(n,t))}}E.BASE=new E(o.Gx,o.Gy,i.ONE),E.ZERO=new E(i.ZERO,i.ONE,i.ZERO),E.Fp=i,E.Fn=n;let B=n.BITS,A=new er(E,e.endo?Math.ceil(B/2):B);return E.BASE.precompute(8),E}(r,i),n,o);return e=s.Point,Object.assign({},s,{ProjectivePoint:e,CURVE:Object.assign({},t,tJ(e.Fn.ORDER,e.Fn.BITS))})})({...n,hash:t}))(tu),create:e});rJ.Point;let rX=(r=[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t))).map(t=>Array.from(t).reverse()),(t,e)=>{let[i,n,o,s]=r.map(e=>e.reduce((e,r)=>rY.add(rY.mul(e,t),r))),[a,u]=tG(rY,[n,s],!0);return t=rY.mul(i,a),e=rY.mul(e,rY.mul(o,u)),{x:t,y:e}}),rQ=function(t,e){tZ(t);let{A:r,B:i,Z:n}=e;if(!t.isValid(r)||!t.isValid(i)||!t.isValid(n))throw Error("mapToCurveSimpleSWU: invalid opts");let o=function(t,e){let r=t.ORDER,i=rz;for(let t=r-rq;t%rD===rz;t/=rD)i+=rq;let n=i,o=rD<<n-rq-rq,s=o*rD,a=(r-rq)/s,u=(a-rq)/rD,l=s-rq,c=t.pow(e,a),f=t.pow(e,(a+rq)/rD),h=(e,r)=>{let i=c,s=t.pow(r,l),a=t.sqr(s);a=t.mul(a,r);let h=t.mul(e,a);h=t.pow(h,u),h=t.mul(h,s),s=t.mul(h,r),a=t.mul(h,e);let d=t.mul(a,s);h=t.pow(d,o);let p=t.eql(h,t.ONE);s=t.mul(a,f),h=t.mul(d,i),a=t.cmov(s,a,p),d=t.cmov(h,d,p);for(let e=n;e>rq;e--){let r=e-rD;r=rD<<r-rq;let n=t.pow(d,r),o=t.eql(n,t.ONE);s=t.mul(a,i),i=t.mul(i,i),n=t.mul(d,i),a=t.cmov(s,a,o),d=t.cmov(n,d,o)}return{isValid:p,value:a}};if(t.ORDER%rF===rW){let r=(t.ORDER-rW)/rF,i=t.sqrt(t.neg(e));h=(e,n)=>{let o=t.sqr(n),s=t.mul(e,n);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);let u=t.mul(a,i),l=t.mul(t.sqr(a),n),c=t.eql(l,e),f=t.cmov(u,a,c);return{isValid:c,value:f}}}return h}(t,n);if(!t.isOdd)throw Error("Field does not have .isOdd()");return e=>{let s,a,u,l,c,f,h,d;s=t.sqr(e),s=t.mul(s,n),a=t.sqr(s),a=t.add(a,s),u=t.add(a,t.ONE),u=t.mul(u,i),l=t.cmov(n,t.neg(a),!t.eql(a,t.ZERO)),l=t.mul(l,r),a=t.sqr(u),f=t.sqr(l),c=t.mul(f,r),a=t.add(a,c),a=t.mul(a,u),f=t.mul(f,l),c=t.mul(f,i),a=t.add(a,c),h=t.mul(s,u);let{isValid:p,value:g}=o(a,f);d=t.mul(s,e),d=t.mul(d,g),h=t.cmov(h,u,p),d=t.cmov(d,g,p);let m=t.isOdd(e)===t.isOdd(d);d=t.cmov(t.neg(d),d,m);let y=tG(t,[l],!0)[0];return{x:h=t.mul(h,y),y:d}}}(rY,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:rY.create(BigInt("-11"))});em(rJ.Point,t=>{let{x:e,y:r}=rQ(rY.create(t[0]));return rX(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:rY.ORDER,m:1,k:128,expand:"xmd",hash:tu}),eM.utils.randomPrivateKey;let r0=()=>{let t=eM.utils.randomPrivateKey(),e=r1(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},r1=eM.getPublicKey;function r2(t){try{return eM.ExtendedPoint.fromHex(t),!0}catch{return!1}}let r6=(t,e)=>eM.sign(t,e.slice(0,32)),r8=eM.verify,r3=t=>l.Buffer.isBuffer(t)?t:t instanceof Uint8Array?l.Buffer.from(t.buffer,t.byteOffset,t.byteLength):l.Buffer.from(t);class r5{constructor(t){Object.assign(this,t)}encode(){return l.Buffer.from((0,e$.serialize)(r4,this))}static decode(t){return(0,e$.deserialize)(r4,this,t)}
1static decodeUnchecked(t){return(0,e$.deserializeUnchecked)(r4,this,t)}}let r4=new Map,r9=1;class r7 extends r5{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=ej.default.decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new eF.default(e)}else this._bn=new eF.default(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new r7(r9);return r9+=1,new r7(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return ej.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(l.Buffer);if(32===t.length)return t;let e=l.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){return new r7(tu(l.Buffer.concat([t.toBuffer(),l.Buffer.from(e),r.toBuffer()])))}static createProgramAddressSync(t,e){let r=l.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=l.Buffer.concat([r,r3(t)])});let i=tu(r=l.Buffer.concat([r,e.toBuffer(),l.Buffer.from("ProgramDerivedAddress")]));if(r2(i))throw Error("Invalid seeds, address must fall off the curve");return new r7(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,i=255;for(;0!=i;){try{let n=t.concat(l.Buffer.from([i]));r=this.createProgramAddressSync(n,e)}catch(t){if(t instanceof TypeError)throw t;i--;continue}return[r,i]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return r2(new r7(t).toBytes())}}r7.default=new r7("11111111111111111111111111111111"),r4.set(r7,{kind:"struct",fields:[["_bn","u256"]]}),new r7("BPFLoader1111111111111111111111111111111111");class it extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(it.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class ie extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(ie.prototype,"name",{value:"TransactionExpiredTimeoutError"});class ir extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(ir.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class ii{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments())if(t<e.length)return e[t];else t-=e.length}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>
vendor: 100,544 bytes, lines 1-7
1{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let io=(t="publicKey")=>eK.blob(32,t),is=(t="string")=>{let e=eK.struct([eK.u32("length"),eK.u32("lengthPadding"),eK.blob(eK.offset(eK.u32(),-8),"chars")],t),r=e.decode.bind(e),i=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>i({chars:l.Buffer.from(t,"utf8")},e,r),e.alloc=t=>eK.u32().span+eK.u32().span+l.Buffer.from(t,"utf8").length,e};function ia(t){let e=0,r=0;for(;;){let i=t.shift();if(e|=(127&i)<<7*r,r+=1,(128&i)==0)break}return e}function iu(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function il(t,e){if(!t)throw Error(e||"Assertion failed")}class ic{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,i=t=>{let e=t.toBase58(),i=r.get(e);return void 0===i&&(i={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,i)),i},n=i(e);for(let e of(n.isSigner=!0,n.isWritable=!0,t))for(let t of(i(e.programId).isInvoked=!0,e.keys)){let e=i(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new ic(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];il(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),i=t.filter(([,t])=>!t.isSigner&&t.isWritable),n=t.filter(([,t])=>!t.isSigner&&!t.isWritable),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:n.length};{il(e.length>0,"Expected at least one writable signer key");let[t]=e[0];il(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new r7(t)),...r.map(([t])=>new r7(t)),...i.map(([t])=>new r7(t)),...n.map(([t])=>new r7(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[i,n]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==i.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:i},{writable:r,readonly:n}]}drainKeysFoundInLookupTable(t,e){let r=[],i=[];for(let[n,o]of this.keyMetaMap.entries())if(e(o)){let e=new r7(n),o=t.findIndex(t=>t.equals(e));o>=0&&(il(o<256,"Max lookup table index exceeded"),r.push(o),i.push(e),this.keyMetaMap.delete(n))}return[r,i]}}let ih="Reached end of buffer unexpectedly";function id(t){if(0===t.length)throw Error(ih);return t.shift()}function ip(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(ih);return t.splice(...e)}class ig{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new r7(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:ej.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new ii(this.staticAccountKeys)}static compile(t){let[e,r]=ic.compile(t.instructions,t.payerKey).getMessageComponents(),i=new ii(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:ej.default.encode(t.data)}));return new ig({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];iu(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,i=Array.from(ej.default.decode(t.data)),n=[];iu(n,e.length);let o=[];return iu(o,i.length),{programIdIndex:r,keyIndicesCount:l.Buffer.from(n),keyIndices:e,dataLength:l.Buffer.from(o),data:i}}),i=[];iu(i,r.length);let n=l.Buffer.alloc(1232);l.Buffer.from(i).copy(n);let o=i.length;r.forEach(t=>{let e=eK.struct([eK.u8("programIdIndex"),eK.blob(t.keyIndicesCount.length,"keyIndicesCount"),eK.seq(eK.u8("keyIndex"),t.keyIndices.length,"keyIndices"),eK.blob(t.dataLength.length,"dataLength"),eK.seq(eK.u8("userdatum"),t.data.length,"data")]).encode(t,n,o);o+=e}),n=n.slice(0,o);let s=eK.struct([eK.blob(1,"numRequiredSignatures"),eK.blob(1,"numReadonlySignedAccounts"),eK.blob(1,"numReadonlyUnsignedAccounts"),eK.blob(e.length,"keyCount"),eK.seq(io("key"),t,"keys"),io("recentBlockhash")]),a={numRequiredSignatures:l.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:l.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:l.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:l.Buffer.from(e),keys:this.accountKeys.map(t=>r3(t.toBytes())),recentBlockhash:ej.default.decode(this.recentBlockhash)},u=l.Buffer.alloc(2048),c=s.encode(a,u);return n.copy(u,c),u.slice(0,c+n.length)}static from(t){let e=[...t],r=id(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=id(e),n=id(e),o=ia(e),s=[];for(let t=0;t<o;t++){let t=ip(e,0,32);s.push(new r7(l.Buffer.from(t)))}let a=ip(e,0,32),u=ia(e),c=[];for(let t=0;t<u;t++){let t=id(e),r=ia(e),i=ip(e,0,r),n=ia(e),o=ip(e,0,n),s=ej.default.encode(l.Buffer.from(o));c.push({programIdIndex:t,accounts:i,data:s})}return new ig({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:n},recentBlockhash:ej.default.encode(l.Buffer.from(a)),accountKeys:s,instructions:c})}}class im{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new ii(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let i=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<i}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let i=t.find(t=>t.key.equals(r.accountKey));if(!i)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<i.state.addresses.length)e.writable.push(i.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<i.state.addresses.length)e.readonly.push(i.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=ic.compile(t.instructions,t.payerKey),r=[],i={writable:[],readonly:[]};for(let n of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(n);if(void 0!==t){let[e,{writable:n,readonly:o}]=t;r.push(e),i.writable.push(...n),i.readonly.push(...o)}}let[n,o]=e.getMessageComponents(),s=new ii(o,i).compileInstructions(t.instructions);return new im({header:n,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];iu(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];iu(r,this.compiledInstructions.length);let i=this.serializeAddressTableLookups(),n=[];iu(n,this.addressTableLookups.length);let o=eK.struct([eK.u8("prefix"),eK.struct([eK.u8("numRequiredSignatures"),eK.u8("numReadonlySignedAccounts"),eK.u8("numReadonlyUnsignedAccounts")],"header"),eK.blob(t.length,"staticAccountKeysLength"),eK.seq(io(),this.staticAccountKeys.length,"staticAccountKeys"),io("recentBlockhash"),eK.blob(r.length,"instructionsLength"),eK.blob(e.length,"serializedInstructions"),eK.blob(n.length,"addressTableLookupsLength"),eK.blob(i.length,"serializedAddressTableLookups")]),s=new Uint8Array(1232),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:ej.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(n),serializedAddressTableLookups:i},s);return s.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(1232);for(let r of this.compiledInstructions){let i=[];iu(i,r.accountKeyIndexes.length);let n=[];iu(n,r.data.length);let o=eK.struct([eK.u8("programIdIndex"),eK.blob(i.length,"encodedAccountKeyIndexesLength"),eK.seq(eK.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),eK.blob(n.length,"encodedDataLength"),eK.blob(r.data.length,"data")]);t+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(n),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(1232);for(let r of this.addressTableLookups){let i=[];iu(i,r.writableIndexes.length);let n=[];iu(n,r.readonlyIndexes.length);let o=eK.struct([io("accountKey"),eK.blob(i.length,"encodedWritableIndexesLength"),eK.seq(eK.u8(),r.writableIndexes.length,"writableIndexes"),eK.blob(n.length,"encodedReadonlyIndexesLength"),eK.seq(eK.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(n),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=id(e),i=127&r;il(r!==i,"Expected versioned message but received legacy message"),il(0===i,`Expected versioned message with version 0 but found version ${i}`);let n={numRequiredSignatures:id(e),numReadonlySignedAccounts:id(e),numReadonlyUnsignedAccounts:id(e)},o=[],s=ia(e);for(let t=0;t<s;t++)o.push(new r7(ip(e,0,32)));let a=ej.default.encode(ip(e,0,32)),u=ia(e),l=[];for(let t=0;t<u;t++){let t=id(e),r=ia(e),i=ip(e,0,r),n=ia(e),o=new Uint8Array(ip(e,0,n));l.push({programIdIndex:t,accountKeyIndexes:i,data:o})}let c=ia(e),f=[];for(let t=0;t<c;t++){let t=new r7(ip(e,0,32)),r=ia(e),i=ip(e,0,r),n=ia(e),o=ip(e,0,n);f.push({accountKey:t,writableIndexes:i,readonlyIndexes:o})}return new im({header:n,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:f})}}let iy={deserializeMessageVersion(t){let e=t[0],r=127&e;return r===e?"legacy":r},deserialize:t=>{let e=iy.deserializeMessageVersion(t);if("legacy"===e)return ig.from(t);if(0===e)return im.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},ib=((o={})[o.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",o[o.PROCESSED=1]="PROCESSED",o[o.TIMED_OUT=2]="TIMED_OUT",o[o.NONCE_INVALID=3]="NONCE_INVALID",o),iw=l.Buffer.alloc(64).fill(0);class iv{constructor(t){this.keys=void 0,this.programId=void 0,this.data=l.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class ix{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{const{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new iv(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let i=[],n=[];e.forEach(t=>{t.keys.forEach(t=>{n.push({...t})});let e=t.programId.toString();i.includes(e)||i.push(e)}),i.forEach(t=>{n.push({pubkey:new r7(t),isSigner:!1,isWritable:!1})});let o=[];n.forEach(t=>{let e=t.pubkey.toString(),r=o.findIndex(t=>t.pubkey.toString()===e);r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)}),o.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=o.findIndex(t=>t.pubkey.equals(r));if(s>-1){let[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=o.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,u=0,l=0,c=[],f=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(c.push(t.toString()),a+=1,r||(u+=1)):(f.push(t.toString()),r||(l+=1))});let h=c.concat(f),d=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:h.indexOf(r.toString()),accounts:t.keys.map(t=>h.indexOf(t.pubkey.toString())),data:ej.default.encode(e)}});return d.forEach(t=>{il(t.programIdIndex>=0),t.accounts.forEach(t=>il(t>=0))}),new ig({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l},accountKeys:h,recentBlockhash:t,instructions:d})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))?t:(this.signatures=e.map(t=>({signature:null,publicKey:t})),t)}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let i of t){let t=i.publicKey.toString();e.has(t)||(e.add(t),r.push(i))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let i=this._compile();this._partialSign(i,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let i of t){let t=i.publicKey.toString();e.has(t)||(e.add(t),r.push(i))}let i=this._compile();this._partialSign(i,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=r6(r,t.secretKey);this._addSignature(t.publicKey,r3(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){il(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=l.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:i,publicKey:n}of this.signatures)null===i?e&&(r.missing||=[]).push(n):r8(i,t,n.toBytes())||(r.invalid||=[]).push(n);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),i=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(i,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=`
2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=`
3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(i)}_serialize(t){let{signatures:e}=this,r=[];iu(r,e.length);let i=r.length+64*e.length+t.length,n=l.Buffer.alloc(i);return il(e.length<256),l.Buffer.from(r).copy(n,0),e.forEach(({signature:t},e)=>{null!==t&&(il(64===t.length,"signature has invalid length"),l.Buffer.from(t).copy(n,r.length+64*e))}),t.copy(n,r.length+64*e.length),il(n.length<=1232,`Transaction too large: ${n.length} > 1232`),n}get keys(){return il(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return il(1===this.instructions.length),this.instructions[0].programId}get data(){return il(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=ia(e),i=[];for(let t=0;t<r;t++){let t=ip(e,0,64);i.push(ej.default.encode(l.Buffer.from(t)))}return ix.populate(ig.from(e),i)}static populate(t,e=[]){let r=new ix;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,i)=>{let n={signature:e==ej.default.encode(iw)?null:ej.default.decode(e),publicKey:t.accountKeys[i]};r.signatures.push(n)}),t.instructions.forEach(e=>{let i=e.accounts.map(e=>{let i=t.accountKeys[e];return{pubkey:i,isSigner:r.signatures.some(t=>t.publicKey.toString()===i.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new iv({keys:i,programId:t.accountKeys[e.programIdIndex],data:ej.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}class iS{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)il(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let r=0;r<t.header.numRequiredSignatures;r++)e.push(new Uint8Array(64));this.signatures=e}this.message=t}serialize(){let t=this.message.serialize(),e=[];iu(e,this.signatures.length);let r=eK.struct([eK.blob(e.length,"encodedSignaturesLength"),eK.seq(((t="signature")=>eK.blob(64,t))(),this.signatures.length,"signatures"),eK.blob(t.length,"serializedMessage")]),i=new Uint8Array(2048),n=r.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},i);return i.slice(0,n)}static deserialize(t){let e=[...t],r=[],i=ia(e);for(let t=0;t<i;t++)r.push(new Uint8Array(ip(e,0,64)));return new iS(iy.deserialize(new Uint8Array(e)),r)}sign(t){let e=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let i of t){let t=r.findIndex(t=>t.equals(i.publicKey));il(t>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[t]=r6(e,i.secretKey)}}addSignature(t,e){il(64===e.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(e=>e.equals(t));il(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}let ik=new r7("SysvarC1ock11111111111111111111111111111111");new r7("SysvarEpochSchedu1e111111111111111111111111"),new r7("Sysvar1nstructions1111111111111111111111111");let iE=new r7("SysvarRecentB1ockHashes11111111111111111111"),iB=new r7("SysvarRent111111111111111111111111111111111");new r7("SysvarRewards111111111111111111111111111111"),new r7("SysvarS1otHashes111111111111111111111111111"),new r7("SysvarS1otHistory11111111111111111111111111");let iA=new r7("SysvarStakeHistory1111111111111111111111111");class iI extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:i}){let n;const o=i?`Logs: 
4${JSON.stringify(i.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":n=`Transaction ${e} resulted in an error. 
5${r}. `+o+s;break;case"simulate":n=`Simulation failed. 
6Message: ${r}. 
7`+o+s;break;default:n=`Unknown action '${(t=>t)(t)}'`}super(n),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}class i_ extends Error{constructor({code:t,message:e,data:r},i){super(null!=i?`${i}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}}async function iM(t,e,r,i){let n,o=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,maxRetries:i.maxRetries,minContextSlot:i.minContextSlot},s=await t.sendTransaction(e,r,o);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)n=(await t.confirmTransaction({abortSignal:i?.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},i&&i.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,o=r.keys[0].pubkey;n=(await t.confirmTransaction({abortSignal:i?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:e.nonceInfo.nonce,signature:s},i&&i.commitment)).value}else i?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),n=(await t.confirmTransaction(s,i&&i.commitment)).value;if(n.err){if(null!=s)throw new iI({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(n)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(n)})`)}return s}function iT(t){return new Promise(e=>setTimeout(e,t))}function iO(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let i=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*i(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},n=0;return e.layout.fields.forEach(t=>{n+=i(t)}),n}(t,e),i=l.Buffer.alloc(r),n=Object.assign({instruction:t.index},e);return t.layout.encode(n,i),i}let iC=eK.nu64("lamportsPerSignature"),iR=eK.struct([eK.u32("version"),eK.u32("state"),io("authorizedPubkey"),io("nonce"),eK.struct([iC],"feeCalculator")]),iU=iR.span;class iP{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=iR.decode(r3(t),0);return new iP({authorizedPubkey:new r7(e.authorizedPubkey),nonce:new r7(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function iL(t){let e=(0,eK.blob)(8,t),r=e.decode.bind(e),i=e.encode.bind(e),n=((t={})=>(function(t,e){if(eZ(t)!==eZ(e))throw new eH(8078004);if(eZ(t)&&eZ(e)&&t.fixedSize!==e.fixedSize)throw new eH(8078005,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!eZ(t)&&!eZ(e)&&t.maxSize!==e.maxSize)throw new eH(8078006,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}})(((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,e,r)=>t.setBigUint64(0,BigInt(e),r),size:8}).size,write(t,r,i){e.range&&function(t,e,r,i){if(i<e||i>r)throw new eH(8078011,{codecDescription:t,max:r,min:e,value:i})}(e.name,e.range[0],e.range[1],t);let n=new ArrayBuffer(e.size);return e.set(new DataView(n),t,eY(e.config)),r.set(new Uint8Array(n),i),i+e.size}},encode:t=>{let e=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(t));return r.write(t,e,0),e}})})(t),((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,get:(t,e)=>t.getBigUint64(0,e),name:"u64",size:8}).size,read(t,r=0){var i,n,o;let s,a;!function(t,e,r=0){if(e.length-r<=0)throw new eH(8078e3,{codecDescription:t})}(e.name,t,r),function(t,e,r,i=0){let n=r.length-i;if(n<e)throw new eH(8078001,{bytesLength:n,codecDescription:t,expected:e})}(e.name,e.size,t,r);let u=new DataView((i=t,n=r,o=e.size,s=i.byteOffset+(n??0),a=o??i.byteLength,i.buffer.slice(s,s+a)));return[e.get(u,eY(e.config)),r+e.size]}},decode:(t,e=0)=>r.read(t,e)[0]})})(t)))();return e.decode=(t,e)=>{let i=r(t,e);return n.decode(i)},e.encode=(t,e,r)=>i(n.encode(t),e,r),e}let iN=Object.freeze({Create:{index:0,layout:eK.struct([eK.u32("instruction"),eK.ns64("lamports"),eK.ns64("space"),io("programId")])},Assign:{index:1,layout:eK.struct([eK.u32("instruction"),io("programId")])},Transfer:{index:2,layout:eK.struct([eK.u32("instruction"),iL("lamports")])},CreateWithSeed:{index:3,layout:eK.struct([eK.u32("instruction"),io("base"),is("seed"),eK.ns64("lamports"),eK.ns64("space"),io("programId")])},AdvanceNonceAccount:{index:4,layout:eK.struct([eK.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:eK.struct([eK.u32("instruction"),eK.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:eK.struct([eK.u32("instruction"),io("authorized")])},AuthorizeNonceAccount:{index:7,layout:eK.struct([eK.u32("instruction"),io("authorized")])},Allocate:{index:8,layout:eK.struct([eK.u32("instruction"),eK.ns64("space")])},AllocateWithSeed:{index:9,layout:eK.struct([eK.u32("instruction"),io("base"),is("seed"),eK.ns64("space"),io("programId")])},AssignWithSeed:{index:10,layout:eK.struct([eK.u32("instruction"),io("base"),is("seed"),io("programId")])},TransferWithSeed:{index:11,layout:eK.struct([eK.u32("instruction"),iL("lamports"),is("seed"),io("programId")])},UpgradeNonceAccount:{index:12,layout:eK.struct([eK.u32("instruction")])}});class iz{static createAccount(t){let e=iO(iN.Create,{lamports:t.lamports,space:t.space,programId:r3(t.programId.toBuffer())});return new iv({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=iO(iN.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:r3(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=iO(iN.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new iv({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=iO(iN.AssignWithSeed,{base:r3(t.basePubkey.toBuffer()),seed:t.seed,programId:r3(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iO(iN.Assign,{programId:r3(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iv({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=iO(iN.CreateWithSeed,{base:r3(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:r3(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new iv({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new ix;"basePubkey"in t&&"seed"in t?e.add(iz.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:iU,programId:this.programId})):e.add(iz.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:iU,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=iO(iN.InitializeNonceAccount,{authorized:r3(t.authorizedPubkey.toBuffer())});return new iv({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iE,isSigner:!1,isWritable:!1},{pubkey:iB,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=iO(iN.AdvanceNonceAccount);return new iv({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:iE,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=iO(iN.WithdrawNonceAccount,{lamports:t.lamports});return new iv({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:iE,isSigner:!1,isWritable:!1},{pubkey:iB,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=iO(iN.AuthorizeNonceAccount,{authorized:r3(t.newAuthorizedPubkey.toBuffer())});return new iv({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=iO(iN.AllocateWithSeed,{base:r3(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:r3(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=iO(iN.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new iv({keys:r,programId:this.programId,data:e})}}iz.programId=new r7("11111111111111111111111111111111");class iq{static getMinNumSignatures(t){return 2*(Math.ceil(t/iq.chunkSize)+1+1)}static async load(t,e,r,i,n){{let o=await t.getMinimumBalanceForRentExemption(n.length),s=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==n.length&&(a=a||new ix).add(iz.allocate({accountPubkey:r.publicKey,space:n.length})),s.owner.equals(i)||(a=a||new ix).add(iz.assign({accountPubkey:r.publicKey,programId:i})),s.lamports<o&&(a=a||new ix).add(iz.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new ix().add(iz.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:n.length,programId:i}));null!==a&&await iM(t,a,[e,r],{commitment:"confirmed"})}let o=eK.struct([eK.u32("instruction"),eK.u32("offset"),eK.u32("bytesLength"),eK.u32("bytesLengthPadding"),eK.seq(eK.u8("byte"),eK.offset(eK.u32(),-8),"bytes")]),s=iq.chunkSize,a=0,u=n,c=[];for(;u.length>0;){let n=u.slice(0,s),f=l.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:n,bytesLength:0,bytesLengthPadding:0},f);let h=new ix().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:f});c.push(iM(t,h,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await iT(250),a+=s,u=u.slice(s)}await Promise.all(c);{let n=eK.struct([eK.u32("instruction")]),o=l.Buffer.alloc(n.span);n.encode({instruction:1},o);let s=new ix().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:iB,isSigner:!1,isWritable:!1}],programId:i,data:o}),a="processed",u=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:c,value:f}=await t.confirmTransaction({signature:u,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(f.err)throw Error(`Transaction ${u} failed (${JSON.stringify(f)})`);for(;;){try{if(await t.getSlot({commitment:a})>c.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}iq.chunkSize=932,new r7("BPFLoader2111111111111111111111111111111111");var iD=(s=function(){if(u)return a;u=1;var t=Object.prototype.toString,e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};return a=function(r){var i=function r(i,n){var o,s,a,u,l,c,f;if(!0===i)return"true";if(!1===i)return"false";switch(typeof i){case"object":if(null===i)return null;if(i.toJSON&&"function"==typeof i.toJSON)return r(i.toJSON(),n);if("[object Array]"===(f=t.call(i))){for(o=0,a="[",s=i.length-1;o<s;o++)a+=r(i[o],!0)+",";return s>-1&&(a+=r(i[o],!0)),a+"]"}if("[object Object]"!==f)return JSON.stringify(i);for(s=(u=e(i).sort()).length,a="",o=0;o<s;)void 0!==(c=r(i[l=u[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(l)+":"+c),o++;return"{"+a+"}";case"function":case"undefined":return n?null:void 0;case"string":return JSON.stringify(i);default:return isFinite(i)?i:null}}(r,!1);if(void 0!==i)return""+i}}())&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s;function iW(t){let e=0;for(;t>1;)t/=2,e++;return e}class iF{constructor(t,e,r,i,n){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=n}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){var e;let r=iW(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,(e|=e>>32)+1))-iW(32)-1,i=this.getSlotsInEpoch(r);return[r,t-(i-32)]}{let e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?(Math.pow(2,t)-1)*32:(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+iW(32)):this.slotsPerEpoch}}var ij=globalThis.fetch;class i$ extends rg{constructor(t,e,r){super(t=>{let r=new rd(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in r?this.underlyingSocket=r.socket:this.underlyingSocket=r,r},t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.call(...t):Promise.reject(Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.notify(...t):Promise.reject(Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}}class iK{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(iV,t),r=t.length-56;il(r>=0,"lookup table is invalid"),il(r%32==0,"lookup table is invalid");let{addresses:i}=eK.struct([eK.seq(io(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new r7(e.authority[0]):void 0,addresses:i.map(t=>new r7(t))}}}let iV={index:1,layout:eK.struct([eK.u32("typeIndex"),iL("deactivationSlot"),eK.nu64("lastExtendedSlot"),eK.u8("lastExtendedStartIndex"),eK.u8(),eK.seq(io(),eK.offset(eK.u8(),-1),"authority")])},iH=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,iZ=rc(e7(r7),ro(),t=>new r7(t)),iG=rs([ro(),rt("base64")]),iY=rc(e7(l.Buffer),iG,t=>l.Buffer.from(t[0],"base64"));function iJ(t){let e,r;if("string"==typeof t)e=t;else if(t){let{commitment:i,...n}=t;e=i,r=n}return{commitment:e,config:r}}function iX(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function iQ(t){return ru([ra({jsonrpc:rt("2.0"),id:ro(),result:t}),ra({jsonrpc:rt("2.0"),id:ro(),error:ra({code:rl(),message:ro(),data:ri(e5("any",()=>!0))})})])}let i0=iQ(rl());function i1(t){return rc(iQ(t),i0,e=>"error"in e?e:{...e,result:e8(e.result,t)})}function i2(t){return i1(ra({context:ra({slot:rr()}),value:t}))}function i6(t){return ra({context:ra({slot:rr()}),value:t})}function i8(t,e){return 0===t?new im({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new r7(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:ej.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new ig(e)}let i3=ra({foundation:rr(),foundationTerm:rr(),initial:rr(),taper:rr(),terminal:rr()}),i5=i1(e4(re(ra({epoch:rr(),effectiveSlot:rr(),amount:rr(),postBalance:rr(),commission:ri(re(rr()))})))),i4=e4(ra({slot:rr(),prioritizationFee:rr()})),i9=ra({total:rr(),validator:rr(),foundation:rr(),epoch:rr()}),i7=ra({epoch:rr(),slotIndex:rr(),slotsInEpoch:rr(),absoluteSlot:rr(),blockHeight:ri(rr()),transactionCount:ri(rr())}),nt=ra({slotsPerEpoch:rr(),leaderScheduleSlotOffset:rr(),warmup:e9(),firstNormalEpoch:rr(),firstNormalSlot:rr()}),ne=rn(ro(),e4(rr())),nr=re(ru([ra({}),ro()])),ni=ra({err:nr}),nn=rt("receivedSignature"),no=ra({"solana-core":ro(),"feature-set":ri(rr())}),ns=ra({program:ro(),programId:iZ,parsed:rl()}),na=ra({programId:iZ,accounts:e4(iZ),data:ro()}),nu=i2(ra({err:re(ru([ra({}),ro()])),logs:re(e4(ro())),accounts:ri(re(e4(re(ra({executable:e9(),owner:ro(),lamports:rr(),data:e4(ro()),rentEpoch:ri(rr())}))))),unitsConsumed:ri(rr()),returnData:ri(re(ra({programId:ro(),data:rs([ro(),rt("base64")])}))),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(ru([ns,na]))}))))})),nl=i2(ra({byIdentity:rn(ro(),e4(rr())),range:ra({firstSlot:rr(),lastSlot:rr()})})),nc=i1(i3),nf=i1(i9),nh=i1(i4),nd=i1(i7),np=i1(nt),ng=i1(ne),nm=i1(rr()),ny=i2(ra({total:rr(),circulating:rr(),nonCirculating:rr(),nonCirculatingAccounts:e4(iZ)})),nb=ra({amount:ro(),uiAmount:re(rr()),decimals:rr(),uiAmountString:ri(ro())}),nw=i2(e4(ra({address:iZ,amount:ro(),uiAmount:re(rr()),decimals:rr(),uiAmountString:ri(ro())}))),nv=i2(e4(ra({pubkey:iZ,account:ra({executable:e9(),owner:iZ,lamports:rr(),data:iY,rentEpoch:rr()})}))),nx=ra({program:ro(),parsed:rl(),space:rr()}),nS=i2(e4(ra({pubkey:iZ,account:ra({executable:e9(),owner:iZ,lamports:rr(),data:nx,rentEpoch:rr()})}))),nk=i2(e4(ra({lamports:rr(),address:iZ}))),nE=ra({executable:e9(),owner:iZ,lamports:rr(),data:iY,rentEpoch:rr()}),nB=ra({pubkey:iZ,account:nE}),nA=rc(ru([e7(l.Buffer),nx]),ru([iG,nx]),t=>Array.isArray(t)?e8(t,iY):t),nI=ra({executable:e9(),owner:iZ,lamports:rr(),data:nA,rentEpoch:rr()}),n_=ra({pubkey:iZ,account:nI}),nM=ra({state:ru([rt("active"),rt("inactive"),rt("activating"),rt("deactivating")]),active:rr(),inactive:rr()}),nT=i1(e4(ra({signature:ro(),slot:rr(),err:nr,memo:re(ro()),blockTime:ri(re(rr()))}))),nO=i1(e4(ra({signature:ro(),slot:rr(),err:nr,memo:re(ro()),blockTime:ri(re(rr()))}))),nC=ra({subscription:rr(),result:i6(nE)}),nR=ra({pubkey:iZ,account:nE}),nU=ra({subscription:rr(),result:i6(nR)}),nP=ra({parent:rr(),slot:rr(),root:rr()}),nL=ra({subscription:rr(),result:nP}),nN=ru([ra({type:ru([rt("firstShredReceived"),rt("completed"),rt("optimisticConfirmation"),rt("root")]),slot:rr(),timestamp:rr()}),ra({type:rt("createdBank"),parent:rr(),slot:rr(),timestamp:rr()}),ra({type:rt("frozen"),slot:rr(),timestamp:rr(),stats:ra({numTransactionEntries:rr(),numSuccessfulTransactions:rr(),numFailedTransactions:rr(),maxTransactionsPerEntry:rr()})}),ra({type:rt("dead"),slot:rr(),timestamp:rr(),err:ro()})]),nz=ra({subscription:rr(),result:nN}),nq=ra({subscription:rr(),result:i6(ru([ni,nn]))}),nD=ra({subscription:rr(),result:rr()}),nW=ra({pubkey:ro(),gossip:re(ro()),tpu:re(ro()),rpc:re(ro()),version:re(ro())}),nF=ra({votePubkey:ro(),nodePubkey:ro(),activatedStake:rr(),epochVoteAccount:e9(),epochCredits:e4(rs([rr(),rr(),rr()])),commission:rr(),lastVote:rr(),rootSlot:re(rr())}),nj=i1(ra({current:e4(nF),delinquent:e4(nF)})),n$=ru([rt("processed"),rt("confirmed"),rt("finalized")]),nK=ra({slot:rr(),confirmations:re(rr()),err:nr,confirmationStatus:ri(n$)}),nV=i2(e4(re(nK))),nH=i1(rr()),nZ=ra({accountKey:iZ,writableIndexes:e4(rr()),readonlyIndexes:e4(rr())}),nG=ra({signatures:e4(ro()),message:ra({accountKeys:e4(ro()),header:ra({numRequiredSignatures:rr(),numReadonlySignedAccounts:rr(),numReadonlyUnsignedAccounts:rr()}),instructions:e4(ra({accounts:e4(rr()),data:ro(),programIdIndex:rr()})),recentBlockhash:ro(),addressTableLookups:ri(e4(nZ))})}),nY=ra({pubkey:iZ,signer:e9(),writable:e9(),source:ri(ru([rt("transaction"),rt("lookupTable")]))}),nJ=ra({accountKeys:e4(nY),signatures:e4(ro())}),nX=ra({parsed:rl(),program:ro(),programId:iZ}),nQ=ra({accounts:e4(iZ),data:ro(),programId:iZ}),n0=rc(ru([nQ,nX]),ru([ra({parsed:rl(),program:ro(),programId:ro()}),ra({accounts:e4(ro()),data:ro(),programId:ro()})]),t=>"accounts"in t?e8(t,nQ):e8(t,nX)),n1=ra({signatures:e4(ro()),message:ra({accountKeys:e4(nY),instructions:e4(n0),recentBlockhash:ro(),addressTableLookups:ri(re(e4(nZ)))})}),n2=ra({accountIndex:rr(),mint:ro(),owner:ri(ro()),programId:ri(ro()),uiTokenAmount:nb}),n6=ra({writable:e4(iZ),readonly:e4(iZ)}),n8=ra({err:nr,fee:rr(),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(ra({accounts:e4(rr()),data:ro(),programIdIndex:rr()}))})))),preBalances:e4(rr()),postBalances:e4(rr()),logMessages:ri(re(e4(ro()))),preTokenBalances:ri(re(e4(n2))),postTokenBalances:ri(re(e4(n2))),loadedAddresses:ri(n6),computeUnitsConsumed:ri(rr()),costUnits:ri(rr())}),n3=ra({err:nr,fee:rr(),innerInstructions:ri(re(e4(ra({index:rr(),instructions:e4(n0)})))),preBalances:e4(rr()),postBalances:e4(rr()),logMessages:ri(re(e4(ro()))),preTokenBalances:ri(re(e4(n2))),postTokenBalances:ri(re(e4(n2))),loadedAddresses:ri(n6),computeUnitsConsumed:ri(rr()),costUnits:ri(rr())}),n5=ru([rt(0),rt("legacy")]),n4=ra({pubkey:ro(),lamports:rr(),postBalance:re(rr()),rewardType:re(ro()),commission:ri(re(rr()))}),n9=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nG,meta:re(n8),version:ri(n5)})),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),n7=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),ot=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nJ,meta:re(n8),version:ri(n5)})),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),oe=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:n1,meta:re(n3),version:ri(n5)})),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),or=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nJ,meta:re(n3),version:ri(n5)})),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),oi=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),rewards:ri(e4(n4)),blockTime:re(rr()),blockHeight:re(rr())}))),on=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),transactions:e4(ra({transaction:nG,meta:re(n8)})),rewards:ri(e4(n4)),blockTime:re(rr())}))),oo=i1(re(ra({blockhash:ro(),previousBlockhash:ro(),parentSlot:rr(),signatures:e4(ro()),blockTime:re(rr())}))),os=i1(re(ra({slot:rr(),meta:re(n8),blockTime:ri(re(rr())),transaction:nG,version:ri(n5)}))),oa=i1(re(ra({slot:rr(),transaction:n1,meta:re(n3),blockTime:ri(re(rr())),version:ri(n5)}))),ou=i2(ra({blockhash:ro(),lastValidBlockHeight:rr()})),ol=i2(e9()),oc=i1(e4(ra({slot:rr(),numTransactions:rr(),numSlots:rr(),samplePeriodSecs:rr()}))),of=i2(re(ra({feeCalculator:ra({lamportsPerSignature:rr()})}))),oh=i1(ro()),od=i1(ro()),op=ra({err:nr,logs:e4(ro()),signature:ro()}),og=ra({result:i6(op),subscription:rr()}),om={"solana-client":"js/1.0.0-maintenance"};class oy{constructor(t){this._keypair=void 0,this._keypair=t??r0()}static generate(){return new oy(r0())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=r1(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new oy({publicKey:r,secretKey:t})}static fromSeed(t){let e=r1(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new oy({publicKey:e,secretKey:r})}get publicKey(){return new r7(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:eK.struct([eK.u32("instruction"),iL("recentSlot"),eK.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:eK.struct([eK.u32("instruction")])},ExtendLookupTable:{index:2,layout:eK.struct([eK.u32("instruction"),iL(),eK.seq(io(),eK.offset(eK.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:eK.struct([eK.u32("instruction")])},CloseLookupTable:{index:4,layout:eK.struct([eK.u32("instruction")])}}),new r7("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:eK.struct([eK.u8("instruction"),eK.u32("units"),eK.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:eK.struct([eK.u8("instruction"),eK.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:eK.struct([eK.u8("instruction"),eK.u32("units")])},SetComputeUnitPrice:{index:3,layout:eK.struct([eK.u8("instruction"),iL("microLamports")])}}),new r7("ComputeBudget111111111111111111111111111111");let ob=eK.struct([eK.u8("numSignatures"),eK.u8("padding"),eK.u16("signatureOffset"),eK.u16("signatureInstructionIndex"),eK.u16("publicKeyOffset"),eK.u16("publicKeyInstructionIndex"),eK.u16("messageDataOffset"),eK.u16("messageDataSize"),eK.u16("messageInstructionIndex")]);class ow{static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,instructionIndex:n}=t;il(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),il(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);let o=ob.span,s=o+e.length,a=s+i.length,u=l.Buffer.alloc(a+r.length),c=null==n?65535:n;return ob.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:c,publicKeyOffset:o,publicKeyInstructionIndex:c,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:c},u),u.fill(e,o),u.fill(i,s),u.fill(r,a),new iv({keys:[],programId:ow.programId,data:u})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;il(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=oy.fromSecretKey(e),n=t.publicKey.toBytes(),o=r6(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:n,message:r,signature:o,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}ow.programId=new r7("Ed25519SigVerify111111111111111111111111111"),rJ.utils.isValidPrivateKey;let ov=rJ.getPublicKey,ox=eK.struct([eK.u8("numSignatures"),eK.u16("signatureOffset"),eK.u8("signatureInstructionIndex"),eK.u16("ethAddressOffset"),eK.u8("ethAddressInstructionIndex"),eK.u16("messageDataOffset"),eK.u16("messageDataSize"),eK.u8("messageInstructionIndex"),eK.blob(20,"ethAddress"),eK.blob(64,"signature"),eK.u8("recoveryId")]);class oS{static publicKeyToEthAddress(t){il(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return l.Buffer.from(rO(r3(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,recoveryId:n,instructionIndex:o}=t;return oS.createInstructionWithEthAddress({ethAddress:oS.publicKeyToEthAddress(e),message:r,signature:i,recoveryId:n,instructionIndex:o})}static createInstructionWithEthAddress(t){let e,{ethAddress:r,message:i,signature:n,recoveryId:o,instructionIndex:s=0}=t;il(20===(e="string"==typeof r?r.startsWith("0x")?l.Buffer.from(r.substr(2),"hex"):l.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let a=12+e.length,u=a+n.length+1,c=l.Buffer.alloc(ox.span+i.length);return ox.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:i.length,messageInstructionIndex:s,signature:r3(n),ethAddress:r3(e),recoveryId:o},c),c.fill(r3(i),ox.span),new iv({keys:[],programId:oS.programId,data:c})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;il(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{var n;let t,o=r3(e),s=ov(o,!1).slice(1),[a,u]=(n=l.Buffer.from(rO(r3(r))),[(t=rJ.sign(n,o)).toCompactRawBytes(),t.recovery]);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:u,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}oS.programId=new r7("KeccakSecp256k11111111111111111111111111111");let ok=new r7("StakeConfig11111111111111111111111111111111");class oE{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}oE.default=new oE(0,0,r7.default);let oB=Object.freeze({Initialize:{index:0,layout:eK.struct([eK.u32("instruction"),((t="authorized")=>eK.struct([io("staker"),io("withdrawer")],t))(),((t="lockup")=>eK.struct([eK.ns64("unixTimestamp"),eK.ns64("epoch"),io("custodian")],t))()])},Authorize:{index:1,layout:eK.struct([eK.u32("instruction"),io("newAuthorized"),eK.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:eK.struct([eK.u32("instruction")])},Split:{index:3,layout:eK.struct([eK.u32("instruction"),eK.ns64("lamports")])},Withdraw:{index:4,layout:eK.struct([eK.u32("instruction"),eK.ns64("lamports")])},Deactivate:{index:5,layout:eK.struct([eK.u32("instruction")])},Merge:{index:7,layout:eK.struct([eK.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:eK.struct([eK.u32("instruction"),io("newAuthorized"),eK.u32("stakeAuthorizationType"),is("authoritySeed"),io("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class oA{static initialize(t){let{stakePubkey:e,authorized:r,lockup:i}=t,n=i||oE.default,o=iO(oB.Initialize,{authorized:{staker:r3(r.staker.toBuffer()),withdrawer:r3(r.withdrawer.toBuffer())},lockup:{unixTimestamp:n.unixTimestamp,epoch:n.epoch,custodian:r3(n.custodian.toBuffer())}});return new iv({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iB,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new ix;e.add(iz.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:n}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:n}))}static createAccount(t){let e=new ix;e.add(iz.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:n}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:n}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:i}=t,n=iO(oB.Delegate);return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:ok,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,stakeAuthorizationType:n,custodianPubkey:o}=t,s=iO(oB.Authorize,{newAuthorized:r3(i.toBuffer()),stakeAuthorizationType:n.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new ix().add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:i,authorityOwner:n,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,u=iO(oB.AuthorizeWithSeed,{newAuthorized:r3(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:i,authorityOwner:r3(n.toBuffer())}),l=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:ik,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new ix().add({keys:l,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:i,lamports:n}=t,o=iO(oB.Split,{lamports:n});return new iv({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t,e){let r=new ix;return r.add(iz.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,basePubkey:o,seed:s,lamports:a}=t,u=new ix;return u.add(iz.allocate({accountPubkey:n,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&u.add(iz.transfer({fromPubkey:t.authorizedPubkey,toPubkey:n,lamports:e})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:n,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:i}=t,n=iO(oB.Merge);return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:i,lamports:n,custodianPubkey:o}=t,s=iO(oB.Withdraw,{lamports:n}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:iA,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new ix().add({keys:a,programId:this.programId,data:s})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,i=iO(oB.Deactivate);return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}oA.programId=new r7("Stake11111111111111111111111111111111111111"),oA.space=200;let oI=Object.freeze({InitializeAccount:{index:0,layout:eK.struct([eK.u32("instruction"),((t="voteInit")=>eK.struct([io("nodePubkey"),io("authorizedVoter"),io("authorizedWithdrawer"),eK.u8("commission")],t))()])},Authorize:{index:1,layout:eK.struct([eK.u32("instruction"),io("newAuthorized"),eK.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:eK.struct([eK.u32("instruction"),eK.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:eK.struct([eK.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:eK.struct([eK.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>eK.struct([eK.u32("voteAuthorizationType"),io("currentAuthorityDerivedKeyOwnerPubkey"),is("currentAuthorityDerivedKeySeed"),io("newAuthorized")],t))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class o_{static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:i}=t,n=iO(oI.InitializeAccount,{voteInit:{nodePubkey:r3(i.nodePubkey.toBuffer()),authorizedVoter:r3(i.authorizedVoter.toBuffer()),authorizedWithdrawer:r3(i.authorizedWithdrawer.toBuffer()),commission:i.commission}});return new iv({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:iB,isSigner:!1,isWritable:!1},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static createAccount(t){let e=new ix;return e.add(iz.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,voteAuthorizationType:n}=t,o=iO(oI.Authorize,{newAuthorized:r3(i.toBuffer()),voteAuthorizationType:n.index});return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:n,voteAuthorizationType:o,votePubkey:s}=t,a=iO(oI.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:r3(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:r3(n.toBuffer()),voteAuthorizationType:o.index}});return new ix().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:ik,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:n}=t,o=iO(oI.Withdraw,{lamports:i});return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return o_.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:i}=t,n=iO(oI.UpdateValidatorIdentity);return new ix().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}o_.programId=new r7("Vote111111111111111111111111111111111111111"),o_.space=3762,new r7("Va1idator1nfo111111111111111111111111111111"),ra({name:ro(),website:ri(ro()),details:ri(ro()),iconUrl:ri(ro()),keybaseUsername:ri(ro())}),new r7("Vote111111111111111111111111111111111111111"),eK.struct([io("nodePubkey"),io("authorizedWithdrawer"),eK.u8("commission"),eK.nu64(),eK.seq(eK.struct([eK.nu64("slot"),eK.u32("confirmationCount")]),eK.offset(eK.u32(),-8),"votes"),eK.u8("rootSlotValid"),eK.nu64("rootSlot"),eK.nu64(),eK.seq(eK.struct([eK.nu64("epoch"),io("authorizedVoter")]),eK.offset(eK.u32(),-8),"authorizedVoters"),eK.struct([eK.seq(eK.struct([io("authorizedPubkey"),eK.nu64("epochOfLastAuthorizedSwitch"),eK.nu64("targetEpoch")]),32,"buf"),eK.nu64("idx"),eK.u8("isEmpty")],"priorVoters"),eK.nu64(),eK.seq(eK.struct([eK.nu64("epoch"),eK.nu64("credits"),eK.nu64("prevCredits")]),eK.offset(eK.u32(),-8),"epochCredits"),eK.struct([eK.nu64("slot"),eK.nu64("timestamp")],"lastTimestamp")]),t.s(["Connection",0,class{constructor(t,e){let r,i,n,o,s,a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:i}=iJ(e),n=this._buildArgs([],r,void 0,i),o=iD(n);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",n),e=e8(t,i1(rr()));if("error"in e)throw new i_(e.error,"failed to get block height information");return e.result}finally{delete t[o]}})(),await t[o]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,i=e.httpHeaders,n=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit,a=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=r||function(t){let e=t.match(iH);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,i,n,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==n?null:parseInt(n.slice(1),10),u=null==a?"":`:${a+1}`;return`${s}//${i}${u}${o}`}(t),this._rpcClient=function(t,e,r,i,n,o){let s,a,u=r||ij;return null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),i&&(a=async(t,e)=>{let r=await new Promise((r,n)=>{try{i(t,e,(t,e)=>r([t,e]))}catch(t){n(t)}});return await u(...r)}),new rf.default(async(r,i)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},om)};try{let e,r=5,s=500;for(;(e=a?await a(t,o):await u(t,o),429===e.status&&!0!==n)&&(r-=1,0!==r);){;console.error(`Server responded with ${e.status} ${e.statusText}.  Retrying after ${s}ms delay...`),await iT(s),s*=2}let l=await e.text();e.ok?i(null,l):i(Error(`${e.status} ${e.statusText}: ${l}`))}catch(t){t instanceof Error&&i(t)}},{})}(t,i,n,o,s,a),this._rpcRequest=function(t){return(e,r)=>new Promise((i,n)=>{t.request(e,r,(t,e)=>{t?n(t):i(e)})})}(this._rpcClient),this._rpcBatchRequest=function(t){return e=>new Promise((r,i)=>{0===e.length&&r([]);let n=e.map(e=>t.request(e.methodName,e.args));t.request(n,(t,e)=>{t?i(t):r(e)})})}(this._rpcClient),this._rpcWebSocket=new i$(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgs([t.toBase58()],r,void 0,i),o=e8(await this._rpcRequest("getBalance",n),i2(rr()));if("error"in o)throw new i_(o.error,`failed to get balance for ${t.toBase58()}`);return o.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get balance of account "+t.toBase58()+": "+e)})}async getBlockTime(t){let e=e8(await this._rpcRequest("getBlockTime",[t]),i1(re(rr())));if("error"in e)throw new i_(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){let t=e8(await this._rpcRequest("minimumLedgerSlot",[]),i1(rr()));if("error"in t)throw new i_(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let t=e8(await this._rpcRequest("getFirstAvailableBlock",[]),nm);if("error"in t)throw new i_(t.error,"failed to get first available block");return t.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};let r=e8(await this._rpcRequest("getSupply",[e]),ny);if("error"in r)throw new i_(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenSupply",r),i2(nb));if("error"in i)throw new i_(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenAccountBalance",r),i2(nb));if("error"in i)throw new i_(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(t,e,r){let{commitment:i,config:n}=iJ(r),o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});let s=this._buildArgs(o,i,"base64",n),a=e8(await this._rpcRequest("getTokenAccountsByOwner",s),nv);if("error"in a)throw new i_(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(t,e,r){let i=[t.toBase58()];"mint"in e?i.push({mint:e.mint.toBase58()}):i.push({programId:e.programId.toBase58()});let n=this._buildArgs(i,r,"jsonParsed"),o=e8(await this._rpcRequest("getTokenAccountsByOwner",n),nS);if("error"in o)throw new i_(o.error,`failed to get token accounts owned by account ${t.toBase58()}`);return o.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],i=e8(await this._rpcRequest("getLargestAccounts",r),nk);if("error"in i)throw new i_(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),i=e8(await this._rpcRequest("getTokenLargestAccounts",r),nw);if("error"in i)throw new i_(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgs([t.toBase58()],r,"base64",i),o=e8(await this._rpcRequest("getAccountInfo",n),i2(re(nE)));if("error"in o)throw new i_(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e8(await this._rpcRequest("getAccountInfo",n),i2(re(nI)));if("error"in o)throw new i_(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:i}=iJ(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"jsonParsed",i),s=e8(await this._rpcRequest("getMultipleAccounts",o),i2(e4(re(nI))));if("error"in s)throw new i_(s.error,`failed to get info for accounts ${n}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:i}=iJ(e),n=t.map(t=>t.toBase58()),o=this._buildArgs([n],r,"base64",i),s=e8(await this._rpcRequest("getMultipleAccounts",o),i2(e4(re(nE))));if("error"in s)throw new i_(s.error,`failed to get info for accounts ${n}`);return s.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:i,config:n}=iJ(e),o=this._buildArgs([t.toBase58()],i,void 0,{...n,epoch:null!=r?r:n?.epoch}),s=e8(await this._rpcRequest("getStakeActivation",o),i1(nM));if("error"in s)throw new i_(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){let{commitment:r,config:i}=iJ(e),{encoding:n,...o}=i||{},s=this._buildArgs([t.toBase58()],r,n||"base64",{...o,...o.filters?{filters:iX(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),u=e4(nB),l=!0===o.withContext?e8(a,i2(u)):e8(a,i1(u));if("error"in l)throw new i_(l.error,`failed to get accounts owned by program ${t.toBase58()}`);return l.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgs([t.toBase58()],r,"jsonParsed",i),o=e8(await this._rpcRequest("getProgramAccounts",n),i1(e4(n_)));if("error"in o)throw new i_(o.error,`failed to get accounts owned by program ${t.toBase58()}`);return o.result}async confirmTransaction(t,e){let r,i;if("string"==typeof t)r=t;else{if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{i=ej.default.decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(il(64===i.length,"signature has invalid length"),"string"==typeof t)?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,i,n=!1;return{abortConfirmation:()=>{i&&(i(),i=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise((o,s)=>{try{r=this.onSignature(e,(t,e)=>{r=void 0,o({__type:ib.PROCESSED,response:{context:e,value:t}})},t);let a=new Promise(t=>{null==r?t():i=this._onSubscriptionStateChange(r,e=>{"subscribed"===e&&t()})});(async()=>{if(await a,n)return;let r=await this.getSignatureStatus(e);if(n||null==r)return;let{context:i,value:u}=r;if(null!=u)if(u?.err)s(u.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===u.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===u.confirmationStatus||"confirmed"===u.confirmationStatus)return}n=!0,o({__type:ib.PROCESSED,response:{context:i,value:u}})}})()}catch(t){s(t)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:i}}){let n,o=!1,s=new Promise(e=>{let i=async()=>{try{return await this.getBlockHeight(t)}catch(t){return -1}};(async()=>{let t=await i();if(!o){for(;t<=r;)if(await iT(1e3),o||(t=await i(),o))return;e({__type:ib.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),l=this.getCancellationPromise(e);try{let t=await Promise.race([l,u,s]);if(t.__type===ib.PROCESSED)n=t.response;else throw new it(i)}finally{o=!0,a()}return n}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:i,nonceValue:n,signature:o}}){let s,a=!1,u=new Promise(e=>{let o=n,s=null,u=async()=>{try{let{context:e,value:n}=await this.getNonceAndContext(i,{commitment:t,minContextSlot:r});return s=e.slot,n?.nonce}catch(t){return o}};(async()=>{if(o=await u(),!a)for(;;){if(n!==o)return void e({__type:ib.NONCE_INVALID,slotInWhichNonceDidAdvance:s});if(await iT(2e3),a||(o=await u(),a))return}})()}),{abortConfirmation:l,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),f=this.getCancellationPromise(e);try{let e=await Promise.race([f,c,u]);if(e.__type===ib.PROCESSED)s=e.response;else{let i;for(;;){let t=await this.getSignatureStatus(o);if(null==t)break;if(t.context.slot<(e.slotInWhichNonceDidAdvance??r)){await iT(400);continue}i=t;break}if(i?.value){let e=t||"finalized",{confirmationStatus:r}=i.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new ir(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new ir(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new ir(o)}s={context:i.context,value:{err:i.value.err}}}else throw new ir(o)}}finally{a=!0,l()}return s}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,i,n=new Promise(e=>{let i=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":i=this._confirmTransactionInitialTimeout||3e4}r=setTimeout(()=>e({__type:ib.TIMED_OUT,timeoutMs:i}),i)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:t,signature:e});try{let t=await Promise.race([s,n]);if(t.__type===ib.PROCESSED)i=t.response;else throw new ie(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return i}async getClusterNodes(){let t=e8(await this._rpcRequest("getClusterNodes",[]),i1(e4(nW)));if("error"in t)throw new i_(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=e8(await this._rpcRequest("getVoteAccounts",e),nj);if("error"in r)throw new i_(r.error,"failed to get vote accounts");return r.result}async getSlot(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getSlot",i),i1(rr()));if("error"in n)throw new i_(n.error,"failed to get slot");return n.result}async getSlotLeader(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getSlotLeader",i),i1(ro()));if("error"in n)throw new i_(n.error,"failed to get slot leader");return n.result}async getSlotLeaders(t,e){let r=e8(await this._rpcRequest("getSlotLeaders",[t,e]),i1(e4(iZ)));if("error"in r)throw new i_(r.error,"failed to get slot leaders");return r.result}async getSignatureStatus(t,e){let{context:r,value:i}=await this.getSignatureStatuses([t],e);return il(1===i.length),{context:r,value:i[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let i=e8(await this._rpcRequest("getSignatureStatuses",r),nV);if("error"in i)throw new i_(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getTransactionCount",i),i1(rr()));if("error"in n)throw new i_(n.error,"failed to get transaction count");return n.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=e8(await this._rpcRequest("getInflationGovernor",e),nc);if("error"in r)throw new i_(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){let{commitment:i,config:n}=iJ(r),o=this._buildArgs([t.map(t=>t.toBase58())],i,void 0,{...n,epoch:null!=e?e:n?.epoch}),s=e8(await this._rpcRequest("getInflationReward",o),i5);if("error"in s)throw new i_(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){let t=e8(await this._rpcRequest("getInflationRate",[]),nf);if("error"in t)throw new i_(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getEpochInfo",i),nd);if("error"in n)throw new i_(n.error,"failed to get epoch info");return n.result}async getEpochSchedule(){let t=e8(await this._rpcRequest("getEpochSchedule",[]),np);if("error"in t)throw new i_(t.error,"failed to get epoch schedule");let e=t.result;return new iF(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){let t=e8(await this._rpcRequest("getLeaderSchedule",[]),ng);if("error"in t)throw new i_(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),i=e8(await this._rpcRequest("getMinimumBalanceForRentExemption",r),nH);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(t){let{context:e,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(t);return{context:e,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(t){let e=e8(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),oc);if("error"in e)throw new i_(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),i=e8(await this._rpcRequest("getFeeCalculatorForBlockhash",r),of);if("error"in i)throw new i_(i.error,"failed to get fee calculator");let{context:n,value:o}=i.result;return{context:n,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(t,e){let r=r3(t.serialize()).toString("base64"),i=this._buildArgs([r],e),n=e8(await this._rpcRequest("getFeeForMessage",i),i2(re(rr())));if("error"in n)throw new i_(n.error,"failed to get fee for message");if(null===n.result)throw Error("invalid blockhash");return n.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(t=>t.toBase58()),r=e?.length?[e]:[],i=e8(await this._rpcRequest("getRecentPrioritizationFees",r),nh);if("error"in i)throw new i_(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,void 0,r),n=e8(await this._rpcRequest("getLatestBlockhash",i),ou);if("error"in n)throw new i_(n.error,"failed to get latest blockhash");return n.result}async isBlockhashValid(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgs([t],r,void 0,i),o=e8(await this._rpcRequest("isBlockhashValid",n),ol);if("error"in o)throw new i_(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){let t=e8(await this._rpcRequest("getVersion",[]),i1(no));if("error"in t)throw new i_(t.error,"failed to get version");return t.result}async getGenesisHash(){let t=e8(await this._rpcRequest("getGenesisHash",[]),i1(ro()));if("error"in t)throw new i_(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e8(o,ot);if("error"in t)throw t.error;return t.result}case"none":{let t=e8(o,n7);if("error"in t)throw t.error;return t.result}default:{let t=e8(o,n9);if("error"in t)throw t.error;let{result:e}=t;return e?{...e,transactions:e.transactions.map(({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:i8(r,t.message)},version:r}))}:null}}}catch(t){throw new i_(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",n);try{switch(i?.transactionDetails){case"accounts":{let t=e8(o,or);if("error"in t)throw t.error;return t.result}case"none":{let t=e8(o,oi);if("error"in t)throw t.error;return t.result}default:{let t=e8(o,oe);if("error"in t)throw t.error;return t.result}}}catch(t){throw new i_(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){let{commitment:i,...n}=t;r=i,e=n}let i=this._buildArgs([],r,"base64",e),n=e8(await this._rpcRequest("getBlockProduction",i),nl);if("error"in n)throw new i_(n.error,"failed to get block production information");return n.result}async getTransaction(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgsAtLeastConfirmed([t],r,void 0,i),o=e8(await this._rpcRequest("getTransaction",n),os);if("error"in o)throw new i_(o.error,"failed to get transaction");let s=o.result;return s?{...s,transaction:{...s.transaction,message:i8(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){let{commitment:r,config:i}=iJ(e),n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),o=e8(await this._rpcRequest("getTransaction",n),oa);if("error"in o)throw new i_(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){let{commitment:r,config:i}=iJ(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e8(t,oa);if("error"in e)throw new i_(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:i}=iJ(e),n=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,i)}));return(await this._rpcBatchRequest(n)).map(t=>{let e=e8(t,os);if("error"in e)throw new i_(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:i8(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=e8(await this._rpcRequest("getBlock",r),on);if("error"in i)throw new i_(i.error,"failed to get confirmed block");let n=i.result;if(!n)throw Error("Confirmed block "+t+" not found");let o={...n,transactions:n.transactions.map(({transaction:t,meta:e})=>{let r=new ig(t.message);return{meta:e,transaction:{...t,message:r}}})};return{...o,transactions:o.transactions.map(({transaction:t,meta:e})=>({meta:e,transaction:ix.populate(t.message,t.signatures)}))}}async getBlocks(t,e,r){let i=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),n=e8(await this._rpcRequest("getBlocks",i),i1(e4(rr())));if("error"in n)throw new i_(n.error,"failed to get blocks");return n.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=e8(await this._rpcRequest("getBlock",r),oo);if("error"in i)throw new i_(i.error,"failed to get block");let n=i.result;if(!n)throw Error("Block "+t+" not found");return n}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=e8(await this._rpcRequest("getBlock",r),oo);if("error"in i)throw new i_(i.error,"failed to get confirmed block");let n=i.result;if(!n)throw Error("Confirmed block "+t+" not found");return n}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=e8(await this._rpcRequest("getTransaction",r),os);if("error"in i)throw new i_(i.error,"failed to get transaction");let n=i.result;if(!n)return n;let o=new ig(n.transaction.message),s=n.transaction.signatures;return{...n,transaction:ix.populate(o,s)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),i=e8(await this._rpcRequest("getTransaction",r),oa);if("error"in i)throw new i_(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(t,e){let r=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(t=>{let e=e8(t,oa);if("error"in e)throw new i_(e.error,"failed to get confirmed transactions");return e.result})}async getConfirmedSignaturesForAddress(t,e,r){let i={},n=await this.getFirstAvailableBlock();for(;!("until"in i)&&!(--e<=0)&&!(e<n);)try{let t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(i.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}let o=await this.getSlot("finalized");for(;!("before"in i)&&!(++r>o);)try{let t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(i.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,i)).map(t=>t.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),n=e8(await this._rpcRequest("getConfirmedSignaturesForAddress2",i),nT);if("error"in n)throw new i_(n.error,"failed to get confirmed signatures for address");return n.result}async getSignaturesForAddress(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),n=e8(await this._rpcRequest("getSignaturesForAddress",i),nO);if("error"in n)throw new i_(n.error,"failed to get signatures for address");return n.result}async getAddressLookupTable(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),n=null;return null!==i&&(n=new iK({key:t,state:iK.deserialize(i.data)})),{context:r,value:n}}async getNonceAndContext(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),n=null;return null!==i&&(n=iP.fromAccountData(i.data)),{context:r,value:n}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get nonce for account "+t.toBase58()+": "+e)})}async requestAirdrop(t,e){let r=e8(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),oh);if("error"in r)throw new i_(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await iT(100);let t=Date.now()-this._blockhashInfo.lastFetch;if(null!==this._blockhashInfo.latestBlockhash&&!(t>=3e4))return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){let t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await iT(200)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=iJ(t),i=this._buildArgs([],e,"base64",r),n=e8(await this._rpcRequest("getStakeMinimumDelegation",i),i2(rr()));if("error"in n)throw new i_(n.error,"failed to get stake minimum delegation");return n.result}async simulateTransaction(t,e,r){let i;if("message"in t){let i=t.serialize(),n=l.Buffer.from(i).toString("base64");if(Array.isArray(e)||void 0!==r)throw Error("Invalid arguments");let o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment),e&&"object"==typeof e&&"innerInstructions"in e&&(o.innerInstructions=e.innerInstructions);let s=[n,o],a=e8(await this._rpcRequest("simulateTransaction",s),nu);if("error"in a)throw Error("failed to simulate transaction: "+a.error.message);return a.result}if(t instanceof ix?((i=new ix).feePayer=t.feePayer,i.instructions=t.instructions,i.nonceInfo=t.nonceInfo,i.signatures=t.signatures):(i=ix.populate(t))._message=i._json=void 0,void 0!==e&&!Array.isArray(e))throw Error("Invalid arguments");if(i.nonceInfo&&e)i.sign(...e);else{let t=this._disableBlockhashCaching;for(;;){let r=await this._blockhashWithExpiryBlockHeight(t);if(i.lastValidBlockHeight=r.lastValidBlockHeight,i.recentBlockhash=r.blockhash,!e)break;if(i.sign(...e),!i.signature)throw Error("!signature");let n=i.signature.toString("base64");if(this._blockhashInfo.simulatedSignatures.includes(n)||this._blockhashInfo.transactionSignatures.includes(n))t=!0;else{this._blockhashInfo.simulatedSignatures.push(n);break}}}let n=i._compile(),o=n.serialize(),s=i._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};r&&(a.accounts={encoding:"base64",addresses:(Array.isArray(r)?r:n.nonProgramIds()).map(t=>t.toBase58())}),e&&(a.sigVerify=!0),e&&"object"==typeof e&&"innerInstructions"in e&&(a.innerInstructions=e.innerInstructions);let u=[s,a],c=e8(await this._rpcRequest("simulateTransaction",u),nu);if("error"in c){let t;if("data"in c.error&&(t=c.error.data.logs)&&Array.isArray(t)){let e="\n    ",r=e+t.join(e);console.error(c.error.message,r)}throw new iI({action:"simulate",signature:"",transactionMessage:c.error.message,logs:t})}return c.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw Error("Invalid arguments");let r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw Error("Invalid arguments");if(t.nonceInfo)t.sign(...e);else{let r=this._disableBlockhashCaching;for(;;){let i=await this._blockhashWithExpiryBlockHeight(r);if(t.lastValidBlockHeight=i.lastValidBlockHeight,t.recentBlockhash=i.blockhash,t.sign(...e),!t.signature)throw Error("!signature");let n=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(n))r=!0;else{this._blockhashInfo.transactionSignatures.push(n);break}}}let i=t.serialize();return await this.sendRawTransaction(i,r)}async sendRawTransaction(t,e){let r=r3(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},i=e&&e.skipPreflight,n=!0===i?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),i&&(r.skipPreflight=i),n&&(r.preflightCommitment=n);let o=[t,r],s=e8(await this._rpcRequest("sendTransaction",o),od);if("error"in s){let t;throw"data"in s.error&&(t=s.error.data.logs),new iI({action:i?"send":"simulate",signature:"",transactionMessage:s.error.message,logs:t})}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3===t)?this._updateSubscriptions():(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,e])=>{this._setSubscription(t,{...e,state:"pending"})}))}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach(t=>{try{t(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(null==r)return()=>{};let i=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return i.add(e),()=>{i.delete(e),0===i.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}},500));return}if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async t=>{let r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size){delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],await this._updateSubscriptions();return}await (async()=>{let{args:i,method:n}=r;try{this._setSubscription(t,{...r,state:"subscribing"});let e=await this._rpcWebSocket.call(n,i);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(console.error(`Received ${o instanceof Error?"":"JSON-RPC "}error calling \`${n}\``,{args:i,error:o}),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await (async()=>{let{serverSubscriptionId:i,unsubscribeMethod:n}=r;if(this._subscriptionsAutoDisposedByRpc.has(i))this._subscriptionsAutoDisposedByRpc.delete(i);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(n,[i])}catch(i){if(i instanceof Error&&console.error(`${n} error:`,i.message),!e())return;this._setSubscription(t,{...r,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach(t=>{try{t(...e)}catch(t){console.error(t)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=e8(t,nC);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,i=iD([t.method,e]),n=this._subscriptionsByHash[i];return void 0===n?this._subscriptionsByHash[i]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:n.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let e=this._subscriptionsByHash[i];il(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:i,config:n}=iJ(r),o=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",n);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=e8(t,nU);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,i){let{commitment:n,config:o}=iJ(r),s=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",o||(i?{filters:iX(i)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let i=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=e8(t,og);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=e8(t,nL);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=e8(t,nz);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,i){let n=e||this._commitment;if(n||r||i){let e={};r&&(e.encoding=r),n&&(e.commitment=n),i&&(e=Object.assign(e,i)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,i){let n=e||this._commitment;if(n&&!["confirmed","finalized"].includes(n))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,i)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=e8(t,nq);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let i=this._buildArgs([t],r||this._commitment||"finalized"),n=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(n)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return n}
7onSignatureWithOptions(t,e,r){let{commitment:i,...n}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],i,void 0,n),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=e8(t,nD);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}},"Keypair",0,oy,"PublicKey",0,r7,"Transaction",0,ix,"VersionedMessage",0,iy,"VersionedTransaction",0,iS],250564)},777247,t=>{"use strict";t.i(250564),t.s([])},344048,t=>{"use strict";let e=function(t){if(t.length>=255)throw TypeError("Alphabet too long");let e=new Uint8Array(256);for(let t=0;t<e.length;t++)e[t]=255;for(let r=0;r<t.length;r++){let i=t.charAt(r),n=i.charCodeAt(0);if(255!==e[n])throw TypeError(i+" is ambiguous");e[n]=r}let r=t.length,i=t.charAt(0),n=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return new Uint8Array;let o=0,s=0,a=0;for(;t[o]===i;)s++,o++;let u=(t.length-o)*n+1>>>0,l=new Uint8Array(u);for(;o<t.length;){let i=t.charCodeAt(o);if(i>255)return;let n=e[i];if(255===n)return;let s=0;for(let t=u-1;(0!==n||s<a)&&-1!==t;t--,s++)n+=r*l[t]>>>0,l[t]=n%256>>>0,n=n/256>>>0;if(0!==n)throw Error("Non-zero carry");a=s,o++}let c=u-a;for(;c!==u&&0===l[c];)c++;let f=new Uint8Array(s+(u-c)),h=s;for(;c!==u;)f[h++]=l[c++];return f}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";let n=0,s=0,a=0,u=e.length;for(;a!==u&&0===e[a];)a++,n++;let l=(u-a)*o+1>>>0,c=new Uint8Array(l);for(;a!==u;){let t=e[a],i=0;for(let e=l-1;(0!==t||i<s)&&-1!==e;e--,i++)t+=256*c[e]>>>0,c[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw Error("Non-zero carry");s=i,a++}let f=l-s;for(;f!==l&&0===c[f];)f++;let h=i.repeat(n);for(;f<l;++f)h+=t.charAt(c[f]);return h},decodeUnsafe:s,decode:function(t){let e=s(t);if(e)return e;throw Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");t.s(["default",0,e],344048)},195157,669802,511518,487122,516467,598279,492421,954259,119470,t=>{"use strict";var e=t.i(722978),r=t.i(617058),i=t.i(775354);t.i(410145),t.i(345393);var n=t.i(134645);t.i(777247);var o=t.i(250564),s=t.i(344048);let{decode:a,encode:u}="default"in s.default?s.default.default:s.default;t.s(["decode",0,a,"encode",0,u],669802);let l=Symbol.for("constructDateFrom");function c(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&l in t?t[l](e):t instanceof Date?new t.constructor(e):new Date(e)}function f(t,e){return c(e||t,t)}function h(t,e,r){let i=f(t,r?.in);return isNaN(e)?c(r?.in||t,NaN):(e&&i.setDate(i.getDate()+e),i)}t.s(["constructFromSymbol",0,l,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200,"minutesInYear",0,525600],511518),t.s(["constructFrom",0,c],487122),t.s(["toDate",0,f],516467),t.s(["addDays",0,h],598279);let d={};function p(){return d}function g(t,e){let r=p(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,n=f(t,e?.in),o=n.getDay();return n.setDate(n.getDate()-(7*(o<i)+o-i)),n.setHours(0,0,0,0),n}async function m(){try{let t=await fetch("/api/user/balance/vault",{next:{tags:["vault-balance"],revalidate:600}}),e=await t.json();if(200!==t.status)throw Error("Failed to fetch vault balance");let r=e.balance,n=i.initialVirtualCurrencies;return{balance:r,virtualCurrencies:n}}catch(t){throw console.error(t),t}}t.s(["getDefaultOptions",0,p],492421),t.s(["startOfWeek",0,g],954259),t.s(["subDays",0,function(t,e,r){return h(t,-e,r)}],119470),new o.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),t.s(["MAX_STALE_TIME",0,15e3,"UTC_TO_NOON_EST_HOURS_DIFF",0,17,"cn",0,function(...t){return(0,r.twMerge)((0,e.clsx)(t))},"debounce",0,(t,e)=>{let r;return(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...i),e)}},"decodeTransaction",0,t=>o.Transaction.from(a(t)),"decodeVersionedTransaction",0,t=>o.VersionedTransaction.deserialize(a(t)),"encodeTransaction",0,t=>u(new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!0}))),"encodeVersionedTransaction",0,t=>u(new Uint8Array(t.serialize())),"getCostPerItem",0,(t,e)=>{let{StackedDiscountValues:r}=e,i=Object.keys(r).map(Number).sort((t,e)=>t-e);return i.reduce((e,i)=>t>=i?r[i]:e,r[i[0]])},"getNFTAttributeValueFromMetadata",0,(t,e)=>{if(!t||!t.attributes)return;let r=t.attributes.find(t=>
7"traitType"in t&&t.traitType?t.traitType===e:"trait_type"in t&&!!t.trait_type&&t.trait_type===e);return r?.value},"getNextMondayAtMidnightEST",0,function(){return new Date(h(g(new n.TZDate(new Date,"America/New_York"),{weekStartsOn:1}),7))},"getTomorrowAtNoonEST",0,()=>{let t=h(new Date,1);return t.setUTCHours(17,0,0,0),t},"getVaultBalance",0,m,"getWalletSigningGuidance",0,function(t){let{browserLabel:e,isWalletAppBrowser:r}=function(t){let e={browserLabel:"a regular mobile browser",isWalletAppBrowser:!1};if(!t)return e;let r=t.toLowerCase();return r.includes("phantom")?{browserLabel:"the Phantom app browser",isWalletAppBrowser:!0}:r.includes("solflare")?{browserLabel:"the Solflare app browser",isWalletAppBrowser:!0}:r.includes("coinbasewallet")||r.includes("cbwallet")||r.includes("base/")?{browserLabel:"the Base app browser",isWalletAppBrowser:!0}:r.includes("metamask")?{browserLabel:"the MetaMask app browser",isWalletAppBrowser:!0}:r.includes("crios")||r.includes("chrome")?{browserLabel:"Chrome",isWalletAppBrowser:!1}:r.includes("fxios")||r.includes("firefox")?{browserLabel:"Firefox",isWalletAppBrowser:!1}:r.includes("edgios")||r.includes("edga")||r.includes("edg/")?{browserLabel:"Edge",isWalletAppBrowser:!1}:r.includes("opr/")||r.includes("opios")||r.includes("opera")?{browserLabel:"Opera",isWalletAppBrowser:!1}:r.includes("brave")?{browserLabel:"Brave",isWalletAppBrowser:!1}:!r.includes("safari")||r.includes("chrome")||r.includes("crios")?e:{browserLabel:"Safari",isWalletAppBrowser:!1}}(t);return{title:"Can't Sign Transaction",intro:`It looks like you're using ${e}.`,detail:"This action needs a wallet-connected browser to sign the transaction.",instruction:"Open PixelByPixel inside the Phantom, Solflare, Base (formerly Coinbase Wallet), MetaMask, or another web3 wallet app browser instead, then reconnect your wallet and try again.",fallback:"If you're already in a wallet app browser, make sure the connected wallet matches the wallet on your account."}},"isItemUnavailableForPurchase",0,function(t,e){if(e){let r=Number(e[t.ItemId]?.count)||0;return!!t.IsStackable&&!!t.CustomData.MaxStacks&&r>=t.CustomData.MaxStacks}return!0},"isValidUrl",0,t=>{try{return new URL(t),!0}catch{return!1}},"truncateAddress",0,function(t){return t?t.slice(0,4)+"..."+t.slice(-4):""},"truncateString",0,function(t,e){return!t||t.length<=e?t:t.slice(0,e)+"..."}],195157)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.