diff --git a/dist/otpauth.esm.js b/dist/otpauth.esm.js
index 4cda3da..3bfa899 100644
--- a/dist/otpauth.esm.js
+++ b/dist/otpauth.esm.js
@@ -1650,6 +1650,6 @@ class URI {
* Library version.
* @type {string}
*/
-const version = "9.2.1";
+const version = "9.2.2";
export { HOTP, Secret, TOTP, URI, version };
diff --git a/dist/otpauth.esm.min.js b/dist/otpauth.esm.min.js
index eb9b0ce..da7e8d6 100644
--- a/dist/otpauth.esm.min.js
+++ b/dist/otpauth.esm.min.js
@@ -1,3 +1,3 @@
///
-const Ie=r=>{const e=new ArrayBuffer(8),n=new Uint8Array(e);let t=r;for(let i=7;i>=0&&t!==0;i--)n[i]=t&255,t-=n[i],t/=256;return e},ht=void 0,at=void 0,ct=void 0;var q=Object.freeze({__proto__:null,createHmac:void 0,randomBytes:void 0,timingSafeEqual:void 0});const J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q="ARRAYBUFFER not supported by this environment",W="UINT8ARRAY not supported by this environment";function _(r,e,n,t){let i,s,u;const c=e||[0],a=(n=n||0)>>>3,l=t===-1?3:0;for(i=0;i>>2,c.length<=s&&c.push(0),c[s]|=r[i]<<8*(l+t*(u%4));return{value:c,binLen:8*r.length+n}}function B(r,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(d=0;d>>1)+m,f=g>>>2;p.length<=f;)p.push(0);p[f]|=h<<8*(A+l*(g%4))}return{value:p,binLen:4*u.length+a}}(t,i,s,n)};case"TEXT":return function(t,i,s){return function(u,c,a,l,d){let h,f,g,p,m,A,y,b,v=0;const H=a||[0],S=(l=l||0)>>>3;if(c==="UTF8")for(y=d===-1?3:0,g=0;gh?f.push(h):2048>h?(f.push(192|h>>>6),f.push(128|63&h)):55296>h||57344<=h?f.push(224|h>>>12,128|h>>>6&63,128|63&h):(g+=1,h=65536+((1023&h)<<10|1023&u.charCodeAt(g)),f.push(240|h>>>18,128|h>>>12&63,128|h>>>6&63,128|63&h)),p=0;p>>2;H.length<=m;)H.push(0);H[m]|=f[p]<<8*(y+d*(A%4)),v+=1}else for(y=d===-1?2:0,b=c==="UTF16LE"&&d!==1||c!=="UTF16LE"&&d===1,g=0;g>>8),A=v+S,m=A>>>2;H.length<=m;)H.push(0);H[m]|=h<<8*(y+d*(A%4)),v+=2}return{value:H,binLen:8*v+l}}(t,e,i,s,n)};case"B64":return function(t,i,s){return function(u,c,a,l){let d,h,f,g,p,m,A,y=0;const b=c||[0],v=(a=a||0)>>>3,H=l===-1?3:0,S=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),S!==-1&&S>>2;b.length<=m;)b.push(0);b[m]|=(g>>>16-8*f&255)<<8*(H+l*(A%4)),y+=1}}return{value:b,binLen:8*y+a}}(t,i,s,n)};case"BYTES":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(h=0;h>>2,p.length<=f&&p.push(0),p[f]|=d<<8*(A+l*(g%4));return{value:p,binLen:8*u.length+a}}(t,i,s,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(Q)}return function(t,i,s){return function(u,c,a,l){return _(new Uint8Array(u),c,a,l)}(t,i,s,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(W)}return function(t,i,s){return _(t,i,s,n)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function ee(r,e,n,t){switch(r){case"HEX":return function(i){return function(s,u,c,a){const l="0123456789abcdef";let d,h,f="";const g=u/8,p=c===-1?3:0;for(d=0;d>>2]>>>8*(p+c*(d%4)),f+=l.charAt(h>>>4&15)+l.charAt(15&h);return a.outputUpper?f.toUpperCase():f}(i,e,n,t)};case"B64":return function(i){return function(s,u,c,a){let l,d,h,f,g,p="";const m=u/8,A=c===-1?3:0;for(l=0;l>>2]:0,g=l+2>>2]:0,h=(s[l>>>2]>>>8*(A+c*(l%4))&255)<<16|(f>>>8*(A+c*((l+1)%4))&255)<<8|g>>>8*(A+c*((l+2)%4))&255,d=0;d<4;d+=1)p+=8*l+6*d<=u?J.charAt(h>>>6*(3-d)&63):a.b64Pad;return p}(i,e,n,t)};case"BYTES":return function(i){return function(s,u,c){let a,l,d="";const h=u/8,f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255,d+=String.fromCharCode(l);return d}(i,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(i){throw new Error(Q)}return function(i){return function(s,u,c){let a;const l=u/8,d=new ArrayBuffer(l),h=new Uint8Array(d),f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255;return d}(i,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(i){throw new Error(W)}return function(i){return function(s,u,c){let a;const l=u/8,d=c===-1?3:0,h=new Uint8Array(l);for(a=0;a>>2]>>>8*(d+c*(a%4))&255;return h}(i,e,n)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const k=4294967296,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],$=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],P="Chosen SHA variant is not supported",te="Cannot set numRounds with MAC";function z(r,e){let n,t;const i=r.binLen>>>3,s=e.binLen>>>3,u=i<<3,c=4-i<<3;if(i%4!=0){for(n=0;n>>2,r.value[t]|=e.value[n>>>2]<>>2]>>>c;return(r.value.length<<2)-4>=s+i&&r.value.pop(),{value:r.value,binLen:r.binLen+e.binLen}}return{value:r.value.concat(e.value),binLen:r.binLen+e.binLen}}function ne(r){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},t="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(t);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(t);e.outputLen=n.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function K(r,e,n,t){const i=r+" must include a value and format";if(!e){if(!t)throw new Error(i);return t}if(e.value===void 0||!e.format)throw new Error(i);return B(e.format,e.encoding||"UTF8",n)(e.value)}class j{constructor(e,n,t){const i=t||{};if(this.t=n,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let n,t=0;const i=this.m>>>5,s=this.C(e,this.h,this.u),u=s.binLen,c=s.value,a=u>>>5;for(n=0;n>>5),this.u=u%this.m,this.l=!0,this}getHash(e,n){let t,i,s=this.R;const u=ne(n);if(this.K){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const c=ee(e,s,this.T,u);if(this.H&&this.g)return c(this.g(u));for(i=this.F(this.h.slice(),this.u,this.A,this.L(this.U),s),t=1;t>>24-s%32),i=this.F(i,s,0,this.B(this.o),s);return c(i)}setHMACKey(e,n,t){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=B(n,(t||{}).encoding||"UTF8",this.T);this.k(i(e))}k(e){const n=this.m>>>3,t=n/4-1;let i;if(this.numRounds!==1)throw new Error(te);if(this.H)throw new Error("MAC key already set");for(n>>32-e}function L(r,e){return r>>>e|r<<32-e}function re(r,e){return r>>>e}function ie(r,e,n){return r^e^n}function se(r,e,n){return r&e^~r&n}function oe(r,e,n){return r&e^r&n^e&n}function ye(r){return L(r,2)^L(r,13)^L(r,22)}function I(r,e){const n=(65535&r)+(65535&e);return(65535&(r>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function He(r,e,n,t){const i=(65535&r)+(65535&e)+(65535&n)+(65535&t);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16))<<16|65535&i}function O(r,e,n,t,i){const s=(65535&r)+(65535&e)+(65535&n)+(65535&t)+(65535&i);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16)+(s>>>16))<<16|65535&s}function Ee(r){return L(r,7)^L(r,18)^re(r,3)}function Ne(r){return L(r,6)^L(r,11)^L(r,25)}function ve(r){return[1732584193,4023233417,2562383102,271733878,3285377520]}function ue(r,e){let n,t,i,s,u,c,a;const l=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],a=0;a<80;a+=1)l[a]=a<16?r[a]:F(l[a-3]^l[a-8]^l[a-14]^l[a-16],1),c=a<20?O(F(n,5),se(t,i,s),u,1518500249,l[a]):a<40?O(F(n,5),ie(t,i,s),u,1859775393,l[a]):a<60?O(F(n,5),oe(t,i,s),u,2400959708,l[a]):O(F(n,5),ie(t,i,s),u,3395469782,l[a]),u=s,s=i,i=F(t,30),t=n,n=c;return e[0]=I(n,e[0]),e[1]=I(t,e[1]),e[2]=I(i,e[2]),e[3]=I(s,e[3]),e[4]=I(u,e[4]),e}function Se(r,e,n,t){let i;const s=15+(e+65>>>9<<4),u=e+n;for(;r.length<=s;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[s]=4294967295&u,r[s-1]=u/k|0,i=0;i>>9<<4),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/k|0,g=0;g32?(n=64-e,new o(r.I<>>n,r.N<>>n)):e!==0?(n=32-e,new o(r.N<>>n,r.I<>>n)):r}function R(r,e){let n;return e<32?(n=32-e,new o(r.N>>>e|r.I<>>e|r.N<>>e|r.N<>>e|r.I<>>e,r.I>>>e|r.N<<32-e)}function Re(r,e,n){return new o(r.N&e.N^r.N&n.N^e.N&n.N,r.I&e.I^r.I&n.I^e.I&n.I)}function Te(r){const e=R(r,28),n=R(r,34),t=R(r,39);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function U(r,e){let n,t;n=(65535&r.I)+(65535&e.I),t=(r.I>>>16)+(e.I>>>16)+(n>>>16);const i=(65535&t)<<16|65535&n;return n=(65535&r.N)+(65535&e.N)+(t>>>16),t=(r.N>>>16)+(e.N>>>16)+(n>>>16),new o((65535&t)<<16|65535&n,i)}function Ce(r,e,n,t){let i,s;i=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I),s=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i>>>16);const u=(65535&s)<<16|65535&i;return i=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(s>>>16),s=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i>>>16),new o((65535&s)<<16|65535&i,u)}function $e(r,e,n,t,i){let s,u;s=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I)+(65535&i.I),u=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i.I>>>16)+(s>>>16);const c=(65535&u)<<16|65535&s;return s=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(65535&i.N)+(u>>>16),u=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i.N>>>16)+(s>>>16),new o((65535&u)<<16|65535&s,c)}function Y(r,e){return new o(r.N^e.N,r.I^e.I)}function Ke(r){const e=R(r,19),n=R(r,61),t=le(r,6);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Be(r){const e=R(r,1),n=R(r,8),t=le(r,7);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Fe(r){const e=R(r,14),n=R(r,18),t=R(r,41);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}const Me=[new o(w[0],3609767458),new o(w[1],602891725),new o(w[2],3964484399),new o(w[3],2173295548),new o(w[4],4081628472),new o(w[5],3053834265),new o(w[6],2937671579),new o(w[7],3664609560),new o(w[8],2734883394),new o(w[9],1164996542),new o(w[10],1323610764),new o(w[11],3590304994),new o(w[12],4068182383),new o(w[13],991336113),new o(w[14],633803317),new o(w[15],3479774868),new o(w[16],2666613458),new o(w[17],944711139),new o(w[18],2341262773),new o(w[19],2007800933),new o(w[20],1495990901),new o(w[21],1856431235),new o(w[22],3175218132),new o(w[23],2198950837),new o(w[24],3999719339),new o(w[25],766784016),new o(w[26],2566594879),new o(w[27],3203337956),new o(w[28],1034457026),new o(w[29],2466948901),new o(w[30],3758326383),new o(w[31],168717936),new o(w[32],1188179964),new o(w[33],1546045734),new o(w[34],1522805485),new o(w[35],2643833823),new o(w[36],2343527390),new o(w[37],1014477480),new o(w[38],1206759142),new o(w[39],344077627),new o(w[40],1290863460),new o(w[41],3158454273),new o(w[42],3505952657),new o(w[43],106217008),new o(w[44],3606008344),new o(w[45],1432725776),new o(w[46],1467031594),new o(w[47],851169720),new o(w[48],3100823752),new o(w[49],1363258195),new o(w[50],3750685593),new o(w[51],3785050280),new o(w[52],3318307427),new o(w[53],3812723403),new o(w[54],2003034995),new o(w[55],3602036899),new o(w[56],1575990012),new o(w[57],1125592928),new o(w[58],2716904306),new o(w[59],442776044),new o(w[60],593698344),new o(w[61],3733110249),new o(w[62],2999351573),new o(w[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)];function fe(r){return r==="SHA-384"?[new o(3418070365,C[0]),new o(1654270250,C[1]),new o(2438529370,C[2]),new o(355462360,C[3]),new o(1731405415,C[4]),new o(41048885895,C[5]),new o(3675008525,C[6]),new o(1203062813,C[7])]:[new o($[0],4089235720),new o($[1],2227873595),new o($[2],4271175723),new o($[3],1595750129),new o($[4],2917565137),new o($[5],725511199),new o($[6],4215389547),new o($[7],327033209)]}function we(r,e){let n,t,i,s,u,c,a,l,d,h,f,g;const p=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],c=e[5],a=e[6],l=e[7],f=0;f<80;f+=1)f<16?(g=2*f,p[f]=new o(r[g],r[g+1])):p[f]=Ce(Ke(p[f-2]),p[f-7],Be(p[f-15]),p[f-16]),d=$e(l,Fe(u),(A=c,y=a,new o((m=u).N&A.N^~m.N&y.N,m.I&A.I^~m.I&y.I)),Me[f],p[f]),h=U(Te(n),Re(n,t,i)),l=a,a=c,c=u,u=U(s,d),s=i,i=t,t=n,n=U(d,h);var m,A,y;return e[0]=U(n,e[0]),e[1]=U(t,e[1]),e[2]=U(i,e[2]),e[3]=U(s,e[3]),e[4]=U(u,e[4]),e[5]=U(c,e[5]),e[6]=U(a,e[6]),e[7]=U(l,e[7]),e}let ke=class extends j{constructor(r,e,n){if(r!=="SHA-384"&&r!=="SHA-512")throw new Error(P);super(r,e,n);const t=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=B(this.t,this.i,this.T),this.v=we,this.L=function(i){return i.slice()},this.B=fe,this.F=function(i,s,u,c){return function(a,l,d,h,f){let g,p;const m=31+(l+129>>>10<<5),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/k|0,g=0;g>>1)%5][(t>>>1)/5|0]=Y(e[(t>>>1)%5][(t>>>1)/5|0],new o(r[t+1],r[t]));for(n=0;n<24;n+=1){for(s=G(),t=0;t<5;t+=1)u[t]=(a=e[t][0],l=e[t][1],d=e[t][2],h=e[t][3],f=e[t][4],new o(a.N^l.N^d.N^h.N^f.N,a.I^l.I^d.I^h.I^f.I));for(t=0;t<5;t+=1)c[t]=Y(u[(t+4)%5],ce(u[(t+1)%5],1));for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=Y(e[t][i],c[t]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)s[i][(2*t+3*i)%5]=ce(e[t][i],Oe[t][i]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=Y(s[t][i],new o(~s[(t+1)%5][i].N&s[(t+2)%5][i].N,~s[(t+1)%5][i].I&s[(t+2)%5][i].I));e[0][0]=Y(e[0][0],Pe[n])}var a,l,d,h,f;return e}function de(r){let e,n,t=0;const i=[0,0],s=[4294967295&r,r/k&2097151];for(e=6;e>=0;e--)n=s[e>>2]>>>8*e&255,n===0&&t===0||(i[t+1>>2]|=n<<8*(t+1),t+=1);return t=t!==0?t:1,i[0]|=t,{value:t+1>4?i:[i[0]],binLen:8+8*t}}function Z(r){return z(de(r.binLen),r)}function ge(r,e){let n,t=de(e);t=z(t,r);const i=e>>>2,s=(i-t.value.length%i)%i;for(n=0;n>>5,be=f>>>5;for(b=0;b=m;b+=X)p=D(h.slice(b,b+X),p),f-=m;for(h=h.slice(b),f%=m;h.length>>3,h[b>>2]^=A<=y));)S.push(v.N),H+=1,64*H%m==0&&(D(null,p),H=0);return S}(u,c,0,l,i,t,d)},s.hmacKey&&this.k(K("hmacKey",s.hmacKey,this.T))}O(r,e){const n=function(i){const s=i||{};return{funcName:K("funcName",s.funcName,1,{value:[],binLen:0}),customization:K("Customization",s.customization,1,{value:[],binLen:0})}}(r||{});e&&(n.funcName=e);const t=z(Z(n.funcName),Z(n.customization));if(n.customization.binLen!==0||n.funcName.binLen!==0){const i=ge(t,this.m>>>3);for(let s=0;s>>5)this.U=this.v(i.slice(s,s+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(r){const e=function(t){const i=t||{};return{kmacKey:K("kmacKey",i.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:K("Customization",i.customization,1,{value:[],binLen:0})}}(r||{});this.O(r,e.funcName);const n=ge(Z(e.kmacKey),this.m>>>3);for(let t=0;t>>5)this.U=this.v(n.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(r){const e=z({value:this.h.slice(),binLen:this.u},function(n){let t,i,s=0;const u=[0,0],c=[4294967295&n,n/k&2097151];for(t=6;t>=0;t--)i=c[t>>2]>>>8*t&255,i===0&&s===0||(u[s>>2]|=i<<8*s,s+=1);return s=s!==0?s:1,u[s>>2]|=s<<8*s,{value:s+1>4?u:[u[0]],binLen:8+8*s}}(r.outputLen));return this.F(e.value,e.binLen,this.A,this.L(this.U),r.outputLen)}};class Xe{constructor(e,n,t){if(e=="SHA-1")this.P=new Ue(e,n,t);else if(e=="SHA-224"||e=="SHA-256")this.P=new Le(e,n,t);else if(e=="SHA-384"||e=="SHA-512")this.P=new ke(e,n,t);else{if(e!="SHA3-224"&&e!="SHA3-256"&&e!="SHA3-384"&&e!="SHA3-512"&&e!="SHAKE128"&&e!="SHAKE256"&&e!="CSHAKE128"&&e!="CSHAKE256"&&e!="KMAC128"&&e!="KMAC256")throw new Error(P);this.P=new xe(e,n,t)}}update(e){return this.P.update(e),this}getHash(e,n){return this.P.getHash(e,n)}setHMACKey(e,n,t){this.P.setHMACKey(e,n,t)}getHMAC(e,n){return this.P.getHMAC(e,n)}}const M=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),ze={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},je=(r,e,n)=>{q!=null;{const t=ze[r.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const i=new Xe(t,"ARRAYBUFFER");return i.setHMACKey(e,"ARRAYBUFFER"),i.update(n),i.getHMAC("ARRAYBUFFER")}},V="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",De=r=>{let e=r.length;for(;r[e-1]==="=";)--e;const n=(e=8&&(s-=8,i[c++]=u>>>s)}return t},qe=r=>{const e=new Uint8Array(r);let n=0,t=0,i="";for(let s=0;s=5;)i+=V[t>>>n-5&31],n-=5;return n>0&&(i+=V[t<<5-n&31]),i},Ge=r=>{const e=new ArrayBuffer(r.length/2),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{const e=new ArrayBuffer(r.length),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{if(!pe)throw new Error("Encoding API not available");return pe.encode(r).buffer},We=r=>{if(!me)throw new Error("Encoding API not available");return me.decode(r)},_e=r=>{var e;if(q!=null,!((e=M.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return M.crypto.getRandomValues(new Uint8Array(r)).buffer};class T{constructor({buffer:e,size:n=20}={}){this.buffer=typeof e=="undefined"?_e(n):e}static fromLatin1(e){return new T({buffer:Ve(e)})}static fromUTF8(e){return new T({buffer:Qe(e)})}static fromBase32(e){return new T({buffer:De(e)})}static fromHex(e){return new T({buffer:Ge(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:Je(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:We(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:qe(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:Ze(this.buffer)}),this.hex}}const et=(r,e)=>{q!=null;{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let n=-1,t=0;for(;++n0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class N{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=N.defaults.issuer,label:n=N.defaults.label,issuerInLabel:t=N.defaults.issuerInLabel,secret:i=new T,algorithm:s=N.defaults.algorithm,digits:u=N.defaults.digits,period:c=N.defaults.period}={}){this.issuer=e,this.label=n,this.issuerInLabel=t,this.secret=typeof i=="string"?T.fromBase32(i):i,this.algorithm=s.toUpperCase(),this.digits=u,this.period=c}static generate({secret:e,algorithm:n,digits:t,period:i=N.defaults.period,timestamp:s=Date.now()}){return x.generate({secret:e,algorithm:n,digits:t,counter:Math.floor(s/1e3/i)})}generate({timestamp:e=Date.now()}={}){return N.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:n,algorithm:t,digits:i,period:s=N.defaults.period,timestamp:u=Date.now(),window:c}){return x.validate({token:e,secret:n,algorithm:t,digits:i,counter:Math.floor(u/1e3/s),window:c})}validate({token:e,timestamp:n,window:t}){return N.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const nt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,rt=/^[2-7A-Z]+=*$/i,it=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,st=/^[+-]?\d+$/,Ae=/^\+?[1-9]\d*$/;class ot{static parse(e){let n;try{n=e.match(nt)}catch(a){}if(!Array.isArray(n))throw new URIError("Invalid URI format");const t=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),s=n[3].split("&").reduce((a,l)=>{const d=l.split(/=(.*)/,2).map(decodeURIComponent),h=d[0].toLowerCase(),f=d[1],g=a;return g[h]=f,g},{});let u;const c={};if(t==="hotp")if(u=x,typeof s.counter!="undefined"&&st.test(s.counter))c.counter=parseInt(s.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(u=N,typeof s.period!="undefined")if(Ae.test(s.period))c.period=parseInt(s.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof s.issuer!="undefined"&&(c.issuer=s.issuer),i.length===2?(c.label=i[1],typeof c.issuer=="undefined"||c.issuer===""?c.issuer=i[0]:i[0]===""&&(c.issuerInLabel=!1)):(c.label=i[0],typeof c.issuer!="undefined"&&c.issuer!==""&&(c.issuerInLabel=!1)),typeof s.secret!="undefined"&&rt.test(s.secret))c.secret=s.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof s.algorithm!="undefined")if(it.test(s.algorithm))c.algorithm=s.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof s.digits!="undefined")if(Ae.test(s.digits))c.digits=parseInt(s.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new u(c)}static stringify(e){if(e instanceof x||e instanceof N)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const ut="9.2.1";export{x as HOTP,T as Secret,N as TOTP,ot as URI,ut as version};
+const Ie=r=>{const e=new ArrayBuffer(8),n=new Uint8Array(e);let t=r;for(let i=7;i>=0&&t!==0;i--)n[i]=t&255,t-=n[i],t/=256;return e},ht=void 0,at=void 0,ct=void 0;var q=Object.freeze({__proto__:null,createHmac:void 0,randomBytes:void 0,timingSafeEqual:void 0});const J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q="ARRAYBUFFER not supported by this environment",W="UINT8ARRAY not supported by this environment";function _(r,e,n,t){let i,s,u;const c=e||[0],a=(n=n||0)>>>3,l=t===-1?3:0;for(i=0;i>>2,c.length<=s&&c.push(0),c[s]|=r[i]<<8*(l+t*(u%4));return{value:c,binLen:8*r.length+n}}function B(r,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(d=0;d>>1)+m,f=g>>>2;p.length<=f;)p.push(0);p[f]|=h<<8*(A+l*(g%4))}return{value:p,binLen:4*u.length+a}}(t,i,s,n)};case"TEXT":return function(t,i,s){return function(u,c,a,l,d){let h,f,g,p,m,A,y,b,v=0;const H=a||[0],S=(l=l||0)>>>3;if(c==="UTF8")for(y=d===-1?3:0,g=0;gh?f.push(h):2048>h?(f.push(192|h>>>6),f.push(128|63&h)):55296>h||57344<=h?f.push(224|h>>>12,128|h>>>6&63,128|63&h):(g+=1,h=65536+((1023&h)<<10|1023&u.charCodeAt(g)),f.push(240|h>>>18,128|h>>>12&63,128|h>>>6&63,128|63&h)),p=0;p>>2;H.length<=m;)H.push(0);H[m]|=f[p]<<8*(y+d*(A%4)),v+=1}else for(y=d===-1?2:0,b=c==="UTF16LE"&&d!==1||c!=="UTF16LE"&&d===1,g=0;g>>8),A=v+S,m=A>>>2;H.length<=m;)H.push(0);H[m]|=h<<8*(y+d*(A%4)),v+=2}return{value:H,binLen:8*v+l}}(t,e,i,s,n)};case"B64":return function(t,i,s){return function(u,c,a,l){let d,h,f,g,p,m,A,y=0;const b=c||[0],v=(a=a||0)>>>3,H=l===-1?3:0,S=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),S!==-1&&S>>2;b.length<=m;)b.push(0);b[m]|=(g>>>16-8*f&255)<<8*(H+l*(A%4)),y+=1}}return{value:b,binLen:8*y+a}}(t,i,s,n)};case"BYTES":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(h=0;h>>2,p.length<=f&&p.push(0),p[f]|=d<<8*(A+l*(g%4));return{value:p,binLen:8*u.length+a}}(t,i,s,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(Q)}return function(t,i,s){return function(u,c,a,l){return _(new Uint8Array(u),c,a,l)}(t,i,s,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(W)}return function(t,i,s){return _(t,i,s,n)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function ee(r,e,n,t){switch(r){case"HEX":return function(i){return function(s,u,c,a){const l="0123456789abcdef";let d,h,f="";const g=u/8,p=c===-1?3:0;for(d=0;d>>2]>>>8*(p+c*(d%4)),f+=l.charAt(h>>>4&15)+l.charAt(15&h);return a.outputUpper?f.toUpperCase():f}(i,e,n,t)};case"B64":return function(i){return function(s,u,c,a){let l,d,h,f,g,p="";const m=u/8,A=c===-1?3:0;for(l=0;l>>2]:0,g=l+2>>2]:0,h=(s[l>>>2]>>>8*(A+c*(l%4))&255)<<16|(f>>>8*(A+c*((l+1)%4))&255)<<8|g>>>8*(A+c*((l+2)%4))&255,d=0;d<4;d+=1)p+=8*l+6*d<=u?J.charAt(h>>>6*(3-d)&63):a.b64Pad;return p}(i,e,n,t)};case"BYTES":return function(i){return function(s,u,c){let a,l,d="";const h=u/8,f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255,d+=String.fromCharCode(l);return d}(i,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(i){throw new Error(Q)}return function(i){return function(s,u,c){let a;const l=u/8,d=new ArrayBuffer(l),h=new Uint8Array(d),f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255;return d}(i,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(i){throw new Error(W)}return function(i){return function(s,u,c){let a;const l=u/8,d=c===-1?3:0,h=new Uint8Array(l);for(a=0;a>>2]>>>8*(d+c*(a%4))&255;return h}(i,e,n)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const k=4294967296,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],$=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],P="Chosen SHA variant is not supported",te="Cannot set numRounds with MAC";function z(r,e){let n,t;const i=r.binLen>>>3,s=e.binLen>>>3,u=i<<3,c=4-i<<3;if(i%4!=0){for(n=0;n>>2,r.value[t]|=e.value[n>>>2]<>>2]>>>c;return(r.value.length<<2)-4>=s+i&&r.value.pop(),{value:r.value,binLen:r.binLen+e.binLen}}return{value:r.value.concat(e.value),binLen:r.binLen+e.binLen}}function ne(r){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},t="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(t);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(t);e.outputLen=n.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function K(r,e,n,t){const i=r+" must include a value and format";if(!e){if(!t)throw new Error(i);return t}if(e.value===void 0||!e.format)throw new Error(i);return B(e.format,e.encoding||"UTF8",n)(e.value)}class j{constructor(e,n,t){const i=t||{};if(this.t=n,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let n,t=0;const i=this.m>>>5,s=this.C(e,this.h,this.u),u=s.binLen,c=s.value,a=u>>>5;for(n=0;n>>5),this.u=u%this.m,this.l=!0,this}getHash(e,n){let t,i,s=this.R;const u=ne(n);if(this.K){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const c=ee(e,s,this.T,u);if(this.H&&this.g)return c(this.g(u));for(i=this.F(this.h.slice(),this.u,this.A,this.L(this.U),s),t=1;t>>24-s%32),i=this.F(i,s,0,this.B(this.o),s);return c(i)}setHMACKey(e,n,t){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=B(n,(t||{}).encoding||"UTF8",this.T);this.k(i(e))}k(e){const n=this.m>>>3,t=n/4-1;let i;if(this.numRounds!==1)throw new Error(te);if(this.H)throw new Error("MAC key already set");for(n>>32-e}function L(r,e){return r>>>e|r<<32-e}function re(r,e){return r>>>e}function ie(r,e,n){return r^e^n}function se(r,e,n){return r&e^~r&n}function oe(r,e,n){return r&e^r&n^e&n}function ye(r){return L(r,2)^L(r,13)^L(r,22)}function I(r,e){const n=(65535&r)+(65535&e);return(65535&(r>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function He(r,e,n,t){const i=(65535&r)+(65535&e)+(65535&n)+(65535&t);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16))<<16|65535&i}function O(r,e,n,t,i){const s=(65535&r)+(65535&e)+(65535&n)+(65535&t)+(65535&i);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16)+(s>>>16))<<16|65535&s}function Ee(r){return L(r,7)^L(r,18)^re(r,3)}function Ne(r){return L(r,6)^L(r,11)^L(r,25)}function ve(r){return[1732584193,4023233417,2562383102,271733878,3285377520]}function ue(r,e){let n,t,i,s,u,c,a;const l=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],a=0;a<80;a+=1)l[a]=a<16?r[a]:F(l[a-3]^l[a-8]^l[a-14]^l[a-16],1),c=a<20?O(F(n,5),se(t,i,s),u,1518500249,l[a]):a<40?O(F(n,5),ie(t,i,s),u,1859775393,l[a]):a<60?O(F(n,5),oe(t,i,s),u,2400959708,l[a]):O(F(n,5),ie(t,i,s),u,3395469782,l[a]),u=s,s=i,i=F(t,30),t=n,n=c;return e[0]=I(n,e[0]),e[1]=I(t,e[1]),e[2]=I(i,e[2]),e[3]=I(s,e[3]),e[4]=I(u,e[4]),e}function Se(r,e,n,t){let i;const s=15+(e+65>>>9<<4),u=e+n;for(;r.length<=s;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[s]=4294967295&u,r[s-1]=u/k|0,i=0;i>>9<<4),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/k|0,g=0;g32?(n=64-e,new o(r.I<>>n,r.N<>>n)):e!==0?(n=32-e,new o(r.N<>>n,r.I<>>n)):r}function R(r,e){let n;return e<32?(n=32-e,new o(r.N>>>e|r.I<>>e|r.N<>>e|r.N<>>e|r.I<>>e,r.I>>>e|r.N<<32-e)}function Re(r,e,n){return new o(r.N&e.N^r.N&n.N^e.N&n.N,r.I&e.I^r.I&n.I^e.I&n.I)}function Te(r){const e=R(r,28),n=R(r,34),t=R(r,39);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function U(r,e){let n,t;n=(65535&r.I)+(65535&e.I),t=(r.I>>>16)+(e.I>>>16)+(n>>>16);const i=(65535&t)<<16|65535&n;return n=(65535&r.N)+(65535&e.N)+(t>>>16),t=(r.N>>>16)+(e.N>>>16)+(n>>>16),new o((65535&t)<<16|65535&n,i)}function Ce(r,e,n,t){let i,s;i=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I),s=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i>>>16);const u=(65535&s)<<16|65535&i;return i=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(s>>>16),s=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i>>>16),new o((65535&s)<<16|65535&i,u)}function $e(r,e,n,t,i){let s,u;s=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I)+(65535&i.I),u=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i.I>>>16)+(s>>>16);const c=(65535&u)<<16|65535&s;return s=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(65535&i.N)+(u>>>16),u=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i.N>>>16)+(s>>>16),new o((65535&u)<<16|65535&s,c)}function Y(r,e){return new o(r.N^e.N,r.I^e.I)}function Ke(r){const e=R(r,19),n=R(r,61),t=le(r,6);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Be(r){const e=R(r,1),n=R(r,8),t=le(r,7);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Fe(r){const e=R(r,14),n=R(r,18),t=R(r,41);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}const Me=[new o(w[0],3609767458),new o(w[1],602891725),new o(w[2],3964484399),new o(w[3],2173295548),new o(w[4],4081628472),new o(w[5],3053834265),new o(w[6],2937671579),new o(w[7],3664609560),new o(w[8],2734883394),new o(w[9],1164996542),new o(w[10],1323610764),new o(w[11],3590304994),new o(w[12],4068182383),new o(w[13],991336113),new o(w[14],633803317),new o(w[15],3479774868),new o(w[16],2666613458),new o(w[17],944711139),new o(w[18],2341262773),new o(w[19],2007800933),new o(w[20],1495990901),new o(w[21],1856431235),new o(w[22],3175218132),new o(w[23],2198950837),new o(w[24],3999719339),new o(w[25],766784016),new o(w[26],2566594879),new o(w[27],3203337956),new o(w[28],1034457026),new o(w[29],2466948901),new o(w[30],3758326383),new o(w[31],168717936),new o(w[32],1188179964),new o(w[33],1546045734),new o(w[34],1522805485),new o(w[35],2643833823),new o(w[36],2343527390),new o(w[37],1014477480),new o(w[38],1206759142),new o(w[39],344077627),new o(w[40],1290863460),new o(w[41],3158454273),new o(w[42],3505952657),new o(w[43],106217008),new o(w[44],3606008344),new o(w[45],1432725776),new o(w[46],1467031594),new o(w[47],851169720),new o(w[48],3100823752),new o(w[49],1363258195),new o(w[50],3750685593),new o(w[51],3785050280),new o(w[52],3318307427),new o(w[53],3812723403),new o(w[54],2003034995),new o(w[55],3602036899),new o(w[56],1575990012),new o(w[57],1125592928),new o(w[58],2716904306),new o(w[59],442776044),new o(w[60],593698344),new o(w[61],3733110249),new o(w[62],2999351573),new o(w[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)];function fe(r){return r==="SHA-384"?[new o(3418070365,C[0]),new o(1654270250,C[1]),new o(2438529370,C[2]),new o(355462360,C[3]),new o(1731405415,C[4]),new o(41048885895,C[5]),new o(3675008525,C[6]),new o(1203062813,C[7])]:[new o($[0],4089235720),new o($[1],2227873595),new o($[2],4271175723),new o($[3],1595750129),new o($[4],2917565137),new o($[5],725511199),new o($[6],4215389547),new o($[7],327033209)]}function we(r,e){let n,t,i,s,u,c,a,l,d,h,f,g;const p=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],c=e[5],a=e[6],l=e[7],f=0;f<80;f+=1)f<16?(g=2*f,p[f]=new o(r[g],r[g+1])):p[f]=Ce(Ke(p[f-2]),p[f-7],Be(p[f-15]),p[f-16]),d=$e(l,Fe(u),(A=c,y=a,new o((m=u).N&A.N^~m.N&y.N,m.I&A.I^~m.I&y.I)),Me[f],p[f]),h=U(Te(n),Re(n,t,i)),l=a,a=c,c=u,u=U(s,d),s=i,i=t,t=n,n=U(d,h);var m,A,y;return e[0]=U(n,e[0]),e[1]=U(t,e[1]),e[2]=U(i,e[2]),e[3]=U(s,e[3]),e[4]=U(u,e[4]),e[5]=U(c,e[5]),e[6]=U(a,e[6]),e[7]=U(l,e[7]),e}let ke=class extends j{constructor(r,e,n){if(r!=="SHA-384"&&r!=="SHA-512")throw new Error(P);super(r,e,n);const t=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=B(this.t,this.i,this.T),this.v=we,this.L=function(i){return i.slice()},this.B=fe,this.F=function(i,s,u,c){return function(a,l,d,h,f){let g,p;const m=31+(l+129>>>10<<5),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/k|0,g=0;g>>1)%5][(t>>>1)/5|0]=Y(e[(t>>>1)%5][(t>>>1)/5|0],new o(r[t+1],r[t]));for(n=0;n<24;n+=1){for(s=G(),t=0;t<5;t+=1)u[t]=(a=e[t][0],l=e[t][1],d=e[t][2],h=e[t][3],f=e[t][4],new o(a.N^l.N^d.N^h.N^f.N,a.I^l.I^d.I^h.I^f.I));for(t=0;t<5;t+=1)c[t]=Y(u[(t+4)%5],ce(u[(t+1)%5],1));for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=Y(e[t][i],c[t]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)s[i][(2*t+3*i)%5]=ce(e[t][i],Oe[t][i]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=Y(s[t][i],new o(~s[(t+1)%5][i].N&s[(t+2)%5][i].N,~s[(t+1)%5][i].I&s[(t+2)%5][i].I));e[0][0]=Y(e[0][0],Pe[n])}var a,l,d,h,f;return e}function de(r){let e,n,t=0;const i=[0,0],s=[4294967295&r,r/k&2097151];for(e=6;e>=0;e--)n=s[e>>2]>>>8*e&255,n===0&&t===0||(i[t+1>>2]|=n<<8*(t+1),t+=1);return t=t!==0?t:1,i[0]|=t,{value:t+1>4?i:[i[0]],binLen:8+8*t}}function Z(r){return z(de(r.binLen),r)}function ge(r,e){let n,t=de(e);t=z(t,r);const i=e>>>2,s=(i-t.value.length%i)%i;for(n=0;n>>5,be=f>>>5;for(b=0;b=m;b+=X)p=D(h.slice(b,b+X),p),f-=m;for(h=h.slice(b),f%=m;h.length>>3,h[b>>2]^=A<=y));)S.push(v.N),H+=1,64*H%m==0&&(D(null,p),H=0);return S}(u,c,0,l,i,t,d)},s.hmacKey&&this.k(K("hmacKey",s.hmacKey,this.T))}O(r,e){const n=function(i){const s=i||{};return{funcName:K("funcName",s.funcName,1,{value:[],binLen:0}),customization:K("Customization",s.customization,1,{value:[],binLen:0})}}(r||{});e&&(n.funcName=e);const t=z(Z(n.funcName),Z(n.customization));if(n.customization.binLen!==0||n.funcName.binLen!==0){const i=ge(t,this.m>>>3);for(let s=0;s>>5)this.U=this.v(i.slice(s,s+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(r){const e=function(t){const i=t||{};return{kmacKey:K("kmacKey",i.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:K("Customization",i.customization,1,{value:[],binLen:0})}}(r||{});this.O(r,e.funcName);const n=ge(Z(e.kmacKey),this.m>>>3);for(let t=0;t>>5)this.U=this.v(n.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(r){const e=z({value:this.h.slice(),binLen:this.u},function(n){let t,i,s=0;const u=[0,0],c=[4294967295&n,n/k&2097151];for(t=6;t>=0;t--)i=c[t>>2]>>>8*t&255,i===0&&s===0||(u[s>>2]|=i<<8*s,s+=1);return s=s!==0?s:1,u[s>>2]|=s<<8*s,{value:s+1>4?u:[u[0]],binLen:8+8*s}}(r.outputLen));return this.F(e.value,e.binLen,this.A,this.L(this.U),r.outputLen)}};class Xe{constructor(e,n,t){if(e=="SHA-1")this.P=new Ue(e,n,t);else if(e=="SHA-224"||e=="SHA-256")this.P=new Le(e,n,t);else if(e=="SHA-384"||e=="SHA-512")this.P=new ke(e,n,t);else{if(e!="SHA3-224"&&e!="SHA3-256"&&e!="SHA3-384"&&e!="SHA3-512"&&e!="SHAKE128"&&e!="SHAKE256"&&e!="CSHAKE128"&&e!="CSHAKE256"&&e!="KMAC128"&&e!="KMAC256")throw new Error(P);this.P=new xe(e,n,t)}}update(e){return this.P.update(e),this}getHash(e,n){return this.P.getHash(e,n)}setHMACKey(e,n,t){this.P.setHMACKey(e,n,t)}getHMAC(e,n){return this.P.getHMAC(e,n)}}const M=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),ze={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},je=(r,e,n)=>{q!=null;{const t=ze[r.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const i=new Xe(t,"ARRAYBUFFER");return i.setHMACKey(e,"ARRAYBUFFER"),i.update(n),i.getHMAC("ARRAYBUFFER")}},V="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",De=r=>{let e=r.length;for(;r[e-1]==="=";)--e;const n=(e=8&&(s-=8,i[c++]=u>>>s)}return t},qe=r=>{const e=new Uint8Array(r);let n=0,t=0,i="";for(let s=0;s=5;)i+=V[t>>>n-5&31],n-=5;return n>0&&(i+=V[t<<5-n&31]),i},Ge=r=>{const e=new ArrayBuffer(r.length/2),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{const e=new ArrayBuffer(r.length),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{if(!pe)throw new Error("Encoding API not available");return pe.encode(r).buffer},We=r=>{if(!me)throw new Error("Encoding API not available");return me.decode(r)},_e=r=>{var e;if(q!=null,!((e=M.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return M.crypto.getRandomValues(new Uint8Array(r)).buffer};class T{constructor({buffer:e,size:n=20}={}){this.buffer=typeof e=="undefined"?_e(n):e}static fromLatin1(e){return new T({buffer:Ve(e)})}static fromUTF8(e){return new T({buffer:Qe(e)})}static fromBase32(e){return new T({buffer:De(e)})}static fromHex(e){return new T({buffer:Ge(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:Je(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:We(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:qe(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:Ze(this.buffer)}),this.hex}}const et=(r,e)=>{q!=null;{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let n=-1,t=0;for(;++n0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class N{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=N.defaults.issuer,label:n=N.defaults.label,issuerInLabel:t=N.defaults.issuerInLabel,secret:i=new T,algorithm:s=N.defaults.algorithm,digits:u=N.defaults.digits,period:c=N.defaults.period}={}){this.issuer=e,this.label=n,this.issuerInLabel=t,this.secret=typeof i=="string"?T.fromBase32(i):i,this.algorithm=s.toUpperCase(),this.digits=u,this.period=c}static generate({secret:e,algorithm:n,digits:t,period:i=N.defaults.period,timestamp:s=Date.now()}){return x.generate({secret:e,algorithm:n,digits:t,counter:Math.floor(s/1e3/i)})}generate({timestamp:e=Date.now()}={}){return N.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:n,algorithm:t,digits:i,period:s=N.defaults.period,timestamp:u=Date.now(),window:c}){return x.validate({token:e,secret:n,algorithm:t,digits:i,counter:Math.floor(u/1e3/s),window:c})}validate({token:e,timestamp:n,window:t}){return N.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const nt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,rt=/^[2-7A-Z]+=*$/i,it=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,st=/^[+-]?\d+$/,Ae=/^\+?[1-9]\d*$/;class ot{static parse(e){let n;try{n=e.match(nt)}catch(a){}if(!Array.isArray(n))throw new URIError("Invalid URI format");const t=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),s=n[3].split("&").reduce((a,l)=>{const d=l.split(/=(.*)/,2).map(decodeURIComponent),h=d[0].toLowerCase(),f=d[1],g=a;return g[h]=f,g},{});let u;const c={};if(t==="hotp")if(u=x,typeof s.counter!="undefined"&&st.test(s.counter))c.counter=parseInt(s.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(u=N,typeof s.period!="undefined")if(Ae.test(s.period))c.period=parseInt(s.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof s.issuer!="undefined"&&(c.issuer=s.issuer),i.length===2?(c.label=i[1],typeof c.issuer=="undefined"||c.issuer===""?c.issuer=i[0]:i[0]===""&&(c.issuerInLabel=!1)):(c.label=i[0],typeof c.issuer!="undefined"&&c.issuer!==""&&(c.issuerInLabel=!1)),typeof s.secret!="undefined"&&rt.test(s.secret))c.secret=s.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof s.algorithm!="undefined")if(it.test(s.algorithm))c.algorithm=s.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof s.digits!="undefined")if(Ae.test(s.digits))c.digits=parseInt(s.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new u(c)}static stringify(e){if(e instanceof x||e instanceof N)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const ut="9.2.2";export{x as HOTP,T as Secret,N as TOTP,ot as URI,ut as version};
//# sourceMappingURL=otpauth.esm.min.js.map
diff --git a/dist/otpauth.node.cjs b/dist/otpauth.node.cjs
index 8103a80..83edb3a 100644
--- a/dist/otpauth.node.cjs
+++ b/dist/otpauth.node.cjs
@@ -959,7 +959,7 @@ class URI {
* Library version.
* @type {string}
*/
-const version = "9.2.1";
+const version = "9.2.2";
exports.HOTP = HOTP;
exports.Secret = Secret;
diff --git a/dist/otpauth.node.min.cjs b/dist/otpauth.node.min.cjs
index 946ad85..41f071d 100644
--- a/dist/otpauth.node.min.cjs
+++ b/dist/otpauth.node.min.cjs
@@ -1,3 +1,3 @@
///
-"use strict";var H=require("node:crypto");function T(s){var e=Object.create(null);return s&&Object.keys(s).forEach(function(r){if(r!=="default"){var t=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:function(){return s[r]}})}}),e.default=s,Object.freeze(e)}var c=T(H);const v=s=>{const e=new ArrayBuffer(8),r=new Uint8Array(e);let t=s;for(let n=7;n>=0&&t!==0;n--)r[n]=t&255,t-=r[n],t/=256;return e};var U=void 0;const d=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),E={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},O=(s,e,r)=>{if(c!=null&&c.createHmac){const t=c.createHmac(s,d.Buffer.from(e));return t.update(d.Buffer.from(r)),t.digest().buffer}else{const t=E[s.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const n=new U(t,"ARRAYBUFFER");return n.setHMACKey(e,"ARRAYBUFFER"),n.update(r),n.getHMAC("ARRAYBUFFER")}},m="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",L=s=>{let e=s.length;for(;s[e-1]==="=";)--e;const r=(e=8&&(i-=8,n[o++]=a>>>i)}return t},B=s=>{const e=new Uint8Array(s);let r=0,t=0,n="";for(let i=0;i=5;)n+=m[t>>>r-5&31],r-=5;return r>0&&(n+=m[t<<5-r&31]),n},C=s=>{const e=new ArrayBuffer(s.length/2),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(s);let r="";for(let t=0;t{const e=new ArrayBuffer(s.length),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(s);let r="";for(let t=0;t{if(!y)throw new Error("Encoding API not available");return y.encode(s).buffer},D=s=>{if(!A)throw new Error("Encoding API not available");return A.decode(s)},F=s=>{var e;if(c!=null&&c.randomBytes)return c.randomBytes(s).buffer;if(!((e=d.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return d.crypto.getRandomValues(new Uint8Array(s)).buffer};class h{constructor({buffer:e,size:r=20}={}){this.buffer=typeof e=="undefined"?F(r):e}static fromLatin1(e){return new h({buffer:P(e)})}static fromUTF8(e){return new h({buffer:x(e)})}static fromBase32(e){return new h({buffer:L(e)})}static fromHex(e){return new h({buffer:C(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:j(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:D(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:B(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:R(this.buffer)}),this.hex}}const M=(s,e)=>{if(c!=null&&c.timingSafeEqual)return c.timingSafeEqual(d.Buffer.from(s),d.Buffer.from(e));{if(s.length!==e.length)throw new TypeError("Input strings must have the same length");let r=-1,t=0;for(;++r0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class u{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=u.defaults.issuer,label:r=u.defaults.label,issuerInLabel:t=u.defaults.issuerInLabel,secret:n=new h,algorithm:i=u.defaults.algorithm,digits:a=u.defaults.digits,period:o=u.defaults.period}={}){this.issuer=e,this.label=r,this.issuerInLabel=t,this.secret=typeof n=="string"?h.fromBase32(n):n,this.algorithm=i.toUpperCase(),this.digits=a,this.period=o}static generate({secret:e,algorithm:r,digits:t,period:n=u.defaults.period,timestamp:i=Date.now()}){return p.generate({secret:e,algorithm:r,digits:t,counter:Math.floor(i/1e3/n)})}generate({timestamp:e=Date.now()}={}){return u.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:r,algorithm:t,digits:n,period:i=u.defaults.period,timestamp:a=Date.now(),window:o}){return p.validate({token:e,secret:r,algorithm:t,digits:n,counter:Math.floor(a/1e3/i),window:o})}validate({token:e,timestamp:r,window:t}){return u.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const G=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,Y=/^[2-7A-Z]+=*$/i,Z=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,q=/^[+-]?\d+$/,$=/^\+?[1-9]\d*$/;class V{static parse(e){let r;try{r=e.match(G)}catch(f){}if(!Array.isArray(r))throw new URIError("Invalid URI format");const t=r[1].toLowerCase(),n=r[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),i=r[3].split("&").reduce((f,g)=>{const w=g.split(/=(.*)/,2).map(decodeURIComponent),I=w[0].toLowerCase(),S=w[1],b=f;return b[I]=S,b},{});let a;const o={};if(t==="hotp")if(a=p,typeof i.counter!="undefined"&&q.test(i.counter))o.counter=parseInt(i.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(a=u,typeof i.period!="undefined")if($.test(i.period))o.period=parseInt(i.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof i.issuer!="undefined"&&(o.issuer=i.issuer),n.length===2?(o.label=n[1],typeof o.issuer=="undefined"||o.issuer===""?o.issuer=n[0]:n[0]===""&&(o.issuerInLabel=!1)):(o.label=n[0],typeof o.issuer!="undefined"&&o.issuer!==""&&(o.issuerInLabel=!1)),typeof i.secret!="undefined"&&Y.test(i.secret))o.secret=i.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof i.algorithm!="undefined")if(Z.test(i.algorithm))o.algorithm=i.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof i.digits!="undefined")if($.test(i.digits))o.digits=parseInt(i.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new a(o)}static stringify(e){if(e instanceof p||e instanceof u)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const z="9.2.1";exports.HOTP=p,exports.Secret=h,exports.TOTP=u,exports.URI=V,exports.version=z;
+"use strict";var H=require("node:crypto");function T(s){var e=Object.create(null);return s&&Object.keys(s).forEach(function(r){if(r!=="default"){var t=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:function(){return s[r]}})}}),e.default=s,Object.freeze(e)}var c=T(H);const v=s=>{const e=new ArrayBuffer(8),r=new Uint8Array(e);let t=s;for(let n=7;n>=0&&t!==0;n--)r[n]=t&255,t-=r[n],t/=256;return e};var U=void 0;const d=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),E={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},O=(s,e,r)=>{if(c!=null&&c.createHmac){const t=c.createHmac(s,d.Buffer.from(e));return t.update(d.Buffer.from(r)),t.digest().buffer}else{const t=E[s.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const n=new U(t,"ARRAYBUFFER");return n.setHMACKey(e,"ARRAYBUFFER"),n.update(r),n.getHMAC("ARRAYBUFFER")}},m="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",L=s=>{let e=s.length;for(;s[e-1]==="=";)--e;const r=(e=8&&(i-=8,n[o++]=a>>>i)}return t},B=s=>{const e=new Uint8Array(s);let r=0,t=0,n="";for(let i=0;i=5;)n+=m[t>>>r-5&31],r-=5;return r>0&&(n+=m[t<<5-r&31]),n},C=s=>{const e=new ArrayBuffer(s.length/2),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(s);let r="";for(let t=0;t{const e=new ArrayBuffer(s.length),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(s);let r="";for(let t=0;t{if(!y)throw new Error("Encoding API not available");return y.encode(s).buffer},D=s=>{if(!A)throw new Error("Encoding API not available");return A.decode(s)},F=s=>{var e;if(c!=null&&c.randomBytes)return c.randomBytes(s).buffer;if(!((e=d.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return d.crypto.getRandomValues(new Uint8Array(s)).buffer};class h{constructor({buffer:e,size:r=20}={}){this.buffer=typeof e=="undefined"?F(r):e}static fromLatin1(e){return new h({buffer:P(e)})}static fromUTF8(e){return new h({buffer:x(e)})}static fromBase32(e){return new h({buffer:L(e)})}static fromHex(e){return new h({buffer:C(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:j(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:D(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:B(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:R(this.buffer)}),this.hex}}const M=(s,e)=>{if(c!=null&&c.timingSafeEqual)return c.timingSafeEqual(d.Buffer.from(s),d.Buffer.from(e));{if(s.length!==e.length)throw new TypeError("Input strings must have the same length");let r=-1,t=0;for(;++r0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class u{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=u.defaults.issuer,label:r=u.defaults.label,issuerInLabel:t=u.defaults.issuerInLabel,secret:n=new h,algorithm:i=u.defaults.algorithm,digits:a=u.defaults.digits,period:o=u.defaults.period}={}){this.issuer=e,this.label=r,this.issuerInLabel=t,this.secret=typeof n=="string"?h.fromBase32(n):n,this.algorithm=i.toUpperCase(),this.digits=a,this.period=o}static generate({secret:e,algorithm:r,digits:t,period:n=u.defaults.period,timestamp:i=Date.now()}){return p.generate({secret:e,algorithm:r,digits:t,counter:Math.floor(i/1e3/n)})}generate({timestamp:e=Date.now()}={}){return u.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:r,algorithm:t,digits:n,period:i=u.defaults.period,timestamp:a=Date.now(),window:o}){return p.validate({token:e,secret:r,algorithm:t,digits:n,counter:Math.floor(a/1e3/i),window:o})}validate({token:e,timestamp:r,window:t}){return u.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const G=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,Y=/^[2-7A-Z]+=*$/i,Z=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,q=/^[+-]?\d+$/,$=/^\+?[1-9]\d*$/;class V{static parse(e){let r;try{r=e.match(G)}catch(f){}if(!Array.isArray(r))throw new URIError("Invalid URI format");const t=r[1].toLowerCase(),n=r[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),i=r[3].split("&").reduce((f,g)=>{const w=g.split(/=(.*)/,2).map(decodeURIComponent),I=w[0].toLowerCase(),S=w[1],b=f;return b[I]=S,b},{});let a;const o={};if(t==="hotp")if(a=p,typeof i.counter!="undefined"&&q.test(i.counter))o.counter=parseInt(i.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(a=u,typeof i.period!="undefined")if($.test(i.period))o.period=parseInt(i.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof i.issuer!="undefined"&&(o.issuer=i.issuer),n.length===2?(o.label=n[1],typeof o.issuer=="undefined"||o.issuer===""?o.issuer=n[0]:n[0]===""&&(o.issuerInLabel=!1)):(o.label=n[0],typeof o.issuer!="undefined"&&o.issuer!==""&&(o.issuerInLabel=!1)),typeof i.secret!="undefined"&&Y.test(i.secret))o.secret=i.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof i.algorithm!="undefined")if(Z.test(i.algorithm))o.algorithm=i.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof i.digits!="undefined")if($.test(i.digits))o.digits=parseInt(i.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new a(o)}static stringify(e){if(e instanceof p||e instanceof u)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const z="9.2.2";exports.HOTP=p,exports.Secret=h,exports.TOTP=u,exports.URI=V,exports.version=z;
//# sourceMappingURL=otpauth.node.min.cjs.map
diff --git a/dist/otpauth.node.min.mjs b/dist/otpauth.node.min.mjs
index a5a7747..d0b97a2 100644
--- a/dist/otpauth.node.min.mjs
+++ b/dist/otpauth.node.min.mjs
@@ -1,3 +1,3 @@
///
-import*as c from"node:crypto";const H=n=>{const e=new ArrayBuffer(8),r=new Uint8Array(e);let t=n;for(let s=7;s>=0&&t!==0;s--)r[s]=t&255,t-=r[s],t/=256;return e};var T=void 0;const d=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),U={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},v=(n,e,r)=>{if(c!=null&&c.createHmac){const t=c.createHmac(n,d.Buffer.from(e));return t.update(d.Buffer.from(r)),t.digest().buffer}else{const t=U[n.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const s=new T(t,"ARRAYBUFFER");return s.setHMACKey(e,"ARRAYBUFFER"),s.update(r),s.getHMAC("ARRAYBUFFER")}},m="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",E=n=>{let e=n.length;for(;n[e-1]==="=";)--e;const r=(e=8&&(i-=8,s[o++]=a>>>i)}return t},L=n=>{const e=new Uint8Array(n);let r=0,t=0,s="";for(let i=0;i=5;)s+=m[t>>>r-5&31],r-=5;return r>0&&(s+=m[t<<5-r&31]),s},B=n=>{const e=new ArrayBuffer(n.length/2),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(n);let r="";for(let t=0;t{const e=new ArrayBuffer(n.length),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(n);let r="";for(let t=0;t{if(!y)throw new Error("Encoding API not available");return y.encode(n).buffer},x=n=>{if(!A)throw new Error("Encoding API not available");return A.decode(n)},j=n=>{var e;if(c!=null&&c.randomBytes)return c.randomBytes(n).buffer;if(!((e=d.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return d.crypto.getRandomValues(new Uint8Array(n)).buffer};class h{constructor({buffer:e,size:r=20}={}){this.buffer=typeof e=="undefined"?j(r):e}static fromLatin1(e){return new h({buffer:O(e)})}static fromUTF8(e){return new h({buffer:P(e)})}static fromBase32(e){return new h({buffer:E(e)})}static fromHex(e){return new h({buffer:B(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:R(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:x(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:L(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:C(this.buffer)}),this.hex}}const k=(n,e)=>{if(c!=null&&c.timingSafeEqual)return c.timingSafeEqual(d.Buffer.from(n),d.Buffer.from(e));{if(n.length!==e.length)throw new TypeError("Input strings must have the same length");let r=-1,t=0;for(;++r0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class u{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=u.defaults.issuer,label:r=u.defaults.label,issuerInLabel:t=u.defaults.issuerInLabel,secret:s=new h,algorithm:i=u.defaults.algorithm,digits:a=u.defaults.digits,period:o=u.defaults.period}={}){this.issuer=e,this.label=r,this.issuerInLabel=t,this.secret=typeof s=="string"?h.fromBase32(s):s,this.algorithm=i.toUpperCase(),this.digits=a,this.period=o}static generate({secret:e,algorithm:r,digits:t,period:s=u.defaults.period,timestamp:i=Date.now()}){return p.generate({secret:e,algorithm:r,digits:t,counter:Math.floor(i/1e3/s)})}generate({timestamp:e=Date.now()}={}){return u.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:r,algorithm:t,digits:s,period:i=u.defaults.period,timestamp:a=Date.now(),window:o}){return p.validate({token:e,secret:r,algorithm:t,digits:s,counter:Math.floor(a/1e3/i),window:o})}validate({token:e,timestamp:r,window:t}){return u.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const M=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,D=/^[2-7A-Z]+=*$/i,G=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,Y=/^[+-]?\d+$/,$=/^\+?[1-9]\d*$/;class Z{static parse(e){let r;try{r=e.match(M)}catch(f){}if(!Array.isArray(r))throw new URIError("Invalid URI format");const t=r[1].toLowerCase(),s=r[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),i=r[3].split("&").reduce((f,g)=>{const w=g.split(/=(.*)/,2).map(decodeURIComponent),I=w[0].toLowerCase(),S=w[1],b=f;return b[I]=S,b},{});let a;const o={};if(t==="hotp")if(a=p,typeof i.counter!="undefined"&&Y.test(i.counter))o.counter=parseInt(i.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(a=u,typeof i.period!="undefined")if($.test(i.period))o.period=parseInt(i.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof i.issuer!="undefined"&&(o.issuer=i.issuer),s.length===2?(o.label=s[1],typeof o.issuer=="undefined"||o.issuer===""?o.issuer=s[0]:s[0]===""&&(o.issuerInLabel=!1)):(o.label=s[0],typeof o.issuer!="undefined"&&o.issuer!==""&&(o.issuerInLabel=!1)),typeof i.secret!="undefined"&&D.test(i.secret))o.secret=i.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof i.algorithm!="undefined")if(G.test(i.algorithm))o.algorithm=i.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof i.digits!="undefined")if($.test(i.digits))o.digits=parseInt(i.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new a(o)}static stringify(e){if(e instanceof p||e instanceof u)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const V="9.2.1";export{p as HOTP,h as Secret,u as TOTP,Z as URI,V as version};
+import*as c from"node:crypto";const H=n=>{const e=new ArrayBuffer(8),r=new Uint8Array(e);let t=n;for(let s=7;s>=0&&t!==0;s--)r[s]=t&255,t-=r[s],t/=256;return e};var T=void 0;const d=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),U={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},v=(n,e,r)=>{if(c!=null&&c.createHmac){const t=c.createHmac(n,d.Buffer.from(e));return t.update(d.Buffer.from(r)),t.digest().buffer}else{const t=U[n.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const s=new T(t,"ARRAYBUFFER");return s.setHMACKey(e,"ARRAYBUFFER"),s.update(r),s.getHMAC("ARRAYBUFFER")}},m="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",E=n=>{let e=n.length;for(;n[e-1]==="=";)--e;const r=(e=8&&(i-=8,s[o++]=a>>>i)}return t},L=n=>{const e=new Uint8Array(n);let r=0,t=0,s="";for(let i=0;i=5;)s+=m[t>>>r-5&31],r-=5;return r>0&&(s+=m[t<<5-r&31]),s},B=n=>{const e=new ArrayBuffer(n.length/2),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(n);let r="";for(let t=0;t{const e=new ArrayBuffer(n.length),r=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(n);let r="";for(let t=0;t{if(!y)throw new Error("Encoding API not available");return y.encode(n).buffer},x=n=>{if(!A)throw new Error("Encoding API not available");return A.decode(n)},j=n=>{var e;if(c!=null&&c.randomBytes)return c.randomBytes(n).buffer;if(!((e=d.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return d.crypto.getRandomValues(new Uint8Array(n)).buffer};class h{constructor({buffer:e,size:r=20}={}){this.buffer=typeof e=="undefined"?j(r):e}static fromLatin1(e){return new h({buffer:O(e)})}static fromUTF8(e){return new h({buffer:P(e)})}static fromBase32(e){return new h({buffer:E(e)})}static fromHex(e){return new h({buffer:B(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:R(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:x(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:L(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:C(this.buffer)}),this.hex}}const k=(n,e)=>{if(c!=null&&c.timingSafeEqual)return c.timingSafeEqual(d.Buffer.from(n),d.Buffer.from(e));{if(n.length!==e.length)throw new TypeError("Input strings must have the same length");let r=-1,t=0;for(;++r0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class u{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=u.defaults.issuer,label:r=u.defaults.label,issuerInLabel:t=u.defaults.issuerInLabel,secret:s=new h,algorithm:i=u.defaults.algorithm,digits:a=u.defaults.digits,period:o=u.defaults.period}={}){this.issuer=e,this.label=r,this.issuerInLabel=t,this.secret=typeof s=="string"?h.fromBase32(s):s,this.algorithm=i.toUpperCase(),this.digits=a,this.period=o}static generate({secret:e,algorithm:r,digits:t,period:s=u.defaults.period,timestamp:i=Date.now()}){return p.generate({secret:e,algorithm:r,digits:t,counter:Math.floor(i/1e3/s)})}generate({timestamp:e=Date.now()}={}){return u.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:r,algorithm:t,digits:s,period:i=u.defaults.period,timestamp:a=Date.now(),window:o}){return p.validate({token:e,secret:r,algorithm:t,digits:s,counter:Math.floor(a/1e3/i),window:o})}validate({token:e,timestamp:r,window:t}){return u.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const M=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,D=/^[2-7A-Z]+=*$/i,G=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,Y=/^[+-]?\d+$/,$=/^\+?[1-9]\d*$/;class Z{static parse(e){let r;try{r=e.match(M)}catch(f){}if(!Array.isArray(r))throw new URIError("Invalid URI format");const t=r[1].toLowerCase(),s=r[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),i=r[3].split("&").reduce((f,g)=>{const w=g.split(/=(.*)/,2).map(decodeURIComponent),I=w[0].toLowerCase(),S=w[1],b=f;return b[I]=S,b},{});let a;const o={};if(t==="hotp")if(a=p,typeof i.counter!="undefined"&&Y.test(i.counter))o.counter=parseInt(i.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(a=u,typeof i.period!="undefined")if($.test(i.period))o.period=parseInt(i.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof i.issuer!="undefined"&&(o.issuer=i.issuer),s.length===2?(o.label=s[1],typeof o.issuer=="undefined"||o.issuer===""?o.issuer=s[0]:s[0]===""&&(o.issuerInLabel=!1)):(o.label=s[0],typeof o.issuer!="undefined"&&o.issuer!==""&&(o.issuerInLabel=!1)),typeof i.secret!="undefined"&&D.test(i.secret))o.secret=i.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof i.algorithm!="undefined")if(G.test(i.algorithm))o.algorithm=i.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof i.digits!="undefined")if($.test(i.digits))o.digits=parseInt(i.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new a(o)}static stringify(e){if(e instanceof p||e instanceof u)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const V="9.2.2";export{p as HOTP,h as Secret,u as TOTP,Z as URI,V as version};
//# sourceMappingURL=otpauth.node.min.mjs.map
diff --git a/dist/otpauth.node.mjs b/dist/otpauth.node.mjs
index fea4660..ff658f0 100644
--- a/dist/otpauth.node.mjs
+++ b/dist/otpauth.node.mjs
@@ -938,6 +938,6 @@ class URI {
* Library version.
* @type {string}
*/
-const version = "9.2.1";
+const version = "9.2.2";
export { HOTP, Secret, TOTP, URI, version };
diff --git a/dist/otpauth.umd.js b/dist/otpauth.umd.js
index 78b9584..2381874 100644
--- a/dist/otpauth.umd.js
+++ b/dist/otpauth.umd.js
@@ -1656,7 +1656,7 @@
* Library version.
* @type {string}
*/
- const version = "9.2.1";
+ const version = "9.2.2";
exports.HOTP = HOTP;
exports.Secret = Secret;
diff --git a/dist/otpauth.umd.min.js b/dist/otpauth.umd.min.js
index 0c51114..401c889 100644
--- a/dist/otpauth.umd.min.js
+++ b/dist/otpauth.umd.min.js
@@ -1,3 +1,3 @@
///
-(function(C,P){typeof exports=="object"&&typeof module!="undefined"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(C=typeof globalThis!="undefined"?globalThis:C||self,P(C.OTPAuth={}))})(this,function(C){"use strict";const P=r=>{const e=new ArrayBuffer(8),n=new Uint8Array(e);let t=r;for(let i=7;i>=0&&t!==0;i--)n[i]=t&255,t-=n[i],t/=256;return e};var Z=Object.freeze({__proto__:null,createHmac:void 0,randomBytes:void 0,timingSafeEqual:void 0});const W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_="ARRAYBUFFER not supported by this environment",ee="UINT8ARRAY not supported by this environment";function te(r,e,n,t){let i,s,u;const c=e||[0],a=(n=n||0)>>>3,l=t===-1?3:0;for(i=0;i>>2,c.length<=s&&c.push(0),c[s]|=r[i]<<8*(l+t*(u%4));return{value:c,binLen:8*r.length+n}}function F(r,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(d=0;d>>1)+m,f=g>>>2;p.length<=f;)p.push(0);p[f]|=h<<8*(A+l*(g%4))}return{value:p,binLen:4*u.length+a}}(t,i,s,n)};case"TEXT":return function(t,i,s){return function(u,c,a,l,d){let h,f,g,p,m,A,y,b,S=0;const H=a||[0],U=(l=l||0)>>>3;if(c==="UTF8")for(y=d===-1?3:0,g=0;gh?f.push(h):2048>h?(f.push(192|h>>>6),f.push(128|63&h)):55296>h||57344<=h?f.push(224|h>>>12,128|h>>>6&63,128|63&h):(g+=1,h=65536+((1023&h)<<10|1023&u.charCodeAt(g)),f.push(240|h>>>18,128|h>>>12&63,128|h>>>6&63,128|63&h)),p=0;p>>2;H.length<=m;)H.push(0);H[m]|=f[p]<<8*(y+d*(A%4)),S+=1}else for(y=d===-1?2:0,b=c==="UTF16LE"&&d!==1||c!=="UTF16LE"&&d===1,g=0;g>>8),A=S+U,m=A>>>2;H.length<=m;)H.push(0);H[m]|=h<<8*(y+d*(A%4)),S+=2}return{value:H,binLen:8*S+l}}(t,e,i,s,n)};case"B64":return function(t,i,s){return function(u,c,a,l){let d,h,f,g,p,m,A,y=0;const b=c||[0],S=(a=a||0)>>>3,H=l===-1?3:0,U=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),U!==-1&&U>>2;b.length<=m;)b.push(0);b[m]|=(g>>>16-8*f&255)<<8*(H+l*(A%4)),y+=1}}return{value:b,binLen:8*y+a}}(t,i,s,n)};case"BYTES":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(h=0;h>>2,p.length<=f&&p.push(0),p[f]|=d<<8*(A+l*(g%4));return{value:p,binLen:8*u.length+a}}(t,i,s,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(_)}return function(t,i,s){return function(u,c,a,l){return te(new Uint8Array(u),c,a,l)}(t,i,s,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(ee)}return function(t,i,s){return te(t,i,s,n)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function ne(r,e,n,t){switch(r){case"HEX":return function(i){return function(s,u,c,a){const l="0123456789abcdef";let d,h,f="";const g=u/8,p=c===-1?3:0;for(d=0;d>>2]>>>8*(p+c*(d%4)),f+=l.charAt(h>>>4&15)+l.charAt(15&h);return a.outputUpper?f.toUpperCase():f}(i,e,n,t)};case"B64":return function(i){return function(s,u,c,a){let l,d,h,f,g,p="";const m=u/8,A=c===-1?3:0;for(l=0;l>>2]:0,g=l+2>>2]:0,h=(s[l>>>2]>>>8*(A+c*(l%4))&255)<<16|(f>>>8*(A+c*((l+1)%4))&255)<<8|g>>>8*(A+c*((l+2)%4))&255,d=0;d<4;d+=1)p+=8*l+6*d<=u?W.charAt(h>>>6*(3-d)&63):a.b64Pad;return p}(i,e,n,t)};case"BYTES":return function(i){return function(s,u,c){let a,l,d="";const h=u/8,f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255,d+=String.fromCharCode(l);return d}(i,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(i){throw new Error(_)}return function(i){return function(s,u,c){let a;const l=u/8,d=new ArrayBuffer(l),h=new Uint8Array(d),f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255;return d}(i,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(i){throw new Error(ee)}return function(i){return function(s,u,c){let a;const l=u/8,d=c===-1?3:0,h=new Uint8Array(l);for(a=0;a>>2]>>>8*(d+c*(a%4))&255;return h}(i,e,n)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const O=4294967296,w=[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],$=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],K=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Y="Chosen SHA variant is not supported",re="Cannot set numRounds with MAC";function z(r,e){let n,t;const i=r.binLen>>>3,s=e.binLen>>>3,u=i<<3,c=4-i<<3;if(i%4!=0){for(n=0;n>>2,r.value[t]|=e.value[n>>>2]<>>2]>>>c;return(r.value.length<<2)-4>=s+i&&r.value.pop(),{value:r.value,binLen:r.binLen+e.binLen}}return{value:r.value.concat(e.value),binLen:r.binLen+e.binLen}}function ie(r){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},t="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(t);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(t);e.outputLen=n.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function B(r,e,n,t){const i=r+" must include a value and format";if(!e){if(!t)throw new Error(i);return t}if(e.value===void 0||!e.format)throw new Error(i);return F(e.format,e.encoding||"UTF8",n)(e.value)}class D{constructor(e,n,t){const i=t||{};if(this.t=n,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let n,t=0;const i=this.m>>>5,s=this.C(e,this.h,this.u),u=s.binLen,c=s.value,a=u>>>5;for(n=0;n>>5),this.u=u%this.m,this.l=!0,this}getHash(e,n){let t,i,s=this.R;const u=ie(n);if(this.K){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const c=ne(e,s,this.T,u);if(this.H&&this.g)return c(this.g(u));for(i=this.F(this.h.slice(),this.u,this.A,this.L(this.U),s),t=1;t>>24-s%32),i=this.F(i,s,0,this.B(this.o),s);return c(i)}setHMACKey(e,n,t){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=F(n,(t||{}).encoding||"UTF8",this.T);this.k(i(e))}k(e){const n=this.m>>>3,t=n/4-1;let i;if(this.numRounds!==1)throw new Error(re);if(this.H)throw new Error("MAC key already set");for(n>>32-e}function L(r,e){return r>>>e|r<<32-e}function se(r,e){return r>>>e}function oe(r,e,n){return r^e^n}function ue(r,e,n){return r&e^~r&n}function he(r,e,n){return r&e^r&n^e&n}function ye(r){return L(r,2)^L(r,13)^L(r,22)}function I(r,e){const n=(65535&r)+(65535&e);return(65535&(r>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function He(r,e,n,t){const i=(65535&r)+(65535&e)+(65535&n)+(65535&t);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16))<<16|65535&i}function x(r,e,n,t,i){const s=(65535&r)+(65535&e)+(65535&n)+(65535&t)+(65535&i);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16)+(s>>>16))<<16|65535&s}function Ee(r){return L(r,7)^L(r,18)^se(r,3)}function Ne(r){return L(r,6)^L(r,11)^L(r,25)}function ve(r){return[1732584193,4023233417,2562383102,271733878,3285377520]}function ae(r,e){let n,t,i,s,u,c,a;const l=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],a=0;a<80;a+=1)l[a]=a<16?r[a]:M(l[a-3]^l[a-8]^l[a-14]^l[a-16],1),c=a<20?x(M(n,5),ue(t,i,s),u,1518500249,l[a]):a<40?x(M(n,5),oe(t,i,s),u,1859775393,l[a]):a<60?x(M(n,5),he(t,i,s),u,2400959708,l[a]):x(M(n,5),oe(t,i,s),u,3395469782,l[a]),u=s,s=i,i=M(t,30),t=n,n=c;return e[0]=I(n,e[0]),e[1]=I(t,e[1]),e[2]=I(i,e[2]),e[3]=I(s,e[3]),e[4]=I(u,e[4]),e}function Se(r,e,n,t){let i;const s=15+(e+65>>>9<<4),u=e+n;for(;r.length<=s;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[s]=4294967295&u,r[s-1]=u/O|0,i=0;i>>9<<4),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/O|0,g=0;g32?(n=64-e,new o(r.I<>>n,r.N<>>n)):e!==0?(n=32-e,new o(r.N<>>n,r.I<>>n)):r}function R(r,e){let n;return e<32?(n=32-e,new o(r.N>>>e|r.I<>>e|r.N<>>e|r.N<>>e|r.I<>>e,r.I>>>e|r.N<<32-e)}function Re(r,e,n){return new o(r.N&e.N^r.N&n.N^e.N&n.N,r.I&e.I^r.I&n.I^e.I&n.I)}function Te(r){const e=R(r,28),n=R(r,34),t=R(r,39);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function v(r,e){let n,t;n=(65535&r.I)+(65535&e.I),t=(r.I>>>16)+(e.I>>>16)+(n>>>16);const i=(65535&t)<<16|65535&n;return n=(65535&r.N)+(65535&e.N)+(t>>>16),t=(r.N>>>16)+(e.N>>>16)+(n>>>16),new o((65535&t)<<16|65535&n,i)}function Ce(r,e,n,t){let i,s;i=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I),s=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i>>>16);const u=(65535&s)<<16|65535&i;return i=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(s>>>16),s=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i>>>16),new o((65535&s)<<16|65535&i,u)}function $e(r,e,n,t,i){let s,u;s=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I)+(65535&i.I),u=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i.I>>>16)+(s>>>16);const c=(65535&u)<<16|65535&s;return s=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(65535&i.N)+(u>>>16),u=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i.N>>>16)+(s>>>16),new o((65535&u)<<16|65535&s,c)}function X(r,e){return new o(r.N^e.N,r.I^e.I)}function Ke(r){const e=R(r,19),n=R(r,61),t=we(r,6);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Be(r){const e=R(r,1),n=R(r,8),t=we(r,7);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Fe(r){const e=R(r,14),n=R(r,18),t=R(r,41);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}const Me=[new o(w[0],3609767458),new o(w[1],602891725),new o(w[2],3964484399),new o(w[3],2173295548),new o(w[4],4081628472),new o(w[5],3053834265),new o(w[6],2937671579),new o(w[7],3664609560),new o(w[8],2734883394),new o(w[9],1164996542),new o(w[10],1323610764),new o(w[11],3590304994),new o(w[12],4068182383),new o(w[13],991336113),new o(w[14],633803317),new o(w[15],3479774868),new o(w[16],2666613458),new o(w[17],944711139),new o(w[18],2341262773),new o(w[19],2007800933),new o(w[20],1495990901),new o(w[21],1856431235),new o(w[22],3175218132),new o(w[23],2198950837),new o(w[24],3999719339),new o(w[25],766784016),new o(w[26],2566594879),new o(w[27],3203337956),new o(w[28],1034457026),new o(w[29],2466948901),new o(w[30],3758326383),new o(w[31],168717936),new o(w[32],1188179964),new o(w[33],1546045734),new o(w[34],1522805485),new o(w[35],2643833823),new o(w[36],2343527390),new o(w[37],1014477480),new o(w[38],1206759142),new o(w[39],344077627),new o(w[40],1290863460),new o(w[41],3158454273),new o(w[42],3505952657),new o(w[43],106217008),new o(w[44],3606008344),new o(w[45],1432725776),new o(w[46],1467031594),new o(w[47],851169720),new o(w[48],3100823752),new o(w[49],1363258195),new o(w[50],3750685593),new o(w[51],3785050280),new o(w[52],3318307427),new o(w[53],3812723403),new o(w[54],2003034995),new o(w[55],3602036899),new o(w[56],1575990012),new o(w[57],1125592928),new o(w[58],2716904306),new o(w[59],442776044),new o(w[60],593698344),new o(w[61],3733110249),new o(w[62],2999351573),new o(w[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)];function de(r){return r==="SHA-384"?[new o(3418070365,$[0]),new o(1654270250,$[1]),new o(2438529370,$[2]),new o(355462360,$[3]),new o(1731405415,$[4]),new o(41048885895,$[5]),new o(3675008525,$[6]),new o(1203062813,$[7])]:[new o(K[0],4089235720),new o(K[1],2227873595),new o(K[2],4271175723),new o(K[3],1595750129),new o(K[4],2917565137),new o(K[5],725511199),new o(K[6],4215389547),new o(K[7],327033209)]}function ge(r,e){let n,t,i,s,u,c,a,l,d,h,f,g;const p=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],c=e[5],a=e[6],l=e[7],f=0;f<80;f+=1)f<16?(g=2*f,p[f]=new o(r[g],r[g+1])):p[f]=Ce(Ke(p[f-2]),p[f-7],Be(p[f-15]),p[f-16]),d=$e(l,Fe(u),(A=c,y=a,new o((m=u).N&A.N^~m.N&y.N,m.I&A.I^~m.I&y.I)),Me[f],p[f]),h=v(Te(n),Re(n,t,i)),l=a,a=c,c=u,u=v(s,d),s=i,i=t,t=n,n=v(d,h);var m,A,y;return e[0]=v(n,e[0]),e[1]=v(t,e[1]),e[2]=v(i,e[2]),e[3]=v(s,e[3]),e[4]=v(u,e[4]),e[5]=v(c,e[5]),e[6]=v(a,e[6]),e[7]=v(l,e[7]),e}let ke=class extends D{constructor(r,e,n){if(r!=="SHA-384"&&r!=="SHA-512")throw new Error(Y);super(r,e,n);const t=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=F(this.t,this.i,this.T),this.v=ge,this.L=function(i){return i.slice()},this.B=de,this.F=function(i,s,u,c){return function(a,l,d,h,f){let g,p;const m=31+(l+129>>>10<<5),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/O|0,g=0;g>>1)%5][(t>>>1)/5|0]=X(e[(t>>>1)%5][(t>>>1)/5|0],new o(r[t+1],r[t]));for(n=0;n<24;n+=1){for(s=V(),t=0;t<5;t+=1)u[t]=(a=e[t][0],l=e[t][1],d=e[t][2],h=e[t][3],f=e[t][4],new o(a.N^l.N^d.N^h.N^f.N,a.I^l.I^d.I^h.I^f.I));for(t=0;t<5;t+=1)c[t]=X(u[(t+4)%5],fe(u[(t+1)%5],1));for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=X(e[t][i],c[t]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)s[i][(2*t+3*i)%5]=fe(e[t][i],Oe[t][i]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=X(s[t][i],new o(~s[(t+1)%5][i].N&s[(t+2)%5][i].N,~s[(t+1)%5][i].I&s[(t+2)%5][i].I));e[0][0]=X(e[0][0],Pe[n])}var a,l,d,h,f;return e}function pe(r){let e,n,t=0;const i=[0,0],s=[4294967295&r,r/O&2097151];for(e=6;e>=0;e--)n=s[e>>2]>>>8*e&255,n===0&&t===0||(i[t+1>>2]|=n<<8*(t+1),t+=1);return t=t!==0?t:1,i[0]|=t,{value:t+1>4?i:[i[0]],binLen:8+8*t}}function J(r){return z(pe(r.binLen),r)}function me(r,e){let n,t=pe(e);t=z(t,r);const i=e>>>2,s=(i-t.value.length%i)%i;for(n=0;n>>5,ht=f>>>5;for(b=0;b=m;b+=G)p=q(h.slice(b,b+G),p),f-=m;for(h=h.slice(b),f%=m;h.length>>3,h[b>>2]^=A<=y));)U.push(S.N),H+=1,64*H%m==0&&(q(null,p),H=0);return U}(u,c,0,l,i,t,d)},s.hmacKey&&this.k(B("hmacKey",s.hmacKey,this.T))}O(r,e){const n=function(i){const s=i||{};return{funcName:B("funcName",s.funcName,1,{value:[],binLen:0}),customization:B("Customization",s.customization,1,{value:[],binLen:0})}}(r||{});e&&(n.funcName=e);const t=z(J(n.funcName),J(n.customization));if(n.customization.binLen!==0||n.funcName.binLen!==0){const i=me(t,this.m>>>3);for(let s=0;s>>5)this.U=this.v(i.slice(s,s+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(r){const e=function(t){const i=t||{};return{kmacKey:B("kmacKey",i.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:B("Customization",i.customization,1,{value:[],binLen:0})}}(r||{});this.O(r,e.funcName);const n=me(J(e.kmacKey),this.m>>>3);for(let t=0;t>>5)this.U=this.v(n.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(r){const e=z({value:this.h.slice(),binLen:this.u},function(n){let t,i,s=0;const u=[0,0],c=[4294967295&n,n/O&2097151];for(t=6;t>=0;t--)i=c[t>>2]>>>8*t&255,i===0&&s===0||(u[s>>2]|=i<<8*s,s+=1);return s=s!==0?s:1,u[s>>2]|=s<<8*s,{value:s+1>4?u:[u[0]],binLen:8+8*s}}(r.outputLen));return this.F(e.value,e.binLen,this.A,this.L(this.U),r.outputLen)}};class Xe{constructor(e,n,t){if(e=="SHA-1")this.P=new Ue(e,n,t);else if(e=="SHA-224"||e=="SHA-256")this.P=new Le(e,n,t);else if(e=="SHA-384"||e=="SHA-512")this.P=new ke(e,n,t);else{if(e!="SHA3-224"&&e!="SHA3-256"&&e!="SHA3-384"&&e!="SHA3-512"&&e!="SHAKE128"&&e!="SHAKE256"&&e!="CSHAKE128"&&e!="CSHAKE256"&&e!="KMAC128"&&e!="KMAC256")throw new Error(Y);this.P=new xe(e,n,t)}}update(e){return this.P.update(e),this}getHash(e,n){return this.P.getHash(e,n)}setHMACKey(e,n,t){this.P.setHMACKey(e,n,t)}getHMAC(e,n){return this.P.getHMAC(e,n)}}const k=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),je={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},ze=(r,e,n)=>{Z!=null;{const t=je[r.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const i=new Xe(t,"ARRAYBUFFER");return i.setHMACKey(e,"ARRAYBUFFER"),i.update(n),i.getHMAC("ARRAYBUFFER")}},Q="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",De=r=>{let e=r.length;for(;r[e-1]==="=";)--e;const n=(e=8&&(s-=8,i[c++]=u>>>s)}return t},qe=r=>{const e=new Uint8Array(r);let n=0,t=0,i="";for(let s=0;s=5;)i+=Q[t>>>n-5&31],n-=5;return n>0&&(i+=Q[t<<5-n&31]),i},Ge=r=>{const e=new ArrayBuffer(r.length/2),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{const e=new ArrayBuffer(r.length),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{if(!Ae)throw new Error("Encoding API not available");return Ae.encode(r).buffer},We=r=>{if(!be)throw new Error("Encoding API not available");return be.decode(r)},_e=r=>{var e;if(Z!=null,!((e=k.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return k.crypto.getRandomValues(new Uint8Array(r)).buffer};class T{constructor({buffer:e,size:n=20}={}){this.buffer=typeof e=="undefined"?_e(n):e}static fromLatin1(e){return new T({buffer:Ve(e)})}static fromUTF8(e){return new T({buffer:Qe(e)})}static fromBase32(e){return new T({buffer:De(e)})}static fromHex(e){return new T({buffer:Ge(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:Je(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:We(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:qe(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:Ze(this.buffer)}),this.hex}}const et=(r,e)=>{Z!=null;{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let n=-1,t=0;for(;++n0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class N{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=N.defaults.issuer,label:n=N.defaults.label,issuerInLabel:t=N.defaults.issuerInLabel,secret:i=new T,algorithm:s=N.defaults.algorithm,digits:u=N.defaults.digits,period:c=N.defaults.period}={}){this.issuer=e,this.label=n,this.issuerInLabel=t,this.secret=typeof i=="string"?T.fromBase32(i):i,this.algorithm=s.toUpperCase(),this.digits=u,this.period=c}static generate({secret:e,algorithm:n,digits:t,period:i=N.defaults.period,timestamp:s=Date.now()}){return j.generate({secret:e,algorithm:n,digits:t,counter:Math.floor(s/1e3/i)})}generate({timestamp:e=Date.now()}={}){return N.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:n,algorithm:t,digits:i,period:s=N.defaults.period,timestamp:u=Date.now(),window:c}){return j.validate({token:e,secret:n,algorithm:t,digits:i,counter:Math.floor(u/1e3/s),window:c})}validate({token:e,timestamp:n,window:t}){return N.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const nt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,rt=/^[2-7A-Z]+=*$/i,it=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,st=/^[+-]?\d+$/,Ie=/^\+?[1-9]\d*$/;class ot{static parse(e){let n;try{n=e.match(nt)}catch(a){}if(!Array.isArray(n))throw new URIError("Invalid URI format");const t=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),s=n[3].split("&").reduce((a,l)=>{const d=l.split(/=(.*)/,2).map(decodeURIComponent),h=d[0].toLowerCase(),f=d[1],g=a;return g[h]=f,g},{});let u;const c={};if(t==="hotp")if(u=j,typeof s.counter!="undefined"&&st.test(s.counter))c.counter=parseInt(s.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(u=N,typeof s.period!="undefined")if(Ie.test(s.period))c.period=parseInt(s.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof s.issuer!="undefined"&&(c.issuer=s.issuer),i.length===2?(c.label=i[1],typeof c.issuer=="undefined"||c.issuer===""?c.issuer=i[0]:i[0]===""&&(c.issuerInLabel=!1)):(c.label=i[0],typeof c.issuer!="undefined"&&c.issuer!==""&&(c.issuerInLabel=!1)),typeof s.secret!="undefined"&&rt.test(s.secret))c.secret=s.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof s.algorithm!="undefined")if(it.test(s.algorithm))c.algorithm=s.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof s.digits!="undefined")if(Ie.test(s.digits))c.digits=parseInt(s.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new u(c)}static stringify(e){if(e instanceof j||e instanceof N)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const ut="9.2.1";C.HOTP=j,C.Secret=T,C.TOTP=N,C.URI=ot,C.version=ut});
+(function(C,P){typeof exports=="object"&&typeof module!="undefined"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(C=typeof globalThis!="undefined"?globalThis:C||self,P(C.OTPAuth={}))})(this,function(C){"use strict";const P=r=>{const e=new ArrayBuffer(8),n=new Uint8Array(e);let t=r;for(let i=7;i>=0&&t!==0;i--)n[i]=t&255,t-=n[i],t/=256;return e};var Z=Object.freeze({__proto__:null,createHmac:void 0,randomBytes:void 0,timingSafeEqual:void 0});const W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_="ARRAYBUFFER not supported by this environment",ee="UINT8ARRAY not supported by this environment";function te(r,e,n,t){let i,s,u;const c=e||[0],a=(n=n||0)>>>3,l=t===-1?3:0;for(i=0;i>>2,c.length<=s&&c.push(0),c[s]|=r[i]<<8*(l+t*(u%4));return{value:c,binLen:8*r.length+n}}function F(r,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;if(u.length%2!=0)throw new Error("String of HEX type must be in byte increments");const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(d=0;d>>1)+m,f=g>>>2;p.length<=f;)p.push(0);p[f]|=h<<8*(A+l*(g%4))}return{value:p,binLen:4*u.length+a}}(t,i,s,n)};case"TEXT":return function(t,i,s){return function(u,c,a,l,d){let h,f,g,p,m,A,y,b,S=0;const H=a||[0],U=(l=l||0)>>>3;if(c==="UTF8")for(y=d===-1?3:0,g=0;gh?f.push(h):2048>h?(f.push(192|h>>>6),f.push(128|63&h)):55296>h||57344<=h?f.push(224|h>>>12,128|h>>>6&63,128|63&h):(g+=1,h=65536+((1023&h)<<10|1023&u.charCodeAt(g)),f.push(240|h>>>18,128|h>>>12&63,128|h>>>6&63,128|63&h)),p=0;p>>2;H.length<=m;)H.push(0);H[m]|=f[p]<<8*(y+d*(A%4)),S+=1}else for(y=d===-1?2:0,b=c==="UTF16LE"&&d!==1||c!=="UTF16LE"&&d===1,g=0;g>>8),A=S+U,m=A>>>2;H.length<=m;)H.push(0);H[m]|=h<<8*(y+d*(A%4)),S+=2}return{value:H,binLen:8*S+l}}(t,e,i,s,n)};case"B64":return function(t,i,s){return function(u,c,a,l){let d,h,f,g,p,m,A,y=0;const b=c||[0],S=(a=a||0)>>>3,H=l===-1?3:0,U=u.indexOf("=");if(u.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(u=u.replace(/=/g,""),U!==-1&&U>>2;b.length<=m;)b.push(0);b[m]|=(g>>>16-8*f&255)<<8*(H+l*(A%4)),y+=1}}return{value:b,binLen:8*y+a}}(t,i,s,n)};case"BYTES":return function(t,i,s){return function(u,c,a,l){let d,h,f,g;const p=c||[0],m=(a=a||0)>>>3,A=l===-1?3:0;for(h=0;h>>2,p.length<=f&&p.push(0),p[f]|=d<<8*(A+l*(g%4));return{value:p,binLen:8*u.length+a}}(t,i,s,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error(_)}return function(t,i,s){return function(u,c,a,l){return te(new Uint8Array(u),c,a,l)}(t,i,s,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error(ee)}return function(t,i,s){return te(t,i,s,n)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function ne(r,e,n,t){switch(r){case"HEX":return function(i){return function(s,u,c,a){const l="0123456789abcdef";let d,h,f="";const g=u/8,p=c===-1?3:0;for(d=0;d>>2]>>>8*(p+c*(d%4)),f+=l.charAt(h>>>4&15)+l.charAt(15&h);return a.outputUpper?f.toUpperCase():f}(i,e,n,t)};case"B64":return function(i){return function(s,u,c,a){let l,d,h,f,g,p="";const m=u/8,A=c===-1?3:0;for(l=0;l>>2]:0,g=l+2>>2]:0,h=(s[l>>>2]>>>8*(A+c*(l%4))&255)<<16|(f>>>8*(A+c*((l+1)%4))&255)<<8|g>>>8*(A+c*((l+2)%4))&255,d=0;d<4;d+=1)p+=8*l+6*d<=u?W.charAt(h>>>6*(3-d)&63):a.b64Pad;return p}(i,e,n,t)};case"BYTES":return function(i){return function(s,u,c){let a,l,d="";const h=u/8,f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255,d+=String.fromCharCode(l);return d}(i,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(i){throw new Error(_)}return function(i){return function(s,u,c){let a;const l=u/8,d=new ArrayBuffer(l),h=new Uint8Array(d),f=c===-1?3:0;for(a=0;a>>2]>>>8*(f+c*(a%4))&255;return d}(i,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(i){throw new Error(ee)}return function(i){return function(s,u,c){let a;const l=u/8,d=c===-1?3:0,h=new Uint8Array(l);for(a=0;a>>2]>>>8*(d+c*(a%4))&255;return h}(i,e,n)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const O=4294967296,w=[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],$=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],K=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Y="Chosen SHA variant is not supported",re="Cannot set numRounds with MAC";function z(r,e){let n,t;const i=r.binLen>>>3,s=e.binLen>>>3,u=i<<3,c=4-i<<3;if(i%4!=0){for(n=0;n>>2,r.value[t]|=e.value[n>>>2]<>>2]>>>c;return(r.value.length<<2)-4>=s+i&&r.value.pop(),{value:r.value,binLen:r.binLen+e.binLen}}return{value:r.value.concat(e.value),binLen:r.binLen+e.binLen}}function ie(r){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=r||{},t="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(t);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(t);e.outputLen=n.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function B(r,e,n,t){const i=r+" must include a value and format";if(!e){if(!t)throw new Error(i);return t}if(e.value===void 0||!e.format)throw new Error(i);return F(e.format,e.encoding||"UTF8",n)(e.value)}class D{constructor(e,n,t){const i=t||{};if(this.t=n,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let n,t=0;const i=this.m>>>5,s=this.C(e,this.h,this.u),u=s.binLen,c=s.value,a=u>>>5;for(n=0;n>>5),this.u=u%this.m,this.l=!0,this}getHash(e,n){let t,i,s=this.R;const u=ie(n);if(this.K){if(u.outputLen===-1)throw new Error("Output length must be specified in options");s=u.outputLen}const c=ne(e,s,this.T,u);if(this.H&&this.g)return c(this.g(u));for(i=this.F(this.h.slice(),this.u,this.A,this.L(this.U),s),t=1;t>>24-s%32),i=this.F(i,s,0,this.B(this.o),s);return c(i)}setHMACKey(e,n,t){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=F(n,(t||{}).encoding||"UTF8",this.T);this.k(i(e))}k(e){const n=this.m>>>3,t=n/4-1;let i;if(this.numRounds!==1)throw new Error(re);if(this.H)throw new Error("MAC key already set");for(n>>32-e}function L(r,e){return r>>>e|r<<32-e}function se(r,e){return r>>>e}function oe(r,e,n){return r^e^n}function ue(r,e,n){return r&e^~r&n}function he(r,e,n){return r&e^r&n^e&n}function ye(r){return L(r,2)^L(r,13)^L(r,22)}function I(r,e){const n=(65535&r)+(65535&e);return(65535&(r>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function He(r,e,n,t){const i=(65535&r)+(65535&e)+(65535&n)+(65535&t);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16))<<16|65535&i}function x(r,e,n,t,i){const s=(65535&r)+(65535&e)+(65535&n)+(65535&t)+(65535&i);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(i>>>16)+(s>>>16))<<16|65535&s}function Ee(r){return L(r,7)^L(r,18)^se(r,3)}function Ne(r){return L(r,6)^L(r,11)^L(r,25)}function ve(r){return[1732584193,4023233417,2562383102,271733878,3285377520]}function ae(r,e){let n,t,i,s,u,c,a;const l=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],a=0;a<80;a+=1)l[a]=a<16?r[a]:M(l[a-3]^l[a-8]^l[a-14]^l[a-16],1),c=a<20?x(M(n,5),ue(t,i,s),u,1518500249,l[a]):a<40?x(M(n,5),oe(t,i,s),u,1859775393,l[a]):a<60?x(M(n,5),he(t,i,s),u,2400959708,l[a]):x(M(n,5),oe(t,i,s),u,3395469782,l[a]),u=s,s=i,i=M(t,30),t=n,n=c;return e[0]=I(n,e[0]),e[1]=I(t,e[1]),e[2]=I(i,e[2]),e[3]=I(s,e[3]),e[4]=I(u,e[4]),e}function Se(r,e,n,t){let i;const s=15+(e+65>>>9<<4),u=e+n;for(;r.length<=s;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[s]=4294967295&u,r[s-1]=u/O|0,i=0;i>>9<<4),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/O|0,g=0;g32?(n=64-e,new o(r.I<>>n,r.N<>>n)):e!==0?(n=32-e,new o(r.N<>>n,r.I<>>n)):r}function R(r,e){let n;return e<32?(n=32-e,new o(r.N>>>e|r.I<>>e|r.N<>>e|r.N<>>e|r.I<>>e,r.I>>>e|r.N<<32-e)}function Re(r,e,n){return new o(r.N&e.N^r.N&n.N^e.N&n.N,r.I&e.I^r.I&n.I^e.I&n.I)}function Te(r){const e=R(r,28),n=R(r,34),t=R(r,39);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function v(r,e){let n,t;n=(65535&r.I)+(65535&e.I),t=(r.I>>>16)+(e.I>>>16)+(n>>>16);const i=(65535&t)<<16|65535&n;return n=(65535&r.N)+(65535&e.N)+(t>>>16),t=(r.N>>>16)+(e.N>>>16)+(n>>>16),new o((65535&t)<<16|65535&n,i)}function Ce(r,e,n,t){let i,s;i=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I),s=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i>>>16);const u=(65535&s)<<16|65535&i;return i=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(s>>>16),s=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i>>>16),new o((65535&s)<<16|65535&i,u)}function $e(r,e,n,t,i){let s,u;s=(65535&r.I)+(65535&e.I)+(65535&n.I)+(65535&t.I)+(65535&i.I),u=(r.I>>>16)+(e.I>>>16)+(n.I>>>16)+(t.I>>>16)+(i.I>>>16)+(s>>>16);const c=(65535&u)<<16|65535&s;return s=(65535&r.N)+(65535&e.N)+(65535&n.N)+(65535&t.N)+(65535&i.N)+(u>>>16),u=(r.N>>>16)+(e.N>>>16)+(n.N>>>16)+(t.N>>>16)+(i.N>>>16)+(s>>>16),new o((65535&u)<<16|65535&s,c)}function X(r,e){return new o(r.N^e.N,r.I^e.I)}function Ke(r){const e=R(r,19),n=R(r,61),t=we(r,6);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Be(r){const e=R(r,1),n=R(r,8),t=we(r,7);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}function Fe(r){const e=R(r,14),n=R(r,18),t=R(r,41);return new o(e.N^n.N^t.N,e.I^n.I^t.I)}const Me=[new o(w[0],3609767458),new o(w[1],602891725),new o(w[2],3964484399),new o(w[3],2173295548),new o(w[4],4081628472),new o(w[5],3053834265),new o(w[6],2937671579),new o(w[7],3664609560),new o(w[8],2734883394),new o(w[9],1164996542),new o(w[10],1323610764),new o(w[11],3590304994),new o(w[12],4068182383),new o(w[13],991336113),new o(w[14],633803317),new o(w[15],3479774868),new o(w[16],2666613458),new o(w[17],944711139),new o(w[18],2341262773),new o(w[19],2007800933),new o(w[20],1495990901),new o(w[21],1856431235),new o(w[22],3175218132),new o(w[23],2198950837),new o(w[24],3999719339),new o(w[25],766784016),new o(w[26],2566594879),new o(w[27],3203337956),new o(w[28],1034457026),new o(w[29],2466948901),new o(w[30],3758326383),new o(w[31],168717936),new o(w[32],1188179964),new o(w[33],1546045734),new o(w[34],1522805485),new o(w[35],2643833823),new o(w[36],2343527390),new o(w[37],1014477480),new o(w[38],1206759142),new o(w[39],344077627),new o(w[40],1290863460),new o(w[41],3158454273),new o(w[42],3505952657),new o(w[43],106217008),new o(w[44],3606008344),new o(w[45],1432725776),new o(w[46],1467031594),new o(w[47],851169720),new o(w[48],3100823752),new o(w[49],1363258195),new o(w[50],3750685593),new o(w[51],3785050280),new o(w[52],3318307427),new o(w[53],3812723403),new o(w[54],2003034995),new o(w[55],3602036899),new o(w[56],1575990012),new o(w[57],1125592928),new o(w[58],2716904306),new o(w[59],442776044),new o(w[60],593698344),new o(w[61],3733110249),new o(w[62],2999351573),new o(w[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)];function de(r){return r==="SHA-384"?[new o(3418070365,$[0]),new o(1654270250,$[1]),new o(2438529370,$[2]),new o(355462360,$[3]),new o(1731405415,$[4]),new o(41048885895,$[5]),new o(3675008525,$[6]),new o(1203062813,$[7])]:[new o(K[0],4089235720),new o(K[1],2227873595),new o(K[2],4271175723),new o(K[3],1595750129),new o(K[4],2917565137),new o(K[5],725511199),new o(K[6],4215389547),new o(K[7],327033209)]}function ge(r,e){let n,t,i,s,u,c,a,l,d,h,f,g;const p=[];for(n=e[0],t=e[1],i=e[2],s=e[3],u=e[4],c=e[5],a=e[6],l=e[7],f=0;f<80;f+=1)f<16?(g=2*f,p[f]=new o(r[g],r[g+1])):p[f]=Ce(Ke(p[f-2]),p[f-7],Be(p[f-15]),p[f-16]),d=$e(l,Fe(u),(A=c,y=a,new o((m=u).N&A.N^~m.N&y.N,m.I&A.I^~m.I&y.I)),Me[f],p[f]),h=v(Te(n),Re(n,t,i)),l=a,a=c,c=u,u=v(s,d),s=i,i=t,t=n,n=v(d,h);var m,A,y;return e[0]=v(n,e[0]),e[1]=v(t,e[1]),e[2]=v(i,e[2]),e[3]=v(s,e[3]),e[4]=v(u,e[4]),e[5]=v(c,e[5]),e[6]=v(a,e[6]),e[7]=v(l,e[7]),e}let ke=class extends D{constructor(r,e,n){if(r!=="SHA-384"&&r!=="SHA-512")throw new Error(Y);super(r,e,n);const t=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=F(this.t,this.i,this.T),this.v=ge,this.L=function(i){return i.slice()},this.B=de,this.F=function(i,s,u,c){return function(a,l,d,h,f){let g,p;const m=31+(l+129>>>10<<5),A=l+d;for(;a.length<=m;)a.push(0);for(a[l>>>5]|=128<<24-l%32,a[m]=4294967295&A,a[m-1]=A/O|0,g=0;g>>1)%5][(t>>>1)/5|0]=X(e[(t>>>1)%5][(t>>>1)/5|0],new o(r[t+1],r[t]));for(n=0;n<24;n+=1){for(s=V(),t=0;t<5;t+=1)u[t]=(a=e[t][0],l=e[t][1],d=e[t][2],h=e[t][3],f=e[t][4],new o(a.N^l.N^d.N^h.N^f.N,a.I^l.I^d.I^h.I^f.I));for(t=0;t<5;t+=1)c[t]=X(u[(t+4)%5],fe(u[(t+1)%5],1));for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=X(e[t][i],c[t]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)s[i][(2*t+3*i)%5]=fe(e[t][i],Oe[t][i]);for(t=0;t<5;t+=1)for(i=0;i<5;i+=1)e[t][i]=X(s[t][i],new o(~s[(t+1)%5][i].N&s[(t+2)%5][i].N,~s[(t+1)%5][i].I&s[(t+2)%5][i].I));e[0][0]=X(e[0][0],Pe[n])}var a,l,d,h,f;return e}function pe(r){let e,n,t=0;const i=[0,0],s=[4294967295&r,r/O&2097151];for(e=6;e>=0;e--)n=s[e>>2]>>>8*e&255,n===0&&t===0||(i[t+1>>2]|=n<<8*(t+1),t+=1);return t=t!==0?t:1,i[0]|=t,{value:t+1>4?i:[i[0]],binLen:8+8*t}}function J(r){return z(pe(r.binLen),r)}function me(r,e){let n,t=pe(e);t=z(t,r);const i=e>>>2,s=(i-t.value.length%i)%i;for(n=0;n>>5,ht=f>>>5;for(b=0;b=m;b+=G)p=q(h.slice(b,b+G),p),f-=m;for(h=h.slice(b),f%=m;h.length>>3,h[b>>2]^=A<=y));)U.push(S.N),H+=1,64*H%m==0&&(q(null,p),H=0);return U}(u,c,0,l,i,t,d)},s.hmacKey&&this.k(B("hmacKey",s.hmacKey,this.T))}O(r,e){const n=function(i){const s=i||{};return{funcName:B("funcName",s.funcName,1,{value:[],binLen:0}),customization:B("Customization",s.customization,1,{value:[],binLen:0})}}(r||{});e&&(n.funcName=e);const t=z(J(n.funcName),J(n.customization));if(n.customization.binLen!==0||n.funcName.binLen!==0){const i=me(t,this.m>>>3);for(let s=0;s>>5)this.U=this.v(i.slice(s,s+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(r){const e=function(t){const i=t||{};return{kmacKey:B("kmacKey",i.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:B("Customization",i.customization,1,{value:[],binLen:0})}}(r||{});this.O(r,e.funcName);const n=me(J(e.kmacKey),this.m>>>3);for(let t=0;t>>5)this.U=this.v(n.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(r){const e=z({value:this.h.slice(),binLen:this.u},function(n){let t,i,s=0;const u=[0,0],c=[4294967295&n,n/O&2097151];for(t=6;t>=0;t--)i=c[t>>2]>>>8*t&255,i===0&&s===0||(u[s>>2]|=i<<8*s,s+=1);return s=s!==0?s:1,u[s>>2]|=s<<8*s,{value:s+1>4?u:[u[0]],binLen:8+8*s}}(r.outputLen));return this.F(e.value,e.binLen,this.A,this.L(this.U),r.outputLen)}};class Xe{constructor(e,n,t){if(e=="SHA-1")this.P=new Ue(e,n,t);else if(e=="SHA-224"||e=="SHA-256")this.P=new Le(e,n,t);else if(e=="SHA-384"||e=="SHA-512")this.P=new ke(e,n,t);else{if(e!="SHA3-224"&&e!="SHA3-256"&&e!="SHA3-384"&&e!="SHA3-512"&&e!="SHAKE128"&&e!="SHAKE256"&&e!="CSHAKE128"&&e!="CSHAKE256"&&e!="KMAC128"&&e!="KMAC256")throw new Error(Y);this.P=new xe(e,n,t)}}update(e){return this.P.update(e),this}getHash(e,n){return this.P.getHash(e,n)}setHMACKey(e,n,t){this.P.setHMACKey(e,n,t)}getHMAC(e,n){return this.P.getHMAC(e,n)}}const k=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__!="undefined")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global})(),je={SHA1:"SHA-1",SHA224:"SHA-224",SHA256:"SHA-256",SHA384:"SHA-384",SHA512:"SHA-512","SHA3-224":"SHA3-224","SHA3-256":"SHA3-256","SHA3-384":"SHA3-384","SHA3-512":"SHA3-512"},ze=(r,e,n)=>{Z!=null;{const t=je[r.toUpperCase()];if(typeof t=="undefined")throw new TypeError("Unknown hash function");const i=new Xe(t,"ARRAYBUFFER");return i.setHMACKey(e,"ARRAYBUFFER"),i.update(n),i.getHMAC("ARRAYBUFFER")}},Q="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",De=r=>{let e=r.length;for(;r[e-1]==="=";)--e;const n=(e=8&&(s-=8,i[c++]=u>>>s)}return t},qe=r=>{const e=new Uint8Array(r);let n=0,t=0,i="";for(let s=0;s=5;)i+=Q[t>>>n-5&31],n-=5;return n>0&&(i+=Q[t<<5-n&31]),i},Ge=r=>{const e=new ArrayBuffer(r.length/2),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{const e=new ArrayBuffer(r.length),n=new Uint8Array(e);for(let t=0;t{const e=new Uint8Array(r);let n="";for(let t=0;t{if(!Ae)throw new Error("Encoding API not available");return Ae.encode(r).buffer},We=r=>{if(!be)throw new Error("Encoding API not available");return be.decode(r)},_e=r=>{var e;if(Z!=null,!((e=k.crypto)!=null&&e.getRandomValues))throw new Error("Cryptography API not available");return k.crypto.getRandomValues(new Uint8Array(r)).buffer};class T{constructor({buffer:e,size:n=20}={}){this.buffer=typeof e=="undefined"?_e(n):e}static fromLatin1(e){return new T({buffer:Ve(e)})}static fromUTF8(e){return new T({buffer:Qe(e)})}static fromBase32(e){return new T({buffer:De(e)})}static fromHex(e){return new T({buffer:Ge(e)})}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,value:Je(this.buffer)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,value:We(this.buffer)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,value:qe(this.buffer)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,value:Ze(this.buffer)}),this.hex}}const et=(r,e)=>{Z!=null;{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let n=-1,t=0;for(;++n0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}};class N{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}constructor({issuer:e=N.defaults.issuer,label:n=N.defaults.label,issuerInLabel:t=N.defaults.issuerInLabel,secret:i=new T,algorithm:s=N.defaults.algorithm,digits:u=N.defaults.digits,period:c=N.defaults.period}={}){this.issuer=e,this.label=n,this.issuerInLabel=t,this.secret=typeof i=="string"?T.fromBase32(i):i,this.algorithm=s.toUpperCase(),this.digits=u,this.period=c}static generate({secret:e,algorithm:n,digits:t,period:i=N.defaults.period,timestamp:s=Date.now()}){return j.generate({secret:e,algorithm:n,digits:t,counter:Math.floor(s/1e3/i)})}generate({timestamp:e=Date.now()}={}){return N.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:n,algorithm:t,digits:i,period:s=N.defaults.period,timestamp:u=Date.now(),window:c}){return j.validate({token:e,secret:n,algorithm:t,digits:i,counter:Math.floor(u/1e3/s),window:c})}validate({token:e,timestamp:n,window:t}){return N.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:t})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}}const nt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,rt=/^[2-7A-Z]+=*$/i,it=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,st=/^[+-]?\d+$/,Ie=/^\+?[1-9]\d*$/;class ot{static parse(e){let n;try{n=e.match(nt)}catch(a){}if(!Array.isArray(n))throw new URIError("Invalid URI format");const t=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),s=n[3].split("&").reduce((a,l)=>{const d=l.split(/=(.*)/,2).map(decodeURIComponent),h=d[0].toLowerCase(),f=d[1],g=a;return g[h]=f,g},{});let u;const c={};if(t==="hotp")if(u=j,typeof s.counter!="undefined"&&st.test(s.counter))c.counter=parseInt(s.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(t==="totp"){if(u=N,typeof s.period!="undefined")if(Ie.test(s.period))c.period=parseInt(s.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof s.issuer!="undefined"&&(c.issuer=s.issuer),i.length===2?(c.label=i[1],typeof c.issuer=="undefined"||c.issuer===""?c.issuer=i[0]:i[0]===""&&(c.issuerInLabel=!1)):(c.label=i[0],typeof c.issuer!="undefined"&&c.issuer!==""&&(c.issuerInLabel=!1)),typeof s.secret!="undefined"&&rt.test(s.secret))c.secret=s.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof s.algorithm!="undefined")if(it.test(s.algorithm))c.algorithm=s.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof s.digits!="undefined")if(Ie.test(s.digits))c.digits=parseInt(s.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new u(c)}static stringify(e){if(e instanceof j||e instanceof N)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const ut="9.2.2";C.HOTP=j,C.Secret=T,C.TOTP=N,C.URI=ot,C.version=ut});
//# sourceMappingURL=otpauth.umd.min.js.map
diff --git a/docs/assets/main.js b/docs/assets/main.js
index d0aa8d5..7270cff 100644
--- a/docs/assets/main.js
+++ b/docs/assets/main.js
@@ -1,8 +1,8 @@
"use strict";
"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o `,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=`
- ${ce(l.parent,i)}. ${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))} `),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
-`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML=' ',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=` `),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})();
+ ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))} `),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(B,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
+`,this.handleValueChange()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(e=>{e.style.display="block";let n=Array.from(e.querySelectorAll(".tsd-index-link")).every(r=>r.offsetParent==null);e.style.display=n?"none":"block"})}};var Z=class extends C{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML=' ',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=` `),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})();
/*! Bundled license information:
lunr/lunr.js:
diff --git a/docs/assets/style.css b/docs/assets/style.css
index 07a385b..98a4377 100644
--- a/docs/assets/style.css
+++ b/docs/assets/style.css
@@ -29,7 +29,7 @@
--light-color-ts-constructor-signature: var(--light-color-ts-constructor);
--light-color-ts-parameter: var(--light-color-ts-variable);
/* type literal not included as links will never be generated to it */
- --light-color-ts-type-parameter: var(--light-color-ts-type-alias);
+ --light-color-ts-type-parameter: #a55c0e;
--light-color-ts-accessor: var(--light-color-ts-property);
--light-color-ts-get-signature: var(--light-color-ts-accessor);
--light-color-ts-set-signature: var(--light-color-ts-accessor);
@@ -69,7 +69,7 @@
--dark-color-ts-constructor-signature: var(--dark-color-ts-constructor);
--dark-color-ts-parameter: var(--dark-color-ts-variable);
/* type literal not included as links will never be generated to it */
- --dark-color-ts-type-parameter: var(--dark-color-ts-type-alias);
+ --dark-color-ts-type-parameter: #e07d13;
--dark-color-ts-accessor: var(--dark-color-ts-property);
--dark-color-ts-get-signature: var(--dark-color-ts-accessor);
--dark-color-ts-set-signature: var(--dark-color-ts-accessor);
@@ -266,12 +266,12 @@ h6 {
line-height: 1.2;
}
-h1 > a,
-h2 > a,
-h3 > a,
-h4 > a,
-h5 > a,
-h6 > a {
+h1 > a:not(.link),
+h2 > a:not(.link),
+h3 > a:not(.link),
+h4 > a:not(.link),
+h5 > a:not(.link),
+h6 > a:not(.link) {
text-decoration: none;
color: var(--color-text);
}
@@ -649,6 +649,28 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
font-weight: bold;
}
+.tsd-full-hierarchy:not(:last-child) {
+ margin-bottom: 1em;
+ padding-bottom: 1em;
+ border-bottom: 1px solid var(--color-accent);
+}
+.tsd-full-hierarchy,
+.tsd-full-hierarchy ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+.tsd-full-hierarchy ul {
+ padding-left: 1.5rem;
+}
+.tsd-full-hierarchy a {
+ padding: 0.25rem 0 !important;
+ font-size: 1rem;
+ display: inline-flex;
+ align-items: center;
+ color: var(--color-text);
+}
+
.tsd-panel-group.tsd-index-group {
margin-bottom: 0;
}
@@ -714,12 +736,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
}
.tsd-navigation > a,
.tsd-navigation .tsd-accordion-summary {
- width: calc(100% - 0.5rem);
+ width: calc(100% - 0.25rem);
+ display: flex;
+ align-items: center;
}
.tsd-navigation a,
.tsd-navigation summary > span,
.tsd-page-navigation a {
- display: inline-flex;
+ display: flex;
+ width: calc(100% - 0.25rem);
align-items: center;
padding: 0.25rem;
color: var(--color-text);
@@ -759,11 +784,6 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
margin-left: -1.5rem;
}
-.tsd-nested-navigation > li > a,
-.tsd-nested-navigation > li > span {
- width: calc(100% - 1.75rem - 0.5rem);
-}
-
.tsd-page-navigation ul {
padding-left: 1.75rem;
}
diff --git a/docs/classes/HOTP.html b/docs/classes/HOTP.html
index 4b4e958..db65800 100644
--- a/docs/classes/HOTP.html
+++ b/docs/classes/HOTP.html
@@ -1,6 +1,6 @@
HOTP | otpauth Index IndexProperties issuer In Label : undefined | boolean label : undefined | string secret : undefined | string | Secret Properties algorithm algorithm : string
issuer In Label issuer In Label : boolean
Accessors Static
defaults get defaults( ) : { Â Â Â Â algorithm : string ; Â Â Â Â counter : number ; Â Â Â Â digits : number ; Â Â Â Â issuer : string ; Â Â Â Â issuerInLabel : boolean ; Â Â Â Â label : string ; Â Â Â Â window : number ; } Returns { Â Â Â Â algorithm : string ; Â Â Â Â counter : number ; Â Â Â Â digits : number ; Â Â Â Â issuer : string ; Â Â Â Â issuerInLabel : boolean ; Â Â Â Â label : string ; Â Â Â Â window : number ; } algorithm : string counter : number digits : number issuer : string issuer In Label : boolean label : string window : number Methods generate generate ( config ? ) : string Properties algorithm algorithm : string
issuer In Label issuer In Label : boolean
Accessors Static
defaults get defaults( ) : { Â Â Â Â algorithm : string ; Â Â Â Â counter : number ; Â Â Â Â digits : number ; Â Â Â Â issuer : string ; Â Â Â Â issuerInLabel : boolean ; Â Â Â Â label : string ; Â Â Â Â window : number ; } Returns { Â Â Â Â algorithm : string ; Â Â Â Â counter : number ; Â Â Â Â digits : number ; Â Â Â Â issuer : string ; Â Â Â Â issuerInLabel : boolean ; Â Â Â Â label : string ; Â Â Â Â window : number ; } algorithm : string counter : number digits : number issuer : string issuer In Label : boolean label : string window : number Methods generate generate ( config ? ) : string Parameters Optional
config : { Â Â Â Â counter : undefined | number ; } = {} counter : undefined | number Returns string Token.
-
HOTP: An HMAC-based One-time Password Algorithm.
See
RFC 4226
-