import{aI as Me,aY as Fe,aN as xe}from"./index-DirqwtNG.js";var Be={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Gt=function(t,r){return Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var f in i)i.hasOwnProperty(f)&&(n[f]=i[f])},Gt(t,r)};function Re(t,r){Gt(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var $t=function(){return $t=Object.assign||function(r){for(var n,i=1,f=arguments.length;i<f;i++){n=arguments[i];for(var h in n)Object.prototype.hasOwnProperty.call(n,h)&&(r[h]=n[h])}return r},$t.apply(this,arguments)};function Pe(t,r){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,i=Object.getOwnPropertySymbols(t);f<i.length;f++)r.indexOf(i[f])<0&&Object.prototype.propertyIsEnumerable.call(t,i[f])&&(n[i[f]]=t[i[f]]);return n}function Ie(t,r,n,i){var f=arguments.length,h=f<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,n):i,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(t,r,n,i);else for(var u=t.length-1;u>=0;u--)(v=t[u])&&(h=(f<3?v(h):f>3?v(r,n,h):v(r,n))||h);return f>3&&h&&Object.defineProperty(r,n,h),h}function je(t,r){return function(n,i){r(n,i,t)}}function He(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)}function Ke(t,r,n,i){function f(h){return h instanceof n?h:new n(function(v){v(h)})}return new(n||(n=Promise))(function(h,v){function u(_){try{s(i.next(_))}catch(w){v(w)}}function o(_){try{s(i.throw(_))}catch(w){v(w)}}function s(_){_.done?h(_.value):f(_.value).then(u,o)}s((i=i.apply(t,r||[])).next())})}function ze(t,r){var n={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},i,f,h,v;return v={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function u(s){return function(_){return o([s,_])}}function o(s){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,f&&(h=s[0]&2?f.return:s[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,s[1])).done)return h;switch(f=0,h&&(s=[s[0]&2,h.value]),s[0]){case 0:case 1:h=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,f=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(h=n.trys,!(h=h.length>0&&h[h.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!h||s[1]>h[0]&&s[1]<h[3])){n.label=s[1];break}if(s[0]===6&&n.label<h[1]){n.label=h[1],h=s;break}if(h&&n.label<h[2]){n.label=h[2],n.ops.push(s);break}h[2]&&n.ops.pop(),n.trys.pop();continue}s=r.call(t,n)}catch(_){s=[6,_],f=0}finally{i=h=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Ye(t,r,n,i){i===void 0&&(i=n),t[i]=r[n]}function We(t,r){for(var n in t)n!=="default"&&!r.hasOwnProperty(n)&&(r[n]=t[n])}function Vt(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),f,h=[],v;try{for(;(r===void 0||r-- >0)&&!(f=i.next()).done;)h.push(f.value)}catch(u){v={error:u}}finally{try{f&&!f.done&&(n=i.return)&&n.call(i)}finally{if(v)throw v.error}}return h}function qe(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(de(arguments[r]));return t}function Ge(){for(var t=0,r=0,n=arguments.length;r<n;r++)t+=arguments[r].length;for(var i=Array(t),f=0,r=0;r<n;r++)for(var h=arguments[r],v=0,u=h.length;v<u;v++,f++)i[f]=h[v];return i}function Tt(t){return this instanceof Tt?(this.v=t,this):new Tt(t)}function $e(t,r,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,r||[]),f,h=[];return f={},v("next"),v("throw"),v("return"),f[Symbol.asyncIterator]=function(){return this},f;function v(E){i[E]&&(f[E]=function(c){return new Promise(function(b,p){h.push([E,c,b,p])>1||u(E,c)})})}function u(E,c){try{o(i[E](c))}catch(b){w(h[0][3],b)}}function o(E){E.value instanceof Tt?Promise.resolve(E.value.v).then(s,_):w(h[0][2],E)}function s(E){u("next",E)}function _(E){u("throw",E)}function w(E,c){E(c),h.shift(),h.length&&u(h[0][0],h[0][1])}}function Ve(t){var r,n;return r={},i("next"),i("throw",function(f){throw f}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(f,h){r[f]=t[f]?function(v){return(n=!n)?{value:Tt(t[f](v)),done:f==="return"}:h?h(v):v}:h}}function Xe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],n;return r?r.call(t):(t=typeof Vt=="function"?Vt(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(h){n[h]=t[h]&&function(v){return new Promise(function(u,o){v=t[h](v),f(u,o,v.done,v.value)})}}function f(h,v,u,o){Promise.resolve(o).then(function(s){h({value:s,done:u})},v)}}function Je(t,r){return Object.defineProperty?Object.defineProperty(t,"raw",{value:r}):t.raw=r,t}function Ze(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r.default=t,r}function Qe(t){return t&&t.__esModule?t:{default:t}}function ke(t,r){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return r.get(t)}function tr(t,r,n){if(!r.has(t))throw new TypeError("attempted to set private field on non-instance");return r.set(t,n),n}const er=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return $t},__asyncDelegator:Ve,__asyncGenerator:$e,__asyncValues:Xe,__await:Tt,__awaiter:Ke,__classPrivateFieldGet:ke,__classPrivateFieldSet:tr,__createBinding:Ye,__decorate:Ie,__exportStar:We,__extends:Re,__generator:ze,__importDefault:Qe,__importStar:Ze,__makeTemplateObject:Je,__metadata:He,__param:je,__read:de,__rest:Pe,__spread:qe,__spreadArrays:Ge,__values:Vt},Symbol.toStringTag,{value:"Module"})),Bt=Me(er);var zt={},Ut={},ne;function rr(){if(ne)return Ut;ne=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.delay=void 0;function t(r){return new Promise(n=>{setTimeout(()=>{n(!0)},r)})}return Ut.delay=t,Ut}var gt={},Yt={},yt={},ie;function nr(){return ie||(ie=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.ONE_THOUSAND=yt.ONE_HUNDRED=void 0,yt.ONE_HUNDRED=100,yt.ONE_THOUSAND=1e3),yt}var Wt={},ae;function ir(){return ae||(ae=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Wt)),Wt}var ue;function be(){return ue||(ue=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const r=Bt;r.__exportStar(nr(),t),r.__exportStar(ir(),t)}(Yt)),Yt}var oe;function ar(){if(oe)return gt;oe=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.fromMiliseconds=gt.toMiliseconds=void 0;const t=be();function r(i){return i*t.ONE_THOUSAND}gt.toMiliseconds=r;function n(i){return Math.floor(i/t.ONE_THOUSAND)}return gt.fromMiliseconds=n,gt}var he;function ur(){return he||(he=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const r=Bt;r.__exportStar(rr(),t),r.__exportStar(ar(),t)}(zt)),zt}var mt={},fe;function or(){if(fe)return mt;fe=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const i=this.get(n);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const f=Date.now()-i.started;this.timestamps.set(n,{started:i.started,elapsed:f})}get(n){const i=this.timestamps.get(n);if(typeof i>"u")throw new Error(`No timestamp found for label: ${n}`);return i}elapsed(n){const i=this.get(n);return i.elapsed||Date.now()-i.started}}return mt.Watch=t,mt.default=t,mt}var qt={},At={},se;function hr(){if(se)return At;se=1,Object.defineProperty(At,"__esModule",{value:!0}),At.IWatch=void 0;class t{}return At.IWatch=t,At}var le;function fr(){return le||(le=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Bt.__exportStar(hr(),t)}(qt)),qt}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const r=Bt;r.__exportStar(ur(),t),r.__exportStar(or(),t),r.__exportStar(fr(),t),r.__exportStar(be(),t)})(Be);var q={};Object.defineProperty(q,"__esModule",{value:!0});q.getLocalStorage=q.getLocalStorageOrThrow=q.getCrypto=q.getCryptoOrThrow=vr=q.getLocation=q.getLocationOrThrow=Er=q.getNavigator=q.getNavigatorOrThrow=cr=q.getDocument=q.getDocumentOrThrow=q.getFromWindowOrThrow=q.getFromWindow=void 0;function St(t){let r;return typeof window<"u"&&typeof window[t]<"u"&&(r=window[t]),r}q.getFromWindow=St;function Ct(t){const r=St(t);if(!r)throw new Error(`${t} is not defined in Window`);return r}q.getFromWindowOrThrow=Ct;function sr(){return Ct("document")}q.getDocumentOrThrow=sr;function lr(){return St("document")}var cr=q.getDocument=lr;function Dr(){return Ct("navigator")}q.getNavigatorOrThrow=Dr;function _r(){return St("navigator")}var Er=q.getNavigator=_r;function dr(){return Ct("location")}q.getLocationOrThrow=dr;function br(){return St("location")}var vr=q.getLocation=br;function wr(){return Ct("crypto")}q.getCryptoOrThrow=wr;function gr(){return St("crypto")}q.getCrypto=gr;function yr(){return Ct("localStorage")}q.getLocalStorageOrThrow=yr;function Sr(){return St("localStorage")}q.getLocalStorage=Sr;var te={};Object.defineProperty(te,"__esModule",{value:!0});var pr=te.getWindowMetadata=void 0;const ce=q;function mr(){let t,r;try{t=ce.getDocumentOrThrow(),r=ce.getLocationOrThrow()}catch{return null}function n(){const w=t.getElementsByTagName("link"),E=[];for(let c=0;c<w.length;c++){const b=w[c],p=b.getAttribute("rel");if(p&&p.toLowerCase().indexOf("icon")>-1){const g=b.getAttribute("href");if(g)if(g.toLowerCase().indexOf("https:")===-1&&g.toLowerCase().indexOf("http:")===-1&&g.indexOf("//")!==0){let O=r.protocol+"//"+r.host;if(g.indexOf("/")===0)O+=g;else{const P=r.pathname.split("/");P.pop();const U=P.join("/");O+=U+"/"+g}E.push(O)}else if(g.indexOf("//")===0){const O=r.protocol+g;E.push(O)}else E.push(g)}}return E}function i(...w){const E=t.getElementsByTagName("meta");for(let c=0;c<E.length;c++){const b=E[c],p=["itemprop","property","name"].map(g=>b.getAttribute(g)).filter(g=>g?w.includes(g):!1);if(p.length&&p){const g=b.getAttribute("content");if(g)return g}}return""}function f(){let w=i("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}function h(){return i("description","og:description","twitter:description","keywords")}const v=f(),u=h(),o=r.origin,s=n();return{description:u,url:o,icons:s,name:v}}pr=te.getWindowMetadata=mr;var ei=t=>encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Cr={},Rt={},x={},ve={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function r(u,o){var s=u>>>16&65535,_=u&65535,w=o>>>16&65535,E=o&65535;return _*E+(s*E+_*w<<16>>>0)|0}t.mul=Math.imul||r;function n(u,o){return u+o|0}t.add=n;function i(u,o){return u-o|0}t.sub=i;function f(u,o){return u<<o|u>>>32-o}t.rotl=f;function h(u,o){return u<<32-o|u>>>o}t.rotr=h;function v(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||v,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(ve);Object.defineProperty(x,"__esModule",{value:!0});var we=ve;function Or(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])<<16>>16}x.readInt16BE=Or;function Ur(t,r){return r===void 0&&(r=0),(t[r+0]<<8|t[r+1])>>>0}x.readUint16BE=Ur;function Ar(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])<<16>>16}x.readInt16LE=Ar;function Tr(t,r){return r===void 0&&(r=0),(t[r+1]<<8|t[r])>>>0}x.readUint16LE=Tr;function ge(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>8,r[n+1]=t>>>0,r}x.writeUint16BE=ge;x.writeInt16BE=ge;function ye(t,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r}x.writeUint16LE=ye;x.writeInt16LE=ye;function Xt(t,r){return r===void 0&&(r=0),t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]}x.readInt32BE=Xt;function Jt(t,r){return r===void 0&&(r=0),(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}x.readUint32BE=Jt;function Zt(t,r){return r===void 0&&(r=0),t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}x.readInt32LE=Zt;function Qt(t,r){return r===void 0&&(r=0),(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r])>>>0}x.readUint32LE=Qt;function Ft(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>24,r[n+1]=t>>>16,r[n+2]=t>>>8,r[n+3]=t>>>0,r}x.writeUint32BE=Ft;x.writeInt32BE=Ft;function xt(t,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=t>>>0,r[n+1]=t>>>8,r[n+2]=t>>>16,r[n+3]=t>>>24,r}x.writeUint32LE=xt;x.writeInt32LE=xt;function Nr(t,r){r===void 0&&(r=0);var n=Xt(t,r),i=Xt(t,r+4);return n*4294967296+i-(i>>31)*4294967296}x.readInt64BE=Nr;function Lr(t,r){r===void 0&&(r=0);var n=Jt(t,r),i=Jt(t,r+4);return n*4294967296+i}x.readUint64BE=Lr;function Mr(t,r){r===void 0&&(r=0);var n=Zt(t,r),i=Zt(t,r+4);return i*4294967296+n-(n>>31)*4294967296}x.readInt64LE=Mr;function Fr(t,r){r===void 0&&(r=0);var n=Qt(t,r),i=Qt(t,r+4);return i*4294967296+n}x.readUint64LE=Fr;function Se(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ft(t/4294967296>>>0,r,n),Ft(t>>>0,r,n+4),r}x.writeUint64BE=Se;x.writeInt64BE=Se;function pe(t,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),xt(t>>>0,r,n),xt(t/4294967296>>>0,r,n+4),r}x.writeUint64LE=pe;x.writeInt64LE=pe;function xr(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,f=1,h=t/8+n-1;h>=n;h--)i+=r[h]*f,f*=256;return i}x.readUintBE=xr;function Br(t,r,n){if(n===void 0&&(n=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,f=1,h=n;h<n+t/8;h++)i+=r[h]*f,f*=256;return i}x.readUintLE=Br;function Rr(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!we.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var f=1,h=t/8+i-1;h>=i;h--)n[h]=r/f&255,f*=256;return n}x.writeUintBE=Rr;function Pr(t,r,n,i){if(n===void 0&&(n=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!we.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var f=1,h=i;h<i+t/8;h++)n[h]=r/f&255,f*=256;return n}x.writeUintLE=Pr;function Ir(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r)}x.readFloat32BE=Ir;function jr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat32(r,!0)}x.readFloat32LE=jr;function Hr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r)}x.readFloat64BE=Hr;function Kr(t,r){r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.getFloat64(r,!0)}x.readFloat64LE=Kr;function zr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t),r}x.writeFloat32BE=zr;function Yr(t,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,t,!0),r}x.writeFloat32LE=Yr;function Wr(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t),r}x.writeFloat64BE=Wr;function qr(t,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,t,!0),r}x.writeFloat64LE=qr;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});function Gr(t){for(var r=0;r<t.length;r++)t[r]=0;return t}dt.wipe=Gr;Object.defineProperty(Rt,"__esModule",{value:!0});var Et=x,kt=dt,$r=20;function Vr(t,r,n){for(var i=1634760805,f=857760878,h=2036477234,v=1797285236,u=n[3]<<24|n[2]<<16|n[1]<<8|n[0],o=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],_=n[15]<<24|n[14]<<16|n[13]<<8|n[12],w=n[19]<<24|n[18]<<16|n[17]<<8|n[16],E=n[23]<<24|n[22]<<16|n[21]<<8|n[20],c=n[27]<<24|n[26]<<16|n[25]<<8|n[24],b=n[31]<<24|n[30]<<16|n[29]<<8|n[28],p=r[3]<<24|r[2]<<16|r[1]<<8|r[0],g=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],P=r[15]<<24|r[14]<<16|r[13]<<8|r[12],U=i,l=f,d=h,D=v,e=u,a=o,y=s,m=_,A=w,M=E,B=c,F=b,N=p,L=g,S=O,T=P,$=0;$<$r;$+=2)U=U+e|0,N^=U,N=N>>>16|N<<16,A=A+N|0,e^=A,e=e>>>20|e<<12,l=l+a|0,L^=l,L=L>>>16|L<<16,M=M+L|0,a^=M,a=a>>>20|a<<12,d=d+y|0,S^=d,S=S>>>16|S<<16,B=B+S|0,y^=B,y=y>>>20|y<<12,D=D+m|0,T^=D,T=T>>>16|T<<16,F=F+T|0,m^=F,m=m>>>20|m<<12,d=d+y|0,S^=d,S=S>>>24|S<<8,B=B+S|0,y^=B,y=y>>>25|y<<7,D=D+m|0,T^=D,T=T>>>24|T<<8,F=F+T|0,m^=F,m=m>>>25|m<<7,l=l+a|0,L^=l,L=L>>>24|L<<8,M=M+L|0,a^=M,a=a>>>25|a<<7,U=U+e|0,N^=U,N=N>>>24|N<<8,A=A+N|0,e^=A,e=e>>>25|e<<7,U=U+a|0,T^=U,T=T>>>16|T<<16,B=B+T|0,a^=B,a=a>>>20|a<<12,l=l+y|0,N^=l,N=N>>>16|N<<16,F=F+N|0,y^=F,y=y>>>20|y<<12,d=d+m|0,L^=d,L=L>>>16|L<<16,A=A+L|0,m^=A,m=m>>>20|m<<12,D=D+e|0,S^=D,S=S>>>16|S<<16,M=M+S|0,e^=M,e=e>>>20|e<<12,d=d+m|0,L^=d,L=L>>>24|L<<8,A=A+L|0,m^=A,m=m>>>25|m<<7,D=D+e|0,S^=D,S=S>>>24|S<<8,M=M+S|0,e^=M,e=e>>>25|e<<7,l=l+y|0,N^=l,N=N>>>24|N<<8,F=F+N|0,y^=F,y=y>>>25|y<<7,U=U+a|0,T^=U,T=T>>>24|T<<8,B=B+T|0,a^=B,a=a>>>25|a<<7;Et.writeUint32LE(U+i|0,t,0),Et.writeUint32LE(l+f|0,t,4),Et.writeUint32LE(d+h|0,t,8),Et.writeUint32LE(D+v|0,t,12),Et.writeUint32LE(e+u|0,t,16),Et.writeUint32LE(a+o|0,t,20),Et.writeUint32LE(y+s|0,t,24),Et.writeUint32LE(m+_|0,t,28),Et.writeUint32LE(A+w|0,t,32),Et.writeUint32LE(M+E|0,t,36),Et.writeUint32LE(B+c|0,t,40),Et.writeUint32LE(F+b|0,t,44),Et.writeUint32LE(N+p|0,t,48),Et.writeUint32LE(L+g|0,t,52),Et.writeUint32LE(S+O|0,t,56),Et.writeUint32LE(T+P|0,t,60)}function me(t,r,n,i,f){if(f===void 0&&(f=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var h,v;if(f===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");h=new Uint8Array(16),v=h.length-r.length,h.set(r,v)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");h=r,v=f}for(var u=new Uint8Array(64),o=0;o<n.length;o+=64){Vr(u,h,t);for(var s=o;s<o+64&&s<n.length;s++)i[s]=n[s]^u[s-o];Jr(h,0,v)}return kt.wipe(u),f===0&&kt.wipe(h),i}Rt.streamXOR=me;function Xr(t,r,n,i){return i===void 0&&(i=0),kt.wipe(n),me(t,r,n,n,i)}Rt.stream=Xr;function Jr(t,r,n){for(var i=1;n--;)i=i+(t[r]&255)|0,t[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var Ce={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});function Zr(t,r,n){return~(t-1)&r|t-1&n}vt.select=Zr;function Qr(t,r){return(t|0)-(r|0)-1>>>31&1}vt.lessOrEqual=Qr;function Oe(t,r){if(t.length!==r.length)return 0;for(var n=0,i=0;i<t.length;i++)n|=t[i]^r[i];return 1&n-1>>>8}vt.compare=Oe;function kr(t,r){return t.length===0||r.length===0?!1:Oe(t,r)!==0}vt.equal=kr;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=vt,n=dt;t.DIGEST_LENGTH=16;var i=function(){function v(u){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var o=u[0]|u[1]<<8;this._r[0]=o&8191;var s=u[2]|u[3]<<8;this._r[1]=(o>>>13|s<<3)&8191;var _=u[4]|u[5]<<8;this._r[2]=(s>>>10|_<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(_>>>7|w<<9)&8191;var E=u[8]|u[9]<<8;this._r[4]=(w>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var c=u[10]|u[11]<<8;this._r[6]=(E>>>14|c<<2)&8191;var b=u[12]|u[13]<<8;this._r[7]=(c>>>11|b<<5)&8065;var p=u[14]|u[15]<<8;this._r[8]=(b>>>8|p<<8)&8191,this._r[9]=p>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return v.prototype._blocks=function(u,o,s){for(var _=this._fin?0:2048,w=this._h[0],E=this._h[1],c=this._h[2],b=this._h[3],p=this._h[4],g=this._h[5],O=this._h[6],P=this._h[7],U=this._h[8],l=this._h[9],d=this._r[0],D=this._r[1],e=this._r[2],a=this._r[3],y=this._r[4],m=this._r[5],A=this._r[6],M=this._r[7],B=this._r[8],F=this._r[9];s>=16;){var N=u[o+0]|u[o+1]<<8;w+=N&8191;var L=u[o+2]|u[o+3]<<8;E+=(N>>>13|L<<3)&8191;var S=u[o+4]|u[o+5]<<8;c+=(L>>>10|S<<6)&8191;var T=u[o+6]|u[o+7]<<8;b+=(S>>>7|T<<9)&8191;var $=u[o+8]|u[o+9]<<8;p+=(T>>>4|$<<12)&8191,g+=$>>>1&8191;var Z=u[o+10]|u[o+11]<<8;O+=($>>>14|Z<<2)&8191;var J=u[o+12]|u[o+13]<<8;P+=(Z>>>11|J<<5)&8191;var X=u[o+14]|u[o+15]<<8;U+=(J>>>8|X<<8)&8191,l+=X>>>5|_;var C=0,R=C;R+=w*d,R+=E*(5*F),R+=c*(5*B),R+=b*(5*M),R+=p*(5*A),C=R>>>13,R&=8191,R+=g*(5*m),R+=O*(5*y),R+=P*(5*a),R+=U*(5*e),R+=l*(5*D),C+=R>>>13,R&=8191;var I=C;I+=w*D,I+=E*d,I+=c*(5*F),I+=b*(5*B),I+=p*(5*M),C=I>>>13,I&=8191,I+=g*(5*A),I+=O*(5*m),I+=P*(5*y),I+=U*(5*a),I+=l*(5*e),C+=I>>>13,I&=8191;var j=C;j+=w*e,j+=E*D,j+=c*d,j+=b*(5*F),j+=p*(5*B),C=j>>>13,j&=8191,j+=g*(5*M),j+=O*(5*A),j+=P*(5*m),j+=U*(5*y),j+=l*(5*a),C+=j>>>13,j&=8191;var H=C;H+=w*a,H+=E*e,H+=c*D,H+=b*d,H+=p*(5*F),C=H>>>13,H&=8191,H+=g*(5*B),H+=O*(5*M),H+=P*(5*A),H+=U*(5*m),H+=l*(5*y),C+=H>>>13,H&=8191;var K=C;K+=w*y,K+=E*a,K+=c*e,K+=b*D,K+=p*d,C=K>>>13,K&=8191,K+=g*(5*F),K+=O*(5*B),K+=P*(5*M),K+=U*(5*A),K+=l*(5*m),C+=K>>>13,K&=8191;var z=C;z+=w*m,z+=E*y,z+=c*a,z+=b*e,z+=p*D,C=z>>>13,z&=8191,z+=g*d,z+=O*(5*F),z+=P*(5*B),z+=U*(5*M),z+=l*(5*A),C+=z>>>13,z&=8191;var Y=C;Y+=w*A,Y+=E*m,Y+=c*y,Y+=b*a,Y+=p*e,C=Y>>>13,Y&=8191,Y+=g*D,Y+=O*d,Y+=P*(5*F),Y+=U*(5*B),Y+=l*(5*M),C+=Y>>>13,Y&=8191;var W=C;W+=w*M,W+=E*A,W+=c*m,W+=b*y,W+=p*a,C=W>>>13,W&=8191,W+=g*e,W+=O*D,W+=P*d,W+=U*(5*F),W+=l*(5*B),C+=W>>>13,W&=8191;var G=C;G+=w*B,G+=E*M,G+=c*A,G+=b*m,G+=p*y,C=G>>>13,G&=8191,G+=g*a,G+=O*e,G+=P*D,G+=U*d,G+=l*(5*F),C+=G>>>13,G&=8191;var V=C;V+=w*F,V+=E*B,V+=c*M,V+=b*A,V+=p*m,C=V>>>13,V&=8191,V+=g*y,V+=O*a,V+=P*e,V+=U*D,V+=l*d,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+R|0,R=C&8191,C=C>>>13,I+=C,w=R,E=I,c=j,b=H,p=K,g=z,O=Y,P=W,U=G,l=V,o+=16,s-=16}this._h[0]=w,this._h[1]=E,this._h[2]=c,this._h[3]=b,this._h[4]=p,this._h[5]=g,this._h[6]=O,this._h[7]=P,this._h[8]=U,this._h[9]=l},v.prototype.finish=function(u,o){o===void 0&&(o=0);var s=new Uint16Array(10),_,w,E,c;if(this._leftover){for(c=this._leftover,this._buffer[c++]=1;c<16;c++)this._buffer[c]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(_=this._h[1]>>>13,this._h[1]&=8191,c=2;c<10;c++)this._h[c]+=_,_=this._h[c]>>>13,this._h[c]&=8191;for(this._h[0]+=_*5,_=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=_,_=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=_,s[0]=this._h[0]+5,_=s[0]>>>13,s[0]&=8191,c=1;c<10;c++)s[c]=this._h[c]+_,_=s[c]>>>13,s[c]&=8191;for(s[9]-=8192,w=(_^1)-1,c=0;c<10;c++)s[c]&=w;for(w=~w,c=0;c<10;c++)this._h[c]=this._h[c]&w|s[c];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,E=this._h[0]+this._pad[0],this._h[0]=E&65535,c=1;c<8;c++)E=(this._h[c]+this._pad[c]|0)+(E>>>16)|0,this._h[c]=E&65535;return u[o+0]=this._h[0]>>>0,u[o+1]=this._h[0]>>>8,u[o+2]=this._h[1]>>>0,u[o+3]=this._h[1]>>>8,u[o+4]=this._h[2]>>>0,u[o+5]=this._h[2]>>>8,u[o+6]=this._h[3]>>>0,u[o+7]=this._h[3]>>>8,u[o+8]=this._h[4]>>>0,u[o+9]=this._h[4]>>>8,u[o+10]=this._h[5]>>>0,u[o+11]=this._h[5]>>>8,u[o+12]=this._h[6]>>>0,u[o+13]=this._h[6]>>>8,u[o+14]=this._h[7]>>>0,u[o+15]=this._h[7]>>>8,this._finished=!0,this},v.prototype.update=function(u){var o=0,s=u.length,_;if(this._leftover){_=16-this._leftover,_>s&&(_=s);for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[o+w];if(s-=_,o+=_,this._leftover+=_,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(_=s-s%16,this._blocks(u,o,_),o+=_,s-=_),s){for(var w=0;w<s;w++)this._buffer[this._leftover+w]=u[o+w];this._leftover+=s}return this},v.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},v.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},v}();t.Poly1305=i;function f(v,u){var o=new i(v);o.update(u);var s=o.digest();return o.clean(),s}t.oneTimeAuth=f;function h(v,u){return v.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:r.equal(v,u)}t.equal=h})(Ce);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Rt,n=Ce,i=dt,f=x,h=vt;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var v=new Uint8Array(16),u=function(){function o(s){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,s.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return o.prototype.seal=function(s,_,w,E){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var c=new Uint8Array(16);c.set(s,c.length-s.length);var b=new Uint8Array(32);r.stream(this._key,c,b,4);var p=_.length+this.tagLength,g;if(E){if(E.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");g=E}else g=new Uint8Array(p);return r.streamXOR(this._key,c,_,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),b,g.subarray(0,g.length-this.tagLength),w),i.wipe(c),g},o.prototype.open=function(s,_,w,E){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(_.length<this.tagLength)return null;var c=new Uint8Array(16);c.set(s,c.length-s.length);var b=new Uint8Array(32);r.stream(this._key,c,b,4);var p=new Uint8Array(this.tagLength);if(this._authenticate(p,b,_.subarray(0,_.length-this.tagLength),w),!h.equal(p,_.subarray(_.length-this.tagLength,_.length)))return null;var g=_.length-this.tagLength,O;if(E){if(E.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");O=E}else O=new Uint8Array(g);return r.streamXOR(this._key,c,_.subarray(0,_.length-this.tagLength),O,4),i.wipe(c),O},o.prototype.clean=function(){return i.wipe(this._key),this},o.prototype._authenticate=function(s,_,w,E){var c=new n.Poly1305(_);E&&(c.update(E),E.length%16>0&&c.update(v.subarray(E.length%16))),c.update(w),w.length%16>0&&c.update(v.subarray(w.length%16));var b=new Uint8Array(8);E&&f.writeUint64LE(E.length,b),c.update(b),f.writeUint64LE(w.length,b),c.update(b);for(var p=c.digest(),g=0;g<p.length;g++)s[g]=p[g];c.clean(),i.wipe(p),i.wipe(b)},o}();t.ChaCha20Poly1305=u})(Cr);var Ue={},Nt={},ee={};Object.defineProperty(ee,"__esModule",{value:!0});function tn(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}ee.isSerializableHash=tn;Object.defineProperty(Nt,"__esModule",{value:!0});var bt=ee,en=vt,rn=dt,Ae=function(){function t(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var f=0;f<i.length;f++)i[f]^=54;this._inner.update(i);for(var f=0;f<i.length;f++)i[f]^=106;this._outer.update(i),bt.isSerializableHash(this._inner)&&bt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),rn.wipe(i)}return t.prototype.reset=function(){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){bt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),bt.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(r){return this._inner.update(r),this},t.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},t.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},t.prototype.saveState=function(){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(r){if(!bt.isSerializableHash(this._inner)||!bt.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(r){if(!bt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},t}();Nt.HMAC=Ae;function nn(t,r,n){var i=new Ae(t,r);i.update(n);var f=i.digest();return i.clean(),f}Nt.hmac=nn;Nt.equal=en.equal;Object.defineProperty(Ue,"__esModule",{value:!0});var De=Nt,_e=dt,an=function(){function t(r,n,i,f){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=f;var h=De.hmac(this._hash,i,n);this._hmac=new De.HMAC(r,h),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},t.prototype.clean=function(){this._hmac.clean(),_e.wipe(this._buffer),_e.wipe(this._counter),this._bufpos=0},t}(),ri=Ue.HKDF=an,Te={},Pt={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.BrowserRandomSource=void 0;const Ee=65536;class un{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=Ee)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,Ee)));return n}}It.BrowserRandomSource=un;var jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.NodeRandomSource=void 0;const on=dt;class hn{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Fe<"u"){const r=xe;r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let f=0;f<i.length;f++)i[f]=n[f];return(0,on.wipe)(n),i}}jt.NodeRandomSource=hn;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SystemRandomSource=void 0;const fn=It,sn=jt;class ln{constructor(){if(this.isAvailable=!1,this.name="",this._source=new fn.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new sn.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Pt.SystemRandomSource=ln;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const r=Pt,n=x,i=dt;t.defaultRandomSource=new r.SystemRandomSource;function f(s,_=t.defaultRandomSource){return _.randomBytes(s)}t.randomBytes=f;function h(s=t.defaultRandomSource){const _=f(4,s),w=(0,n.readUint32LE)(_);return(0,i.wipe)(_),w}t.randomUint32=h;const v="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(s,_=v,w=t.defaultRandomSource){if(_.length<2)throw new Error("randomString charset is too short");if(_.length>256)throw new Error("randomString charset is too long");let E="";const c=_.length,b=256-256%c;for(;s>0;){const p=f(Math.ceil(s*256/b),w);for(let g=0;g<p.length&&s>0;g++){const O=p[g];O<b&&(E+=_.charAt(O%c),s--)}(0,i.wipe)(p)}return E}t.randomString=u;function o(s,_=v,w=t.defaultRandomSource){const E=Math.ceil(s/(Math.log(_.length)/Math.LN2));return u(E,_,w)}t.randomStringForEntropy=o})(Te);var cn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=x,n=dt;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},u.prototype.update=function(o,s){if(s===void 0&&(s=o.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var _=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=o[_++],s--;this._bufferLength===this.blockSize&&(h(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(_=h(this._temp,this._state,o,_,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=o[_++],s--;return this},u.prototype.finish=function(o){if(!this._finished){var s=this._bytesHashed,_=this._bufferLength,w=s/536870912|0,E=s<<3,c=s%64<56?64:128;this._buffer[_]=128;for(var b=_+1;b<c-8;b++)this._buffer[b]=0;r.writeUint32BE(w,this._buffer,c-8),r.writeUint32BE(E,this._buffer,c-4),h(this._temp,this._state,this._buffer,0,c),this._finished=!0}for(var b=0;b<this.digestLength/4;b++)r.writeUint32BE(this._state[b],o,b*4);return this},u.prototype.digest=function(){var o=new Uint8Array(this.digestLength);return this.finish(o),o},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(o){return this._state.set(o.state),this._bufferLength=o.bufferLength,o.buffer&&this._buffer.set(o.buffer),this._bytesHashed=o.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(o){n.wipe(o.state),o.buffer&&n.wipe(o.buffer),o.bufferLength=0,o.bytesHashed=0},u}();t.SHA256=i;var f=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function h(u,o,s,_,w){for(;w>=64;){for(var E=o[0],c=o[1],b=o[2],p=o[3],g=o[4],O=o[5],P=o[6],U=o[7],l=0;l<16;l++){var d=_+l*4;u[l]=r.readUint32BE(s,d)}for(var l=16;l<64;l++){var D=u[l-2],e=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=u[l-15];var a=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;u[l]=(e+u[l-7]|0)+(a+u[l-16]|0)}for(var l=0;l<64;l++){var e=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&O^~g&P)|0)+(U+(f[l]+u[l]|0)|0)|0,a=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&c^E&b^c&b)|0;U=P,P=O,O=g,g=p+e|0,p=b,b=c,c=E,E=e+a|0}o[0]+=E,o[1]+=c,o[2]+=b,o[3]+=p,o[4]+=g,o[5]+=O,o[6]+=P,o[7]+=U,_+=64,w-=64}return _}function v(u){var o=new i;o.update(u);var s=o.digest();return o.clean(),s}t.hash=v})(cn);var Dn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const r=Te,n=dt;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(l){const d=new Float64Array(16);if(l)for(let D=0;D<l.length;D++)d[D]=l[D];return d}const f=new Uint8Array(32);f[0]=9;const h=i([56129,1]);function v(l){let d=1;for(let D=0;D<16;D++){let e=l[D]+d+65535;d=Math.floor(e/65536),l[D]=e-d*65536}l[0]+=d-1+37*(d-1)}function u(l,d,D){const e=~(D-1);for(let a=0;a<16;a++){const y=e&(l[a]^d[a]);l[a]^=y,d[a]^=y}}function o(l,d){const D=i(),e=i();for(let a=0;a<16;a++)e[a]=d[a];v(e),v(e),v(e);for(let a=0;a<2;a++){D[0]=e[0]-65517;for(let m=1;m<15;m++)D[m]=e[m]-65535-(D[m-1]>>16&1),D[m-1]&=65535;D[15]=e[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,u(e,D,1-y)}for(let a=0;a<16;a++)l[2*a]=e[a]&255,l[2*a+1]=e[a]>>8}function s(l,d){for(let D=0;D<16;D++)l[D]=d[2*D]+(d[2*D+1]<<8);l[15]&=32767}function _(l,d,D){for(let e=0;e<16;e++)l[e]=d[e]+D[e]}function w(l,d,D){for(let e=0;e<16;e++)l[e]=d[e]-D[e]}function E(l,d,D){let e,a,y=0,m=0,A=0,M=0,B=0,F=0,N=0,L=0,S=0,T=0,$=0,Z=0,J=0,X=0,C=0,R=0,I=0,j=0,H=0,K=0,z=0,Y=0,W=0,G=0,V=0,wt=0,pt=0,Ot=0,Mt=0,Kt=0,re=0,k=D[0],tt=D[1],et=D[2],rt=D[3],nt=D[4],it=D[5],at=D[6],ut=D[7],ot=D[8],ht=D[9],ft=D[10],st=D[11],lt=D[12],ct=D[13],Dt=D[14],_t=D[15];e=d[0],y+=e*k,m+=e*tt,A+=e*et,M+=e*rt,B+=e*nt,F+=e*it,N+=e*at,L+=e*ut,S+=e*ot,T+=e*ht,$+=e*ft,Z+=e*st,J+=e*lt,X+=e*ct,C+=e*Dt,R+=e*_t,e=d[1],m+=e*k,A+=e*tt,M+=e*et,B+=e*rt,F+=e*nt,N+=e*it,L+=e*at,S+=e*ut,T+=e*ot,$+=e*ht,Z+=e*ft,J+=e*st,X+=e*lt,C+=e*ct,R+=e*Dt,I+=e*_t,e=d[2],A+=e*k,M+=e*tt,B+=e*et,F+=e*rt,N+=e*nt,L+=e*it,S+=e*at,T+=e*ut,$+=e*ot,Z+=e*ht,J+=e*ft,X+=e*st,C+=e*lt,R+=e*ct,I+=e*Dt,j+=e*_t,e=d[3],M+=e*k,B+=e*tt,F+=e*et,N+=e*rt,L+=e*nt,S+=e*it,T+=e*at,$+=e*ut,Z+=e*ot,J+=e*ht,X+=e*ft,C+=e*st,R+=e*lt,I+=e*ct,j+=e*Dt,H+=e*_t,e=d[4],B+=e*k,F+=e*tt,N+=e*et,L+=e*rt,S+=e*nt,T+=e*it,$+=e*at,Z+=e*ut,J+=e*ot,X+=e*ht,C+=e*ft,R+=e*st,I+=e*lt,j+=e*ct,H+=e*Dt,K+=e*_t,e=d[5],F+=e*k,N+=e*tt,L+=e*et,S+=e*rt,T+=e*nt,$+=e*it,Z+=e*at,J+=e*ut,X+=e*ot,C+=e*ht,R+=e*ft,I+=e*st,j+=e*lt,H+=e*ct,K+=e*Dt,z+=e*_t,e=d[6],N+=e*k,L+=e*tt,S+=e*et,T+=e*rt,$+=e*nt,Z+=e*it,J+=e*at,X+=e*ut,C+=e*ot,R+=e*ht,I+=e*ft,j+=e*st,H+=e*lt,K+=e*ct,z+=e*Dt,Y+=e*_t,e=d[7],L+=e*k,S+=e*tt,T+=e*et,$+=e*rt,Z+=e*nt,J+=e*it,X+=e*at,C+=e*ut,R+=e*ot,I+=e*ht,j+=e*ft,H+=e*st,K+=e*lt,z+=e*ct,Y+=e*Dt,W+=e*_t,e=d[8],S+=e*k,T+=e*tt,$+=e*et,Z+=e*rt,J+=e*nt,X+=e*it,C+=e*at,R+=e*ut,I+=e*ot,j+=e*ht,H+=e*ft,K+=e*st,z+=e*lt,Y+=e*ct,W+=e*Dt,G+=e*_t,e=d[9],T+=e*k,$+=e*tt,Z+=e*et,J+=e*rt,X+=e*nt,C+=e*it,R+=e*at,I+=e*ut,j+=e*ot,H+=e*ht,K+=e*ft,z+=e*st,Y+=e*lt,W+=e*ct,G+=e*Dt,V+=e*_t,e=d[10],$+=e*k,Z+=e*tt,J+=e*et,X+=e*rt,C+=e*nt,R+=e*it,I+=e*at,j+=e*ut,H+=e*ot,K+=e*ht,z+=e*ft,Y+=e*st,W+=e*lt,G+=e*ct,V+=e*Dt,wt+=e*_t,e=d[11],Z+=e*k,J+=e*tt,X+=e*et,C+=e*rt,R+=e*nt,I+=e*it,j+=e*at,H+=e*ut,K+=e*ot,z+=e*ht,Y+=e*ft,W+=e*st,G+=e*lt,V+=e*ct,wt+=e*Dt,pt+=e*_t,e=d[12],J+=e*k,X+=e*tt,C+=e*et,R+=e*rt,I+=e*nt,j+=e*it,H+=e*at,K+=e*ut,z+=e*ot,Y+=e*ht,W+=e*ft,G+=e*st,V+=e*lt,wt+=e*ct,pt+=e*Dt,Ot+=e*_t,e=d[13],X+=e*k,C+=e*tt,R+=e*et,I+=e*rt,j+=e*nt,H+=e*it,K+=e*at,z+=e*ut,Y+=e*ot,W+=e*ht,G+=e*ft,V+=e*st,wt+=e*lt,pt+=e*ct,Ot+=e*Dt,Mt+=e*_t,e=d[14],C+=e*k,R+=e*tt,I+=e*et,j+=e*rt,H+=e*nt,K+=e*it,z+=e*at,Y+=e*ut,W+=e*ot,G+=e*ht,V+=e*ft,wt+=e*st,pt+=e*lt,Ot+=e*ct,Mt+=e*Dt,Kt+=e*_t,e=d[15],R+=e*k,I+=e*tt,j+=e*et,H+=e*rt,K+=e*nt,z+=e*it,Y+=e*at,W+=e*ut,G+=e*ot,V+=e*ht,wt+=e*ft,pt+=e*st,Ot+=e*lt,Mt+=e*ct,Kt+=e*Dt,re+=e*_t,y+=38*I,m+=38*j,A+=38*H,M+=38*K,B+=38*z,F+=38*Y,N+=38*W,L+=38*G,S+=38*V,T+=38*wt,$+=38*pt,Z+=38*Ot,J+=38*Mt,X+=38*Kt,C+=38*re,a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=M+a+65535,a=Math.floor(e/65536),M=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=S+a+65535,a=Math.floor(e/65536),S=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),a=1,e=y+a+65535,a=Math.floor(e/65536),y=e-a*65536,e=m+a+65535,a=Math.floor(e/65536),m=e-a*65536,e=A+a+65535,a=Math.floor(e/65536),A=e-a*65536,e=M+a+65535,a=Math.floor(e/65536),M=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=F+a+65535,a=Math.floor(e/65536),F=e-a*65536,e=N+a+65535,a=Math.floor(e/65536),N=e-a*65536,e=L+a+65535,a=Math.floor(e/65536),L=e-a*65536,e=S+a+65535,a=Math.floor(e/65536),S=e-a*65536,e=T+a+65535,a=Math.floor(e/65536),T=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=Z+a+65535,a=Math.floor(e/65536),Z=e-a*65536,e=J+a+65535,a=Math.floor(e/65536),J=e-a*65536,e=X+a+65535,a=Math.floor(e/65536),X=e-a*65536,e=C+a+65535,a=Math.floor(e/65536),C=e-a*65536,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,y+=a-1+37*(a-1),l[0]=y,l[1]=m,l[2]=A,l[3]=M,l[4]=B,l[5]=F,l[6]=N,l[7]=L,l[8]=S,l[9]=T,l[10]=$,l[11]=Z,l[12]=J,l[13]=X,l[14]=C,l[15]=R}function c(l,d){E(l,d,d)}function b(l,d){const D=i();for(let e=0;e<16;e++)D[e]=d[e];for(let e=253;e>=0;e--)c(D,D),e!==2&&e!==4&&E(D,D,d);for(let e=0;e<16;e++)l[e]=D[e]}function p(l,d){const D=new Uint8Array(32),e=new Float64Array(80),a=i(),y=i(),m=i(),A=i(),M=i(),B=i();for(let S=0;S<31;S++)D[S]=l[S];D[31]=l[31]&127|64,D[0]&=248,s(e,d);for(let S=0;S<16;S++)y[S]=e[S];a[0]=A[0]=1;for(let S=254;S>=0;--S){const T=D[S>>>3]>>>(S&7)&1;u(a,y,T),u(m,A,T),_(M,a,m),w(a,a,m),_(m,y,A),w(y,y,A),c(A,M),c(B,a),E(a,m,a),E(m,y,M),_(M,a,m),w(a,a,m),c(y,a),w(m,A,B),E(a,m,h),_(a,a,A),E(m,m,a),E(a,A,B),E(A,y,e),c(y,M),u(a,y,T),u(m,A,T)}for(let S=0;S<16;S++)e[S+16]=a[S],e[S+32]=m[S],e[S+48]=y[S],e[S+64]=A[S];const F=e.subarray(32),N=e.subarray(16);b(F,F),E(N,N,F);const L=new Uint8Array(32);return o(L,N),L}t.scalarMult=p;function g(l){return p(l,f)}t.scalarMultBase=g;function O(l){if(l.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const d=new Uint8Array(l);return{publicKey:g(d),secretKey:d}}t.generateKeyPairFromSeed=O;function P(l){const d=(0,r.randomBytes)(32,l),D=O(d);return(0,n.wipe)(d),D}t.generateKeyPair=P;function U(l,d,D=!1){if(l.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(d.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const e=p(l,d);if(D){let a=0;for(let y=0;y<e.length;y++)a|=e[y];if(a===0)throw new Error("X25519: invalid shared key")}return e}t.sharedKey=U})(Dn);function _n(t,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var f=0;f<t.length;f++){var h=t.charAt(f),v=h.charCodeAt(0);if(n[v]!==255)throw new TypeError(h+" is ambiguous");n[v]=f}var u=t.length,o=t.charAt(0),s=Math.log(u)/Math.log(256),_=Math.log(256)/Math.log(u);function w(b){if(b instanceof Uint8Array||(ArrayBuffer.isView(b)?b=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):Array.isArray(b)&&(b=Uint8Array.from(b))),!(b instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(b.length===0)return"";for(var p=0,g=0,O=0,P=b.length;O!==P&&b[O]===0;)O++,p++;for(var U=(P-O)*_+1>>>0,l=new Uint8Array(U);O!==P;){for(var d=b[O],D=0,e=U-1;(d!==0||D<g)&&e!==-1;e--,D++)d+=256*l[e]>>>0,l[e]=d%u>>>0,d=d/u>>>0;if(d!==0)throw new Error("Non-zero carry");g=D,O++}for(var a=U-g;a!==U&&l[a]===0;)a++;for(var y=o.repeat(p);a<U;++a)y+=t.charAt(l[a]);return y}function E(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return new Uint8Array;var p=0;if(b[p]!==" "){for(var g=0,O=0;b[p]===o;)g++,p++;for(var P=(b.length-p)*s+1>>>0,U=new Uint8Array(P);b[p];){var l=n[b.charCodeAt(p)];if(l===255)return;for(var d=0,D=P-1;(l!==0||d<O)&&D!==-1;D--,d++)l+=u*U[D]>>>0,U[D]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");O=d,p++}if(b[p]!==" "){for(var e=P-O;e!==P&&U[e]===0;)e++;for(var a=new Uint8Array(g+(P-e)),y=g;e!==P;)a[y++]=U[e++];return a}}}function c(b){var p=E(b);if(p)return p;throw new Error(`Non-${r} character`)}return{encode:w,decodeUnsafe:E,decode:c}}var En=_n,dn=En;const bn=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},vn=t=>new TextEncoder().encode(t),wn=t=>new TextDecoder().decode(t);class gn{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class yn{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Ne(this,r)}}class Sn{constructor(r){this.decoders=r}or(r){return Ne(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ne=(t,r)=>new Sn({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}});class pn{constructor(r,n,i,f){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=f,this.encoder=new gn(r,n,i),this.decoder=new yn(r,n,f)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Ht=({name:t,prefix:r,encode:n,decode:i})=>new pn(t,r,n,i),Lt=({prefix:t,name:r,alphabet:n})=>{const{encode:i,decode:f}=dn(n,r);return Ht({prefix:t,name:r,encode:i,decode:h=>bn(f(h))})},mn=(t,r,n,i)=>{const f={};for(let _=0;_<r.length;++_)f[r[_]]=_;let h=t.length;for(;t[h-1]==="=";)--h;const v=new Uint8Array(h*n/8|0);let u=0,o=0,s=0;for(let _=0;_<h;++_){const w=f[t[_]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);o=o<<n|w,u+=n,u>=8&&(u-=8,v[s++]=255&o>>u)}if(u>=n||255&o<<8-u)throw new SyntaxError("Unexpected end of data");return v},Cn=(t,r,n)=>{const i=r[r.length-1]==="=",f=(1<<n)-1;let h="",v=0,u=0;for(let o=0;o<t.length;++o)for(u=u<<8|t[o],v+=8;v>n;)v-=n,h+=r[f&u>>v];if(v&&(h+=r[f&u<<n-v]),i)for(;h.length*n&7;)h+="=";return h},Q=({name:t,prefix:r,bitsPerChar:n,alphabet:i})=>Ht({prefix:r,name:t,encode(f){return Cn(f,i,n)},decode(f){return mn(f,i,n,t)}}),On=Ht({prefix:"\0",name:"identity",encode:t=>wn(t),decode:t=>vn(t)}),ni=Object.freeze(Object.defineProperty({__proto__:null,identity:On},Symbol.toStringTag,{value:"Module"})),Un=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ii=Object.freeze(Object.defineProperty({__proto__:null,base2:Un},Symbol.toStringTag,{value:"Module"})),An=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ai=Object.freeze(Object.defineProperty({__proto__:null,base8:An},Symbol.toStringTag,{value:"Module"})),Tn=Lt({prefix:"9",name:"base10",alphabet:"0123456789"}),ui=Object.freeze(Object.defineProperty({__proto__:null,base10:Tn},Symbol.toStringTag,{value:"Module"})),Nn=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ln=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),oi=Object.freeze(Object.defineProperty({__proto__:null,base16:Nn,base16upper:Ln},Symbol.toStringTag,{value:"Module"})),Mn=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Fn=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),xn=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Bn=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Rn=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Pn=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),In=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),jn=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Hn=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hi=Object.freeze(Object.defineProperty({__proto__:null,base32:Mn,base32hex:Rn,base32hexpad:In,base32hexpadupper:jn,base32hexupper:Pn,base32pad:xn,base32padupper:Bn,base32upper:Fn,base32z:Hn},Symbol.toStringTag,{value:"Module"})),Kn=Lt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),zn=Lt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),fi=Object.freeze(Object.defineProperty({__proto__:null,base36:Kn,base36upper:zn},Symbol.toStringTag,{value:"Module"})),Yn=Lt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Wn=Lt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),si=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Yn,base58flickr:Wn},Symbol.toStringTag,{value:"Module"})),qn=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Gn=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),$n=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vn=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),li=Object.freeze(Object.defineProperty({__proto__:null,base64:qn,base64pad:Gn,base64url:$n,base64urlpad:Vn},Symbol.toStringTag,{value:"Module"})),Le=Array.from("๐๐ชโ๐ฐ๐๐๐๐๐๐๐๐๐๐๐๐๐โ๐ป๐ฅ๐พ๐ฟ๐โค๐๐คฃ๐๐๐๐ญ๐๐๐ ๐๐๐ฅ๐ฅฐ๐๐๐๐ข๐ค๐๐๐ช๐โบ๐๐ค๐๐๐๐๐น๐คฆ๐๐โโจ๐คท๐ฑ๐๐ธ๐๐๐๐๐๐๐๐๐คฉ๐๐๐ค๐๐ฏ๐๐๐ถ๐๐คญโฃ๐๐๐๐ช๐๐ฅ๐๐๐ฉ๐ก๐คช๐๐ฅณ๐ฅ๐คค๐๐๐ณโ๐๐๐ด๐๐ฌ๐๐๐ท๐ป๐โญโ ๐ฅบ๐๐๐ค๐ฆโ๐ฃ๐๐โน๐๐๐ โ๐๐บ๐๐ป๐๐๐๐๐น๐ฃ๐ซ๐๐๐ต๐ค๐๐ด๐ค๐ผ๐ซโฝ๐คโ๐๐คซ๐๐ฎ๐๐ป๐๐ถ๐๐ฒ๐ฟ๐งก๐โก๐๐โโ๐๐ฐ๐คจ๐ถ๐ค๐ถ๐ฐ๐๐ข๐ค๐๐จ๐จ๐คฌโ๐๐บ๐ค๐๐๐ฑ๐๐ถ๐ฅดโถโกโ๐๐ธโฌ๐จ๐๐ฆ๐ท๐บโ ๐ ๐๐ต๐๐คฒ๐ค ๐คง๐๐ต๐ ๐ง๐พ๐๐๐ค๐๐คฏ๐ทโ๐ง๐ฏ๐๐๐ค๐๐โ๐ด๐ฃ๐ธ๐๐๐ฅ๐คข๐ ๐ก๐ฉ๐๐ธ๐ป๐ค๐คฎ๐ผ๐ฅต๐ฉ๐๐๐ผ๐๐ฃ๐ฅ"),Xn=Le.reduce((t,r,n)=>(t[n]=r,t),[]),Jn=Le.reduce((t,r,n)=>(t[r.codePointAt(0)]=n,t),[]);function Zn(t){return t.reduce((r,n)=>(r+=Xn[n],r),"")}function Qn(t){const r=[];for(const n of t){const i=Jn[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const kn=Ht({prefix:"๐",name:"base256emoji",encode:Zn,decode:Qn}),ci=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:kn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;export{ri as H,ai as a,ii as b,ui as c,oi as d,hi as e,fi as f,si as g,li as h,ni as i,ci as j,Be as k,x as l,pr as m,cr as n,Er as o,cn as p,Cr as q,Te as r,ei as s,vr as t,dt as w,Dn as x};