shalomail 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,64 +1,64 @@
1
- var st=BigInt(4294967295),Xr=BigInt(32);function Ro(t,e=!1){return e?{h:Number(t&st),l:Number(t>>Xr&st)}:{h:Number(t>>Xr&st)|0,l:Number(t&st)|0}}function Qr(t,e=!1){let r=t.length,n=new Uint32Array(r),s=new Uint32Array(r);for(let i=0;i<r;i++){let{h:o,l:u}=Ro(t[i],e);[n[i],s[i]]=[o,u]}return[n,s]}var Lo=t=>t/2**32|0,Oo=t=>t>>>0;function Jr(t,e,r,n){let s=Lo(r),i=Oo(r);t.setUint32(e,n?i:s,n),t.setUint32(e+4,n?s:i,n)}var jt=(t,e,r)=>t>>>r,zt=(t,e,r)=>t<<32-r|e>>>r,xe=(t,e,r)=>t>>>r|e<<32-r,ye=(t,e,r)=>t<<32-r|e>>>r,Ie=(t,e,r)=>t<<64-r|e>>>r-32,Pe=(t,e,r)=>t>>>r-32|e<<64-r;function J(t,e,r,n){let s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}var en=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),tn=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,rn=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),nn=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,sn=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),on=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0;function ot(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}var Kt=t=>t?`"${t}" `:"";function Me(t,e=""){if(typeof t!="number")throw new TypeError(Kt(e)+"expected number, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError(Kt(e)+"expected integer >= 0, got "+t);return t}function ee(t,e,r=""){if(ot(t)&&(e===void 0||t.length===e))return t;e!==void 0&&Me(e,"length");let n=ot(t),s=e!==void 0?` of length ${e}`:"",i=n?`length=${t.length}`:`type=${typeof t}`,o=Kt(r)+"expected Uint8Array"+s+", got "+i;throw n?new RangeError(o):new TypeError(o)}var _o=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)},un=(t,e)=>{_o(t,e);let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${e}" expected plain object`);if(Object.hasOwn(t,"__proto__"))throw new TypeError(`"${e}.__proto__" is not allowed`)};function Gt(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function cn(t,e){ee(t,void 0,"output");let r=e.outputLen;if(!(t.length>=r))throw new RangeError('"output" expected length >= '+r)}function Vt(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function it(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var ln=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",No=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ut(t){if(ee(t),ln)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=No[t[r]];return e}function an(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function at(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(ln)try{return Uint8Array.fromHex(t)}catch(s){throw s instanceof SyntaxError?new RangeError(s.message):s}let e=t.length,r=e/2;if(e%2)throw new RangeError("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let s=0,i=0;s<r;s++,i+=2){let o=an(t.charCodeAt(i)),u=an(t.charCodeAt(i+1));if(o===void 0||u===void 0){let a=t[i]+t[i+1];throw new RangeError('hex string expected, got non-hex character "'+a+'" at index '+i)}n[s]=o*16+u}return n}function Wt(...t){let e=0;for(let n=0;n<t.length;n++){let s=t[n];ee(s),e+=s.length}let r=new Uint8Array(e);for(let n=0,s=0;n<t.length;n++){let i=t[n];r.set(i,s),s+=i.length}return r}function Uo(t,e,r="opts"){return un(t,"defaults"),e!==void 0&&un(e,r),Object.assign(Object.create(null),t,e)}function fn(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=Uo({},e,"info");let r=(s,i)=>t(i).update(s).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=s=>t(s),Object.assign(r,e),Object.freeze(r)}function dn(t=32){Me(t,"bytesLength");let e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return e.getRandomValues(new Uint8Array(t))}var hn=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});var ct=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,r,n,s){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=s,this.buffer=new Uint8Array(e),this.view=it(this.buffer)}update(e){Gt(this),ee(e);let{view:r,buffer:n,blockLen:s}=this,i=e.length,o=!1;for(let u=0;u<i;){let a=Math.min(s-this.pos,i-u);if(a===s){let c=it(e);for(;s<=i-u;u+=s)this.process(c,u);o=!0;continue}n.set(u===0&&a===i?e:e.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===s&&(this.process(r,0),this.pos=0,o=!0)}return this.length+=e.length,o&&this.roundClean(),this}digestInto(e){Gt(this),cn(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;r[o++]=128,r.fill(0,o),this.padOffset>s-o&&(this.process(n,0),r.fill(0)),Jr(n,s-8,this.length*8,i),this.process(n,0),this.roundClean();let u=e===r?n:it(e),a=this.outputLen,c=a/4,l=this.get();if(a%4||c>l.length)throw new Error("invalid outputLen");for(let f=0;f<c;f++)u.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:r,length:n,finished:s,destroyed:i,pos:o}=this;return e.destroyed=i,e.finished=s,e.length=n,e.pos=o,o&&e.buffer.set(r),e}clone(){return this._cloneInto()}};var pn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var mn=Qr(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Io=mn[0],Po=mn[1],ce=new Uint32Array(80),le=new Uint32Array(80),Zt=class extends ct{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,r){super(128,e,16,!1),this.Ah=r[0]|0,this.Al=r[1]|0,this.Bh=r[2]|0,this.Bl=r[3]|0,this.Ch=r[4]|0,this.Cl=r[5]|0,this.Dh=r[6]|0,this.Dl=r[7]|0,this.Eh=r[8]|0,this.El=r[9]|0,this.Fh=r[10]|0,this.Fl=r[11]|0,this.Gh=r[12]|0,this.Gl=r[13]|0,this.Hh=r[14]|0,this.Hl=r[15]|0}get(){let{Ah:e,Al:r,Bh:n,Bl:s,Ch:i,Cl:o,Dh:u,Dl:a,Eh:c,El:l,Fh:f,Fl:h,Gh:p,Gl:g,Hh:m,Hl:y}=this;return[e,r,n,s,i,o,u,a,c,l,f,h,p,g,m,y]}set(e,r,n,s,i,o,u,a,c,l,f,h,p,g,m,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=u|0,this.Dl=a|0,this.Eh=c|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=g|0,this.Hh=m|0,this.Hl=y|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let d=0;d<16;d++,r+=4)ce[d]=e.getUint32(r),le[d]=e.getUint32(r+=4);for(let d=16;d<80;d++){let x=ce[d-15]|0,w=le[d-15]|0,S=xe(x,w,1)^xe(x,w,8)^jt(x,w,7),_=ye(x,w,1)^ye(x,w,8)^zt(x,w,7),C=ce[d-2]|0,E=le[d-2]|0,k=xe(C,E,19)^Ie(C,E,61)^jt(C,E,6),U=ye(C,E,19)^Pe(C,E,61)^zt(C,E,6),L=rn(_,U,le[d-7],le[d-16]),N=nn(L,S,k,ce[d-7],ce[d-16]);ce[d]=N|0,le[d]=L|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:u,Cl:a,Dh:c,Dl:l,Eh:f,El:h,Fh:p,Fl:g,Gh:m,Gl:y,Hh:v,Hl:D}=this;for(let d=0;d<80;d++){let x=xe(f,h,14)^xe(f,h,18)^Ie(f,h,41),w=ye(f,h,14)^ye(f,h,18)^Pe(f,h,41),S=f&p^~f&m,_=h&g^~h&y,C=sn(D,w,_,Po[d],le[d]),E=on(C,v,x,S,Io[d],ce[d]),k=C|0,U=xe(n,s,28)^Ie(n,s,34)^Ie(n,s,39),L=ye(n,s,28)^Pe(n,s,34)^Pe(n,s,39),N=n&i^n&u^i&u,b=s&o^s&a^o&a;v=m|0,D=y|0,m=p|0,y=g|0,p=f|0,g=h|0,{h:f,l:h}=J(c|0,l|0,E|0,k|0),c=u|0,l=a|0,u=i|0,a=o|0,i=n|0,o=s|0;let B=en(k,L,b);n=tn(B,E,U,N),s=B|0}({h:n,l:s}=J(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=J(this.Bh|0,this.Bl|0,i|0,o|0),{h:u,l:a}=J(this.Ch|0,this.Cl|0,u|0,a|0),{h:c,l}=J(this.Dh|0,this.Dl|0,c|0,l|0),{h:f,l:h}=J(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:g}=J(this.Fh|0,this.Fl|0,p|0,g|0),{h:m,l:y}=J(this.Gh|0,this.Gl|0,m|0,y|0),{h:v,l:D}=J(this.Hh|0,this.Hl|0,v|0,D|0),this.set(n,s,i,o,u,a,c,l,f,h,p,g,m,y,v,D)}roundClean(){Vt(ce,le)}destroy(){this.destroyed=!0,Vt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Yt=class extends Zt{constructor(){super(64,pn)}};var Xt=fn(()=>new Yt,hn(3));function ft(t,e,r=()=>{}){if(!Array.isArray(t))throw new TypeError(`"${e}" expected array, got type=${typeof t}`);for(let n=0;n<t.length;n++)r(t[n],`${e}[${n}]`);return t}var M=(t,e,r)=>ee(t,e,r),Qt=Me;function fe(t,e="object"){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(e==="object"?"expected valid options object":`"${e}" expected object, got type=${typeof t}`);return t}function be(t,e){if(typeof t!="function")throw new TypeError(`"${e}" is invalid: expected function, got ${typeof t}`);return t}var xn=ut,Jt=(...t)=>Wt(...t),yn=t=>at(t),He=ot,$e=t=>dn(t),lt=BigInt(0),gn=BigInt(1),Mo=t=>t?`"${t}" `:"";function ie(t,e=""){if(typeof t!="boolean")throw new TypeError(Mo(e)+"expected boolean, got type="+typeof t);return t}function Ho(t){if(typeof t=="bigint"){if(!de(t))throw new RangeError("positive bigint expected, got "+t)}else Qt(t);return t}function Se(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(r+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){let r=e&&`"${e}" `;throw new RangeError(r+"expected safe integer, got "+t)}}function bn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?lt:BigInt("0x"+t)}function dt(t){return bn(ut(t))}function ue(t){return bn(ut(he(ee(t)).reverse()))}function er(t,e){if(Me(e),e===0)throw new Error("zero output length is invalid");t=Ho(t);let r=e*2,n=t.toString(16);if(n.length>r)throw new RangeError("number is too large");return at(n.padStart(r,"0"))}function ht(t,e){return er(t,e).reverse()}function he(t){return Uint8Array.from(M(t))}function de(t){return typeof t=="bigint"&&lt<=t}function tr(t,e,r){return de(t)&&de(e)&&de(r)&&e<=t&&t<r}function Ae(t,e,r,n){if(!tr(e,r,n))throw new RangeError("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function rr(t){if(t<lt)throw new Error("expected non-negative bigint, got "+t);return t===lt?0:t.toString(2).length}var An=t=>(Se(t,"n"),(gn<<BigInt(t))-gn);function te(t,e={},r={},n="object"){fe(t,n),fe(e,"fields"),fe(r,"optFields");function s(o,u,a){let c=n==="object"?`param "${String(o)}"`:`"${n}.${String(o)}"`,l=t[o];if(!Object.hasOwn(t,o)&&(a?l!==void 0:u!=="function"))throw new TypeError(`${c} is invalid: expected own property`);if(a&&l===void 0)return;let f=typeof l;if(f!==u||l===null)throw new TypeError(`${c} is invalid: expected ${u}, got ${f}`)}let i=(o,u)=>Object.entries(o).forEach(([a,c])=>s(a,c,u));i(e,!1),i(r,!0)}var H=BigInt(0),O=BigInt(1),we=BigInt(2),En=BigInt(3),nr=BigInt(4),Bn=BigInt(5),$o=BigInt(7),Cn=BigInt(8),jo=BigInt(9),zo=BigInt(15),vn=BigInt(16),Ko=BigInt("0x10000000000000000");function R(t,e){if(e<=H)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=H?r:e+r}function Go(t,e,r){if(r<=O)throw new Error("pow: expected modulus > 1, got "+r);if(typeof e!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof e);if(e<H)throw new Error("invalid exponent, negatives unsupported");if(e===H)return O;if(e===O)return t;let n=t%r;if(n<H&&(n+=r),e<Ko){let u=O;for(;e>H;)e&O&&(u=u*n%r),n=n*n%r,e>>=O;return u}let s=[];for(;e>H;)s.push(Number(e&zo)),e>>=nr;let i=new Array(16);i[0]=O,i[1]=n;for(let u=2;u<16;u++)i[u]=i[u-1]*n%r;let o=i[s[s.length-1]];for(let u=s.length-2;u>=0;u--){o=o*o%r,o=o*o%r,o=o*o%r,o=o*o%r;let a=s[u];a!==0&&(o=o*i[a]%r)}return o}function V(t,e,r){if(r<=O)throw new Error("pow2: expected modulus > 1, got "+r);if(e<H)throw new Error("pow2: expected non-negative exponent, got "+e);let n=t;for(;e-- >H;)n*=n,n%=r;return n}function wn(t,e){if(t===H)throw new Error("invert: expected non-zero number");if(e<=O)throw new Error("invert: expected modulus > 1, got "+e);let r=R(t,e),n=e,s=H,i=O;for(;r!==H;){let u=n/r,a=n-r*u,c=s-i*u;n=r,r=a,s=i,i=c}if(n!==O)throw new Error("invert: does not exist");return R(s,e)}function sr(t,e,r){let n=t;if(!n.eql(n.sqr(e),r))throw new Error("Cannot find square root")}function or(t,e){if((t&O)===H)throw new Error(e+": expected odd modulus, got "+t)}function Tn(t,e){let r=t,n=(r.ORDER+O)/nr,s=r.pow(e,n);return sr(r,s,e),s}function Vo(t,e){let r=t,n=(r.ORDER-Bn)/Cn,s=r.mul(e,we),i=r.pow(s,n),o=r.mul(e,i),u=r.mul(r.mul(o,we),i),a=r.mul(o,r.sub(u,r.ONE));return sr(r,a,e),a}function Wo(t){let e=gt(t),r=Sn(t),n=r(e,e.neg(e.ONE)),s=r(e,n),i=r(e,e.neg(n)),o=(t+$o)/vn;return((u,a)=>{let c=u,l=c.pow(a,o),f=c.mul(l,n),h=c.mul(l,s),p=c.mul(l,i),g=c.eql(c.sqr(f),a),m=c.eql(c.sqr(h),a);l=c.cmov(l,f,g),f=c.cmov(p,h,m);let y=c.eql(c.sqr(f),a),v=c.cmov(l,f,y);return sr(c,v,a),v})}function Sn(t){if(t<En)throw new Error("sqrt is not defined for small field");or(t,"tonelliShanks");let e=t-O,r=0;for(;e%we===H;)e/=we,r++;let n=we,s=gt(t);for(;je(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Tn;let i=s.pow(n,e),o=(e+O)/we;return function(a,c){let l=a;if(l.is0(c))return c;if(je(l,c)!==1)throw new Error("Cannot find square root");let f=r,h=l.mul(l.ONE,i),p=l.pow(c,e),g=l.pow(c,o);for(;!l.eql(p,l.ONE);){if(l.is0(p))throw new Error("Cannot find square root: probably non-prime P");let m=1,y=l.sqr(p);for(;!l.eql(y,l.ONE);)if(m++,y=l.sqr(y),m===f)throw new Error("Cannot find square root");let v=O<<BigInt(f-m-1),D=l.pow(h,v);f=m,h=l.sqr(D),p=l.mul(p,h),g=l.mul(g,D)}return g}}function Zo(t){return or(t,"Fp.sqrt"),t%nr===En?Tn:t%Cn===Bn?Vo:t%vn===jo?Wo(t):Sn(t)}var Fn=(t,e)=>(R(t,e)&O)===O,Yo=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Fe(t){if(fe(t,"field"),typeof t.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof t.ORDER);Se(t.BYTES,"BYTES"),Se(t.BITS,"BITS");for(let e of Yo)be(t[e],"field."+e);if(t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=O)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function mt(t,e,r=!1){Fe(t),ft(e,"nums"),ie(r,"passZero");let n=t,s=new Array(e.length).fill(r?n.ZERO:void 0),i=e.reduce((u,a,c)=>n.is0(a)?u:(s[c]=u,n.mul(u,a)),n.ONE),o=n.inv(i);return e.reduceRight((u,a,c)=>n.is0(a)?u:(s[c]=n.mul(u,s[c]),n.mul(u,a)),o),s}function je(t,e){Fe(t);let r=t;or(r.ORDER,"FpLegendre");let n=(r.ORDER-O)/we,s=r.pow(e,n),i=r.eql(s,r.ONE),o=r.eql(s,r.ZERO),u=r.eql(s,r.neg(r.ONE));if(!i&&!o&&!u)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function Xo(t,e){if(e!==void 0&&Qt(e),t<=H)throw new Error("invalid n length: expected positive n, got "+t);if(e!==void 0&&e<1)throw new Error("invalid n length: expected positive bit length, got "+e);let r=rr(t);if(e!==void 0&&e<r)throw new Error(`invalid n length: expected nBitLength (${e}) >= bitLen(n) (${r})`);let n=e!==void 0?e:r,s=Math.ceil(n/8);return{nBitLength:n,nByteLength:s}}var Dn=new WeakMap,pt=class{ORDER;BITS;BYTES;isLE;ZERO=H;ONE=O;_lengths;_mod;constructor(e,r={}){if(e<=O)throw new Error("invalid field: expected ORDER > 1, got "+e);let n;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(n=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:s,nByteLength:i}=Xo(e,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=s,this.BYTES=i,Object.freeze(this)}create(e){return R(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof e);return H<=e&&e<this.ORDER}is0(e){return e===H}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&O)===O}neg(e){return R(-e,this.ORDER)}eql(e,r){return e===r}sqr(e){return R(e*e,this.ORDER)}add(e,r){return R(e+r,this.ORDER)}sub(e,r){return R(e-r,this.ORDER)}mul(e,r){return R(e*r,this.ORDER)}pow(e,r){return Go(e,r,this.ORDER)}div(e,r){return R(e*wn(r,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,r){return e+r}subN(e,r){return e-r}mulN(e,r){return e*r}inv(e){return wn(e,this.ORDER)}sqrt(e){let r=Dn.get(this);return r||Dn.set(this,r=Zo(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?ht(e,this.BYTES):er(e,this.BYTES)}fromBytes(e,r=!1){M(e);let{_lengths:n,BYTES:s,isLE:i,ORDER:o,_mod:u}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>s)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+e.length);let c=new Uint8Array(s);c.set(e,i?0:c.length-e.length),e=c}if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);let a=i?ue(e):dt(e);if(u&&(a=R(a,o)),!r&&!this.isValid(a))throw new Error("invalid field element: outside of range 0..ORDER");return a}invertBatch(e){return mt(this,e,!0)}cmov(e,r,n){return ie(n,"condition"),n?r:e}};function gt(t,e={}){return Object.freeze(pt.prototype),new pt(t,e)}var ar=BigInt(0),ze=BigInt(1),Qo=BigInt(4),ir=16,kn=128,Jo=5,Rn=2**31;function Ke(t){let e=t;if(typeof e!="function")throw new TypeError('"Point" expected constructor, got type='+typeof t);be(e.fromAffine,"Point.fromAffine"),be(e.fromBytes,"Point.fromBytes"),be(e.fromHex,"Point.fromHex"),fe(e.BASE,"Point.BASE"),fe(e.ZERO,"Point.ZERO"),Fe(e.Fp),Fe(e.Fn)}function On(t,e){Ke(t),qn(e,t);let r=mt(t.Fp,e.map(n=>n.Z));return e.map((n,s)=>t.fromAffine(n.toAffine(r[s])))}function ei(t,e,r=1){if(!Number.isSafeInteger(t)||t<r||t>e)throw new Error("invalid window size, expected ["+r+".."+e+"], got W="+t)}function ti(t,e){let r=t*(4*e+128);if(r>Rn)throw new Error("invalid window size: table would need ~"+Math.ceil(r/2**20)+" MiB, max "+Rn/2**20+" MiB")}function ri(t,e){if(t!==void 0){be(t,"randomBytes");try{let r=t(e);if(!He(r)||r.length!==e)return}catch{return}return t}}function qn(t,e){ft(t,"points"),t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function ni(t,e,r){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,s)=>{if(!(r===void 0?e.isValid(n):de(n)&&n<r))throw new Error("invalid scalar at index "+s)})}var _n=new WeakMap;function ur(t){return _n.get(t)||1}function si(t,e){let r=t.double(),n=[t];for(let s=1;s<e;s++)n.push(n[s-1].add(r));return n}function oi(t,e){let r=2**e,n=r/2,s=BigInt(r-1),i=[];for(;t>ar;){let o=0;t&ze&&(o=Number(t&s),o>=n&&(o-=r),t-=BigInt(o)),i.push(o),t>>=ze}return i}function ii(t,e,r){let n=2**e,s=n/2,i=BigInt(n-1),o=BigInt(e),u=[];for(let a=0;a<r;a++){let c=Number(t&i);t>>=o,c>s&&(c-=n,t+=ze),u.push(c)}if(t!==ar)throw new Error("invalid wnaf");return u}function ui(t,e,r){let n=0;for(let i of r)n=Math.max(n,i.length);let s=t;for(let i=n-1;i>=0;i--){i!==n-1&&(s=s.double());for(let o=0;o<r.length;o++){let u=r[o][i];if(u){let a=e[o][Math.abs(u)-1>>1];s=s.add(u<0?a.negate():a)}}}return s}var xt=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,r){Ke(e),this.randomBytes=ri(r,ir),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,r,n){let s=Math.ceil(n/r)+1,i=2**(r-1),o=[],u=e;for(let a=0;a<s;a++){let c=u;for(let l=0;l<i;l++)o.push(c),c=c.add(u);u=o[o.length-1].double()}return{W:r,bits:n,windows:s,comp:o}}wnafCachedCT(e,r){let{W:n,windows:s,comp:i}=e,o=2**(n-1),u=ii(r,n,s),a=this.ZERO,c=this.BASE;for(let l=0;l<s;l++){let f=u[l],h=l*o,p=Math.abs(f)-1,g=i[h];for(let y=1;y<o;y++)g=y===p?i[h+y]:g;let m=g.negate();f===0?c=c.add(i[h]):a=a.add(f<0?m:g)}return{p:a,f:c}}getWnafPrecomputes(e,r,n,s){let i=this.wnafPrecomputes.get(r),o=i?.find(u=>u.W===e&&u.bits===n);return o||(o=this.buildWnafTable(r,e,n),typeof s=="function"&&(o={...o,comp:s(o.comp)}),i||(i=[],this.wnafPrecomputes.set(r,i)),i.push(o)),o}assertPoint(e){if(!(e instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof e)}validateMulInput(e,r){if(this.assertPoint(e),!tr(r,ze,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(e,r,n,s){let i=ur(e);return i===1?this.fixedWindowCT(e,r,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,s),r)}mulCT(e,r,n){return this.validateMulInput(e,r),this.runCT(e,r,this.bits,n)}mulCTBlinded(e,r,n){if(this.validateMulInput(e,r),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");let s=this.Point.Fn.BITS+kn,i=this.randomBytes(ir);if(!He(i)||i.length!==ir)throw new Error("randomBytes returned invalid byte array");i[0]=i[0]&63|128;let o=r+dt(i)*this.Point.Fn.ORDER;return this.runCT(e,o,s,n)}fixedWindowCT(e,r,n){let s=Jo,i=1<<s,o=An(s),u=new Array(i);u[0]=this.ZERO;for(let l=1;l<i;l++)u[l]=u[l-1].add(e);let a=Math.ceil(n/s),c=this.ZERO;for(let l=a-1;l>=0;l--){if(l!==a-1)for(let p=0;p<s;p++)c=c.double();let f=Number(r>>BigInt(l*s)&o),h=u[0];for(let p=1;p<i;p++)h=p===f?u[p]:h;c=c.add(h)}return{p:c,f:c}}shouldBlind(e,r){return this.randomBytes===void 0?!1:r===ze?!0:e!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(e,r,n,s){return this.shouldBlind(e,n)?this.mulCTBlinded(e,r,s):this.mulCT(e,r,s)}mulUnsafe(e,r,n){if(this.assertPoint(e),!de(r))throw new Error("invalid scalar");let s=ur(e);if(s===1||r>=this.Point.Fn.ORDER)return ai(this.Point,[e],[r],!0);let i=this.getWnafPrecomputes(s,e,this.bits,n);return this.wnafCachedCT(i,r).p}setWindowSize(e,r){this.assertPoint(e),ei(r,this.bits);let n=Math.ceil((this.bits+kn)/r)+1;ti(n*2**(r-1),this.Point.Fp.BYTES),_n.set(e,r),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return ur(e)!==1}};function ai(t,e,r,n=!1){if(Ke(t),qn(e,t),ie(n,"allowOversized"),ni(r,t.Fn,n?t.Fn.ORDER**Qo:void 0),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let s=e.map(o=>si(o,4)),i=r.map(o=>oi(o,4));return ui(t.ZERO,s,i)}function Ln(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Fe(e),e}else return gt(t,{isLE:r})}function Nn(t,e,r={},n){if(t!=="weierstrass"&&t!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(n===void 0&&(n=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);te(r);for(let a of["p","n","h"]){let c=e[a];if(!(de(c)&&c!==ar))throw new Error(`CURVE.${a} must be positive bigint`)}let s=Ln(e.p,r.Fp,n),i=Ln(e.n,r.Fn,n),u=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(let a of u)if(!s.isValid(e[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:s,Fn:i}}function yt(t,e){return function(n){let s=t(n);return{secretKey:s,publicKey:e(s)}}}var bt=BigInt(0),At=BigInt(1),wt=BigInt(2),ci=BigInt(4),Un=BigInt(8);function li(t,e,r,n){let s=t.sqr(r),i=t.sqr(n),o=t.add(t.mul(e.a,s),i),u=t.add(t.ONE,t.mul(e.d,t.mul(s,i)));return t.eql(o,u)}function In(t,e={}){te(e,{},{},"extraOpts");let r=e,n=Nn("edwards",t,r,r.FpFnLE),{Fp:s,Fn:i}=n,o=n.CURVE,{h:u}=o;if(je(s,o.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(je(s,o.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");te(r,{},{uvRatio:"function",randomBytes:"function"});let a=r.randomBytes===void 0?$e:r.randomBytes,c=wt<<BigInt(s.BYTES*8)-At;function l(D){if(!s.isOdd)throw new Error("Field does not have .isOdd()");return s.isOdd(D)}let f=r.uvRatio===void 0?(D,d)=>{try{return{isValid:!0,value:s.sqrt(s.div(D,d))}}catch{return{isValid:!1,value:bt}}}:r.uvRatio;if(!li(s,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");let h=s.eql(o.a,s.neg(s.ONE))?D=>s.neg(D):s.eql(o.a,s.ONE)?D=>D:D=>s.mul(o.a,D);function p(D,d,x=!1){let w=x?At:bt;return Ae("coordinate "+D,d,w,c),d}function g(D){if(!(D instanceof m))throw new Error("EdwardsPoint expected")}class m{static BASE=new m(o.Gx,o.Gy,s.ONE,s.mul(o.Gx,o.Gy));static ZERO=new m(s.ZERO,s.ONE,s.ONE,s.ZERO);static Fp=s;static Fn=i;X;Y;Z;T;constructor(d,x,w,S){this.X=p("x",d),this.Y=p("y",x),this.Z=p("z",w,!0),this.T=p("t",S),Object.freeze(this)}static CURVE(){return o}static fromAffine(d){if(d instanceof m)throw new Error("extended point not allowed");let{x,y:w}=d||{};return p("x",x),p("y",w),new m(x,w,s.ONE,s.mul(x,w))}static fromBytes(d,x=!1){let w=s.BYTES,{a:S,d:_}=o;d=he(M(d,w,"point")),ie(x,"zip215");let C=he(d),E=d[w-1];C[w-1]=E&-129;let k=ue(C),U=x?c:s.ORDER;Ae("point.y",k,bt,U);let L=s.sqr(k),N=s.sub(L,s.ONE),b=s.sub(s.mulN(_,L),S),{isValid:B,value:A}=f(N,b);if(!B)throw new Error("bad point: invalid y coordinate");let T=l(A),F=(E&128)!==0;if(!x&&s.is0(A)&&F)throw new Error("bad point: x=0 and x_0=1");return F!==T&&(A=s.neg(A)),m.fromAffine({x:A,y:k})}static fromHex(d,x=!1){return m.fromBytes(yn(d),x)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(d=6,x=!0){return v.setWindowSize(this,d),x||this.multiply(wt),this}assertValidity(){let d=this,{a:x,d:w}=o;if(d.is0())throw new Error("bad point: ZERO");let{X:S,Y:_,Z:C,T:E}=d,k=s.sqr(S),U=s.sqr(_),L=s.sqr(C),N=s.sqr(L),b=s.mul(k,x),B=s.mul(s.add(b,U),L),A=s.add(N,s.mul(w,s.mul(k,U)));if(!s.eql(B,A))throw new Error("bad point: equation left != right (1)");let T=s.mul(S,_),F=s.mul(C,E);if(!s.eql(T,F))throw new Error("bad point: equation left != right (2)")}equals(d){g(d);let{X:x,Y:w,Z:S}=this,{X:_,Y:C,Z:E}=d,k=s.mul(x,E),U=s.mul(_,S),L=s.mul(w,E),N=s.mul(C,S);return s.eql(k,U)&&s.eql(L,N)}is0(){return this.equals(m.ZERO)}negate(){return new m(s.neg(this.X),this.Y,this.Z,s.neg(this.T))}double(){let{X:d,Y:x,Z:w}=this,S=s.sqr(d),_=s.sqr(x),C=s.mul(s.sqr(w),wt),E=h(S),k=s.addN(d,x),U=s.sub(s.subN(s.sqr(k),S),_),L=s.addN(E,_),N=s.subN(L,C),b=s.subN(E,_),B=s.mul(U,N),A=s.mul(L,b),T=s.mul(U,b),F=s.mul(N,L);return new m(B,A,F,T)}add(d){g(d);let{d:x}=o,{X:w,Y:S,Z:_,T:C}=this,{X:E,Y:k,Z:U,T:L}=d,N=s.mul(w,E),b=s.mul(S,k),B=s.mul(s.mulN(C,x),L),A=s.mul(_,U),T=s.sub(s.subN(s.mulN(s.addN(w,S),s.addN(E,k)),N),b),F=s.subN(A,B),I=s.addN(A,B),P=s.sub(b,h(N)),$=s.mul(T,F),z=s.mul(I,P),K=s.mul(T,P),oe=s.mul(F,I);return new m($,z,oe,K)}subtract(d){return g(d),this.add(d.negate())}multiply(d){if(!i.isValidNot0(d))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:x,f:w}=v.mulSecret(this,d,u,y);return y([x,w])[0]}multiplyUnsafe(d){if(!i.isValid(d))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return d===bt?m.ZERO:this.is0()||d===At?this:v.mulUnsafe(this,d,y)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return v.mulUnsafe(this,o.n).is0()}toAffine(d){let x=this,w=d;if(w!=null&&typeof w!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof w);let{X:S,Y:_,Z:C}=x,E=x.is0();w==null&&(w=E?s.create(Un):s.inv(C));let k=s.mul(S,w),U=s.mul(_,w),L=s.mul(C,w);if(E)return{x:s.ZERO,y:s.ONE};if(!s.eql(L,s.ONE))throw new Error("invZ was invalid");return{x:k,y:U}}clearCofactor(){return u===At?this:u===wt?this.double():u===ci?this.double().double():u===Un?this.double().double().double():this.multiplyUnsafe(u)}toBytes(){let{x:d,y:x}=this.toAffine(),w=s.toBytes(x);return w[w.length-1]|=l(d)?128:0,w}toHex(){return xn(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let y=D=>On(m,D),v=new xt(m,a);return v.bits>=6&&m.BASE.precompute(6),Object.freeze(m.prototype),Object.freeze(m),m}function Pn(t,e,r={}){if(Ke(t),typeof e!="function")throw new Error('"hash" function param is required');let n=e,s=r;te(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});let{prehash:i}=s,{BASE:o,Fp:u,Fn:a}=t,c=n.outputLen,l=2*u.BYTES;if(c!==void 0&&(Se(c,"hash.outputLen"),c!==l))throw new Error(`hash.outputLen must be ${l}, got ${c}`);let f=s.randomBytes===void 0?$e:s.randomBytes,h=s.toMontgomery,p=s.toMontgomerySecret,g=s.adjustScalarBytes===void 0?b=>b:s.adjustScalarBytes,m=s.domain===void 0?(b,B,A)=>{if(ie(A,"phflag"),B.length||A)throw new Error("Contexts/pre-hash are not supported");return b}:s.domain;function y(b){return a.create(ue(b))}function v(b){let B=E.secretKey;M(b,E.secretKey,"secretKey");let A=M(n(b),2*B,"hashedSecretKey"),T=g(A.slice(0,B)),F=A.slice(B,2*B),I=y(T);return{head:T,prefix:F,scalar:I}}function D(b){let{head:B,prefix:A,scalar:T}=v(b),F=o.multiply(T),I=F.toBytes();return{head:B,prefix:A,scalar:T,point:F,pointBytes:I}}function d(b){return D(b).pointBytes}function x(b=Uint8Array.of(),...B){let A=Jt(...B);return y(n(m(A,M(b,void 0,"context"),!!i)))}function w(b,B,A={}){te(A,{},{},"options"),b=he(M(b,void 0,"message")),i&&(b=i(b));let{prefix:T,scalar:F,pointBytes:I}=D(B),P=x(A.context,T,b),$=o.multiply(P).toBytes(),z=x(A.context,$,I,b),K=a.create(P+z*F);if(!a.isValid(K))throw new Error("sign failed: invalid s");let oe=Jt($,a.toBytes(K));return M(oe,E.signature,"result")}let S={zip215:s.zip215};function _(b,B,A,T=S){te(T);let{context:F}=T,I=T.zip215===void 0?!!S.zip215:T.zip215,P=E.signature;b=M(b,P,"signature"),B=M(B,void 0,"message"),A=M(A,E.publicKey,"publicKey"),I!==void 0&&ie(I,"zip215"),i&&(B=i(B));let $=P/2,z=b.subarray(0,$),K=ue(b.subarray($,P)),oe,Ne,rt;try{oe=t.fromBytes(A,I),Ne=t.fromBytes(z,I),rt=o.multiplyUnsafe(K)}catch{return!1}if(!I&&oe.isSmallOrder())return!1;let Ue=x(F,z,A,B);return Ne.add(oe.multiplyUnsafe(Ue)).subtract(rt).clearCofactor().is0()}let C=u.BYTES,E={secretKey:C,publicKey:C,signature:2*C,seed:C};function k(b){return b=b===void 0?f(E.seed):b,M(b,E.seed,"seed")}function U(b){return He(b)&&b.length===E.secretKey}function L(b,B){try{return!!t.fromBytes(b,B===void 0?S.zip215:B)}catch{return!1}}let N={getExtendedPublicKey:D,randomSecretKey:k,isValidSecretKey:U,isValidPublicKey:L,toMontgomery(b){if(h===void 0)throw new Error("Montgomery conversion is not supported for this curve");return h(t.fromBytes(b))},toMontgomerySecret(b){if(p===void 0)throw new Error("Montgomery conversion is not supported for this curve");return p(b)}};return Object.freeze(E),Object.freeze(N),Object.freeze({keygen:yt(k,d),getPublicKey:d,sign:w,verify:_,utils:N,Point:t,lengths:E})}var De=BigInt(0),W=BigInt(1),Dt=BigInt(2);function Mn(t,e){return t+e-(e>>W<<W)}function fi(t){let e=BigInt(6)*t;return(r,n,s)=>{let i=n+s,u=((e+s-n)*r+n)%t;return{x_2:u,x_3:i-u}}}function di(t){return te(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...t})}function Hn(t){let e=di(t),{P:r,type:n,adjustScalarBytes:s,powPminus2:i,randomBytes:o}=e,u=e.scalarMultBase,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let c=o===void 0?$e:o,l=a?255:448,f=fi(r),h=a?32:56,p=BigInt(a?9:5),g=BigInt(a?121665:39081),m=a?Dt**BigInt(254):Dt**BigInt(447),y=a?BigInt(8)*(Dt**BigInt(251)-W):BigInt(4)*(Dt**BigInt(445)-W),v=m+y+W,D=A=>R(A,r),d=x(p);function x(A){return ht(D(A),h)}function w(A){let T=he(M(A,h,"uCoordinate"));return a&&(T[31]&=127),D(ue(T))}function S(A){return ue(s(he(M(A,h,"scalar"))))}let _=new Set(a?[De,W,r-W,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[De,W,r-W]);function C(A,T){let F=w(T);if(_.has(F))throw new Error("invalid private or public key received");let I=L(F,S(A));if(I===De)throw new Error("invalid private or public key received");return x(I)}function E(A){if(u===void 0)return C(A,d);let T=S(A);Ae("scalar",T,m,v);let F=D(u(T));if(F===De)throw new Error("invalid private or public key received");return x(F)}let k=E,U=C;function L(A,T){Ae("u",A,De,r),Ae("scalar",T,m,v);let F=T,I=A,P=W,$=De,z=A,K=W,oe=F^F>>W;for(let Ue=BigInt(l-1);Ue>=De;Ue--){let Mt=Mn(r,oe>>Ue);({x_2:P,x_3:z}=f(Mt,P,z)),{x_2:$,x_3:K}=f(Mt,$,K);let nt=P+$,Ht=D(nt*nt),$t=P-$,Kr=D($t*$t),Gr=Ht-Kr,Fo=z+K,ko=z-K,Vr=D(ko*nt),Wr=D(Fo*$t),Zr=Vr+Wr,Yr=Vr-Wr;z=D(Zr*Zr),K=D(I*D(Yr*Yr)),P=D(Ht*Kr),$=D(Gr*(Ht+D(g*Gr)))}let Ne=Mn(r,F);({x_2:P,x_3:z}=f(Ne,P,z)),{x_2:$,x_3:K}=f(Ne,$,K);let rt=i($);return D(P*rt)}let N={secretKey:h,publicKey:h,seed:h},b=A=>(A=A===void 0?c(h):A,M(A,N.seed,"seed"),A),B={randomSecretKey:b};return Object.freeze(N),Object.freeze(B),Object.freeze({keygen:yt(b,k),getSharedSecret:U,getPublicKey:k,scalarMult:C,scalarMultBase:E,utils:B,GuBytes:d.slice(),lengths:N})}var $n=BigInt(0),cr=BigInt(1),jn=BigInt(2),hi=BigInt(3),pi=BigInt(5),mi=BigInt(8),Et=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),gi={p:Et,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:mi,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Gn(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),s=BigInt(80),i=Et,u=t*t%i*t%i,a=V(u,jn,i)*u%i,c=V(a,cr,i)*t%i,l=V(c,pi,i)*c%i,f=V(l,e,i)*l%i,h=V(f,r,i)*f%i,p=V(h,n,i)*h%i,g=V(p,s,i)*p%i,m=V(g,s,i)*p%i,y=V(m,e,i)*l%i;return{pow_p_5_8:V(y,jn,i)*t%i,b2:u}}function lr(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}var zn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function xi(t,e){let r=Et,n=R(e*e*e,r),s=R(n*n*e,r),i=Gn(t*s).pow_p_5_8,o=R(t*n*i,r),u=R(e*o*o,r),a=o,c=R(o*zn,r),l=u===t,f=u===R(-t,r),h=u===R(-t*zn,r);return l&&(o=a),(f||h)&&(o=c),Fn(o,r)&&(o=R(-o,r)),{isValid:l||f,value:o}}var Ge=In(gi,{uvRatio:xi}),Kn=Ge.Fp;function yi(t){let{y:e}=t;return Kn.toBytes(Kn.div(cr+e,cr-e))}function bi(t){let e=Ge.Fp.BYTES;return ee(t,e),lr(Xt(t.subarray(0,e))).subarray(0,e)}function Ai(t){return Pn(Ge,Xt,Object.assign({adjustScalarBytes:lr,toMontgomery:yi,toMontgomerySecret:bi,zip215:!0},t))}var Vn=Ai({});var G=(()=>{let t=Et,e=r=>{let{pow_p_5_8:n,b2:s}=Gn(r);return R(V(n,hi,t)*s,t)};return Hn({P:t,type:"x25519",powPminus2:e,adjustScalarBytes:lr,scalarMultBase:r=>{let n=R(r,Ge.Fn.ORDER);if(n===$n)return $n;let s=Ge.BASE.multiply(n);return R((s.Z+s.Y)*e(R(s.Z-s.Y,t)),t)}})})();var Wn=1,Ct=new TextEncoder;function fr(t){return Z(Ct.encode(`shalom/v1/${t}`))}function ke(t){return t.buffer instanceof ArrayBuffer?t:new Uint8Array(t)}function Z(...t){let e=new Uint8Array(t.reduce((n,s)=>n+s.length,0)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e}async function Zn(t,e,r,n){let s=await crypto.subtle.importKey("raw",Z(t),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:Z(e,r),info:fr(n)},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Yn(){let{secretKey:t,publicKey:e}=G.keygen();return{secretKey:t,publicKey:e}}function Xn(t){return G.getPublicKey(t)}async function Qn(t,e,r){let n=G.keygen(),s=G.getSharedSecret(n.secretKey,t),i=await Zn(s,n.publicKey,t,r),o=crypto.getRandomValues(new Uint8Array(12)),u=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:o,additionalData:fr(r)},i,ke(e)));return Z(new Uint8Array([Wn]),n.publicKey,o,u)}async function Ve(t,e,r){if(e.length<61||e[0]!==Wn)throw new Error("lacre inv\xE1lido");let n=e.subarray(1,33),s=e.subarray(33,45),i=e.subarray(45),o=G.getPublicKey(t),u=G.getSharedSecret(t,n),a=await Zn(u,n,o,r);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:ke(s),additionalData:fr(r)},a,ke(i)))}async function Jn(t,e){return JSON.parse(new TextDecoder().decode(await Ve(t,e,"head")))}function re(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function Y(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}var Bt=2;async function es(t,e,r,n,s,i){let o=await crypto.subtle.importKey("raw",Z(t,e),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:Z(r,n,s),info:Z(Ct.encode(`shalom/v2/${i}`))},o,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ts(t,e,r,n){let s=G.keygen(),i=G.getPublicKey(e),o=await es(G.getSharedSecret(s.secretKey,t),G.getSharedSecret(e,t),s.publicKey,i,t,n),u=crypto.getRandomValues(new Uint8Array(12)),a=Z(new Uint8Array([Bt]),Ct.encode(`shalom/v2/${n}`)),c=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:u,additionalData:a},o,ke(r)));return Z(new Uint8Array([Bt]),s.publicKey,u,c)}async function rs(t,e,r,n){if(r.length<61||r[0]!==Bt)throw new Error("lacre inv\xE1lido");let s=r.subarray(1,33),i=r.subarray(33,45),o=G.getPublicKey(t),u=await es(G.getSharedSecret(t,s),G.getSharedSecret(t,e),s,e,o,n),a=Z(new Uint8Array([Bt]),Ct.encode(`shalom/v2/${n}`));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:ke(i),additionalData:a},u,ke(r.subarray(45))))}var ne=new TextEncoder,ae=t=>t===32||t===9,ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",We=new Uint8Array(256);for(let t=0;t<ns.length;t++)We[ns.charCodeAt(t)]=t;function hr(t){let e=t.length;for(;e>0&&t.charAt(e-1)==="=";)e--;e%4===1&&e--;let r=e%4,n=Math.floor(e/4)*3+(r?r-1:0),s=new ArrayBuffer(n),i=new Uint8Array(s),o=0;for(let u=0;u<e;u+=4){let a=We[t.charCodeAt(u)],c=We[t.charCodeAt(u+1)],l=We[t.charCodeAt(u+2)],f=We[t.charCodeAt(u+3)];i[o++]=a<<2|c>>4,o<n&&(i[o++]=(c&15)<<4|l>>2),o<n&&(i[o++]=(l&3)<<6|f&63)}return s}var wi=new Map([["iso88598i","iso-8859-8"],["iso88598e","iso-8859-8"],["shiftjis","shift_jis"],["windows31j","shift_jis"],["mskanji","shift_jis"],["eucjp","euc-jp"],["iso2022jp","iso-2022-jp"],["iso2022jp1","iso-2022-jp"],["iso2022jp2","iso-2022-jp"],["junet","iso-2022-jp"],["euckr","euc-kr"],["uhc","euc-kr"],["tis620","windows-874"]]),Di=new Map([["932","shift_jis"],["936","gbk"],["949","euc-kr"],["950","big5"],["874","windows-874"],["51932","euc-jp"],["50220","iso-2022-jp"],["50221","iso-2022-jp"],["50222","iso-2022-jp"]]),Ei=/^(?:cp|windows|ms|ibm)(\d+)$/;function Bi(t){return t.replace(/^(?:x-ms-|x-|cs)/,"").replace(/[\s._-]+/g,"")}var ss=new Set(["unicode-1-1-utf-8 unicode11utf8 unicode20utf8 utf-8 utf8 x-unicode20utf8","866 cp866 csibm866 ibm866","csisolatin2 iso-8859-2 iso-ir-101 iso8859-2 iso88592 iso_8859-2 iso_8859-2:1987 l2 latin2","csisolatin3 iso-8859-3 iso-ir-109 iso8859-3 iso88593 iso_8859-3 iso_8859-3:1988 l3 latin3","csisolatin4 iso-8859-4 iso-ir-110 iso8859-4 iso88594 iso_8859-4 iso_8859-4:1988 l4 latin4","csisolatincyrillic cyrillic iso-8859-5 iso-ir-144 iso8859-5 iso88595 iso_8859-5 iso_8859-5:1988","arabic asmo-708 csiso88596e csiso88596i csisolatinarabic ecma-114 iso-8859-6 iso-8859-6-e","iso-8859-6-i iso-ir-127 iso8859-6 iso88596 iso_8859-6 iso_8859-6:1987","csisolatingreek ecma-118 elot_928 greek greek8 iso-8859-7 iso-ir-126 iso8859-7 iso88597 iso_8859-7","iso_8859-7:1987 sun_eu_greek","csiso88598e csisolatinhebrew hebrew iso-8859-8 iso-8859-8-e iso-ir-138 iso8859-8 iso88598 iso_8859-8","iso_8859-8:1988 visual","csiso88598i iso-8859-8-i logical","csisolatin6 iso-8859-10 iso-ir-157 iso8859-10 iso885910 l6 latin6","iso-8859-13 iso8859-13 iso885913","iso-8859-14 iso8859-14 iso885914","csisolatin9 iso-8859-15 iso8859-15 iso885915 iso_8859-15 l9","iso-8859-16","cskoi8r koi koi8 koi8-r koi8_r","koi8-ru koi8-u","csmacintosh mac macintosh x-mac-roman","dos-874 iso-8859-11 iso8859-11 iso885911 tis-620 windows-874","cp1250 windows-1250 x-cp1250","cp1251 windows-1251 x-cp1251","ansi_x3.4-1968 ascii cp1252 cp819 csisolatin1 ibm819 iso-8859-1 iso-ir-100 iso8859-1 iso88591","iso_8859-1 iso_8859-1:1987 l1 latin1 us-ascii windows-1252 x-cp1252","cp1253 windows-1253 x-cp1253","cp1254 csisolatin5 iso-8859-9 iso-ir-148 iso8859-9 iso88599 iso_8859-9 iso_8859-9:1989 l5 latin5","windows-1254 x-cp1254","cp1255 windows-1255 x-cp1255","cp1256 windows-1256 x-cp1256","cp1257 windows-1257 x-cp1257","cp1258 windows-1258 x-cp1258","x-mac-cyrillic x-mac-ukrainian","chinese csgb2312 csiso58gb231280 gb2312 gb_2312 gb_2312-80 gbk iso-ir-58 x-gbk","gb18030","big5 big5-hkscs cn-big5 csbig5 x-x-big5","cseucpkdfmtjapanese euc-jp x-euc-jp","csiso2022jp iso-2022-jp","csshiftjis ms932 ms_kanji shift-jis shift_jis sjis windows-31j x-sjis","cseuckr csksc56011987 euc-kr iso-ir-149 korean ks_c_5601-1987 ks_c_5601-1989 ksc5601 ksc_5601","windows-949","csiso2022kr hz-gb-2312 iso-2022-cn iso-2022-cn-ext iso-2022-kr replacement","x-user-defined"].join(" ").split(" ")),Ci=new Set(["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr","replacement"]),vi={encoding:"replacement",decode:t=>t&&t.byteLength?"\uFFFD":""},Ti=new Map([["utf-16","utf-16"],["utf16","utf-16"],["utf_16","utf-16"],["utf-16le","utf-16le"],["utf-16be","utf-16be"]]);function cs(t){if(t=(t||"utf8").trim().toLowerCase(),ss.has(t))return t;let e=Ti.get(t);if(e)return e;let r=Bi(t),n=r.match(Ei),s=n&&Di.get(n[1])||wi.get(r)||r;return ss.has(s)?s:null}var os=new Map;function vt(t){if(Ci.has(t))return vi;let e=os.get(t);if(e===void 0){e=null;try{e=new TextDecoder(t)}catch{}os.set(t,e)}return e}var pr=new TextDecoder;function ls(t){let e=cs(t);return e?vt(e):null}function fs(t){return ls(t)||vt("windows-1252")||pr}var Si=new Set(["utf-16le","utf-16be"]),Fi=new Set(["utf-16"]);function ki(t){return t[0]===254&&t[1]===255?"utf-16be":t[0]===255&&t[1]===254?"utf-16le":null}function Ri(t){for(let e=0;e<t.length;){let r=t[e];if(r<128){e++;continue}let n;if(r>=194&&r<=223)n=1;else if(r>=224&&r<=239)n=2;else if(r>=240&&r<=244)n=3;else return!1;if(e+n>=t.length)return!1;let s=t[e+1],i=r===224?160:r===240?144:128,o=r===237?159:r===244?143:191;if(s<i||s>o)return!1;for(let u=2;u<=n;u++)if((t[e+u]&192)!==128)return!1;e+=n+1}return!0}function Tt(t,e=pr){let r=t instanceof Uint8Array?t:new Uint8Array(t);return Ri(r)?e.decode(r):fs("windows-1252").decode(r)}function mr(t,e){let r=t instanceof Uint8Array?t:new Uint8Array(t),n=cs(e),s=n?vt(n):null;if(n&&Fi.has(n)){let i=ki(r);s=i&&vt(i)||s}return s?s.decode(r):Tt(r)}var Li=1024,Oi=/charset\s*=\s*["']?\s*([^\s"';>]+)/;function qi(t){let e=pr.decode(t.subarray(0,Li)).toLowerCase(),r=0;for(;(r=e.indexOf("<meta",r))>=0;){let n=e.indexOf(">",r);n<0&&(n=e.length);let s=Oi.exec(e.slice(r,n));if(s)return s[1];r=n}return null}function ds(t,e,r){let n=new Uint8Array(t);if(e)return mr(n,e);let s=r?qi(n):null,i=s?ls(s):null;return!i||Si.has(i.encoding)?Tt(n):(i.encoding==="x-user-defined"?fs("windows-1252"):i).decode(n)}async function Re(t){if("arrayBuffer"in t)return await t.arrayBuffer();let e=new FileReader;return new Promise((r,n)=>{e.onload=()=>{r(e.result)},e.onerror=()=>{n(e.error)},e.readAsArrayBuffer(t)})}function Ee(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1}function Ze(t){return t.replace(/[\r\n]+/g," ")}function dr(t,e,r){let n=t.indexOf("*");n>=0&&(t=t.slice(0,n)),e=e.toUpperCase();let s;if(e==="Q"){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let i=ne.encode(r),o=[];for(let a=0,c=i.length;a<c;a++){let l=i[a];if(a<=c-2&&l===61){let f=Ee(i[a+1]),h=Ee(i[a+2]);if(f>=0&&h>=0){o.push(f<<4|h),a+=2;continue}}o.push(l)}s=new ArrayBuffer(o.length);let u=new DataView(s);for(let a=0,c=o.length;a<c;a++)u.setUint8(a,o[a])}else e==="B"?s=hr(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=ne.encode(r);return Ze(mr(s,t))}var hs="=\\?([^?\\s]+)\\?([QqBb])\\?([^?]*)\\?=",is=new RegExp(hs,"g"),_i=/^[ \t\r\n]+$/,Ni=new RegExp(`^(?:${hs}\\s*)+$`);function ps(t){return Ni.test(t)}function Ui(t){let e=[];is.lastIndex=0;let r=0,n;for(;n=is.exec(t);)n.index>r&&e.push({text:t.substring(r,n.index)}),e.push({charset:n[1],encoding:n[2],encodedText:n[3]}),r=n.index+n[0].length;return r<t.length&&e.push({text:t.substring(r)}),e}function Ii(t,e){let r=t.encoding.toUpperCase();return t.charset!==e.charset||r!==e.encoding.toUpperCase()?!1:r==="B"?t.encodedText.length%4===0&&!t.padded:!0}function us(t,e){let r="",n=null;for(let s=0;s<t.length;s++){let i=t[s];if(i.text!==void 0){let o=t[s+1];if(n&&o&&o.text===void 0&&_i.test(i.text))continue;n&&(r+=dr(n.charset,n.encoding,n.encodedText),n=null),r+=i.text;continue}if(n&&e&&Ii(n,i)){n.encodedText+=i.encodedText,n.padded=i.encodedText.endsWith("=");continue}n&&(r+=dr(n.charset,n.encoding,n.encodedText)),n={charset:i.charset,encoding:i.encoding,encodedText:i.encodedText,padded:i.encodedText.endsWith("=")}}return n&&(r+=dr(n.charset,n.encoding,n.encodedText)),r}function pe(t){let e=Ui((t||"").toString()),r=us(e,!0);return r.indexOf("\uFFFD")<0?r:us(e,!1)}function as(t,e){e=e||"utf-8";let r=[];for(let i=0;i<t.length;i++){let o=t.charAt(i),u=o==="%"?Ee(t.charCodeAt(i+1)):-1,a=u>=0?Ee(t.charCodeAt(i+2)):-1;if(a>=0)r.push(u<<4|a),i+=2;else if(o.charCodeAt(0)>126){let c=ne.encode(o);for(let l=0;l<c.length;l++)r.push(c[l])}else r.push(o.charCodeAt(0))}let n=new ArrayBuffer(r.length),s=new DataView(n);for(let i=0,o=r.length;i<o;i++)s.setUint8(i,r[i]);return mr(n,e)}function ms(t){let e=new Map;Object.keys(t.params).forEach(r=>{let n=r.match(/\*((\d+)\*?)?$/);if(!n)return;let s=r.slice(0,n.index).toLowerCase(),i=Number(n[2])||0,o=e.get(s);o||(o={charset:null,values:[]},e.set(s,o));let u=t.params[r],a=n[0].charAt(n[0].length-1)==="*";i===0&&a&&(n=u.match(/^([^']*)'[^']*'(.*)$/))&&(o.charset=n[1]||"utf-8",u=n[2]),o.values.push({nr:i,value:u,encoded:a}),delete t.params[r]}),e.forEach((r,n)=>{if(Object.prototype.hasOwnProperty.call(t.params,n))return;let s="",i="";for(let o of r.values.sort((u,a)=>u.nr-a.nr)){if(o.encoded){i+=o.value;continue}i&&(s+=as(i,r.charset),i=""),s+=o.value}i&&(s+=as(i,r.charset)),t.params[n]=s})}var Ye=class{constructor(){this.chunks=[],this.runBuffer=null,this.runStart=0,this.runEnd=0,this.pendingLineBreak=null}continuesRun(e){return e.buffer===this.runBuffer&&e.byteOffset===this.runEnd}flushRun(){this.runBuffer&&this.runEnd>this.runStart&&this.chunks.push(new Uint8Array(this.runBuffer,this.runStart,this.runEnd-this.runStart)),this.runBuffer=null}update(e,r){let n=this.pendingLineBreak;n&&this.continuesRun(n)&&e.buffer===this.runBuffer&&e.byteOffset===this.runEnd+n.byteLength?this.runEnd=e.byteOffset+e.byteLength:(this.flushRun(),n&&this.chunks.push(n),this.runBuffer=e.buffer,this.runStart=e.byteOffset,this.runEnd=e.byteOffset+e.byteLength),this.pendingLineBreak=r}finalize(e=!1){let r=this.pendingLineBreak;return!e&&r&&(this.continuesRun(r)?this.runEnd+=r.byteLength:(this.flushRun(),this.chunks.push(r))),this.flushRun(),Re(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Be=class{constructor(e=100*1024){this.maxChunkSize=e,this.buffer=null,this.bufferPos=0,this.chunks=[]}writeByte(e){(!this.buffer||this.bufferPos>=this.buffer.length)&&(this.flush(),this.buffer??=new Uint8Array(this.maxChunkSize)),this.buffer[this.bufferPos++]=e}writeBytes(e,r=0,n=e.length){for(;r<n;){(!this.buffer||this.bufferPos>=this.buffer.length)&&(this.flush(),this.buffer??=new Uint8Array(this.maxChunkSize));let s=Math.min(n-r,this.buffer.length-this.bufferPos);this.buffer.set(e.subarray(r,r+s),this.bufferPos),this.bufferPos+=s,r+=s}}append(e){e.length>=this.maxChunkSize/2?(this.flush(),this.chunks.push(e)):this.writeBytes(e)}flush(){this.buffer&&this.bufferPos&&(this.chunks.push(this.buffer.slice(0,this.bufferPos)),this.bufferPos=0)}finalize(){return this.flush(),Re(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Xe=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.output=new Be,this.remainder=""}pushChunk(e){e.length&&this.output.append(new Uint8Array(hr(e)))}flushRemainder(){this.pushChunk(this.remainder),this.remainder=""}update(e){let r=this.decoder.decode(e).replace(/[^a-zA-Z0-9+/=]+/g,""),n=0,s;for(;(s=r.indexOf("=",n))>=0;)this.remainder+=r.substring(n,s),this.flushRemainder(),n=s+1;if(this.remainder+=r.substring(n),this.remainder.length>=this.maxChunkSize){let i=Math.floor(this.remainder.length/4)*4;this.pushChunk(this.remainder.substring(0,i)),this.remainder=this.remainder.substring(i)}}finalize(){return this.flushRemainder(),this.output.finalize()}};var gs=61,Qe=class{constructor(){this.output=new Be,this.pendingLineBreak=null}writeLineBreak(){this.pendingLineBreak&&this.output.writeBytes(this.pendingLineBreak)}update(e,r){this.writeLineBreak();let n=e.length;for(;n>0&&ae(e[n-1]);)n--;let s=n>0&&e[n-1]===gs;s&&n--;let i=0;for(let o=0;o<n;o++){if(e[o]!==gs||o+2>=n)continue;let u=Ee(e[o+1]),a=Ee(e[o+2]);u<0||a<0||(this.output.writeBytes(e,i,o),this.output.writeByte(u<<4|a),o+=2,i=o+1)}this.output.writeBytes(e,i,n),this.pendingLineBreak=s?null:r}finalize(e=!1){return e||this.writeLineBreak(),this.output.finalize()}};var Pi={EINVALIDOPTION:TypeError,EINVALIDINPUT:TypeError,EPARSERREUSED:Error,EMAXNESTINGDEPTH:Error,EMAXHEADERSIZE:Error,EMAXPARTCOUNT:Error,EMAXFORWARDEDADDRESSES:Error};function X(t,e){let r=new Pi[t](e);return r.code=t,r}var Mi=new TextDecoder("utf-8",{ignoreBOM:!0}),Hi=4096,$i=64,ji=t=>{let e=0,r=t.length;for(;e<r&&ae(t.charCodeAt(e));)e++;for(;r>e&&ae(t.charCodeAt(r-1));)r--;return t.slice(e,r)},zi=/^(?:From |[!-9;-~]*[ \t]*:)/,Ki=new Set(["content-type","content-transfer-encoding","content-disposition","content-id","content-description"]),Le=class{constructor(e){this.options=e,this.postalMime=e.postalMime;let r=this.postalMime.limits;if(this.postalMime.counters.partCount++,this.postalMime.counters.partCount>r.maxPartCount)throw X("EMAXPARTCOUNT",`Maximum MIME part count of ${r.maxPartCount} parts exceeded`);if(this.childNodes=[],this.finalizedChildCount=0,e.parentNode){if(this.parentNode=e.parentNode,this.depth=this.parentNode.depth+1,this.depth>r.maxNestingDepth)throw X("EMAXNESTINGDEPTH",`Maximum MIME nesting depth of ${r.maxNestingDepth} levels exceeded`);e.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[];let s=(e.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:s,parsed:{value:s,params:{}},multipart:!1},this.contentTransferEncoding={value:"8bit",encoding:""},this.contentDisposition={value:"",parsed:{value:"",params:{}}},this.headers=[],this.rawHeaderLines=[],this.contentDecoder=null,this.content=null}setupContentDecoder(e){e==="base64"?this.contentDecoder=new Xe:e==="quoted-printable"?this.contentDecoder=new Qe:this.contentDecoder=new Ye}async finalize(e=!1){if(this.state==="finished")return;this.state==="header"&&this.endHeaders();let r=this.postalMime.boundaries;for(let n=r.length-1;n>=0;n--)if(r[n].node===this){r.splice(n,1);break}await this.finalizeChildNodes(e),this.content=this.contentDecoder?await this.contentDecoder.finalize(e):null,this.contentDecoder=null,this.state="finished"}async finalizeChildNodes(e=!1){for(;this.finalizedChildCount<this.childNodes.length;)await this.childNodes[this.finalizedChildCount++].finalize(e)}stripComments(e){let r="",n=0,s=!1,i=!1,o=-1,u=!1,a=0,c=g=>{r+=e.slice(a,g),a=g+1},l=!1,f=!1,h=g=>{l=!0,f=ae(e.charCodeAt(g))},p=()=>!u||!l||f;for(let g=0;g<e.length;g++){let m=e.charAt(g);if(s)s=!1;else if(m==="\\")s=!0;else if(m==='"'&&n===0)i=!i;else if(!i){if(m==="("&&p()){n===0&&(o=g),n++,c(g);continue}if(m===")"&&n>0){n--,c(g);continue}n===0&&(m==="="?u=!0:m===";"&&(u=!1))}n===0?h(g):c(g)}return n===0||e.indexOf(";",o)<0?r+e.slice(a):e}parseStructuredHeader(e){e=this.stripComments(e);let r={value:"",params:{}},n=!1,s="",i="value",o="",u=!1,a=!1,c=!1,l,f=()=>{s.length&&(s+=o),o=""},h=-1,p=d=>{h>=0&&(s+=e.slice(h,d),h=-1)},g=d=>{h<0&&(f(),h=d)},m=()=>{let d=s;return s="",o="",u=!1,d},y=(d,x)=>{d&&!Object.prototype.hasOwnProperty.call(r.params,d)&&(r.params[d]=x)},v=()=>{let d=m();n===!1?r.value=d:y(n,d)},D=()=>{y(m().trim().toLowerCase(),"")};for(let d=0,x=e.length;d<x;d++)switch(l=e.charAt(d),i){case"key":if(l==="="){p(d),n=m().trim().toLowerCase(),i="value";break}if(l===";"){p(d),D();break}h<0&&(h=d);break;case"value":if(u&&l!==";"){c=!1;break}if(c)g(d);else if(a&&l==="\\"){p(d),c=!0;continue}else a&&l===a?(p(d),a=!1,u=!0):!a&&l==='"'?(p(d),a=l,f()):!a&&l===";"?(p(d),v(),i="key"):!a&&(l===" "||l===" ")?(p(d),o+=l):g(d);c=!1;break}return p(e.length),i==="value"?v():D(),r.value&&(r.value=r.value.toLowerCase()),ms(r),r}decodeFlowedText(e,r){let n=[],s=[],i=!1,o=0;for(let u=0;u<=e.length;){let a=e.indexOf(`
2
- `,u);a<0&&(a=e.length);let c=e.slice(u,a),l=0;for(;c.charCodeAt(l)===62;)l++;let f=c.charCodeAt(l)===32?l+1:l,h=c.slice(f),p=h==="-- ";if(i&&l===o&&!p){if(r){let g=s[s.length-1];s[s.length-1]=g.slice(0,-1)}s.push(h)}else u&&s.push(`
3
- `),s.push(l?c:h);if(i=!p&&h.endsWith(" "),o=l,s.length>=Hi){let g=s.pop();n.push(s.join("")),s=[g]}u=a+1}return n.push(s.join("")),n.join("")}getTextContent(){if(!this.content)return"";let e=ds(this.content,this.contentType.parsed.params.charset,this.contentType.parsed.value==="text/html").replace(/\r\n/g,`
1
+ var st=BigInt(4294967295),Jr=BigInt(32);function Ro(t,e=!1){return e?{h:Number(t&st),l:Number(t>>Jr&st)}:{h:Number(t>>Jr&st)|0,l:Number(t&st)|0}}function en(t,e=!1){let r=t.length,n=new Uint32Array(r),s=new Uint32Array(r);for(let i=0;i<r;i++){let{h:o,l:u}=Ro(t[i],e);[n[i],s[i]]=[o,u]}return[n,s]}var Lo=t=>t/2**32|0,Oo=t=>t>>>0;function tn(t,e,r,n){let s=Lo(r),i=Oo(r);t.setUint32(e,n?i:s,n),t.setUint32(e+4,n?s:i,n)}var zt=(t,e,r)=>t>>>r,Kt=(t,e,r)=>t<<32-r|e>>>r,ye=(t,e,r)=>t>>>r|e<<32-r,xe=(t,e,r)=>t<<32-r|e>>>r,Ie=(t,e,r)=>t<<64-r|e>>>r-32,Pe=(t,e,r)=>t>>>r-32|e<<64-r;function ee(t,e,r,n){let s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}var rn=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),nn=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,sn=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),on=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,un=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),an=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0;function ot(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}var Gt=t=>t?`"${t}" `:"";function Me(t,e=""){if(typeof t!="number")throw new TypeError(Gt(e)+"expected number, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError(Gt(e)+"expected integer >= 0, got "+t);return t}function te(t,e,r=""){if(ot(t)&&(e===void 0||t.length===e))return t;e!==void 0&&Me(e,"length");let n=ot(t),s=e!==void 0?` of length ${e}`:"",i=n?`length=${t.length}`:`type=${typeof t}`,o=Gt(r)+"expected Uint8Array"+s+", got "+i;throw n?new RangeError(o):new TypeError(o)}var _o=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)},cn=(t,e)=>{_o(t,e);let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${e}" expected plain object`);if(Object.hasOwn(t,"__proto__"))throw new TypeError(`"${e}.__proto__" is not allowed`)};function Vt(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function fn(t,e){te(t,void 0,"output");let r=e.outputLen;if(!(t.length>=r))throw new RangeError('"output" expected length >= '+r)}function Wt(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function it(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var dn=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",No=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ut(t){if(te(t),dn)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=No[t[r]];return e}function ln(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function at(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(dn)try{return Uint8Array.fromHex(t)}catch(s){throw s instanceof SyntaxError?new RangeError(s.message):s}let e=t.length,r=e/2;if(e%2)throw new RangeError("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let s=0,i=0;s<r;s++,i+=2){let o=ln(t.charCodeAt(i)),u=ln(t.charCodeAt(i+1));if(o===void 0||u===void 0){let a=t[i]+t[i+1];throw new RangeError('hex string expected, got non-hex character "'+a+'" at index '+i)}n[s]=o*16+u}return n}function Zt(...t){let e=0;for(let n=0;n<t.length;n++){let s=t[n];te(s),e+=s.length}let r=new Uint8Array(e);for(let n=0,s=0;n<t.length;n++){let i=t[n];r.set(i,s),s+=i.length}return r}function Uo(t,e,r="opts"){return cn(t,"defaults"),e!==void 0&&cn(e,r),Object.assign(Object.create(null),t,e)}function hn(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=Uo({},e,"info");let r=(s,i)=>t(i).update(s).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=s=>t(s),Object.assign(r,e),Object.freeze(r)}function pn(t=32){Me(t,"bytesLength");let e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return e.getRandomValues(new Uint8Array(t))}var gn=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});var ct=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,r,n,s){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=s,this.buffer=new Uint8Array(e),this.view=it(this.buffer)}update(e){Vt(this),te(e);let{view:r,buffer:n,blockLen:s}=this,i=e.length,o=!1;for(let u=0;u<i;){let a=Math.min(s-this.pos,i-u);if(a===s){let c=it(e);for(;s<=i-u;u+=s)this.process(c,u);o=!0;continue}n.set(u===0&&a===i?e:e.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===s&&(this.process(r,0),this.pos=0,o=!0)}return this.length+=e.length,o&&this.roundClean(),this}digestInto(e){Vt(this),fn(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;r[o++]=128,r.fill(0,o),this.padOffset>s-o&&(this.process(n,0),r.fill(0)),tn(n,s-8,this.length*8,i),this.process(n,0),this.roundClean();let u=e===r?n:it(e),a=this.outputLen,c=a/4,l=this.get();if(a%4||c>l.length)throw new Error("invalid outputLen");for(let f=0;f<c;f++)u.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:r,length:n,finished:s,destroyed:i,pos:o}=this;return e.destroyed=i,e.finished=s,e.length=n,e.pos=o,o&&e.buffer.set(r),e}clone(){return this._cloneInto()}};var mn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var yn=en(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Io=yn[0],Po=yn[1],ce=new Uint32Array(80),le=new Uint32Array(80),Yt=class extends ct{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,r){super(128,e,16,!1),this.Ah=r[0]|0,this.Al=r[1]|0,this.Bh=r[2]|0,this.Bl=r[3]|0,this.Ch=r[4]|0,this.Cl=r[5]|0,this.Dh=r[6]|0,this.Dl=r[7]|0,this.Eh=r[8]|0,this.El=r[9]|0,this.Fh=r[10]|0,this.Fl=r[11]|0,this.Gh=r[12]|0,this.Gl=r[13]|0,this.Hh=r[14]|0,this.Hl=r[15]|0}get(){let{Ah:e,Al:r,Bh:n,Bl:s,Ch:i,Cl:o,Dh:u,Dl:a,Eh:c,El:l,Fh:f,Fl:h,Gh:p,Gl:m,Hh:g,Hl:x}=this;return[e,r,n,s,i,o,u,a,c,l,f,h,p,m,g,x]}set(e,r,n,s,i,o,u,a,c,l,f,h,p,m,g,x){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=u|0,this.Dl=a|0,this.Eh=c|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=m|0,this.Hh=g|0,this.Hl=x|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let d=0;d<16;d++,r+=4)ce[d]=e.getUint32(r),le[d]=e.getUint32(r+=4);for(let d=16;d<80;d++){let y=ce[d-15]|0,w=le[d-15]|0,S=ye(y,w,1)^ye(y,w,8)^zt(y,w,7),_=xe(y,w,1)^xe(y,w,8)^Kt(y,w,7),C=ce[d-2]|0,E=le[d-2]|0,k=ye(C,E,19)^Ie(C,E,61)^zt(C,E,6),U=xe(C,E,19)^Pe(C,E,61)^Kt(C,E,6),L=sn(_,U,le[d-7],le[d-16]),N=on(L,S,k,ce[d-7],ce[d-16]);ce[d]=N|0,le[d]=L|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:u,Cl:a,Dh:c,Dl:l,Eh:f,El:h,Fh:p,Fl:m,Gh:g,Gl:x,Hh:v,Hl:D}=this;for(let d=0;d<80;d++){let y=ye(f,h,14)^ye(f,h,18)^Ie(f,h,41),w=xe(f,h,14)^xe(f,h,18)^Pe(f,h,41),S=f&p^~f&g,_=h&m^~h&x,C=un(D,w,_,Po[d],le[d]),E=an(C,v,y,S,Io[d],ce[d]),k=C|0,U=ye(n,s,28)^Ie(n,s,34)^Ie(n,s,39),L=xe(n,s,28)^Pe(n,s,34)^Pe(n,s,39),N=n&i^n&u^i&u,b=s&o^s&a^o&a;v=g|0,D=x|0,g=p|0,x=m|0,p=f|0,m=h|0,{h:f,l:h}=ee(c|0,l|0,E|0,k|0),c=u|0,l=a|0,u=i|0,a=o|0,i=n|0,o=s|0;let B=rn(k,L,b);n=nn(B,E,U,N),s=B|0}({h:n,l:s}=ee(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=ee(this.Bh|0,this.Bl|0,i|0,o|0),{h:u,l:a}=ee(this.Ch|0,this.Cl|0,u|0,a|0),{h:c,l}=ee(this.Dh|0,this.Dl|0,c|0,l|0),{h:f,l:h}=ee(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:m}=ee(this.Fh|0,this.Fl|0,p|0,m|0),{h:g,l:x}=ee(this.Gh|0,this.Gl|0,g|0,x|0),{h:v,l:D}=ee(this.Hh|0,this.Hl|0,v|0,D|0),this.set(n,s,i,o,u,a,c,l,f,h,p,m,g,x,v,D)}roundClean(){Wt(ce,le)}destroy(){this.destroyed=!0,Wt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Xt=class extends Yt{constructor(){super(64,mn)}};var Qt=hn(()=>new Xt,gn(3));function ft(t,e,r=()=>{}){if(!Array.isArray(t))throw new TypeError(`"${e}" expected array, got type=${typeof t}`);for(let n=0;n<t.length;n++)r(t[n],`${e}[${n}]`);return t}var M=(t,e,r)=>te(t,e,r),Jt=Me;function fe(t,e="object"){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(e==="object"?"expected valid options object":`"${e}" expected object, got type=${typeof t}`);return t}function be(t,e){if(typeof t!="function")throw new TypeError(`"${e}" is invalid: expected function, got ${typeof t}`);return t}var bn=ut,er=(...t)=>Zt(...t),An=t=>at(t),He=ot,$e=t=>pn(t),lt=BigInt(0),xn=BigInt(1),Mo=t=>t?`"${t}" `:"";function ie(t,e=""){if(typeof t!="boolean")throw new TypeError(Mo(e)+"expected boolean, got type="+typeof t);return t}function Ho(t){if(typeof t=="bigint"){if(!de(t))throw new RangeError("positive bigint expected, got "+t)}else Jt(t);return t}function Se(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(r+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){let r=e&&`"${e}" `;throw new RangeError(r+"expected safe integer, got "+t)}}function wn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?lt:BigInt("0x"+t)}function dt(t){return wn(ut(t))}function ue(t){return wn(ut(he(te(t)).reverse()))}function tr(t,e){if(Me(e),e===0)throw new Error("zero output length is invalid");t=Ho(t);let r=e*2,n=t.toString(16);if(n.length>r)throw new RangeError("number is too large");return at(n.padStart(r,"0"))}function ht(t,e){return tr(t,e).reverse()}function he(t){return Uint8Array.from(M(t))}function de(t){return typeof t=="bigint"&&lt<=t}function rr(t,e,r){return de(t)&&de(e)&&de(r)&&e<=t&&t<r}function Ae(t,e,r,n){if(!rr(e,r,n))throw new RangeError("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function nr(t){if(t<lt)throw new Error("expected non-negative bigint, got "+t);return t===lt?0:t.toString(2).length}var Dn=t=>(Se(t,"n"),(xn<<BigInt(t))-xn);function re(t,e={},r={},n="object"){fe(t,n),fe(e,"fields"),fe(r,"optFields");function s(o,u,a){let c=n==="object"?`param "${String(o)}"`:`"${n}.${String(o)}"`,l=t[o];if(!Object.hasOwn(t,o)&&(a?l!==void 0:u!=="function"))throw new TypeError(`${c} is invalid: expected own property`);if(a&&l===void 0)return;let f=typeof l;if(f!==u||l===null)throw new TypeError(`${c} is invalid: expected ${u}, got ${f}`)}let i=(o,u)=>Object.entries(o).forEach(([a,c])=>s(a,c,u));i(e,!1),i(r,!0)}var H=BigInt(0),O=BigInt(1),we=BigInt(2),Cn=BigInt(3),sr=BigInt(4),vn=BigInt(5),$o=BigInt(7),Tn=BigInt(8),jo=BigInt(9),zo=BigInt(15),Sn=BigInt(16),Ko=BigInt("0x10000000000000000");function R(t,e){if(e<=H)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=H?r:e+r}function Go(t,e,r){if(r<=O)throw new Error("pow: expected modulus > 1, got "+r);if(typeof e!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof e);if(e<H)throw new Error("invalid exponent, negatives unsupported");if(e===H)return O;if(e===O)return t;let n=t%r;if(n<H&&(n+=r),e<Ko){let u=O;for(;e>H;)e&O&&(u=u*n%r),n=n*n%r,e>>=O;return u}let s=[];for(;e>H;)s.push(Number(e&zo)),e>>=sr;let i=new Array(16);i[0]=O,i[1]=n;for(let u=2;u<16;u++)i[u]=i[u-1]*n%r;let o=i[s[s.length-1]];for(let u=s.length-2;u>=0;u--){o=o*o%r,o=o*o%r,o=o*o%r,o=o*o%r;let a=s[u];a!==0&&(o=o*i[a]%r)}return o}function V(t,e,r){if(r<=O)throw new Error("pow2: expected modulus > 1, got "+r);if(e<H)throw new Error("pow2: expected non-negative exponent, got "+e);let n=t;for(;e-- >H;)n*=n,n%=r;return n}function En(t,e){if(t===H)throw new Error("invert: expected non-zero number");if(e<=O)throw new Error("invert: expected modulus > 1, got "+e);let r=R(t,e),n=e,s=H,i=O;for(;r!==H;){let u=n/r,a=n-r*u,c=s-i*u;n=r,r=a,s=i,i=c}if(n!==O)throw new Error("invert: does not exist");return R(s,e)}function or(t,e,r){let n=t;if(!n.eql(n.sqr(e),r))throw new Error("Cannot find square root")}function ir(t,e){if((t&O)===H)throw new Error(e+": expected odd modulus, got "+t)}function Fn(t,e){let r=t,n=(r.ORDER+O)/sr,s=r.pow(e,n);return or(r,s,e),s}function Vo(t,e){let r=t,n=(r.ORDER-vn)/Tn,s=r.mul(e,we),i=r.pow(s,n),o=r.mul(e,i),u=r.mul(r.mul(o,we),i),a=r.mul(o,r.sub(u,r.ONE));return or(r,a,e),a}function Wo(t){let e=mt(t),r=kn(t),n=r(e,e.neg(e.ONE)),s=r(e,n),i=r(e,e.neg(n)),o=(t+$o)/Sn;return((u,a)=>{let c=u,l=c.pow(a,o),f=c.mul(l,n),h=c.mul(l,s),p=c.mul(l,i),m=c.eql(c.sqr(f),a),g=c.eql(c.sqr(h),a);l=c.cmov(l,f,m),f=c.cmov(p,h,g);let x=c.eql(c.sqr(f),a),v=c.cmov(l,f,x);return or(c,v,a),v})}function kn(t){if(t<Cn)throw new Error("sqrt is not defined for small field");ir(t,"tonelliShanks");let e=t-O,r=0;for(;e%we===H;)e/=we,r++;let n=we,s=mt(t);for(;je(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Fn;let i=s.pow(n,e),o=(e+O)/we;return function(a,c){let l=a;if(l.is0(c))return c;if(je(l,c)!==1)throw new Error("Cannot find square root");let f=r,h=l.mul(l.ONE,i),p=l.pow(c,e),m=l.pow(c,o);for(;!l.eql(p,l.ONE);){if(l.is0(p))throw new Error("Cannot find square root: probably non-prime P");let g=1,x=l.sqr(p);for(;!l.eql(x,l.ONE);)if(g++,x=l.sqr(x),g===f)throw new Error("Cannot find square root");let v=O<<BigInt(f-g-1),D=l.pow(h,v);f=g,h=l.sqr(D),p=l.mul(p,h),m=l.mul(m,D)}return m}}function Zo(t){return ir(t,"Fp.sqrt"),t%sr===Cn?Fn:t%Tn===vn?Vo:t%Sn===jo?Wo(t):kn(t)}var Rn=(t,e)=>(R(t,e)&O)===O,Yo=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Fe(t){if(fe(t,"field"),typeof t.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof t.ORDER);Se(t.BYTES,"BYTES"),Se(t.BITS,"BITS");for(let e of Yo)be(t[e],"field."+e);if(t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=O)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function gt(t,e,r=!1){Fe(t),ft(e,"nums"),ie(r,"passZero");let n=t,s=new Array(e.length).fill(r?n.ZERO:void 0),i=e.reduce((u,a,c)=>n.is0(a)?u:(s[c]=u,n.mul(u,a)),n.ONE),o=n.inv(i);return e.reduceRight((u,a,c)=>n.is0(a)?u:(s[c]=n.mul(u,s[c]),n.mul(u,a)),o),s}function je(t,e){Fe(t);let r=t;ir(r.ORDER,"FpLegendre");let n=(r.ORDER-O)/we,s=r.pow(e,n),i=r.eql(s,r.ONE),o=r.eql(s,r.ZERO),u=r.eql(s,r.neg(r.ONE));if(!i&&!o&&!u)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function Xo(t,e){if(e!==void 0&&Jt(e),t<=H)throw new Error("invalid n length: expected positive n, got "+t);if(e!==void 0&&e<1)throw new Error("invalid n length: expected positive bit length, got "+e);let r=nr(t);if(e!==void 0&&e<r)throw new Error(`invalid n length: expected nBitLength (${e}) >= bitLen(n) (${r})`);let n=e!==void 0?e:r,s=Math.ceil(n/8);return{nBitLength:n,nByteLength:s}}var Bn=new WeakMap,pt=class{ORDER;BITS;BYTES;isLE;ZERO=H;ONE=O;_lengths;_mod;constructor(e,r={}){if(e<=O)throw new Error("invalid field: expected ORDER > 1, got "+e);let n;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(n=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:s,nByteLength:i}=Xo(e,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=s,this.BYTES=i,Object.freeze(this)}create(e){return R(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof e);return H<=e&&e<this.ORDER}is0(e){return e===H}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&O)===O}neg(e){return R(-e,this.ORDER)}eql(e,r){return e===r}sqr(e){return R(e*e,this.ORDER)}add(e,r){return R(e+r,this.ORDER)}sub(e,r){return R(e-r,this.ORDER)}mul(e,r){return R(e*r,this.ORDER)}pow(e,r){return Go(e,r,this.ORDER)}div(e,r){return R(e*En(r,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,r){return e+r}subN(e,r){return e-r}mulN(e,r){return e*r}inv(e){return En(e,this.ORDER)}sqrt(e){let r=Bn.get(this);return r||Bn.set(this,r=Zo(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?ht(e,this.BYTES):tr(e,this.BYTES)}fromBytes(e,r=!1){M(e);let{_lengths:n,BYTES:s,isLE:i,ORDER:o,_mod:u}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>s)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+e.length);let c=new Uint8Array(s);c.set(e,i?0:c.length-e.length),e=c}if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);let a=i?ue(e):dt(e);if(u&&(a=R(a,o)),!r&&!this.isValid(a))throw new Error("invalid field element: outside of range 0..ORDER");return a}invertBatch(e){return gt(this,e,!0)}cmov(e,r,n){return ie(n,"condition"),n?r:e}};function mt(t,e={}){return Object.freeze(pt.prototype),new pt(t,e)}var cr=BigInt(0),ze=BigInt(1),Qo=BigInt(4),ur=16,Ln=128,Jo=5,On=2**31;function Ke(t){let e=t;if(typeof e!="function")throw new TypeError('"Point" expected constructor, got type='+typeof t);be(e.fromAffine,"Point.fromAffine"),be(e.fromBytes,"Point.fromBytes"),be(e.fromHex,"Point.fromHex"),fe(e.BASE,"Point.BASE"),fe(e.ZERO,"Point.ZERO"),Fe(e.Fp),Fe(e.Fn)}function _n(t,e){Ke(t),Nn(e,t);let r=gt(t.Fp,e.map(n=>n.Z));return e.map((n,s)=>t.fromAffine(n.toAffine(r[s])))}function ei(t,e,r=1){if(!Number.isSafeInteger(t)||t<r||t>e)throw new Error("invalid window size, expected ["+r+".."+e+"], got W="+t)}function ti(t,e){let r=t*(4*e+128);if(r>On)throw new Error("invalid window size: table would need ~"+Math.ceil(r/2**20)+" MiB, max "+On/2**20+" MiB")}function ri(t,e){if(t!==void 0){be(t,"randomBytes");try{let r=t(e);if(!He(r)||r.length!==e)return}catch{return}return t}}function Nn(t,e){ft(t,"points"),t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function ni(t,e,r){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,s)=>{if(!(r===void 0?e.isValid(n):de(n)&&n<r))throw new Error("invalid scalar at index "+s)})}var Un=new WeakMap;function ar(t){return Un.get(t)||1}function si(t,e){let r=t.double(),n=[t];for(let s=1;s<e;s++)n.push(n[s-1].add(r));return n}function oi(t,e){let r=2**e,n=r/2,s=BigInt(r-1),i=[];for(;t>cr;){let o=0;t&ze&&(o=Number(t&s),o>=n&&(o-=r),t-=BigInt(o)),i.push(o),t>>=ze}return i}function ii(t,e,r){let n=2**e,s=n/2,i=BigInt(n-1),o=BigInt(e),u=[];for(let a=0;a<r;a++){let c=Number(t&i);t>>=o,c>s&&(c-=n,t+=ze),u.push(c)}if(t!==cr)throw new Error("invalid wnaf");return u}function ui(t,e,r){let n=0;for(let i of r)n=Math.max(n,i.length);let s=t;for(let i=n-1;i>=0;i--){i!==n-1&&(s=s.double());for(let o=0;o<r.length;o++){let u=r[o][i];if(u){let a=e[o][Math.abs(u)-1>>1];s=s.add(u<0?a.negate():a)}}}return s}var yt=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,r){Ke(e),this.randomBytes=ri(r,ur),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,r,n){let s=Math.ceil(n/r)+1,i=2**(r-1),o=[],u=e;for(let a=0;a<s;a++){let c=u;for(let l=0;l<i;l++)o.push(c),c=c.add(u);u=o[o.length-1].double()}return{W:r,bits:n,windows:s,comp:o}}wnafCachedCT(e,r){let{W:n,windows:s,comp:i}=e,o=2**(n-1),u=ii(r,n,s),a=this.ZERO,c=this.BASE;for(let l=0;l<s;l++){let f=u[l],h=l*o,p=Math.abs(f)-1,m=i[h];for(let x=1;x<o;x++)m=x===p?i[h+x]:m;let g=m.negate();f===0?c=c.add(i[h]):a=a.add(f<0?g:m)}return{p:a,f:c}}getWnafPrecomputes(e,r,n,s){let i=this.wnafPrecomputes.get(r),o=i?.find(u=>u.W===e&&u.bits===n);return o||(o=this.buildWnafTable(r,e,n),typeof s=="function"&&(o={...o,comp:s(o.comp)}),i||(i=[],this.wnafPrecomputes.set(r,i)),i.push(o)),o}assertPoint(e){if(!(e instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof e)}validateMulInput(e,r){if(this.assertPoint(e),!rr(r,ze,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(e,r,n,s){let i=ar(e);return i===1?this.fixedWindowCT(e,r,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,s),r)}mulCT(e,r,n){return this.validateMulInput(e,r),this.runCT(e,r,this.bits,n)}mulCTBlinded(e,r,n){if(this.validateMulInput(e,r),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");let s=this.Point.Fn.BITS+Ln,i=this.randomBytes(ur);if(!He(i)||i.length!==ur)throw new Error("randomBytes returned invalid byte array");i[0]=i[0]&63|128;let o=r+dt(i)*this.Point.Fn.ORDER;return this.runCT(e,o,s,n)}fixedWindowCT(e,r,n){let s=Jo,i=1<<s,o=Dn(s),u=new Array(i);u[0]=this.ZERO;for(let l=1;l<i;l++)u[l]=u[l-1].add(e);let a=Math.ceil(n/s),c=this.ZERO;for(let l=a-1;l>=0;l--){if(l!==a-1)for(let p=0;p<s;p++)c=c.double();let f=Number(r>>BigInt(l*s)&o),h=u[0];for(let p=1;p<i;p++)h=p===f?u[p]:h;c=c.add(h)}return{p:c,f:c}}shouldBlind(e,r){return this.randomBytes===void 0?!1:r===ze?!0:e!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(e,r,n,s){return this.shouldBlind(e,n)?this.mulCTBlinded(e,r,s):this.mulCT(e,r,s)}mulUnsafe(e,r,n){if(this.assertPoint(e),!de(r))throw new Error("invalid scalar");let s=ar(e);if(s===1||r>=this.Point.Fn.ORDER)return ai(this.Point,[e],[r],!0);let i=this.getWnafPrecomputes(s,e,this.bits,n);return this.wnafCachedCT(i,r).p}setWindowSize(e,r){this.assertPoint(e),ei(r,this.bits);let n=Math.ceil((this.bits+Ln)/r)+1;ti(n*2**(r-1),this.Point.Fp.BYTES),Un.set(e,r),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return ar(e)!==1}};function ai(t,e,r,n=!1){if(Ke(t),Nn(e,t),ie(n,"allowOversized"),ni(r,t.Fn,n?t.Fn.ORDER**Qo:void 0),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let s=e.map(o=>si(o,4)),i=r.map(o=>oi(o,4));return ui(t.ZERO,s,i)}function qn(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Fe(e),e}else return mt(t,{isLE:r})}function In(t,e,r={},n){if(t!=="weierstrass"&&t!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(n===void 0&&(n=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);re(r);for(let a of["p","n","h"]){let c=e[a];if(!(de(c)&&c!==cr))throw new Error(`CURVE.${a} must be positive bigint`)}let s=qn(e.p,r.Fp,n),i=qn(e.n,r.Fn,n),u=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(let a of u)if(!s.isValid(e[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:s,Fn:i}}function xt(t,e){return function(n){let s=t(n);return{secretKey:s,publicKey:e(s)}}}var bt=BigInt(0),At=BigInt(1),wt=BigInt(2),ci=BigInt(4),Pn=BigInt(8);function li(t,e,r,n){let s=t.sqr(r),i=t.sqr(n),o=t.add(t.mul(e.a,s),i),u=t.add(t.ONE,t.mul(e.d,t.mul(s,i)));return t.eql(o,u)}function Mn(t,e={}){re(e,{},{},"extraOpts");let r=e,n=In("edwards",t,r,r.FpFnLE),{Fp:s,Fn:i}=n,o=n.CURVE,{h:u}=o;if(je(s,o.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(je(s,o.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");re(r,{},{uvRatio:"function",randomBytes:"function"});let a=r.randomBytes===void 0?$e:r.randomBytes,c=wt<<BigInt(s.BYTES*8)-At;function l(D){if(!s.isOdd)throw new Error("Field does not have .isOdd()");return s.isOdd(D)}let f=r.uvRatio===void 0?(D,d)=>{try{return{isValid:!0,value:s.sqrt(s.div(D,d))}}catch{return{isValid:!1,value:bt}}}:r.uvRatio;if(!li(s,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");let h=s.eql(o.a,s.neg(s.ONE))?D=>s.neg(D):s.eql(o.a,s.ONE)?D=>D:D=>s.mul(o.a,D);function p(D,d,y=!1){let w=y?At:bt;return Ae("coordinate "+D,d,w,c),d}function m(D){if(!(D instanceof g))throw new Error("EdwardsPoint expected")}class g{static BASE=new g(o.Gx,o.Gy,s.ONE,s.mul(o.Gx,o.Gy));static ZERO=new g(s.ZERO,s.ONE,s.ONE,s.ZERO);static Fp=s;static Fn=i;X;Y;Z;T;constructor(d,y,w,S){this.X=p("x",d),this.Y=p("y",y),this.Z=p("z",w,!0),this.T=p("t",S),Object.freeze(this)}static CURVE(){return o}static fromAffine(d){if(d instanceof g)throw new Error("extended point not allowed");let{x:y,y:w}=d||{};return p("x",y),p("y",w),new g(y,w,s.ONE,s.mul(y,w))}static fromBytes(d,y=!1){let w=s.BYTES,{a:S,d:_}=o;d=he(M(d,w,"point")),ie(y,"zip215");let C=he(d),E=d[w-1];C[w-1]=E&-129;let k=ue(C),U=y?c:s.ORDER;Ae("point.y",k,bt,U);let L=s.sqr(k),N=s.sub(L,s.ONE),b=s.sub(s.mulN(_,L),S),{isValid:B,value:A}=f(N,b);if(!B)throw new Error("bad point: invalid y coordinate");let T=l(A),F=(E&128)!==0;if(!y&&s.is0(A)&&F)throw new Error("bad point: x=0 and x_0=1");return F!==T&&(A=s.neg(A)),g.fromAffine({x:A,y:k})}static fromHex(d,y=!1){return g.fromBytes(An(d),y)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(d=6,y=!0){return v.setWindowSize(this,d),y||this.multiply(wt),this}assertValidity(){let d=this,{a:y,d:w}=o;if(d.is0())throw new Error("bad point: ZERO");let{X:S,Y:_,Z:C,T:E}=d,k=s.sqr(S),U=s.sqr(_),L=s.sqr(C),N=s.sqr(L),b=s.mul(k,y),B=s.mul(s.add(b,U),L),A=s.add(N,s.mul(w,s.mul(k,U)));if(!s.eql(B,A))throw new Error("bad point: equation left != right (1)");let T=s.mul(S,_),F=s.mul(C,E);if(!s.eql(T,F))throw new Error("bad point: equation left != right (2)")}equals(d){m(d);let{X:y,Y:w,Z:S}=this,{X:_,Y:C,Z:E}=d,k=s.mul(y,E),U=s.mul(_,S),L=s.mul(w,E),N=s.mul(C,S);return s.eql(k,U)&&s.eql(L,N)}is0(){return this.equals(g.ZERO)}negate(){return new g(s.neg(this.X),this.Y,this.Z,s.neg(this.T))}double(){let{X:d,Y:y,Z:w}=this,S=s.sqr(d),_=s.sqr(y),C=s.mul(s.sqr(w),wt),E=h(S),k=s.addN(d,y),U=s.sub(s.subN(s.sqr(k),S),_),L=s.addN(E,_),N=s.subN(L,C),b=s.subN(E,_),B=s.mul(U,N),A=s.mul(L,b),T=s.mul(U,b),F=s.mul(N,L);return new g(B,A,F,T)}add(d){m(d);let{d:y}=o,{X:w,Y:S,Z:_,T:C}=this,{X:E,Y:k,Z:U,T:L}=d,N=s.mul(w,E),b=s.mul(S,k),B=s.mul(s.mulN(C,y),L),A=s.mul(_,U),T=s.sub(s.subN(s.mulN(s.addN(w,S),s.addN(E,k)),N),b),F=s.subN(A,B),I=s.addN(A,B),P=s.sub(b,h(N)),$=s.mul(T,F),z=s.mul(I,P),K=s.mul(T,P),oe=s.mul(F,I);return new g($,z,oe,K)}subtract(d){return m(d),this.add(d.negate())}multiply(d){if(!i.isValidNot0(d))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:y,f:w}=v.mulSecret(this,d,u,x);return x([y,w])[0]}multiplyUnsafe(d){if(!i.isValid(d))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return d===bt?g.ZERO:this.is0()||d===At?this:v.mulUnsafe(this,d,x)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return v.mulUnsafe(this,o.n).is0()}toAffine(d){let y=this,w=d;if(w!=null&&typeof w!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof w);let{X:S,Y:_,Z:C}=y,E=y.is0();w==null&&(w=E?s.create(Pn):s.inv(C));let k=s.mul(S,w),U=s.mul(_,w),L=s.mul(C,w);if(E)return{x:s.ZERO,y:s.ONE};if(!s.eql(L,s.ONE))throw new Error("invZ was invalid");return{x:k,y:U}}clearCofactor(){return u===At?this:u===wt?this.double():u===ci?this.double().double():u===Pn?this.double().double().double():this.multiplyUnsafe(u)}toBytes(){let{x:d,y}=this.toAffine(),w=s.toBytes(y);return w[w.length-1]|=l(d)?128:0,w}toHex(){return bn(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let x=D=>_n(g,D),v=new yt(g,a);return v.bits>=6&&g.BASE.precompute(6),Object.freeze(g.prototype),Object.freeze(g),g}function Hn(t,e,r={}){if(Ke(t),typeof e!="function")throw new Error('"hash" function param is required');let n=e,s=r;re(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});let{prehash:i}=s,{BASE:o,Fp:u,Fn:a}=t,c=n.outputLen,l=2*u.BYTES;if(c!==void 0&&(Se(c,"hash.outputLen"),c!==l))throw new Error(`hash.outputLen must be ${l}, got ${c}`);let f=s.randomBytes===void 0?$e:s.randomBytes,h=s.toMontgomery,p=s.toMontgomerySecret,m=s.adjustScalarBytes===void 0?b=>b:s.adjustScalarBytes,g=s.domain===void 0?(b,B,A)=>{if(ie(A,"phflag"),B.length||A)throw new Error("Contexts/pre-hash are not supported");return b}:s.domain;function x(b){return a.create(ue(b))}function v(b){let B=E.secretKey;M(b,E.secretKey,"secretKey");let A=M(n(b),2*B,"hashedSecretKey"),T=m(A.slice(0,B)),F=A.slice(B,2*B),I=x(T);return{head:T,prefix:F,scalar:I}}function D(b){let{head:B,prefix:A,scalar:T}=v(b),F=o.multiply(T),I=F.toBytes();return{head:B,prefix:A,scalar:T,point:F,pointBytes:I}}function d(b){return D(b).pointBytes}function y(b=Uint8Array.of(),...B){let A=er(...B);return x(n(g(A,M(b,void 0,"context"),!!i)))}function w(b,B,A={}){re(A,{},{},"options"),b=he(M(b,void 0,"message")),i&&(b=i(b));let{prefix:T,scalar:F,pointBytes:I}=D(B),P=y(A.context,T,b),$=o.multiply(P).toBytes(),z=y(A.context,$,I,b),K=a.create(P+z*F);if(!a.isValid(K))throw new Error("sign failed: invalid s");let oe=er($,a.toBytes(K));return M(oe,E.signature,"result")}let S={zip215:s.zip215};function _(b,B,A,T=S){re(T);let{context:F}=T,I=T.zip215===void 0?!!S.zip215:T.zip215,P=E.signature;b=M(b,P,"signature"),B=M(B,void 0,"message"),A=M(A,E.publicKey,"publicKey"),I!==void 0&&ie(I,"zip215"),i&&(B=i(B));let $=P/2,z=b.subarray(0,$),K=ue(b.subarray($,P)),oe,Ne,rt;try{oe=t.fromBytes(A,I),Ne=t.fromBytes(z,I),rt=o.multiplyUnsafe(K)}catch{return!1}if(!I&&oe.isSmallOrder())return!1;let Ue=y(F,z,A,B);return Ne.add(oe.multiplyUnsafe(Ue)).subtract(rt).clearCofactor().is0()}let C=u.BYTES,E={secretKey:C,publicKey:C,signature:2*C,seed:C};function k(b){return b=b===void 0?f(E.seed):b,M(b,E.seed,"seed")}function U(b){return He(b)&&b.length===E.secretKey}function L(b,B){try{return!!t.fromBytes(b,B===void 0?S.zip215:B)}catch{return!1}}let N={getExtendedPublicKey:D,randomSecretKey:k,isValidSecretKey:U,isValidPublicKey:L,toMontgomery(b){if(h===void 0)throw new Error("Montgomery conversion is not supported for this curve");return h(t.fromBytes(b))},toMontgomerySecret(b){if(p===void 0)throw new Error("Montgomery conversion is not supported for this curve");return p(b)}};return Object.freeze(E),Object.freeze(N),Object.freeze({keygen:xt(k,d),getPublicKey:d,sign:w,verify:_,utils:N,Point:t,lengths:E})}var De=BigInt(0),W=BigInt(1),Dt=BigInt(2);function $n(t,e){return t+e-(e>>W<<W)}function fi(t){let e=BigInt(6)*t;return(r,n,s)=>{let i=n+s,u=((e+s-n)*r+n)%t;return{x_2:u,x_3:i-u}}}function di(t){return re(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...t})}function jn(t){let e=di(t),{P:r,type:n,adjustScalarBytes:s,powPminus2:i,randomBytes:o}=e,u=e.scalarMultBase,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let c=o===void 0?$e:o,l=a?255:448,f=fi(r),h=a?32:56,p=BigInt(a?9:5),m=BigInt(a?121665:39081),g=a?Dt**BigInt(254):Dt**BigInt(447),x=a?BigInt(8)*(Dt**BigInt(251)-W):BigInt(4)*(Dt**BigInt(445)-W),v=g+x+W,D=A=>R(A,r),d=y(p);function y(A){return ht(D(A),h)}function w(A){let T=he(M(A,h,"uCoordinate"));return a&&(T[31]&=127),D(ue(T))}function S(A){return ue(s(he(M(A,h,"scalar"))))}let _=new Set(a?[De,W,r-W,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[De,W,r-W]);function C(A,T){let F=w(T);if(_.has(F))throw new Error("invalid private or public key received");let I=L(F,S(A));if(I===De)throw new Error("invalid private or public key received");return y(I)}function E(A){if(u===void 0)return C(A,d);let T=S(A);Ae("scalar",T,g,v);let F=D(u(T));if(F===De)throw new Error("invalid private or public key received");return y(F)}let k=E,U=C;function L(A,T){Ae("u",A,De,r),Ae("scalar",T,g,v);let F=T,I=A,P=W,$=De,z=A,K=W,oe=F^F>>W;for(let Ue=BigInt(l-1);Ue>=De;Ue--){let Ht=$n(r,oe>>Ue);({x_2:P,x_3:z}=f(Ht,P,z)),{x_2:$,x_3:K}=f(Ht,$,K);let nt=P+$,$t=D(nt*nt),jt=P-$,Vr=D(jt*jt),Wr=$t-Vr,Fo=z+K,ko=z-K,Zr=D(ko*nt),Yr=D(Fo*jt),Xr=Zr+Yr,Qr=Zr-Yr;z=D(Xr*Xr),K=D(I*D(Qr*Qr)),P=D($t*Vr),$=D(Wr*($t+D(m*Wr)))}let Ne=$n(r,F);({x_2:P,x_3:z}=f(Ne,P,z)),{x_2:$,x_3:K}=f(Ne,$,K);let rt=i($);return D(P*rt)}let N={secretKey:h,publicKey:h,seed:h},b=A=>(A=A===void 0?c(h):A,M(A,N.seed,"seed"),A),B={randomSecretKey:b};return Object.freeze(N),Object.freeze(B),Object.freeze({keygen:xt(b,k),getSharedSecret:U,getPublicKey:k,scalarMult:C,scalarMultBase:E,utils:B,GuBytes:d.slice(),lengths:N})}var zn=BigInt(0),lr=BigInt(1),Kn=BigInt(2),hi=BigInt(3),pi=BigInt(5),gi=BigInt(8),Et=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),mi={p:Et,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:gi,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Wn(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),s=BigInt(80),i=Et,u=t*t%i*t%i,a=V(u,Kn,i)*u%i,c=V(a,lr,i)*t%i,l=V(c,pi,i)*c%i,f=V(l,e,i)*l%i,h=V(f,r,i)*f%i,p=V(h,n,i)*h%i,m=V(p,s,i)*p%i,g=V(m,s,i)*p%i,x=V(g,e,i)*l%i;return{pow_p_5_8:V(x,Kn,i)*t%i,b2:u}}function fr(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}var Gn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function yi(t,e){let r=Et,n=R(e*e*e,r),s=R(n*n*e,r),i=Wn(t*s).pow_p_5_8,o=R(t*n*i,r),u=R(e*o*o,r),a=o,c=R(o*Gn,r),l=u===t,f=u===R(-t,r),h=u===R(-t*Gn,r);return l&&(o=a),(f||h)&&(o=c),Rn(o,r)&&(o=R(-o,r)),{isValid:l||f,value:o}}var Ge=Mn(mi,{uvRatio:yi}),Vn=Ge.Fp;function xi(t){let{y:e}=t;return Vn.toBytes(Vn.div(lr+e,lr-e))}function bi(t){let e=Ge.Fp.BYTES;return te(t,e),fr(Qt(t.subarray(0,e))).subarray(0,e)}function Ai(t){return Hn(Ge,Qt,Object.assign({adjustScalarBytes:fr,toMontgomery:xi,toMontgomerySecret:bi,zip215:!0},t))}var Zn=Ai({});var G=(()=>{let t=Et,e=r=>{let{pow_p_5_8:n,b2:s}=Wn(r);return R(V(n,hi,t)*s,t)};return jn({P:t,type:"x25519",powPminus2:e,adjustScalarBytes:fr,scalarMultBase:r=>{let n=R(r,Ge.Fn.ORDER);if(n===zn)return zn;let s=Ge.BASE.multiply(n);return R((s.Z+s.Y)*e(R(s.Z-s.Y,t)),t)}})})();var Yn=1,Ct=new TextEncoder;function dr(t){return Z(Ct.encode(`shalom/v1/${t}`))}function ke(t){return t.buffer instanceof ArrayBuffer?t:new Uint8Array(t)}function Z(...t){let e=new Uint8Array(t.reduce((n,s)=>n+s.length,0)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e}async function Xn(t,e,r,n){let s=await crypto.subtle.importKey("raw",Z(t),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:Z(e,r),info:dr(n)},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Qn(){let{secretKey:t,publicKey:e}=G.keygen();return{secretKey:t,publicKey:e}}function hr(t){return G.getPublicKey(t)}async function Jn(t,e,r){let n=G.keygen(),s=G.getSharedSecret(n.secretKey,t),i=await Xn(s,n.publicKey,t,r),o=crypto.getRandomValues(new Uint8Array(12)),u=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:o,additionalData:dr(r)},i,ke(e)));return Z(new Uint8Array([Yn]),n.publicKey,o,u)}async function Ve(t,e,r){if(e.length<61||e[0]!==Yn)throw new Error("lacre inv\xE1lido");let n=e.subarray(1,33),s=e.subarray(33,45),i=e.subarray(45),o=G.getPublicKey(t),u=G.getSharedSecret(t,n),a=await Xn(u,n,o,r);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:ke(s),additionalData:dr(r)},a,ke(i)))}async function es(t,e){return JSON.parse(new TextDecoder().decode(await Ve(t,e,"head")))}function Y(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function X(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}var Bt=2;async function ts(t,e,r,n,s,i){let o=await crypto.subtle.importKey("raw",Z(t,e),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:Z(r,n,s),info:Z(Ct.encode(`shalom/v2/${i}`))},o,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function rs(t,e,r,n){let s=G.keygen(),i=G.getPublicKey(e),o=await ts(G.getSharedSecret(s.secretKey,t),G.getSharedSecret(e,t),s.publicKey,i,t,n),u=crypto.getRandomValues(new Uint8Array(12)),a=Z(new Uint8Array([Bt]),Ct.encode(`shalom/v2/${n}`)),c=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:u,additionalData:a},o,ke(r)));return Z(new Uint8Array([Bt]),s.publicKey,u,c)}async function ns(t,e,r,n){if(r.length<61||r[0]!==Bt)throw new Error("lacre inv\xE1lido");let s=r.subarray(1,33),i=r.subarray(33,45),o=G.getPublicKey(t),u=await ts(G.getSharedSecret(t,s),G.getSharedSecret(t,e),s,e,o,n),a=Z(new Uint8Array([Bt]),Ct.encode(`shalom/v2/${n}`));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:ke(i),additionalData:a},u,ke(r.subarray(45))))}var ne=new TextEncoder,ae=t=>t===32||t===9,ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",We=new Uint8Array(256);for(let t=0;t<ss.length;t++)We[ss.charCodeAt(t)]=t;function gr(t){let e=t.length;for(;e>0&&t.charAt(e-1)==="=";)e--;e%4===1&&e--;let r=e%4,n=Math.floor(e/4)*3+(r?r-1:0),s=new ArrayBuffer(n),i=new Uint8Array(s),o=0;for(let u=0;u<e;u+=4){let a=We[t.charCodeAt(u)],c=We[t.charCodeAt(u+1)],l=We[t.charCodeAt(u+2)],f=We[t.charCodeAt(u+3)];i[o++]=a<<2|c>>4,o<n&&(i[o++]=(c&15)<<4|l>>2),o<n&&(i[o++]=(l&3)<<6|f&63)}return s}var wi=new Map([["iso88598i","iso-8859-8"],["iso88598e","iso-8859-8"],["shiftjis","shift_jis"],["windows31j","shift_jis"],["mskanji","shift_jis"],["eucjp","euc-jp"],["iso2022jp","iso-2022-jp"],["iso2022jp1","iso-2022-jp"],["iso2022jp2","iso-2022-jp"],["junet","iso-2022-jp"],["euckr","euc-kr"],["uhc","euc-kr"],["tis620","windows-874"]]),Di=new Map([["932","shift_jis"],["936","gbk"],["949","euc-kr"],["950","big5"],["874","windows-874"],["51932","euc-jp"],["50220","iso-2022-jp"],["50221","iso-2022-jp"],["50222","iso-2022-jp"]]),Ei=/^(?:cp|windows|ms|ibm)(\d+)$/;function Bi(t){return t.replace(/^(?:x-ms-|x-|cs)/,"").replace(/[\s._-]+/g,"")}var os=new Set(["unicode-1-1-utf-8 unicode11utf8 unicode20utf8 utf-8 utf8 x-unicode20utf8","866 cp866 csibm866 ibm866","csisolatin2 iso-8859-2 iso-ir-101 iso8859-2 iso88592 iso_8859-2 iso_8859-2:1987 l2 latin2","csisolatin3 iso-8859-3 iso-ir-109 iso8859-3 iso88593 iso_8859-3 iso_8859-3:1988 l3 latin3","csisolatin4 iso-8859-4 iso-ir-110 iso8859-4 iso88594 iso_8859-4 iso_8859-4:1988 l4 latin4","csisolatincyrillic cyrillic iso-8859-5 iso-ir-144 iso8859-5 iso88595 iso_8859-5 iso_8859-5:1988","arabic asmo-708 csiso88596e csiso88596i csisolatinarabic ecma-114 iso-8859-6 iso-8859-6-e","iso-8859-6-i iso-ir-127 iso8859-6 iso88596 iso_8859-6 iso_8859-6:1987","csisolatingreek ecma-118 elot_928 greek greek8 iso-8859-7 iso-ir-126 iso8859-7 iso88597 iso_8859-7","iso_8859-7:1987 sun_eu_greek","csiso88598e csisolatinhebrew hebrew iso-8859-8 iso-8859-8-e iso-ir-138 iso8859-8 iso88598 iso_8859-8","iso_8859-8:1988 visual","csiso88598i iso-8859-8-i logical","csisolatin6 iso-8859-10 iso-ir-157 iso8859-10 iso885910 l6 latin6","iso-8859-13 iso8859-13 iso885913","iso-8859-14 iso8859-14 iso885914","csisolatin9 iso-8859-15 iso8859-15 iso885915 iso_8859-15 l9","iso-8859-16","cskoi8r koi koi8 koi8-r koi8_r","koi8-ru koi8-u","csmacintosh mac macintosh x-mac-roman","dos-874 iso-8859-11 iso8859-11 iso885911 tis-620 windows-874","cp1250 windows-1250 x-cp1250","cp1251 windows-1251 x-cp1251","ansi_x3.4-1968 ascii cp1252 cp819 csisolatin1 ibm819 iso-8859-1 iso-ir-100 iso8859-1 iso88591","iso_8859-1 iso_8859-1:1987 l1 latin1 us-ascii windows-1252 x-cp1252","cp1253 windows-1253 x-cp1253","cp1254 csisolatin5 iso-8859-9 iso-ir-148 iso8859-9 iso88599 iso_8859-9 iso_8859-9:1989 l5 latin5","windows-1254 x-cp1254","cp1255 windows-1255 x-cp1255","cp1256 windows-1256 x-cp1256","cp1257 windows-1257 x-cp1257","cp1258 windows-1258 x-cp1258","x-mac-cyrillic x-mac-ukrainian","chinese csgb2312 csiso58gb231280 gb2312 gb_2312 gb_2312-80 gbk iso-ir-58 x-gbk","gb18030","big5 big5-hkscs cn-big5 csbig5 x-x-big5","cseucpkdfmtjapanese euc-jp x-euc-jp","csiso2022jp iso-2022-jp","csshiftjis ms932 ms_kanji shift-jis shift_jis sjis windows-31j x-sjis","cseuckr csksc56011987 euc-kr iso-ir-149 korean ks_c_5601-1987 ks_c_5601-1989 ksc5601 ksc_5601","windows-949","csiso2022kr hz-gb-2312 iso-2022-cn iso-2022-cn-ext iso-2022-kr replacement","x-user-defined"].join(" ").split(" ")),Ci=new Set(["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr","replacement"]),vi={encoding:"replacement",decode:t=>t&&t.byteLength?"\uFFFD":""},Ti=new Map([["utf-16","utf-16"],["utf16","utf-16"],["utf_16","utf-16"],["utf-16le","utf-16le"],["utf-16be","utf-16be"]]);function ls(t){if(t=(t||"utf8").trim().toLowerCase(),os.has(t))return t;let e=Ti.get(t);if(e)return e;let r=Bi(t),n=r.match(Ei),s=n&&Di.get(n[1])||wi.get(r)||r;return os.has(s)?s:null}var is=new Map;function vt(t){if(Ci.has(t))return vi;let e=is.get(t);if(e===void 0){e=null;try{e=new TextDecoder(t)}catch{}is.set(t,e)}return e}var mr=new TextDecoder;function fs(t){let e=ls(t);return e?vt(e):null}function ds(t){return fs(t)||vt("windows-1252")||mr}var Si=new Set(["utf-16le","utf-16be"]),Fi=new Set(["utf-16"]);function ki(t){return t[0]===254&&t[1]===255?"utf-16be":t[0]===255&&t[1]===254?"utf-16le":null}function Ri(t){for(let e=0;e<t.length;){let r=t[e];if(r<128){e++;continue}let n;if(r>=194&&r<=223)n=1;else if(r>=224&&r<=239)n=2;else if(r>=240&&r<=244)n=3;else return!1;if(e+n>=t.length)return!1;let s=t[e+1],i=r===224?160:r===240?144:128,o=r===237?159:r===244?143:191;if(s<i||s>o)return!1;for(let u=2;u<=n;u++)if((t[e+u]&192)!==128)return!1;e+=n+1}return!0}function Tt(t,e=mr){let r=t instanceof Uint8Array?t:new Uint8Array(t);return Ri(r)?e.decode(r):ds("windows-1252").decode(r)}function yr(t,e){let r=t instanceof Uint8Array?t:new Uint8Array(t),n=ls(e),s=n?vt(n):null;if(n&&Fi.has(n)){let i=ki(r);s=i&&vt(i)||s}return s?s.decode(r):Tt(r)}var Li=1024,Oi=/charset\s*=\s*["']?\s*([^\s"';>]+)/;function qi(t){let e=mr.decode(t.subarray(0,Li)).toLowerCase(),r=0;for(;(r=e.indexOf("<meta",r))>=0;){let n=e.indexOf(">",r);n<0&&(n=e.length);let s=Oi.exec(e.slice(r,n));if(s)return s[1];r=n}return null}function hs(t,e,r){let n=new Uint8Array(t);if(e)return yr(n,e);let s=r?qi(n):null,i=s?fs(s):null;return!i||Si.has(i.encoding)?Tt(n):(i.encoding==="x-user-defined"?ds("windows-1252"):i).decode(n)}async function Re(t){if("arrayBuffer"in t)return await t.arrayBuffer();let e=new FileReader;return new Promise((r,n)=>{e.onload=()=>{r(e.result)},e.onerror=()=>{n(e.error)},e.readAsArrayBuffer(t)})}function Ee(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1}function Ze(t){return t.replace(/[\r\n]+/g," ")}function pr(t,e,r){let n=t.indexOf("*");n>=0&&(t=t.slice(0,n)),e=e.toUpperCase();let s;if(e==="Q"){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let i=ne.encode(r),o=[];for(let a=0,c=i.length;a<c;a++){let l=i[a];if(a<=c-2&&l===61){let f=Ee(i[a+1]),h=Ee(i[a+2]);if(f>=0&&h>=0){o.push(f<<4|h),a+=2;continue}}o.push(l)}s=new ArrayBuffer(o.length);let u=new DataView(s);for(let a=0,c=o.length;a<c;a++)u.setUint8(a,o[a])}else e==="B"?s=gr(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=ne.encode(r);return Ze(yr(s,t))}var ps="=\\?([^?\\s]+)\\?([QqBb])\\?([^?]*)\\?=",us=new RegExp(ps,"g"),_i=/^[ \t\r\n]+$/,Ni=new RegExp(`^(?:${ps}\\s*)+$`);function gs(t){return Ni.test(t)}function Ui(t){let e=[];us.lastIndex=0;let r=0,n;for(;n=us.exec(t);)n.index>r&&e.push({text:t.substring(r,n.index)}),e.push({charset:n[1],encoding:n[2],encodedText:n[3]}),r=n.index+n[0].length;return r<t.length&&e.push({text:t.substring(r)}),e}function Ii(t,e){let r=t.encoding.toUpperCase();return t.charset!==e.charset||r!==e.encoding.toUpperCase()?!1:r==="B"?t.encodedText.length%4===0&&!t.padded:!0}function as(t,e){let r="",n=null;for(let s=0;s<t.length;s++){let i=t[s];if(i.text!==void 0){let o=t[s+1];if(n&&o&&o.text===void 0&&_i.test(i.text))continue;n&&(r+=pr(n.charset,n.encoding,n.encodedText),n=null),r+=i.text;continue}if(n&&e&&Ii(n,i)){n.encodedText+=i.encodedText,n.padded=i.encodedText.endsWith("=");continue}n&&(r+=pr(n.charset,n.encoding,n.encodedText)),n={charset:i.charset,encoding:i.encoding,encodedText:i.encodedText,padded:i.encodedText.endsWith("=")}}return n&&(r+=pr(n.charset,n.encoding,n.encodedText)),r}function pe(t){let e=Ui((t||"").toString()),r=as(e,!0);return r.indexOf("\uFFFD")<0?r:as(e,!1)}function cs(t,e){e=e||"utf-8";let r=[];for(let i=0;i<t.length;i++){let o=t.charAt(i),u=o==="%"?Ee(t.charCodeAt(i+1)):-1,a=u>=0?Ee(t.charCodeAt(i+2)):-1;if(a>=0)r.push(u<<4|a),i+=2;else if(o.charCodeAt(0)>126){let c=ne.encode(o);for(let l=0;l<c.length;l++)r.push(c[l])}else r.push(o.charCodeAt(0))}let n=new ArrayBuffer(r.length),s=new DataView(n);for(let i=0,o=r.length;i<o;i++)s.setUint8(i,r[i]);return yr(n,e)}function ms(t){let e=new Map;Object.keys(t.params).forEach(r=>{let n=r.match(/\*((\d+)\*?)?$/);if(!n)return;let s=r.slice(0,n.index).toLowerCase(),i=Number(n[2])||0,o=e.get(s);o||(o={charset:null,values:[]},e.set(s,o));let u=t.params[r],a=n[0].charAt(n[0].length-1)==="*";i===0&&a&&(n=u.match(/^([^']*)'[^']*'(.*)$/))&&(o.charset=n[1]||"utf-8",u=n[2]),o.values.push({nr:i,value:u,encoded:a}),delete t.params[r]}),e.forEach((r,n)=>{if(Object.prototype.hasOwnProperty.call(t.params,n))return;let s="",i="";for(let o of r.values.sort((u,a)=>u.nr-a.nr)){if(o.encoded){i+=o.value;continue}i&&(s+=cs(i,r.charset),i=""),s+=o.value}i&&(s+=cs(i,r.charset)),t.params[n]=s})}var Ye=class{constructor(){this.chunks=[],this.runBuffer=null,this.runStart=0,this.runEnd=0,this.pendingLineBreak=null}continuesRun(e){return e.buffer===this.runBuffer&&e.byteOffset===this.runEnd}flushRun(){this.runBuffer&&this.runEnd>this.runStart&&this.chunks.push(new Uint8Array(this.runBuffer,this.runStart,this.runEnd-this.runStart)),this.runBuffer=null}update(e,r){let n=this.pendingLineBreak;n&&this.continuesRun(n)&&e.buffer===this.runBuffer&&e.byteOffset===this.runEnd+n.byteLength?this.runEnd=e.byteOffset+e.byteLength:(this.flushRun(),n&&this.chunks.push(n),this.runBuffer=e.buffer,this.runStart=e.byteOffset,this.runEnd=e.byteOffset+e.byteLength),this.pendingLineBreak=r}finalize(e=!1){let r=this.pendingLineBreak;return!e&&r&&(this.continuesRun(r)?this.runEnd+=r.byteLength:(this.flushRun(),this.chunks.push(r))),this.flushRun(),Re(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Be=class{constructor(e=100*1024){this.maxChunkSize=e,this.buffer=null,this.bufferPos=0,this.chunks=[]}writeByte(e){(!this.buffer||this.bufferPos>=this.buffer.length)&&(this.flush(),this.buffer??=new Uint8Array(this.maxChunkSize)),this.buffer[this.bufferPos++]=e}writeBytes(e,r=0,n=e.length){for(;r<n;){(!this.buffer||this.bufferPos>=this.buffer.length)&&(this.flush(),this.buffer??=new Uint8Array(this.maxChunkSize));let s=Math.min(n-r,this.buffer.length-this.bufferPos);this.buffer.set(e.subarray(r,r+s),this.bufferPos),this.bufferPos+=s,r+=s}}append(e){e.length>=this.maxChunkSize/2?(this.flush(),this.chunks.push(e)):this.writeBytes(e)}flush(){this.buffer&&this.bufferPos&&(this.chunks.push(this.buffer.slice(0,this.bufferPos)),this.bufferPos=0)}finalize(){return this.flush(),Re(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Xe=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.output=new Be,this.remainder=""}pushChunk(e){e.length&&this.output.append(new Uint8Array(gr(e)))}flushRemainder(){this.pushChunk(this.remainder),this.remainder=""}update(e){let r=this.decoder.decode(e).replace(/[^a-zA-Z0-9+/=]+/g,""),n=0,s;for(;(s=r.indexOf("=",n))>=0;)this.remainder+=r.substring(n,s),this.flushRemainder(),n=s+1;if(this.remainder+=r.substring(n),this.remainder.length>=this.maxChunkSize){let i=Math.floor(this.remainder.length/4)*4;this.pushChunk(this.remainder.substring(0,i)),this.remainder=this.remainder.substring(i)}}finalize(){return this.flushRemainder(),this.output.finalize()}};var ys=61,Qe=class{constructor(){this.output=new Be,this.pendingLineBreak=null}writeLineBreak(){this.pendingLineBreak&&this.output.writeBytes(this.pendingLineBreak)}update(e,r){this.writeLineBreak();let n=e.length;for(;n>0&&ae(e[n-1]);)n--;let s=n>0&&e[n-1]===ys;s&&n--;let i=0;for(let o=0;o<n;o++){if(e[o]!==ys||o+2>=n)continue;let u=Ee(e[o+1]),a=Ee(e[o+2]);u<0||a<0||(this.output.writeBytes(e,i,o),this.output.writeByte(u<<4|a),o+=2,i=o+1)}this.output.writeBytes(e,i,n),this.pendingLineBreak=s?null:r}finalize(e=!1){return e||this.writeLineBreak(),this.output.finalize()}};var Pi={EINVALIDOPTION:TypeError,EINVALIDINPUT:TypeError,EPARSERREUSED:Error,EMAXNESTINGDEPTH:Error,EMAXHEADERSIZE:Error,EMAXPARTCOUNT:Error,EMAXFORWARDEDADDRESSES:Error};function Q(t,e){let r=new Pi[t](e);return r.code=t,r}var Mi=new TextDecoder("utf-8",{ignoreBOM:!0}),Hi=4096,$i=64,ji=t=>{let e=0,r=t.length;for(;e<r&&ae(t.charCodeAt(e));)e++;for(;r>e&&ae(t.charCodeAt(r-1));)r--;return t.slice(e,r)},zi=/^(?:From |[!-9;-~]*[ \t]*:)/,Ki=new Set(["content-type","content-transfer-encoding","content-disposition","content-id","content-description"]),Le=class{constructor(e){this.options=e,this.postalMime=e.postalMime;let r=this.postalMime.limits;if(this.postalMime.counters.partCount++,this.postalMime.counters.partCount>r.maxPartCount)throw Q("EMAXPARTCOUNT",`Maximum MIME part count of ${r.maxPartCount} parts exceeded`);if(this.childNodes=[],this.finalizedChildCount=0,e.parentNode){if(this.parentNode=e.parentNode,this.depth=this.parentNode.depth+1,this.depth>r.maxNestingDepth)throw Q("EMAXNESTINGDEPTH",`Maximum MIME nesting depth of ${r.maxNestingDepth} levels exceeded`);e.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[];let s=(e.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:s,parsed:{value:s,params:{}},multipart:!1},this.contentTransferEncoding={value:"8bit",encoding:""},this.contentDisposition={value:"",parsed:{value:"",params:{}}},this.headers=[],this.rawHeaderLines=[],this.contentDecoder=null,this.content=null}setupContentDecoder(e){e==="base64"?this.contentDecoder=new Xe:e==="quoted-printable"?this.contentDecoder=new Qe:this.contentDecoder=new Ye}async finalize(e=!1){if(this.state==="finished")return;this.state==="header"&&this.endHeaders();let r=this.postalMime.boundaries;for(let n=r.length-1;n>=0;n--)if(r[n].node===this){r.splice(n,1);break}await this.finalizeChildNodes(e),this.content=this.contentDecoder?await this.contentDecoder.finalize(e):null,this.contentDecoder=null,this.state="finished"}async finalizeChildNodes(e=!1){for(;this.finalizedChildCount<this.childNodes.length;)await this.childNodes[this.finalizedChildCount++].finalize(e)}stripComments(e){let r="",n=0,s=!1,i=!1,o=-1,u=!1,a=0,c=m=>{r+=e.slice(a,m),a=m+1},l=!1,f=!1,h=m=>{l=!0,f=ae(e.charCodeAt(m))},p=()=>!u||!l||f;for(let m=0;m<e.length;m++){let g=e.charAt(m);if(s)s=!1;else if(g==="\\")s=!0;else if(g==='"'&&n===0)i=!i;else if(!i){if(g==="("&&p()){n===0&&(o=m),n++,c(m);continue}if(g===")"&&n>0){n--,c(m);continue}n===0&&(g==="="?u=!0:g===";"&&(u=!1))}n===0?h(m):c(m)}return n===0||e.indexOf(";",o)<0?r+e.slice(a):e}parseStructuredHeader(e){e=this.stripComments(e);let r={value:"",params:{}},n=!1,s="",i="value",o="",u=!1,a=!1,c=!1,l,f=()=>{s.length&&(s+=o),o=""},h=-1,p=d=>{h>=0&&(s+=e.slice(h,d),h=-1)},m=d=>{h<0&&(f(),h=d)},g=()=>{let d=s;return s="",o="",u=!1,d},x=(d,y)=>{d&&!Object.prototype.hasOwnProperty.call(r.params,d)&&(r.params[d]=y)},v=()=>{let d=g();n===!1?r.value=d:x(n,d)},D=()=>{x(g().trim().toLowerCase(),"")};for(let d=0,y=e.length;d<y;d++)switch(l=e.charAt(d),i){case"key":if(l==="="){p(d),n=g().trim().toLowerCase(),i="value";break}if(l===";"){p(d),D();break}h<0&&(h=d);break;case"value":if(u&&l!==";"){c=!1;break}if(c)m(d);else if(a&&l==="\\"){p(d),c=!0;continue}else a&&l===a?(p(d),a=!1,u=!0):!a&&l==='"'?(p(d),a=l,f()):!a&&l===";"?(p(d),v(),i="key"):!a&&(l===" "||l===" ")?(p(d),o+=l):m(d);c=!1;break}return p(e.length),i==="value"?v():D(),r.value&&(r.value=r.value.toLowerCase()),ms(r),r}decodeFlowedText(e,r){let n=[],s=[],i=!1,o=0;for(let u=0;u<=e.length;){let a=e.indexOf(`
2
+ `,u);a<0&&(a=e.length);let c=e.slice(u,a),l=0;for(;c.charCodeAt(l)===62;)l++;let f=c.charCodeAt(l)===32?l+1:l,h=c.slice(f),p=h==="-- ";if(i&&l===o&&!p){if(r){let m=s[s.length-1];s[s.length-1]=m.slice(0,-1)}s.push(h)}else u&&s.push(`
3
+ `),s.push(l?c:h);if(i=!p&&h.endsWith(" "),o=l,s.length>=Hi){let m=s.pop();n.push(s.join("")),s=[m]}u=a+1}return n.push(s.join("")),n.join("")}getTextContent(){if(!this.content)return"";let e=hs(this.content,this.contentType.parsed.params.charset,this.contentType.parsed.value==="text/html").replace(/\r\n/g,`
4
4
  `);return this.contentType.parsed.value==="text/plain"&&/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){let e=[];for(let o of this.headerLines)e.length&&/^[ \t]/.test(o)?e[e.length-1].push(o):e.push([o]);let r=new Set;for(let o of e){let u=o.join(`
5
- `),a=u.indexOf(":"),c=a<0?u:u.slice(0,a);this.rawHeaderLines.push({key:c.toLowerCase(),line:u});let l=o.join("");a=l.indexOf(":");let f=a<0?l:l.slice(0,a),h=a<0?"":ji(Ze(l.slice(a+1)));this.headers.push({key:f.toLowerCase(),originalKey:f,value:h});let p=f.toLowerCase();if(Ki.has(p)&&!r.has(p))switch(r.add(p),p){case"content-type":this.contentType.value=h;break;case"content-transfer-encoding":this.contentTransferEncoding.value=h;break;case"content-disposition":this.contentDisposition.value=h;break;case"content-id":this.contentId=h;break;case"content-description":this.contentDescription=h;break}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.slice(this.contentType.parsed.value.indexOf("/")+1):!1;let n=this.contentType.multipart?(this.contentType.parsed.params.boundary||"").trimEnd():"";/[^\x00-\x7f]/.test(n)&&(n=""),this.contentType.multipart&&!n&&(this.contentType.parsed.value="text/plain",this.contentType.multipart=!1),this.contentType.multipart&&this.postalMime.boundaries.push({value:ne.encode(n),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value);let s=this.contentDisposition.parsed.value,i=s.search(/[ \t]/);i>=0&&(this.contentDisposition.parsed.value=s.slice(0,i)),this.contentTransferEncoding.encoding=(this.stripComments(this.contentTransferEncoding.value).toLowerCase().match(/^[ \t]*([\w-]+)/)||["",""])[1],this.setupContentDecoder(this.contentTransferEncoding.encoding),this.headerLines=[]}endHeaders(){this.state="body",this.processHeaders()}feed(e,r){switch(this.state){case"header":{if(!e.length)return this.endHeaders(),!1;this.postalMime.counters.headerSize+=Math.max(e.length,$i);let n=this.postalMime.limits.maxHeadersSize;if(this.postalMime.counters.headerSize>n)throw X("EMAXHEADERSIZE",`Maximum header size of ${n} bytes exceeded`);let s=Tt(e,Mi);if(!ae(e[0])&&!zi.test(s))return this.endHeaders(),!0;this.headerLines.push(s);break}case"body":this.contentDecoder&&this.contentDecoder.update(e,r);break}return!1}};var gr={"&AElig":"\xC6","&AElig;":"\xC6","&AMP":"&","&AMP;":"&","&Aacute":"\xC1","&Aacute;":"\xC1","&Abreve;":"\u0102","&Acirc":"\xC2","&Acirc;":"\xC2","&Acy;":"\u0410","&Afr;":"\u{1D504}","&Agrave":"\xC0","&Agrave;":"\xC0","&Alpha;":"\u0391","&Amacr;":"\u0100","&And;":"\u2A53","&Aogon;":"\u0104","&Aopf;":"\u{1D538}","&ApplyFunction;":"\u2061","&Aring":"\xC5","&Aring;":"\xC5","&Ascr;":"\u{1D49C}","&Assign;":"\u2254","&Atilde":"\xC3","&Atilde;":"\xC3","&Auml":"\xC4","&Auml;":"\xC4","&Backslash;":"\u2216","&Barv;":"\u2AE7","&Barwed;":"\u2306","&Bcy;":"\u0411","&Because;":"\u2235","&Bernoullis;":"\u212C","&Beta;":"\u0392","&Bfr;":"\u{1D505}","&Bopf;":"\u{1D539}","&Breve;":"\u02D8","&Bscr;":"\u212C","&Bumpeq;":"\u224E","&CHcy;":"\u0427","&COPY":"\xA9","&COPY;":"\xA9","&Cacute;":"\u0106","&Cap;":"\u22D2","&CapitalDifferentialD;":"\u2145","&Cayleys;":"\u212D","&Ccaron;":"\u010C","&Ccedil":"\xC7","&Ccedil;":"\xC7","&Ccirc;":"\u0108","&Cconint;":"\u2230","&Cdot;":"\u010A","&Cedilla;":"\xB8","&CenterDot;":"\xB7","&Cfr;":"\u212D","&Chi;":"\u03A7","&CircleDot;":"\u2299","&CircleMinus;":"\u2296","&CirclePlus;":"\u2295","&CircleTimes;":"\u2297","&ClockwiseContourIntegral;":"\u2232","&CloseCurlyDoubleQuote;":"\u201D","&CloseCurlyQuote;":"\u2019","&Colon;":"\u2237","&Colone;":"\u2A74","&Congruent;":"\u2261","&Conint;":"\u222F","&ContourIntegral;":"\u222E","&Copf;":"\u2102","&Coproduct;":"\u2210","&CounterClockwiseContourIntegral;":"\u2233","&Cross;":"\u2A2F","&Cscr;":"\u{1D49E}","&Cup;":"\u22D3","&CupCap;":"\u224D","&DD;":"\u2145","&DDotrahd;":"\u2911","&DJcy;":"\u0402","&DScy;":"\u0405","&DZcy;":"\u040F","&Dagger;":"\u2021","&Darr;":"\u21A1","&Dashv;":"\u2AE4","&Dcaron;":"\u010E","&Dcy;":"\u0414","&Del;":"\u2207","&Delta;":"\u0394","&Dfr;":"\u{1D507}","&DiacriticalAcute;":"\xB4","&DiacriticalDot;":"\u02D9","&DiacriticalDoubleAcute;":"\u02DD","&DiacriticalGrave;":"`","&DiacriticalTilde;":"\u02DC","&Diamond;":"\u22C4","&DifferentialD;":"\u2146","&Dopf;":"\u{1D53B}","&Dot;":"\xA8","&DotDot;":"\u20DC","&DotEqual;":"\u2250","&DoubleContourIntegral;":"\u222F","&DoubleDot;":"\xA8","&DoubleDownArrow;":"\u21D3","&DoubleLeftArrow;":"\u21D0","&DoubleLeftRightArrow;":"\u21D4","&DoubleLeftTee;":"\u2AE4","&DoubleLongLeftArrow;":"\u27F8","&DoubleLongLeftRightArrow;":"\u27FA","&DoubleLongRightArrow;":"\u27F9","&DoubleRightArrow;":"\u21D2","&DoubleRightTee;":"\u22A8","&DoubleUpArrow;":"\u21D1","&DoubleUpDownArrow;":"\u21D5","&DoubleVerticalBar;":"\u2225","&DownArrow;":"\u2193","&DownArrowBar;":"\u2913","&DownArrowUpArrow;":"\u21F5","&DownBreve;":"\u0311","&DownLeftRightVector;":"\u2950","&DownLeftTeeVector;":"\u295E","&DownLeftVector;":"\u21BD","&DownLeftVectorBar;":"\u2956","&DownRightTeeVector;":"\u295F","&DownRightVector;":"\u21C1","&DownRightVectorBar;":"\u2957","&DownTee;":"\u22A4","&DownTeeArrow;":"\u21A7","&Downarrow;":"\u21D3","&Dscr;":"\u{1D49F}","&Dstrok;":"\u0110","&ENG;":"\u014A","&ETH":"\xD0","&ETH;":"\xD0","&Eacute":"\xC9","&Eacute;":"\xC9","&Ecaron;":"\u011A","&Ecirc":"\xCA","&Ecirc;":"\xCA","&Ecy;":"\u042D","&Edot;":"\u0116","&Efr;":"\u{1D508}","&Egrave":"\xC8","&Egrave;":"\xC8","&Element;":"\u2208","&Emacr;":"\u0112","&EmptySmallSquare;":"\u25FB","&EmptyVerySmallSquare;":"\u25AB","&Eogon;":"\u0118","&Eopf;":"\u{1D53C}","&Epsilon;":"\u0395","&Equal;":"\u2A75","&EqualTilde;":"\u2242","&Equilibrium;":"\u21CC","&Escr;":"\u2130","&Esim;":"\u2A73","&Eta;":"\u0397","&Euml":"\xCB","&Euml;":"\xCB","&Exists;":"\u2203","&ExponentialE;":"\u2147","&Fcy;":"\u0424","&Ffr;":"\u{1D509}","&FilledSmallSquare;":"\u25FC","&FilledVerySmallSquare;":"\u25AA","&Fopf;":"\u{1D53D}","&ForAll;":"\u2200","&Fouriertrf;":"\u2131","&Fscr;":"\u2131","&GJcy;":"\u0403","&GT":">","&GT;":">","&Gamma;":"\u0393","&Gammad;":"\u03DC","&Gbreve;":"\u011E","&Gcedil;":"\u0122","&Gcirc;":"\u011C","&Gcy;":"\u0413","&Gdot;":"\u0120","&Gfr;":"\u{1D50A}","&Gg;":"\u22D9","&Gopf;":"\u{1D53E}","&GreaterEqual;":"\u2265","&GreaterEqualLess;":"\u22DB","&GreaterFullEqual;":"\u2267","&GreaterGreater;":"\u2AA2","&GreaterLess;":"\u2277","&GreaterSlantEqual;":"\u2A7E","&GreaterTilde;":"\u2273","&Gscr;":"\u{1D4A2}","&Gt;":"\u226B","&HARDcy;":"\u042A","&Hacek;":"\u02C7","&Hat;":"^","&Hcirc;":"\u0124","&Hfr;":"\u210C","&HilbertSpace;":"\u210B","&Hopf;":"\u210D","&HorizontalLine;":"\u2500","&Hscr;":"\u210B","&Hstrok;":"\u0126","&HumpDownHump;":"\u224E","&HumpEqual;":"\u224F","&IEcy;":"\u0415","&IJlig;":"\u0132","&IOcy;":"\u0401","&Iacute":"\xCD","&Iacute;":"\xCD","&Icirc":"\xCE","&Icirc;":"\xCE","&Icy;":"\u0418","&Idot;":"\u0130","&Ifr;":"\u2111","&Igrave":"\xCC","&Igrave;":"\xCC","&Im;":"\u2111","&Imacr;":"\u012A","&ImaginaryI;":"\u2148","&Implies;":"\u21D2","&Int;":"\u222C","&Integral;":"\u222B","&Intersection;":"\u22C2","&InvisibleComma;":"\u2063","&InvisibleTimes;":"\u2062","&Iogon;":"\u012E","&Iopf;":"\u{1D540}","&Iota;":"\u0399","&Iscr;":"\u2110","&Itilde;":"\u0128","&Iukcy;":"\u0406","&Iuml":"\xCF","&Iuml;":"\xCF","&Jcirc;":"\u0134","&Jcy;":"\u0419","&Jfr;":"\u{1D50D}","&Jopf;":"\u{1D541}","&Jscr;":"\u{1D4A5}","&Jsercy;":"\u0408","&Jukcy;":"\u0404","&KHcy;":"\u0425","&KJcy;":"\u040C","&Kappa;":"\u039A","&Kcedil;":"\u0136","&Kcy;":"\u041A","&Kfr;":"\u{1D50E}","&Kopf;":"\u{1D542}","&Kscr;":"\u{1D4A6}","&LJcy;":"\u0409","&LT":"<","&LT;":"<","&Lacute;":"\u0139","&Lambda;":"\u039B","&Lang;":"\u27EA","&Laplacetrf;":"\u2112","&Larr;":"\u219E","&Lcaron;":"\u013D","&Lcedil;":"\u013B","&Lcy;":"\u041B","&LeftAngleBracket;":"\u27E8","&LeftArrow;":"\u2190","&LeftArrowBar;":"\u21E4","&LeftArrowRightArrow;":"\u21C6","&LeftCeiling;":"\u2308","&LeftDoubleBracket;":"\u27E6","&LeftDownTeeVector;":"\u2961","&LeftDownVector;":"\u21C3","&LeftDownVectorBar;":"\u2959","&LeftFloor;":"\u230A","&LeftRightArrow;":"\u2194","&LeftRightVector;":"\u294E","&LeftTee;":"\u22A3","&LeftTeeArrow;":"\u21A4","&LeftTeeVector;":"\u295A","&LeftTriangle;":"\u22B2","&LeftTriangleBar;":"\u29CF","&LeftTriangleEqual;":"\u22B4","&LeftUpDownVector;":"\u2951","&LeftUpTeeVector;":"\u2960","&LeftUpVector;":"\u21BF","&LeftUpVectorBar;":"\u2958","&LeftVector;":"\u21BC","&LeftVectorBar;":"\u2952","&Leftarrow;":"\u21D0","&Leftrightarrow;":"\u21D4","&LessEqualGreater;":"\u22DA","&LessFullEqual;":"\u2266","&LessGreater;":"\u2276","&LessLess;":"\u2AA1","&LessSlantEqual;":"\u2A7D","&LessTilde;":"\u2272","&Lfr;":"\u{1D50F}","&Ll;":"\u22D8","&Lleftarrow;":"\u21DA","&Lmidot;":"\u013F","&LongLeftArrow;":"\u27F5","&LongLeftRightArrow;":"\u27F7","&LongRightArrow;":"\u27F6","&Longleftarrow;":"\u27F8","&Longleftrightarrow;":"\u27FA","&Longrightarrow;":"\u27F9","&Lopf;":"\u{1D543}","&LowerLeftArrow;":"\u2199","&LowerRightArrow;":"\u2198","&Lscr;":"\u2112","&Lsh;":"\u21B0","&Lstrok;":"\u0141","&Lt;":"\u226A","&Map;":"\u2905","&Mcy;":"\u041C","&MediumSpace;":"\u205F","&Mellintrf;":"\u2133","&Mfr;":"\u{1D510}","&MinusPlus;":"\u2213","&Mopf;":"\u{1D544}","&Mscr;":"\u2133","&Mu;":"\u039C","&NJcy;":"\u040A","&Nacute;":"\u0143","&Ncaron;":"\u0147","&Ncedil;":"\u0145","&Ncy;":"\u041D","&NegativeMediumSpace;":"\u200B","&NegativeThickSpace;":"\u200B","&NegativeThinSpace;":"\u200B","&NegativeVeryThinSpace;":"\u200B","&NestedGreaterGreater;":"\u226B","&NestedLessLess;":"\u226A","&NewLine;":`
6
- `,"&Nfr;":"\u{1D511}","&NoBreak;":"\u2060","&NonBreakingSpace;":"\xA0","&Nopf;":"\u2115","&Not;":"\u2AEC","&NotCongruent;":"\u2262","&NotCupCap;":"\u226D","&NotDoubleVerticalBar;":"\u2226","&NotElement;":"\u2209","&NotEqual;":"\u2260","&NotEqualTilde;":"\u2242\u0338","&NotExists;":"\u2204","&NotGreater;":"\u226F","&NotGreaterEqual;":"\u2271","&NotGreaterFullEqual;":"\u2267\u0338","&NotGreaterGreater;":"\u226B\u0338","&NotGreaterLess;":"\u2279","&NotGreaterSlantEqual;":"\u2A7E\u0338","&NotGreaterTilde;":"\u2275","&NotHumpDownHump;":"\u224E\u0338","&NotHumpEqual;":"\u224F\u0338","&NotLeftTriangle;":"\u22EA","&NotLeftTriangleBar;":"\u29CF\u0338","&NotLeftTriangleEqual;":"\u22EC","&NotLess;":"\u226E","&NotLessEqual;":"\u2270","&NotLessGreater;":"\u2278","&NotLessLess;":"\u226A\u0338","&NotLessSlantEqual;":"\u2A7D\u0338","&NotLessTilde;":"\u2274","&NotNestedGreaterGreater;":"\u2AA2\u0338","&NotNestedLessLess;":"\u2AA1\u0338","&NotPrecedes;":"\u2280","&NotPrecedesEqual;":"\u2AAF\u0338","&NotPrecedesSlantEqual;":"\u22E0","&NotReverseElement;":"\u220C","&NotRightTriangle;":"\u22EB","&NotRightTriangleBar;":"\u29D0\u0338","&NotRightTriangleEqual;":"\u22ED","&NotSquareSubset;":"\u228F\u0338","&NotSquareSubsetEqual;":"\u22E2","&NotSquareSuperset;":"\u2290\u0338","&NotSquareSupersetEqual;":"\u22E3","&NotSubset;":"\u2282\u20D2","&NotSubsetEqual;":"\u2288","&NotSucceeds;":"\u2281","&NotSucceedsEqual;":"\u2AB0\u0338","&NotSucceedsSlantEqual;":"\u22E1","&NotSucceedsTilde;":"\u227F\u0338","&NotSuperset;":"\u2283\u20D2","&NotSupersetEqual;":"\u2289","&NotTilde;":"\u2241","&NotTildeEqual;":"\u2244","&NotTildeFullEqual;":"\u2247","&NotTildeTilde;":"\u2249","&NotVerticalBar;":"\u2224","&Nscr;":"\u{1D4A9}","&Ntilde":"\xD1","&Ntilde;":"\xD1","&Nu;":"\u039D","&OElig;":"\u0152","&Oacute":"\xD3","&Oacute;":"\xD3","&Ocirc":"\xD4","&Ocirc;":"\xD4","&Ocy;":"\u041E","&Odblac;":"\u0150","&Ofr;":"\u{1D512}","&Ograve":"\xD2","&Ograve;":"\xD2","&Omacr;":"\u014C","&Omega;":"\u03A9","&Omicron;":"\u039F","&Oopf;":"\u{1D546}","&OpenCurlyDoubleQuote;":"\u201C","&OpenCurlyQuote;":"\u2018","&Or;":"\u2A54","&Oscr;":"\u{1D4AA}","&Oslash":"\xD8","&Oslash;":"\xD8","&Otilde":"\xD5","&Otilde;":"\xD5","&Otimes;":"\u2A37","&Ouml":"\xD6","&Ouml;":"\xD6","&OverBar;":"\u203E","&OverBrace;":"\u23DE","&OverBracket;":"\u23B4","&OverParenthesis;":"\u23DC","&PartialD;":"\u2202","&Pcy;":"\u041F","&Pfr;":"\u{1D513}","&Phi;":"\u03A6","&Pi;":"\u03A0","&PlusMinus;":"\xB1","&Poincareplane;":"\u210C","&Popf;":"\u2119","&Pr;":"\u2ABB","&Precedes;":"\u227A","&PrecedesEqual;":"\u2AAF","&PrecedesSlantEqual;":"\u227C","&PrecedesTilde;":"\u227E","&Prime;":"\u2033","&Product;":"\u220F","&Proportion;":"\u2237","&Proportional;":"\u221D","&Pscr;":"\u{1D4AB}","&Psi;":"\u03A8","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"\u{1D514}","&Qopf;":"\u211A","&Qscr;":"\u{1D4AC}","&RBarr;":"\u2910","&REG":"\xAE","&REG;":"\xAE","&Racute;":"\u0154","&Rang;":"\u27EB","&Rarr;":"\u21A0","&Rarrtl;":"\u2916","&Rcaron;":"\u0158","&Rcedil;":"\u0156","&Rcy;":"\u0420","&Re;":"\u211C","&ReverseElement;":"\u220B","&ReverseEquilibrium;":"\u21CB","&ReverseUpEquilibrium;":"\u296F","&Rfr;":"\u211C","&Rho;":"\u03A1","&RightAngleBracket;":"\u27E9","&RightArrow;":"\u2192","&RightArrowBar;":"\u21E5","&RightArrowLeftArrow;":"\u21C4","&RightCeiling;":"\u2309","&RightDoubleBracket;":"\u27E7","&RightDownTeeVector;":"\u295D","&RightDownVector;":"\u21C2","&RightDownVectorBar;":"\u2955","&RightFloor;":"\u230B","&RightTee;":"\u22A2","&RightTeeArrow;":"\u21A6","&RightTeeVector;":"\u295B","&RightTriangle;":"\u22B3","&RightTriangleBar;":"\u29D0","&RightTriangleEqual;":"\u22B5","&RightUpDownVector;":"\u294F","&RightUpTeeVector;":"\u295C","&RightUpVector;":"\u21BE","&RightUpVectorBar;":"\u2954","&RightVector;":"\u21C0","&RightVectorBar;":"\u2953","&Rightarrow;":"\u21D2","&Ropf;":"\u211D","&RoundImplies;":"\u2970","&Rrightarrow;":"\u21DB","&Rscr;":"\u211B","&Rsh;":"\u21B1","&RuleDelayed;":"\u29F4","&SHCHcy;":"\u0429","&SHcy;":"\u0428","&SOFTcy;":"\u042C","&Sacute;":"\u015A","&Sc;":"\u2ABC","&Scaron;":"\u0160","&Scedil;":"\u015E","&Scirc;":"\u015C","&Scy;":"\u0421","&Sfr;":"\u{1D516}","&ShortDownArrow;":"\u2193","&ShortLeftArrow;":"\u2190","&ShortRightArrow;":"\u2192","&ShortUpArrow;":"\u2191","&Sigma;":"\u03A3","&SmallCircle;":"\u2218","&Sopf;":"\u{1D54A}","&Sqrt;":"\u221A","&Square;":"\u25A1","&SquareIntersection;":"\u2293","&SquareSubset;":"\u228F","&SquareSubsetEqual;":"\u2291","&SquareSuperset;":"\u2290","&SquareSupersetEqual;":"\u2292","&SquareUnion;":"\u2294","&Sscr;":"\u{1D4AE}","&Star;":"\u22C6","&Sub;":"\u22D0","&Subset;":"\u22D0","&SubsetEqual;":"\u2286","&Succeeds;":"\u227B","&SucceedsEqual;":"\u2AB0","&SucceedsSlantEqual;":"\u227D","&SucceedsTilde;":"\u227F","&SuchThat;":"\u220B","&Sum;":"\u2211","&Sup;":"\u22D1","&Superset;":"\u2283","&SupersetEqual;":"\u2287","&Supset;":"\u22D1","&THORN":"\xDE","&THORN;":"\xDE","&TRADE;":"\u2122","&TSHcy;":"\u040B","&TScy;":"\u0426","&Tab;":" ","&Tau;":"\u03A4","&Tcaron;":"\u0164","&Tcedil;":"\u0162","&Tcy;":"\u0422","&Tfr;":"\u{1D517}","&Therefore;":"\u2234","&Theta;":"\u0398","&ThickSpace;":"\u205F\u200A","&ThinSpace;":"\u2009","&Tilde;":"\u223C","&TildeEqual;":"\u2243","&TildeFullEqual;":"\u2245","&TildeTilde;":"\u2248","&Topf;":"\u{1D54B}","&TripleDot;":"\u20DB","&Tscr;":"\u{1D4AF}","&Tstrok;":"\u0166","&Uacute":"\xDA","&Uacute;":"\xDA","&Uarr;":"\u219F","&Uarrocir;":"\u2949","&Ubrcy;":"\u040E","&Ubreve;":"\u016C","&Ucirc":"\xDB","&Ucirc;":"\xDB","&Ucy;":"\u0423","&Udblac;":"\u0170","&Ufr;":"\u{1D518}","&Ugrave":"\xD9","&Ugrave;":"\xD9","&Umacr;":"\u016A","&UnderBar;":"_","&UnderBrace;":"\u23DF","&UnderBracket;":"\u23B5","&UnderParenthesis;":"\u23DD","&Union;":"\u22C3","&UnionPlus;":"\u228E","&Uogon;":"\u0172","&Uopf;":"\u{1D54C}","&UpArrow;":"\u2191","&UpArrowBar;":"\u2912","&UpArrowDownArrow;":"\u21C5","&UpDownArrow;":"\u2195","&UpEquilibrium;":"\u296E","&UpTee;":"\u22A5","&UpTeeArrow;":"\u21A5","&Uparrow;":"\u21D1","&Updownarrow;":"\u21D5","&UpperLeftArrow;":"\u2196","&UpperRightArrow;":"\u2197","&Upsi;":"\u03D2","&Upsilon;":"\u03A5","&Uring;":"\u016E","&Uscr;":"\u{1D4B0}","&Utilde;":"\u0168","&Uuml":"\xDC","&Uuml;":"\xDC","&VDash;":"\u22AB","&Vbar;":"\u2AEB","&Vcy;":"\u0412","&Vdash;":"\u22A9","&Vdashl;":"\u2AE6","&Vee;":"\u22C1","&Verbar;":"\u2016","&Vert;":"\u2016","&VerticalBar;":"\u2223","&VerticalLine;":"|","&VerticalSeparator;":"\u2758","&VerticalTilde;":"\u2240","&VeryThinSpace;":"\u200A","&Vfr;":"\u{1D519}","&Vopf;":"\u{1D54D}","&Vscr;":"\u{1D4B1}","&Vvdash;":"\u22AA","&Wcirc;":"\u0174","&Wedge;":"\u22C0","&Wfr;":"\u{1D51A}","&Wopf;":"\u{1D54E}","&Wscr;":"\u{1D4B2}","&Xfr;":"\u{1D51B}","&Xi;":"\u039E","&Xopf;":"\u{1D54F}","&Xscr;":"\u{1D4B3}","&YAcy;":"\u042F","&YIcy;":"\u0407","&YUcy;":"\u042E","&Yacute":"\xDD","&Yacute;":"\xDD","&Ycirc;":"\u0176","&Ycy;":"\u042B","&Yfr;":"\u{1D51C}","&Yopf;":"\u{1D550}","&Yscr;":"\u{1D4B4}","&Yuml;":"\u0178","&ZHcy;":"\u0416","&Zacute;":"\u0179","&Zcaron;":"\u017D","&Zcy;":"\u0417","&Zdot;":"\u017B","&ZeroWidthSpace;":"\u200B","&Zeta;":"\u0396","&Zfr;":"\u2128","&Zopf;":"\u2124","&Zscr;":"\u{1D4B5}","&aacute":"\xE1","&aacute;":"\xE1","&abreve;":"\u0103","&ac;":"\u223E","&acE;":"\u223E\u0333","&acd;":"\u223F","&acirc":"\xE2","&acirc;":"\xE2","&acute":"\xB4","&acute;":"\xB4","&acy;":"\u0430","&aelig":"\xE6","&aelig;":"\xE6","&af;":"\u2061","&afr;":"\u{1D51E}","&agrave":"\xE0","&agrave;":"\xE0","&alefsym;":"\u2135","&aleph;":"\u2135","&alpha;":"\u03B1","&amacr;":"\u0101","&amalg;":"\u2A3F","&amp":"&","&amp;":"&","&and;":"\u2227","&andand;":"\u2A55","&andd;":"\u2A5C","&andslope;":"\u2A58","&andv;":"\u2A5A","&ang;":"\u2220","&ange;":"\u29A4","&angle;":"\u2220","&angmsd;":"\u2221","&angmsdaa;":"\u29A8","&angmsdab;":"\u29A9","&angmsdac;":"\u29AA","&angmsdad;":"\u29AB","&angmsdae;":"\u29AC","&angmsdaf;":"\u29AD","&angmsdag;":"\u29AE","&angmsdah;":"\u29AF","&angrt;":"\u221F","&angrtvb;":"\u22BE","&angrtvbd;":"\u299D","&angsph;":"\u2222","&angst;":"\xC5","&angzarr;":"\u237C","&aogon;":"\u0105","&aopf;":"\u{1D552}","&ap;":"\u2248","&apE;":"\u2A70","&apacir;":"\u2A6F","&ape;":"\u224A","&apid;":"\u224B","&apos;":"'","&approx;":"\u2248","&approxeq;":"\u224A","&aring":"\xE5","&aring;":"\xE5","&ascr;":"\u{1D4B6}","&ast;":"*","&asymp;":"\u2248","&asympeq;":"\u224D","&atilde":"\xE3","&atilde;":"\xE3","&auml":"\xE4","&auml;":"\xE4","&awconint;":"\u2233","&awint;":"\u2A11","&bNot;":"\u2AED","&backcong;":"\u224C","&backepsilon;":"\u03F6","&backprime;":"\u2035","&backsim;":"\u223D","&backsimeq;":"\u22CD","&barvee;":"\u22BD","&barwed;":"\u2305","&barwedge;":"\u2305","&bbrk;":"\u23B5","&bbrktbrk;":"\u23B6","&bcong;":"\u224C","&bcy;":"\u0431","&bdquo;":"\u201E","&becaus;":"\u2235","&because;":"\u2235","&bemptyv;":"\u29B0","&bepsi;":"\u03F6","&bernou;":"\u212C","&beta;":"\u03B2","&beth;":"\u2136","&between;":"\u226C","&bfr;":"\u{1D51F}","&bigcap;":"\u22C2","&bigcirc;":"\u25EF","&bigcup;":"\u22C3","&bigodot;":"\u2A00","&bigoplus;":"\u2A01","&bigotimes;":"\u2A02","&bigsqcup;":"\u2A06","&bigstar;":"\u2605","&bigtriangledown;":"\u25BD","&bigtriangleup;":"\u25B3","&biguplus;":"\u2A04","&bigvee;":"\u22C1","&bigwedge;":"\u22C0","&bkarow;":"\u290D","&blacklozenge;":"\u29EB","&blacksquare;":"\u25AA","&blacktriangle;":"\u25B4","&blacktriangledown;":"\u25BE","&blacktriangleleft;":"\u25C2","&blacktriangleright;":"\u25B8","&blank;":"\u2423","&blk12;":"\u2592","&blk14;":"\u2591","&blk34;":"\u2593","&block;":"\u2588","&bne;":"=\u20E5","&bnequiv;":"\u2261\u20E5","&bnot;":"\u2310","&bopf;":"\u{1D553}","&bot;":"\u22A5","&bottom;":"\u22A5","&bowtie;":"\u22C8","&boxDL;":"\u2557","&boxDR;":"\u2554","&boxDl;":"\u2556","&boxDr;":"\u2553","&boxH;":"\u2550","&boxHD;":"\u2566","&boxHU;":"\u2569","&boxHd;":"\u2564","&boxHu;":"\u2567","&boxUL;":"\u255D","&boxUR;":"\u255A","&boxUl;":"\u255C","&boxUr;":"\u2559","&boxV;":"\u2551","&boxVH;":"\u256C","&boxVL;":"\u2563","&boxVR;":"\u2560","&boxVh;":"\u256B","&boxVl;":"\u2562","&boxVr;":"\u255F","&boxbox;":"\u29C9","&boxdL;":"\u2555","&boxdR;":"\u2552","&boxdl;":"\u2510","&boxdr;":"\u250C","&boxh;":"\u2500","&boxhD;":"\u2565","&boxhU;":"\u2568","&boxhd;":"\u252C","&boxhu;":"\u2534","&boxminus;":"\u229F","&boxplus;":"\u229E","&boxtimes;":"\u22A0","&boxuL;":"\u255B","&boxuR;":"\u2558","&boxul;":"\u2518","&boxur;":"\u2514","&boxv;":"\u2502","&boxvH;":"\u256A","&boxvL;":"\u2561","&boxvR;":"\u255E","&boxvh;":"\u253C","&boxvl;":"\u2524","&boxvr;":"\u251C","&bprime;":"\u2035","&breve;":"\u02D8","&brvbar":"\xA6","&brvbar;":"\xA6","&bscr;":"\u{1D4B7}","&bsemi;":"\u204F","&bsim;":"\u223D","&bsime;":"\u22CD","&bsol;":"\\","&bsolb;":"\u29C5","&bsolhsub;":"\u27C8","&bull;":"\u2022","&bullet;":"\u2022","&bump;":"\u224E","&bumpE;":"\u2AAE","&bumpe;":"\u224F","&bumpeq;":"\u224F","&cacute;":"\u0107","&cap;":"\u2229","&capand;":"\u2A44","&capbrcup;":"\u2A49","&capcap;":"\u2A4B","&capcup;":"\u2A47","&capdot;":"\u2A40","&caps;":"\u2229\uFE00","&caret;":"\u2041","&caron;":"\u02C7","&ccaps;":"\u2A4D","&ccaron;":"\u010D","&ccedil":"\xE7","&ccedil;":"\xE7","&ccirc;":"\u0109","&ccups;":"\u2A4C","&ccupssm;":"\u2A50","&cdot;":"\u010B","&cedil":"\xB8","&cedil;":"\xB8","&cemptyv;":"\u29B2","&cent":"\xA2","&cent;":"\xA2","&centerdot;":"\xB7","&cfr;":"\u{1D520}","&chcy;":"\u0447","&check;":"\u2713","&checkmark;":"\u2713","&chi;":"\u03C7","&cir;":"\u25CB","&cirE;":"\u29C3","&circ;":"\u02C6","&circeq;":"\u2257","&circlearrowleft;":"\u21BA","&circlearrowright;":"\u21BB","&circledR;":"\xAE","&circledS;":"\u24C8","&circledast;":"\u229B","&circledcirc;":"\u229A","&circleddash;":"\u229D","&cire;":"\u2257","&cirfnint;":"\u2A10","&cirmid;":"\u2AEF","&cirscir;":"\u29C2","&clubs;":"\u2663","&clubsuit;":"\u2663","&colon;":":","&colone;":"\u2254","&coloneq;":"\u2254","&comma;":",","&commat;":"@","&comp;":"\u2201","&compfn;":"\u2218","&complement;":"\u2201","&complexes;":"\u2102","&cong;":"\u2245","&congdot;":"\u2A6D","&conint;":"\u222E","&copf;":"\u{1D554}","&coprod;":"\u2210","&copy":"\xA9","&copy;":"\xA9","&copysr;":"\u2117","&crarr;":"\u21B5","&cross;":"\u2717","&cscr;":"\u{1D4B8}","&csub;":"\u2ACF","&csube;":"\u2AD1","&csup;":"\u2AD0","&csupe;":"\u2AD2","&ctdot;":"\u22EF","&cudarrl;":"\u2938","&cudarrr;":"\u2935","&cuepr;":"\u22DE","&cuesc;":"\u22DF","&cularr;":"\u21B6","&cularrp;":"\u293D","&cup;":"\u222A","&cupbrcap;":"\u2A48","&cupcap;":"\u2A46","&cupcup;":"\u2A4A","&cupdot;":"\u228D","&cupor;":"\u2A45","&cups;":"\u222A\uFE00","&curarr;":"\u21B7","&curarrm;":"\u293C","&curlyeqprec;":"\u22DE","&curlyeqsucc;":"\u22DF","&curlyvee;":"\u22CE","&curlywedge;":"\u22CF","&curren":"\xA4","&curren;":"\xA4","&curvearrowleft;":"\u21B6","&curvearrowright;":"\u21B7","&cuvee;":"\u22CE","&cuwed;":"\u22CF","&cwconint;":"\u2232","&cwint;":"\u2231","&cylcty;":"\u232D","&dArr;":"\u21D3","&dHar;":"\u2965","&dagger;":"\u2020","&daleth;":"\u2138","&darr;":"\u2193","&dash;":"\u2010","&dashv;":"\u22A3","&dbkarow;":"\u290F","&dblac;":"\u02DD","&dcaron;":"\u010F","&dcy;":"\u0434","&dd;":"\u2146","&ddagger;":"\u2021","&ddarr;":"\u21CA","&ddotseq;":"\u2A77","&deg":"\xB0","&deg;":"\xB0","&delta;":"\u03B4","&demptyv;":"\u29B1","&dfisht;":"\u297F","&dfr;":"\u{1D521}","&dharl;":"\u21C3","&dharr;":"\u21C2","&diam;":"\u22C4","&diamond;":"\u22C4","&diamondsuit;":"\u2666","&diams;":"\u2666","&die;":"\xA8","&digamma;":"\u03DD","&disin;":"\u22F2","&div;":"\xF7","&divide":"\xF7","&divide;":"\xF7","&divideontimes;":"\u22C7","&divonx;":"\u22C7","&djcy;":"\u0452","&dlcorn;":"\u231E","&dlcrop;":"\u230D","&dollar;":"$","&dopf;":"\u{1D555}","&dot;":"\u02D9","&doteq;":"\u2250","&doteqdot;":"\u2251","&dotminus;":"\u2238","&dotplus;":"\u2214","&dotsquare;":"\u22A1","&doublebarwedge;":"\u2306","&downarrow;":"\u2193","&downdownarrows;":"\u21CA","&downharpoonleft;":"\u21C3","&downharpoonright;":"\u21C2","&drbkarow;":"\u2910","&drcorn;":"\u231F","&drcrop;":"\u230C","&dscr;":"\u{1D4B9}","&dscy;":"\u0455","&dsol;":"\u29F6","&dstrok;":"\u0111","&dtdot;":"\u22F1","&dtri;":"\u25BF","&dtrif;":"\u25BE","&duarr;":"\u21F5","&duhar;":"\u296F","&dwangle;":"\u29A6","&dzcy;":"\u045F","&dzigrarr;":"\u27FF","&eDDot;":"\u2A77","&eDot;":"\u2251","&eacute":"\xE9","&eacute;":"\xE9","&easter;":"\u2A6E","&ecaron;":"\u011B","&ecir;":"\u2256","&ecirc":"\xEA","&ecirc;":"\xEA","&ecolon;":"\u2255","&ecy;":"\u044D","&edot;":"\u0117","&ee;":"\u2147","&efDot;":"\u2252","&efr;":"\u{1D522}","&eg;":"\u2A9A","&egrave":"\xE8","&egrave;":"\xE8","&egs;":"\u2A96","&egsdot;":"\u2A98","&el;":"\u2A99","&elinters;":"\u23E7","&ell;":"\u2113","&els;":"\u2A95","&elsdot;":"\u2A97","&emacr;":"\u0113","&empty;":"\u2205","&emptyset;":"\u2205","&emptyv;":"\u2205","&emsp13;":"\u2004","&emsp14;":"\u2005","&emsp;":"\u2003","&eng;":"\u014B","&ensp;":"\u2002","&eogon;":"\u0119","&eopf;":"\u{1D556}","&epar;":"\u22D5","&eparsl;":"\u29E3","&eplus;":"\u2A71","&epsi;":"\u03B5","&epsilon;":"\u03B5","&epsiv;":"\u03F5","&eqcirc;":"\u2256","&eqcolon;":"\u2255","&eqsim;":"\u2242","&eqslantgtr;":"\u2A96","&eqslantless;":"\u2A95","&equals;":"=","&equest;":"\u225F","&equiv;":"\u2261","&equivDD;":"\u2A78","&eqvparsl;":"\u29E5","&erDot;":"\u2253","&erarr;":"\u2971","&escr;":"\u212F","&esdot;":"\u2250","&esim;":"\u2242","&eta;":"\u03B7","&eth":"\xF0","&eth;":"\xF0","&euml":"\xEB","&euml;":"\xEB","&euro;":"\u20AC","&excl;":"!","&exist;":"\u2203","&expectation;":"\u2130","&exponentiale;":"\u2147","&fallingdotseq;":"\u2252","&fcy;":"\u0444","&female;":"\u2640","&ffilig;":"\uFB03","&fflig;":"\uFB00","&ffllig;":"\uFB04","&ffr;":"\u{1D523}","&filig;":"\uFB01","&fjlig;":"fj","&flat;":"\u266D","&fllig;":"\uFB02","&fltns;":"\u25B1","&fnof;":"\u0192","&fopf;":"\u{1D557}","&forall;":"\u2200","&fork;":"\u22D4","&forkv;":"\u2AD9","&fpartint;":"\u2A0D","&frac12":"\xBD","&frac12;":"\xBD","&frac13;":"\u2153","&frac14":"\xBC","&frac14;":"\xBC","&frac15;":"\u2155","&frac16;":"\u2159","&frac18;":"\u215B","&frac23;":"\u2154","&frac25;":"\u2156","&frac34":"\xBE","&frac34;":"\xBE","&frac35;":"\u2157","&frac38;":"\u215C","&frac45;":"\u2158","&frac56;":"\u215A","&frac58;":"\u215D","&frac78;":"\u215E","&frasl;":"\u2044","&frown;":"\u2322","&fscr;":"\u{1D4BB}","&gE;":"\u2267","&gEl;":"\u2A8C","&gacute;":"\u01F5","&gamma;":"\u03B3","&gammad;":"\u03DD","&gap;":"\u2A86","&gbreve;":"\u011F","&gcirc;":"\u011D","&gcy;":"\u0433","&gdot;":"\u0121","&ge;":"\u2265","&gel;":"\u22DB","&geq;":"\u2265","&geqq;":"\u2267","&geqslant;":"\u2A7E","&ges;":"\u2A7E","&gescc;":"\u2AA9","&gesdot;":"\u2A80","&gesdoto;":"\u2A82","&gesdotol;":"\u2A84","&gesl;":"\u22DB\uFE00","&gesles;":"\u2A94","&gfr;":"\u{1D524}","&gg;":"\u226B","&ggg;":"\u22D9","&gimel;":"\u2137","&gjcy;":"\u0453","&gl;":"\u2277","&glE;":"\u2A92","&gla;":"\u2AA5","&glj;":"\u2AA4","&gnE;":"\u2269","&gnap;":"\u2A8A","&gnapprox;":"\u2A8A","&gne;":"\u2A88","&gneq;":"\u2A88","&gneqq;":"\u2269","&gnsim;":"\u22E7","&gopf;":"\u{1D558}","&grave;":"`","&gscr;":"\u210A","&gsim;":"\u2273","&gsime;":"\u2A8E","&gsiml;":"\u2A90","&gt":">","&gt;":">","&gtcc;":"\u2AA7","&gtcir;":"\u2A7A","&gtdot;":"\u22D7","&gtlPar;":"\u2995","&gtquest;":"\u2A7C","&gtrapprox;":"\u2A86","&gtrarr;":"\u2978","&gtrdot;":"\u22D7","&gtreqless;":"\u22DB","&gtreqqless;":"\u2A8C","&gtrless;":"\u2277","&gtrsim;":"\u2273","&gvertneqq;":"\u2269\uFE00","&gvnE;":"\u2269\uFE00","&hArr;":"\u21D4","&hairsp;":"\u200A","&half;":"\xBD","&hamilt;":"\u210B","&hardcy;":"\u044A","&harr;":"\u2194","&harrcir;":"\u2948","&harrw;":"\u21AD","&hbar;":"\u210F","&hcirc;":"\u0125","&hearts;":"\u2665","&heartsuit;":"\u2665","&hellip;":"\u2026","&hercon;":"\u22B9","&hfr;":"\u{1D525}","&hksearow;":"\u2925","&hkswarow;":"\u2926","&hoarr;":"\u21FF","&homtht;":"\u223B","&hookleftarrow;":"\u21A9","&hookrightarrow;":"\u21AA","&hopf;":"\u{1D559}","&horbar;":"\u2015","&hscr;":"\u{1D4BD}","&hslash;":"\u210F","&hstrok;":"\u0127","&hybull;":"\u2043","&hyphen;":"\u2010","&iacute":"\xED","&iacute;":"\xED","&ic;":"\u2063","&icirc":"\xEE","&icirc;":"\xEE","&icy;":"\u0438","&iecy;":"\u0435","&iexcl":"\xA1","&iexcl;":"\xA1","&iff;":"\u21D4","&ifr;":"\u{1D526}","&igrave":"\xEC","&igrave;":"\xEC","&ii;":"\u2148","&iiiint;":"\u2A0C","&iiint;":"\u222D","&iinfin;":"\u29DC","&iiota;":"\u2129","&ijlig;":"\u0133","&imacr;":"\u012B","&image;":"\u2111","&imagline;":"\u2110","&imagpart;":"\u2111","&imath;":"\u0131","&imof;":"\u22B7","&imped;":"\u01B5","&in;":"\u2208","&incare;":"\u2105","&infin;":"\u221E","&infintie;":"\u29DD","&inodot;":"\u0131","&int;":"\u222B","&intcal;":"\u22BA","&integers;":"\u2124","&intercal;":"\u22BA","&intlarhk;":"\u2A17","&intprod;":"\u2A3C","&iocy;":"\u0451","&iogon;":"\u012F","&iopf;":"\u{1D55A}","&iota;":"\u03B9","&iprod;":"\u2A3C","&iquest":"\xBF","&iquest;":"\xBF","&iscr;":"\u{1D4BE}","&isin;":"\u2208","&isinE;":"\u22F9","&isindot;":"\u22F5","&isins;":"\u22F4","&isinsv;":"\u22F3","&isinv;":"\u2208","&it;":"\u2062","&itilde;":"\u0129","&iukcy;":"\u0456","&iuml":"\xEF","&iuml;":"\xEF","&jcirc;":"\u0135","&jcy;":"\u0439","&jfr;":"\u{1D527}","&jmath;":"\u0237","&jopf;":"\u{1D55B}","&jscr;":"\u{1D4BF}","&jsercy;":"\u0458","&jukcy;":"\u0454","&kappa;":"\u03BA","&kappav;":"\u03F0","&kcedil;":"\u0137","&kcy;":"\u043A","&kfr;":"\u{1D528}","&kgreen;":"\u0138","&khcy;":"\u0445","&kjcy;":"\u045C","&kopf;":"\u{1D55C}","&kscr;":"\u{1D4C0}","&lAarr;":"\u21DA","&lArr;":"\u21D0","&lAtail;":"\u291B","&lBarr;":"\u290E","&lE;":"\u2266","&lEg;":"\u2A8B","&lHar;":"\u2962","&lacute;":"\u013A","&laemptyv;":"\u29B4","&lagran;":"\u2112","&lambda;":"\u03BB","&lang;":"\u27E8","&langd;":"\u2991","&langle;":"\u27E8","&lap;":"\u2A85","&laquo":"\xAB","&laquo;":"\xAB","&larr;":"\u2190","&larrb;":"\u21E4","&larrbfs;":"\u291F","&larrfs;":"\u291D","&larrhk;":"\u21A9","&larrlp;":"\u21AB","&larrpl;":"\u2939","&larrsim;":"\u2973","&larrtl;":"\u21A2","&lat;":"\u2AAB","&latail;":"\u2919","&late;":"\u2AAD","&lates;":"\u2AAD\uFE00","&lbarr;":"\u290C","&lbbrk;":"\u2772","&lbrace;":"{","&lbrack;":"[","&lbrke;":"\u298B","&lbrksld;":"\u298F","&lbrkslu;":"\u298D","&lcaron;":"\u013E","&lcedil;":"\u013C","&lceil;":"\u2308","&lcub;":"{","&lcy;":"\u043B","&ldca;":"\u2936","&ldquo;":"\u201C","&ldquor;":"\u201E","&ldrdhar;":"\u2967","&ldrushar;":"\u294B","&ldsh;":"\u21B2","&le;":"\u2264","&leftarrow;":"\u2190","&leftarrowtail;":"\u21A2","&leftharpoondown;":"\u21BD","&leftharpoonup;":"\u21BC","&leftleftarrows;":"\u21C7","&leftrightarrow;":"\u2194","&leftrightarrows;":"\u21C6","&leftrightharpoons;":"\u21CB","&leftrightsquigarrow;":"\u21AD","&leftthreetimes;":"\u22CB","&leg;":"\u22DA","&leq;":"\u2264","&leqq;":"\u2266","&leqslant;":"\u2A7D","&les;":"\u2A7D","&lescc;":"\u2AA8","&lesdot;":"\u2A7F","&lesdoto;":"\u2A81","&lesdotor;":"\u2A83","&lesg;":"\u22DA\uFE00","&lesges;":"\u2A93","&lessapprox;":"\u2A85","&lessdot;":"\u22D6","&lesseqgtr;":"\u22DA","&lesseqqgtr;":"\u2A8B","&lessgtr;":"\u2276","&lesssim;":"\u2272","&lfisht;":"\u297C","&lfloor;":"\u230A","&lfr;":"\u{1D529}","&lg;":"\u2276","&lgE;":"\u2A91","&lhard;":"\u21BD","&lharu;":"\u21BC","&lharul;":"\u296A","&lhblk;":"\u2584","&ljcy;":"\u0459","&ll;":"\u226A","&llarr;":"\u21C7","&llcorner;":"\u231E","&llhard;":"\u296B","&lltri;":"\u25FA","&lmidot;":"\u0140","&lmoust;":"\u23B0","&lmoustache;":"\u23B0","&lnE;":"\u2268","&lnap;":"\u2A89","&lnapprox;":"\u2A89","&lne;":"\u2A87","&lneq;":"\u2A87","&lneqq;":"\u2268","&lnsim;":"\u22E6","&loang;":"\u27EC","&loarr;":"\u21FD","&lobrk;":"\u27E6","&longleftarrow;":"\u27F5","&longleftrightarrow;":"\u27F7","&longmapsto;":"\u27FC","&longrightarrow;":"\u27F6","&looparrowleft;":"\u21AB","&looparrowright;":"\u21AC","&lopar;":"\u2985","&lopf;":"\u{1D55D}","&loplus;":"\u2A2D","&lotimes;":"\u2A34","&lowast;":"\u2217","&lowbar;":"_","&loz;":"\u25CA","&lozenge;":"\u25CA","&lozf;":"\u29EB","&lpar;":"(","&lparlt;":"\u2993","&lrarr;":"\u21C6","&lrcorner;":"\u231F","&lrhar;":"\u21CB","&lrhard;":"\u296D","&lrm;":"\u200E","&lrtri;":"\u22BF","&lsaquo;":"\u2039","&lscr;":"\u{1D4C1}","&lsh;":"\u21B0","&lsim;":"\u2272","&lsime;":"\u2A8D","&lsimg;":"\u2A8F","&lsqb;":"[","&lsquo;":"\u2018","&lsquor;":"\u201A","&lstrok;":"\u0142","&lt":"<","&lt;":"<","&ltcc;":"\u2AA6","&ltcir;":"\u2A79","&ltdot;":"\u22D6","&lthree;":"\u22CB","&ltimes;":"\u22C9","&ltlarr;":"\u2976","&ltquest;":"\u2A7B","&ltrPar;":"\u2996","&ltri;":"\u25C3","&ltrie;":"\u22B4","&ltrif;":"\u25C2","&lurdshar;":"\u294A","&luruhar;":"\u2966","&lvertneqq;":"\u2268\uFE00","&lvnE;":"\u2268\uFE00","&mDDot;":"\u223A","&macr":"\xAF","&macr;":"\xAF","&male;":"\u2642","&malt;":"\u2720","&maltese;":"\u2720","&map;":"\u21A6","&mapsto;":"\u21A6","&mapstodown;":"\u21A7","&mapstoleft;":"\u21A4","&mapstoup;":"\u21A5","&marker;":"\u25AE","&mcomma;":"\u2A29","&mcy;":"\u043C","&mdash;":"\u2014","&measuredangle;":"\u2221","&mfr;":"\u{1D52A}","&mho;":"\u2127","&micro":"\xB5","&micro;":"\xB5","&mid;":"\u2223","&midast;":"*","&midcir;":"\u2AF0","&middot":"\xB7","&middot;":"\xB7","&minus;":"\u2212","&minusb;":"\u229F","&minusd;":"\u2238","&minusdu;":"\u2A2A","&mlcp;":"\u2ADB","&mldr;":"\u2026","&mnplus;":"\u2213","&models;":"\u22A7","&mopf;":"\u{1D55E}","&mp;":"\u2213","&mscr;":"\u{1D4C2}","&mstpos;":"\u223E","&mu;":"\u03BC","&multimap;":"\u22B8","&mumap;":"\u22B8","&nGg;":"\u22D9\u0338","&nGt;":"\u226B\u20D2","&nGtv;":"\u226B\u0338","&nLeftarrow;":"\u21CD","&nLeftrightarrow;":"\u21CE","&nLl;":"\u22D8\u0338","&nLt;":"\u226A\u20D2","&nLtv;":"\u226A\u0338","&nRightarrow;":"\u21CF","&nVDash;":"\u22AF","&nVdash;":"\u22AE","&nabla;":"\u2207","&nacute;":"\u0144","&nang;":"\u2220\u20D2","&nap;":"\u2249","&napE;":"\u2A70\u0338","&napid;":"\u224B\u0338","&napos;":"\u0149","&napprox;":"\u2249","&natur;":"\u266E","&natural;":"\u266E","&naturals;":"\u2115","&nbsp":"\xA0","&nbsp;":"\xA0","&nbump;":"\u224E\u0338","&nbumpe;":"\u224F\u0338","&ncap;":"\u2A43","&ncaron;":"\u0148","&ncedil;":"\u0146","&ncong;":"\u2247","&ncongdot;":"\u2A6D\u0338","&ncup;":"\u2A42","&ncy;":"\u043D","&ndash;":"\u2013","&ne;":"\u2260","&neArr;":"\u21D7","&nearhk;":"\u2924","&nearr;":"\u2197","&nearrow;":"\u2197","&nedot;":"\u2250\u0338","&nequiv;":"\u2262","&nesear;":"\u2928","&nesim;":"\u2242\u0338","&nexist;":"\u2204","&nexists;":"\u2204","&nfr;":"\u{1D52B}","&ngE;":"\u2267\u0338","&nge;":"\u2271","&ngeq;":"\u2271","&ngeqq;":"\u2267\u0338","&ngeqslant;":"\u2A7E\u0338","&nges;":"\u2A7E\u0338","&ngsim;":"\u2275","&ngt;":"\u226F","&ngtr;":"\u226F","&nhArr;":"\u21CE","&nharr;":"\u21AE","&nhpar;":"\u2AF2","&ni;":"\u220B","&nis;":"\u22FC","&nisd;":"\u22FA","&niv;":"\u220B","&njcy;":"\u045A","&nlArr;":"\u21CD","&nlE;":"\u2266\u0338","&nlarr;":"\u219A","&nldr;":"\u2025","&nle;":"\u2270","&nleftarrow;":"\u219A","&nleftrightarrow;":"\u21AE","&nleq;":"\u2270","&nleqq;":"\u2266\u0338","&nleqslant;":"\u2A7D\u0338","&nles;":"\u2A7D\u0338","&nless;":"\u226E","&nlsim;":"\u2274","&nlt;":"\u226E","&nltri;":"\u22EA","&nltrie;":"\u22EC","&nmid;":"\u2224","&nopf;":"\u{1D55F}","&not":"\xAC","&not;":"\xAC","&notin;":"\u2209","&notinE;":"\u22F9\u0338","&notindot;":"\u22F5\u0338","&notinva;":"\u2209","&notinvb;":"\u22F7","&notinvc;":"\u22F6","&notni;":"\u220C","&notniva;":"\u220C","&notnivb;":"\u22FE","&notnivc;":"\u22FD","&npar;":"\u2226","&nparallel;":"\u2226","&nparsl;":"\u2AFD\u20E5","&npart;":"\u2202\u0338","&npolint;":"\u2A14","&npr;":"\u2280","&nprcue;":"\u22E0","&npre;":"\u2AAF\u0338","&nprec;":"\u2280","&npreceq;":"\u2AAF\u0338","&nrArr;":"\u21CF","&nrarr;":"\u219B","&nrarrc;":"\u2933\u0338","&nrarrw;":"\u219D\u0338","&nrightarrow;":"\u219B","&nrtri;":"\u22EB","&nrtrie;":"\u22ED","&nsc;":"\u2281","&nsccue;":"\u22E1","&nsce;":"\u2AB0\u0338","&nscr;":"\u{1D4C3}","&nshortmid;":"\u2224","&nshortparallel;":"\u2226","&nsim;":"\u2241","&nsime;":"\u2244","&nsimeq;":"\u2244","&nsmid;":"\u2224","&nspar;":"\u2226","&nsqsube;":"\u22E2","&nsqsupe;":"\u22E3","&nsub;":"\u2284","&nsubE;":"\u2AC5\u0338","&nsube;":"\u2288","&nsubset;":"\u2282\u20D2","&nsubseteq;":"\u2288","&nsubseteqq;":"\u2AC5\u0338","&nsucc;":"\u2281","&nsucceq;":"\u2AB0\u0338","&nsup;":"\u2285","&nsupE;":"\u2AC6\u0338","&nsupe;":"\u2289","&nsupset;":"\u2283\u20D2","&nsupseteq;":"\u2289","&nsupseteqq;":"\u2AC6\u0338","&ntgl;":"\u2279","&ntilde":"\xF1","&ntilde;":"\xF1","&ntlg;":"\u2278","&ntriangleleft;":"\u22EA","&ntrianglelefteq;":"\u22EC","&ntriangleright;":"\u22EB","&ntrianglerighteq;":"\u22ED","&nu;":"\u03BD","&num;":"#","&numero;":"\u2116","&numsp;":"\u2007","&nvDash;":"\u22AD","&nvHarr;":"\u2904","&nvap;":"\u224D\u20D2","&nvdash;":"\u22AC","&nvge;":"\u2265\u20D2","&nvgt;":">\u20D2","&nvinfin;":"\u29DE","&nvlArr;":"\u2902","&nvle;":"\u2264\u20D2","&nvlt;":"<\u20D2","&nvltrie;":"\u22B4\u20D2","&nvrArr;":"\u2903","&nvrtrie;":"\u22B5\u20D2","&nvsim;":"\u223C\u20D2","&nwArr;":"\u21D6","&nwarhk;":"\u2923","&nwarr;":"\u2196","&nwarrow;":"\u2196","&nwnear;":"\u2927","&oS;":"\u24C8","&oacute":"\xF3","&oacute;":"\xF3","&oast;":"\u229B","&ocir;":"\u229A","&ocirc":"\xF4","&ocirc;":"\xF4","&ocy;":"\u043E","&odash;":"\u229D","&odblac;":"\u0151","&odiv;":"\u2A38","&odot;":"\u2299","&odsold;":"\u29BC","&oelig;":"\u0153","&ofcir;":"\u29BF","&ofr;":"\u{1D52C}","&ogon;":"\u02DB","&ograve":"\xF2","&ograve;":"\xF2","&ogt;":"\u29C1","&ohbar;":"\u29B5","&ohm;":"\u03A9","&oint;":"\u222E","&olarr;":"\u21BA","&olcir;":"\u29BE","&olcross;":"\u29BB","&oline;":"\u203E","&olt;":"\u29C0","&omacr;":"\u014D","&omega;":"\u03C9","&omicron;":"\u03BF","&omid;":"\u29B6","&ominus;":"\u2296","&oopf;":"\u{1D560}","&opar;":"\u29B7","&operp;":"\u29B9","&oplus;":"\u2295","&or;":"\u2228","&orarr;":"\u21BB","&ord;":"\u2A5D","&order;":"\u2134","&orderof;":"\u2134","&ordf":"\xAA","&ordf;":"\xAA","&ordm":"\xBA","&ordm;":"\xBA","&origof;":"\u22B6","&oror;":"\u2A56","&orslope;":"\u2A57","&orv;":"\u2A5B","&oscr;":"\u2134","&oslash":"\xF8","&oslash;":"\xF8","&osol;":"\u2298","&otilde":"\xF5","&otilde;":"\xF5","&otimes;":"\u2297","&otimesas;":"\u2A36","&ouml":"\xF6","&ouml;":"\xF6","&ovbar;":"\u233D","&par;":"\u2225","&para":"\xB6","&para;":"\xB6","&parallel;":"\u2225","&parsim;":"\u2AF3","&parsl;":"\u2AFD","&part;":"\u2202","&pcy;":"\u043F","&percnt;":"%","&period;":".","&permil;":"\u2030","&perp;":"\u22A5","&pertenk;":"\u2031","&pfr;":"\u{1D52D}","&phi;":"\u03C6","&phiv;":"\u03D5","&phmmat;":"\u2133","&phone;":"\u260E","&pi;":"\u03C0","&pitchfork;":"\u22D4","&piv;":"\u03D6","&planck;":"\u210F","&planckh;":"\u210E","&plankv;":"\u210F","&plus;":"+","&plusacir;":"\u2A23","&plusb;":"\u229E","&pluscir;":"\u2A22","&plusdo;":"\u2214","&plusdu;":"\u2A25","&pluse;":"\u2A72","&plusmn":"\xB1","&plusmn;":"\xB1","&plussim;":"\u2A26","&plustwo;":"\u2A27","&pm;":"\xB1","&pointint;":"\u2A15","&popf;":"\u{1D561}","&pound":"\xA3","&pound;":"\xA3","&pr;":"\u227A","&prE;":"\u2AB3","&prap;":"\u2AB7","&prcue;":"\u227C","&pre;":"\u2AAF","&prec;":"\u227A","&precapprox;":"\u2AB7","&preccurlyeq;":"\u227C","&preceq;":"\u2AAF","&precnapprox;":"\u2AB9","&precneqq;":"\u2AB5","&precnsim;":"\u22E8","&precsim;":"\u227E","&prime;":"\u2032","&primes;":"\u2119","&prnE;":"\u2AB5","&prnap;":"\u2AB9","&prnsim;":"\u22E8","&prod;":"\u220F","&profalar;":"\u232E","&profline;":"\u2312","&profsurf;":"\u2313","&prop;":"\u221D","&propto;":"\u221D","&prsim;":"\u227E","&prurel;":"\u22B0","&pscr;":"\u{1D4C5}","&psi;":"\u03C8","&puncsp;":"\u2008","&qfr;":"\u{1D52E}","&qint;":"\u2A0C","&qopf;":"\u{1D562}","&qprime;":"\u2057","&qscr;":"\u{1D4C6}","&quaternions;":"\u210D","&quatint;":"\u2A16","&quest;":"?","&questeq;":"\u225F","&quot":'"',"&quot;":'"',"&rAarr;":"\u21DB","&rArr;":"\u21D2","&rAtail;":"\u291C","&rBarr;":"\u290F","&rHar;":"\u2964","&race;":"\u223D\u0331","&racute;":"\u0155","&radic;":"\u221A","&raemptyv;":"\u29B3","&rang;":"\u27E9","&rangd;":"\u2992","&range;":"\u29A5","&rangle;":"\u27E9","&raquo":"\xBB","&raquo;":"\xBB","&rarr;":"\u2192","&rarrap;":"\u2975","&rarrb;":"\u21E5","&rarrbfs;":"\u2920","&rarrc;":"\u2933","&rarrfs;":"\u291E","&rarrhk;":"\u21AA","&rarrlp;":"\u21AC","&rarrpl;":"\u2945","&rarrsim;":"\u2974","&rarrtl;":"\u21A3","&rarrw;":"\u219D","&ratail;":"\u291A","&ratio;":"\u2236","&rationals;":"\u211A","&rbarr;":"\u290D","&rbbrk;":"\u2773","&rbrace;":"}","&rbrack;":"]","&rbrke;":"\u298C","&rbrksld;":"\u298E","&rbrkslu;":"\u2990","&rcaron;":"\u0159","&rcedil;":"\u0157","&rceil;":"\u2309","&rcub;":"}","&rcy;":"\u0440","&rdca;":"\u2937","&rdldhar;":"\u2969","&rdquo;":"\u201D","&rdquor;":"\u201D","&rdsh;":"\u21B3","&real;":"\u211C","&realine;":"\u211B","&realpart;":"\u211C","&reals;":"\u211D","&rect;":"\u25AD","&reg":"\xAE","&reg;":"\xAE","&rfisht;":"\u297D","&rfloor;":"\u230B","&rfr;":"\u{1D52F}","&rhard;":"\u21C1","&rharu;":"\u21C0","&rharul;":"\u296C","&rho;":"\u03C1","&rhov;":"\u03F1","&rightarrow;":"\u2192","&rightarrowtail;":"\u21A3","&rightharpoondown;":"\u21C1","&rightharpoonup;":"\u21C0","&rightleftarrows;":"\u21C4","&rightleftharpoons;":"\u21CC","&rightrightarrows;":"\u21C9","&rightsquigarrow;":"\u219D","&rightthreetimes;":"\u22CC","&ring;":"\u02DA","&risingdotseq;":"\u2253","&rlarr;":"\u21C4","&rlhar;":"\u21CC","&rlm;":"\u200F","&rmoust;":"\u23B1","&rmoustache;":"\u23B1","&rnmid;":"\u2AEE","&roang;":"\u27ED","&roarr;":"\u21FE","&robrk;":"\u27E7","&ropar;":"\u2986","&ropf;":"\u{1D563}","&roplus;":"\u2A2E","&rotimes;":"\u2A35","&rpar;":")","&rpargt;":"\u2994","&rppolint;":"\u2A12","&rrarr;":"\u21C9","&rsaquo;":"\u203A","&rscr;":"\u{1D4C7}","&rsh;":"\u21B1","&rsqb;":"]","&rsquo;":"\u2019","&rsquor;":"\u2019","&rthree;":"\u22CC","&rtimes;":"\u22CA","&rtri;":"\u25B9","&rtrie;":"\u22B5","&rtrif;":"\u25B8","&rtriltri;":"\u29CE","&ruluhar;":"\u2968","&rx;":"\u211E","&sacute;":"\u015B","&sbquo;":"\u201A","&sc;":"\u227B","&scE;":"\u2AB4","&scap;":"\u2AB8","&scaron;":"\u0161","&sccue;":"\u227D","&sce;":"\u2AB0","&scedil;":"\u015F","&scirc;":"\u015D","&scnE;":"\u2AB6","&scnap;":"\u2ABA","&scnsim;":"\u22E9","&scpolint;":"\u2A13","&scsim;":"\u227F","&scy;":"\u0441","&sdot;":"\u22C5","&sdotb;":"\u22A1","&sdote;":"\u2A66","&seArr;":"\u21D8","&searhk;":"\u2925","&searr;":"\u2198","&searrow;":"\u2198","&sect":"\xA7","&sect;":"\xA7","&semi;":";","&seswar;":"\u2929","&setminus;":"\u2216","&setmn;":"\u2216","&sext;":"\u2736","&sfr;":"\u{1D530}","&sfrown;":"\u2322","&sharp;":"\u266F","&shchcy;":"\u0449","&shcy;":"\u0448","&shortmid;":"\u2223","&shortparallel;":"\u2225","&shy":"\xAD","&shy;":"\xAD","&sigma;":"\u03C3","&sigmaf;":"\u03C2","&sigmav;":"\u03C2","&sim;":"\u223C","&simdot;":"\u2A6A","&sime;":"\u2243","&simeq;":"\u2243","&simg;":"\u2A9E","&simgE;":"\u2AA0","&siml;":"\u2A9D","&simlE;":"\u2A9F","&simne;":"\u2246","&simplus;":"\u2A24","&simrarr;":"\u2972","&slarr;":"\u2190","&smallsetminus;":"\u2216","&smashp;":"\u2A33","&smeparsl;":"\u29E4","&smid;":"\u2223","&smile;":"\u2323","&smt;":"\u2AAA","&smte;":"\u2AAC","&smtes;":"\u2AAC\uFE00","&softcy;":"\u044C","&sol;":"/","&solb;":"\u29C4","&solbar;":"\u233F","&sopf;":"\u{1D564}","&spades;":"\u2660","&spadesuit;":"\u2660","&spar;":"\u2225","&sqcap;":"\u2293","&sqcaps;":"\u2293\uFE00","&sqcup;":"\u2294","&sqcups;":"\u2294\uFE00","&sqsub;":"\u228F","&sqsube;":"\u2291","&sqsubset;":"\u228F","&sqsubseteq;":"\u2291","&sqsup;":"\u2290","&sqsupe;":"\u2292","&sqsupset;":"\u2290","&sqsupseteq;":"\u2292","&squ;":"\u25A1","&square;":"\u25A1","&squarf;":"\u25AA","&squf;":"\u25AA","&srarr;":"\u2192","&sscr;":"\u{1D4C8}","&ssetmn;":"\u2216","&ssmile;":"\u2323","&sstarf;":"\u22C6","&star;":"\u2606","&starf;":"\u2605","&straightepsilon;":"\u03F5","&straightphi;":"\u03D5","&strns;":"\xAF","&sub;":"\u2282","&subE;":"\u2AC5","&subdot;":"\u2ABD","&sube;":"\u2286","&subedot;":"\u2AC3","&submult;":"\u2AC1","&subnE;":"\u2ACB","&subne;":"\u228A","&subplus;":"\u2ABF","&subrarr;":"\u2979","&subset;":"\u2282","&subseteq;":"\u2286","&subseteqq;":"\u2AC5","&subsetneq;":"\u228A","&subsetneqq;":"\u2ACB","&subsim;":"\u2AC7","&subsub;":"\u2AD5","&subsup;":"\u2AD3","&succ;":"\u227B","&succapprox;":"\u2AB8","&succcurlyeq;":"\u227D","&succeq;":"\u2AB0","&succnapprox;":"\u2ABA","&succneqq;":"\u2AB6","&succnsim;":"\u22E9","&succsim;":"\u227F","&sum;":"\u2211","&sung;":"\u266A","&sup1":"\xB9","&sup1;":"\xB9","&sup2":"\xB2","&sup2;":"\xB2","&sup3":"\xB3","&sup3;":"\xB3","&sup;":"\u2283","&supE;":"\u2AC6","&supdot;":"\u2ABE","&supdsub;":"\u2AD8","&supe;":"\u2287","&supedot;":"\u2AC4","&suphsol;":"\u27C9","&suphsub;":"\u2AD7","&suplarr;":"\u297B","&supmult;":"\u2AC2","&supnE;":"\u2ACC","&supne;":"\u228B","&supplus;":"\u2AC0","&supset;":"\u2283","&supseteq;":"\u2287","&supseteqq;":"\u2AC6","&supsetneq;":"\u228B","&supsetneqq;":"\u2ACC","&supsim;":"\u2AC8","&supsub;":"\u2AD4","&supsup;":"\u2AD6","&swArr;":"\u21D9","&swarhk;":"\u2926","&swarr;":"\u2199","&swarrow;":"\u2199","&swnwar;":"\u292A","&szlig":"\xDF","&szlig;":"\xDF","&target;":"\u2316","&tau;":"\u03C4","&tbrk;":"\u23B4","&tcaron;":"\u0165","&tcedil;":"\u0163","&tcy;":"\u0442","&tdot;":"\u20DB","&telrec;":"\u2315","&tfr;":"\u{1D531}","&there4;":"\u2234","&therefore;":"\u2234","&theta;":"\u03B8","&thetasym;":"\u03D1","&thetav;":"\u03D1","&thickapprox;":"\u2248","&thicksim;":"\u223C","&thinsp;":"\u2009","&thkap;":"\u2248","&thksim;":"\u223C","&thorn":"\xFE","&thorn;":"\xFE","&tilde;":"\u02DC","&times":"\xD7","&times;":"\xD7","&timesb;":"\u22A0","&timesbar;":"\u2A31","&timesd;":"\u2A30","&tint;":"\u222D","&toea;":"\u2928","&top;":"\u22A4","&topbot;":"\u2336","&topcir;":"\u2AF1","&topf;":"\u{1D565}","&topfork;":"\u2ADA","&tosa;":"\u2929","&tprime;":"\u2034","&trade;":"\u2122","&triangle;":"\u25B5","&triangledown;":"\u25BF","&triangleleft;":"\u25C3","&trianglelefteq;":"\u22B4","&triangleq;":"\u225C","&triangleright;":"\u25B9","&trianglerighteq;":"\u22B5","&tridot;":"\u25EC","&trie;":"\u225C","&triminus;":"\u2A3A","&triplus;":"\u2A39","&trisb;":"\u29CD","&tritime;":"\u2A3B","&trpezium;":"\u23E2","&tscr;":"\u{1D4C9}","&tscy;":"\u0446","&tshcy;":"\u045B","&tstrok;":"\u0167","&twixt;":"\u226C","&twoheadleftarrow;":"\u219E","&twoheadrightarrow;":"\u21A0","&uArr;":"\u21D1","&uHar;":"\u2963","&uacute":"\xFA","&uacute;":"\xFA","&uarr;":"\u2191","&ubrcy;":"\u045E","&ubreve;":"\u016D","&ucirc":"\xFB","&ucirc;":"\xFB","&ucy;":"\u0443","&udarr;":"\u21C5","&udblac;":"\u0171","&udhar;":"\u296E","&ufisht;":"\u297E","&ufr;":"\u{1D532}","&ugrave":"\xF9","&ugrave;":"\xF9","&uharl;":"\u21BF","&uharr;":"\u21BE","&uhblk;":"\u2580","&ulcorn;":"\u231C","&ulcorner;":"\u231C","&ulcrop;":"\u230F","&ultri;":"\u25F8","&umacr;":"\u016B","&uml":"\xA8","&uml;":"\xA8","&uogon;":"\u0173","&uopf;":"\u{1D566}","&uparrow;":"\u2191","&updownarrow;":"\u2195","&upharpoonleft;":"\u21BF","&upharpoonright;":"\u21BE","&uplus;":"\u228E","&upsi;":"\u03C5","&upsih;":"\u03D2","&upsilon;":"\u03C5","&upuparrows;":"\u21C8","&urcorn;":"\u231D","&urcorner;":"\u231D","&urcrop;":"\u230E","&uring;":"\u016F","&urtri;":"\u25F9","&uscr;":"\u{1D4CA}","&utdot;":"\u22F0","&utilde;":"\u0169","&utri;":"\u25B5","&utrif;":"\u25B4","&uuarr;":"\u21C8","&uuml":"\xFC","&uuml;":"\xFC","&uwangle;":"\u29A7","&vArr;":"\u21D5","&vBar;":"\u2AE8","&vBarv;":"\u2AE9","&vDash;":"\u22A8","&vangrt;":"\u299C","&varepsilon;":"\u03F5","&varkappa;":"\u03F0","&varnothing;":"\u2205","&varphi;":"\u03D5","&varpi;":"\u03D6","&varpropto;":"\u221D","&varr;":"\u2195","&varrho;":"\u03F1","&varsigma;":"\u03C2","&varsubsetneq;":"\u228A\uFE00","&varsubsetneqq;":"\u2ACB\uFE00","&varsupsetneq;":"\u228B\uFE00","&varsupsetneqq;":"\u2ACC\uFE00","&vartheta;":"\u03D1","&vartriangleleft;":"\u22B2","&vartriangleright;":"\u22B3","&vcy;":"\u0432","&vdash;":"\u22A2","&vee;":"\u2228","&veebar;":"\u22BB","&veeeq;":"\u225A","&vellip;":"\u22EE","&verbar;":"|","&vert;":"|","&vfr;":"\u{1D533}","&vltri;":"\u22B2","&vnsub;":"\u2282\u20D2","&vnsup;":"\u2283\u20D2","&vopf;":"\u{1D567}","&vprop;":"\u221D","&vrtri;":"\u22B3","&vscr;":"\u{1D4CB}","&vsubnE;":"\u2ACB\uFE00","&vsubne;":"\u228A\uFE00","&vsupnE;":"\u2ACC\uFE00","&vsupne;":"\u228B\uFE00","&vzigzag;":"\u299A","&wcirc;":"\u0175","&wedbar;":"\u2A5F","&wedge;":"\u2227","&wedgeq;":"\u2259","&weierp;":"\u2118","&wfr;":"\u{1D534}","&wopf;":"\u{1D568}","&wp;":"\u2118","&wr;":"\u2240","&wreath;":"\u2240","&wscr;":"\u{1D4CC}","&xcap;":"\u22C2","&xcirc;":"\u25EF","&xcup;":"\u22C3","&xdtri;":"\u25BD","&xfr;":"\u{1D535}","&xhArr;":"\u27FA","&xharr;":"\u27F7","&xi;":"\u03BE","&xlArr;":"\u27F8","&xlarr;":"\u27F5","&xmap;":"\u27FC","&xnis;":"\u22FB","&xodot;":"\u2A00","&xopf;":"\u{1D569}","&xoplus;":"\u2A01","&xotime;":"\u2A02","&xrArr;":"\u27F9","&xrarr;":"\u27F6","&xscr;":"\u{1D4CD}","&xsqcup;":"\u2A06","&xuplus;":"\u2A04","&xutri;":"\u25B3","&xvee;":"\u22C1","&xwedge;":"\u22C0","&yacute":"\xFD","&yacute;":"\xFD","&yacy;":"\u044F","&ycirc;":"\u0177","&ycy;":"\u044B","&yen":"\xA5","&yen;":"\xA5","&yfr;":"\u{1D536}","&yicy;":"\u0457","&yopf;":"\u{1D56A}","&yscr;":"\u{1D4CE}","&yucy;":"\u044E","&yuml":"\xFF","&yuml;":"\xFF","&zacute;":"\u017A","&zcaron;":"\u017E","&zcy;":"\u0437","&zdot;":"\u017C","&zeetrf;":"\u2128","&zeta;":"\u03B6","&zfr;":"\u{1D537}","&zhcy;":"\u0436","&zigrarr;":"\u21DD","&zopf;":"\u{1D56B}","&zscr;":"\u{1D4CF}","&zwj;":"\u200D","&zwnj;":"\u200C"};var Gi=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Vi(t){return t.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof gr[e]=="string")return gr[e];if(r.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;r.charAt(1).toLowerCase()==="x"?n=parseInt(r.slice(2),16):n=parseInt(r.slice(1),10);let s="";return n===0||n>=55296&&n<=57343||n>1114111?"\uFFFD":(n=Gi.get(n)??n,n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}var ws=t=>t.toString(16).toUpperCase().padStart(2,"0");function Ce(t){return t.trim().replace(/[<>"'?&]/g,e=>"&#x"+ws(e.charCodeAt(0))+";")}var Wi=/[^A-Za-z0-9\-._~!$'()*+,;:@]+/g,Zi=Array.from({length:256},(t,e)=>"%"+ws(e));function Yi(t){return t.replace(Wi,e=>Array.from(ne.encode(e),r=>Zi[r]).join(""))}function Ds(t){return"<div>"+Ce(t).replace(/\n/g,"<br />")+"</div>"}function xs(t,e){let r=1/0,n=null;return s=>((s<r||n&&s>n.index)&&(e.lastIndex=s,n=e.exec(t),r=s),n)}function Es(t,e){let r=t.lastIndexOf(">")+1;return e(t.slice(0,r))+t.slice(r)}function Je(t,e,r){return Es(t,n=>n.replace(e,r))}function ys(t,e,r,n){let s=[],i=0,o=0;for(;;){e.lastIndex=o;let u=e.exec(t);if(!u)break;let a=u.index,c=t.indexOf(">",a);if(c<0)break;r.lastIndex=a;let l=r.exec(t);if(!l){o=c+1;continue}s.push(t.slice(i,a),n(...l)),i=o=a+l[0].length}return s.push(t.slice(i)),s.join("")}function xr(t,e,r,n,s,i){let o=xs(t,/>/g),u=xs(t,n),a=[],c=0,l=0;for(;;){e.lastIndex=l;let f=e.exec(t);if(!f)break;let h=f.index;l=h+1;let p=h+f[0].length;if(r){let y=o(p);if(!y)break;p=y.index+1}let g=u(p);if(!g)break;let m=g.index+g[0].length;if(s){let y=o(m);if(!y)break;m=y.index+1}a.push(t.slice(c,h),i),c=l=m}return a.push(t.slice(c)),a.join("")}function yr(t,e){let r=t.lastIndexOf(">"),n=-1;e.lastIndex=0;let s;for(;(s=e.exec(t))&&s.index<r;)n=s.index;return n<0?t:t.slice(t.indexOf(">",n)+1)}function bs(t,e){e.lastIndex=0;let r=e.exec(t);return r&&r.index<t.lastIndexOf(">")?t.slice(0,r.index):t}function Bs(t){return t=t.replace(/\r\n|[\n\r\u2028\u2029]/g,""),t=xr(t,/<!--/g,!1,/-->/g,!1," "),t=Je(t,/<br\b[^>]*>/gi,`
5
+ `),a=u.indexOf(":"),c=a<0?u:u.slice(0,a);this.rawHeaderLines.push({key:c.toLowerCase(),line:u});let l=o.join("");a=l.indexOf(":");let f=a<0?l:l.slice(0,a),h=a<0?"":ji(Ze(l.slice(a+1)));this.headers.push({key:f.toLowerCase(),originalKey:f,value:h});let p=f.toLowerCase();if(Ki.has(p)&&!r.has(p))switch(r.add(p),p){case"content-type":this.contentType.value=h;break;case"content-transfer-encoding":this.contentTransferEncoding.value=h;break;case"content-disposition":this.contentDisposition.value=h;break;case"content-id":this.contentId=h;break;case"content-description":this.contentDescription=h;break}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.slice(this.contentType.parsed.value.indexOf("/")+1):!1;let n=this.contentType.multipart?(this.contentType.parsed.params.boundary||"").trimEnd():"";/[^\x00-\x7f]/.test(n)&&(n=""),this.contentType.multipart&&!n&&(this.contentType.parsed.value="text/plain",this.contentType.multipart=!1),this.contentType.multipart&&this.postalMime.boundaries.push({value:ne.encode(n),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value);let s=this.contentDisposition.parsed.value,i=s.search(/[ \t]/);i>=0&&(this.contentDisposition.parsed.value=s.slice(0,i)),this.contentTransferEncoding.encoding=(this.stripComments(this.contentTransferEncoding.value).toLowerCase().match(/^[ \t]*([\w-]+)/)||["",""])[1],this.setupContentDecoder(this.contentTransferEncoding.encoding),this.headerLines=[]}endHeaders(){this.state="body",this.processHeaders()}feed(e,r){switch(this.state){case"header":{if(!e.length)return this.endHeaders(),!1;this.postalMime.counters.headerSize+=Math.max(e.length,$i);let n=this.postalMime.limits.maxHeadersSize;if(this.postalMime.counters.headerSize>n)throw Q("EMAXHEADERSIZE",`Maximum header size of ${n} bytes exceeded`);let s=Tt(e,Mi);if(!ae(e[0])&&!zi.test(s))return this.endHeaders(),!0;this.headerLines.push(s);break}case"body":this.contentDecoder&&this.contentDecoder.update(e,r);break}return!1}};var xr={"&AElig":"\xC6","&AElig;":"\xC6","&AMP":"&","&AMP;":"&","&Aacute":"\xC1","&Aacute;":"\xC1","&Abreve;":"\u0102","&Acirc":"\xC2","&Acirc;":"\xC2","&Acy;":"\u0410","&Afr;":"\u{1D504}","&Agrave":"\xC0","&Agrave;":"\xC0","&Alpha;":"\u0391","&Amacr;":"\u0100","&And;":"\u2A53","&Aogon;":"\u0104","&Aopf;":"\u{1D538}","&ApplyFunction;":"\u2061","&Aring":"\xC5","&Aring;":"\xC5","&Ascr;":"\u{1D49C}","&Assign;":"\u2254","&Atilde":"\xC3","&Atilde;":"\xC3","&Auml":"\xC4","&Auml;":"\xC4","&Backslash;":"\u2216","&Barv;":"\u2AE7","&Barwed;":"\u2306","&Bcy;":"\u0411","&Because;":"\u2235","&Bernoullis;":"\u212C","&Beta;":"\u0392","&Bfr;":"\u{1D505}","&Bopf;":"\u{1D539}","&Breve;":"\u02D8","&Bscr;":"\u212C","&Bumpeq;":"\u224E","&CHcy;":"\u0427","&COPY":"\xA9","&COPY;":"\xA9","&Cacute;":"\u0106","&Cap;":"\u22D2","&CapitalDifferentialD;":"\u2145","&Cayleys;":"\u212D","&Ccaron;":"\u010C","&Ccedil":"\xC7","&Ccedil;":"\xC7","&Ccirc;":"\u0108","&Cconint;":"\u2230","&Cdot;":"\u010A","&Cedilla;":"\xB8","&CenterDot;":"\xB7","&Cfr;":"\u212D","&Chi;":"\u03A7","&CircleDot;":"\u2299","&CircleMinus;":"\u2296","&CirclePlus;":"\u2295","&CircleTimes;":"\u2297","&ClockwiseContourIntegral;":"\u2232","&CloseCurlyDoubleQuote;":"\u201D","&CloseCurlyQuote;":"\u2019","&Colon;":"\u2237","&Colone;":"\u2A74","&Congruent;":"\u2261","&Conint;":"\u222F","&ContourIntegral;":"\u222E","&Copf;":"\u2102","&Coproduct;":"\u2210","&CounterClockwiseContourIntegral;":"\u2233","&Cross;":"\u2A2F","&Cscr;":"\u{1D49E}","&Cup;":"\u22D3","&CupCap;":"\u224D","&DD;":"\u2145","&DDotrahd;":"\u2911","&DJcy;":"\u0402","&DScy;":"\u0405","&DZcy;":"\u040F","&Dagger;":"\u2021","&Darr;":"\u21A1","&Dashv;":"\u2AE4","&Dcaron;":"\u010E","&Dcy;":"\u0414","&Del;":"\u2207","&Delta;":"\u0394","&Dfr;":"\u{1D507}","&DiacriticalAcute;":"\xB4","&DiacriticalDot;":"\u02D9","&DiacriticalDoubleAcute;":"\u02DD","&DiacriticalGrave;":"`","&DiacriticalTilde;":"\u02DC","&Diamond;":"\u22C4","&DifferentialD;":"\u2146","&Dopf;":"\u{1D53B}","&Dot;":"\xA8","&DotDot;":"\u20DC","&DotEqual;":"\u2250","&DoubleContourIntegral;":"\u222F","&DoubleDot;":"\xA8","&DoubleDownArrow;":"\u21D3","&DoubleLeftArrow;":"\u21D0","&DoubleLeftRightArrow;":"\u21D4","&DoubleLeftTee;":"\u2AE4","&DoubleLongLeftArrow;":"\u27F8","&DoubleLongLeftRightArrow;":"\u27FA","&DoubleLongRightArrow;":"\u27F9","&DoubleRightArrow;":"\u21D2","&DoubleRightTee;":"\u22A8","&DoubleUpArrow;":"\u21D1","&DoubleUpDownArrow;":"\u21D5","&DoubleVerticalBar;":"\u2225","&DownArrow;":"\u2193","&DownArrowBar;":"\u2913","&DownArrowUpArrow;":"\u21F5","&DownBreve;":"\u0311","&DownLeftRightVector;":"\u2950","&DownLeftTeeVector;":"\u295E","&DownLeftVector;":"\u21BD","&DownLeftVectorBar;":"\u2956","&DownRightTeeVector;":"\u295F","&DownRightVector;":"\u21C1","&DownRightVectorBar;":"\u2957","&DownTee;":"\u22A4","&DownTeeArrow;":"\u21A7","&Downarrow;":"\u21D3","&Dscr;":"\u{1D49F}","&Dstrok;":"\u0110","&ENG;":"\u014A","&ETH":"\xD0","&ETH;":"\xD0","&Eacute":"\xC9","&Eacute;":"\xC9","&Ecaron;":"\u011A","&Ecirc":"\xCA","&Ecirc;":"\xCA","&Ecy;":"\u042D","&Edot;":"\u0116","&Efr;":"\u{1D508}","&Egrave":"\xC8","&Egrave;":"\xC8","&Element;":"\u2208","&Emacr;":"\u0112","&EmptySmallSquare;":"\u25FB","&EmptyVerySmallSquare;":"\u25AB","&Eogon;":"\u0118","&Eopf;":"\u{1D53C}","&Epsilon;":"\u0395","&Equal;":"\u2A75","&EqualTilde;":"\u2242","&Equilibrium;":"\u21CC","&Escr;":"\u2130","&Esim;":"\u2A73","&Eta;":"\u0397","&Euml":"\xCB","&Euml;":"\xCB","&Exists;":"\u2203","&ExponentialE;":"\u2147","&Fcy;":"\u0424","&Ffr;":"\u{1D509}","&FilledSmallSquare;":"\u25FC","&FilledVerySmallSquare;":"\u25AA","&Fopf;":"\u{1D53D}","&ForAll;":"\u2200","&Fouriertrf;":"\u2131","&Fscr;":"\u2131","&GJcy;":"\u0403","&GT":">","&GT;":">","&Gamma;":"\u0393","&Gammad;":"\u03DC","&Gbreve;":"\u011E","&Gcedil;":"\u0122","&Gcirc;":"\u011C","&Gcy;":"\u0413","&Gdot;":"\u0120","&Gfr;":"\u{1D50A}","&Gg;":"\u22D9","&Gopf;":"\u{1D53E}","&GreaterEqual;":"\u2265","&GreaterEqualLess;":"\u22DB","&GreaterFullEqual;":"\u2267","&GreaterGreater;":"\u2AA2","&GreaterLess;":"\u2277","&GreaterSlantEqual;":"\u2A7E","&GreaterTilde;":"\u2273","&Gscr;":"\u{1D4A2}","&Gt;":"\u226B","&HARDcy;":"\u042A","&Hacek;":"\u02C7","&Hat;":"^","&Hcirc;":"\u0124","&Hfr;":"\u210C","&HilbertSpace;":"\u210B","&Hopf;":"\u210D","&HorizontalLine;":"\u2500","&Hscr;":"\u210B","&Hstrok;":"\u0126","&HumpDownHump;":"\u224E","&HumpEqual;":"\u224F","&IEcy;":"\u0415","&IJlig;":"\u0132","&IOcy;":"\u0401","&Iacute":"\xCD","&Iacute;":"\xCD","&Icirc":"\xCE","&Icirc;":"\xCE","&Icy;":"\u0418","&Idot;":"\u0130","&Ifr;":"\u2111","&Igrave":"\xCC","&Igrave;":"\xCC","&Im;":"\u2111","&Imacr;":"\u012A","&ImaginaryI;":"\u2148","&Implies;":"\u21D2","&Int;":"\u222C","&Integral;":"\u222B","&Intersection;":"\u22C2","&InvisibleComma;":"\u2063","&InvisibleTimes;":"\u2062","&Iogon;":"\u012E","&Iopf;":"\u{1D540}","&Iota;":"\u0399","&Iscr;":"\u2110","&Itilde;":"\u0128","&Iukcy;":"\u0406","&Iuml":"\xCF","&Iuml;":"\xCF","&Jcirc;":"\u0134","&Jcy;":"\u0419","&Jfr;":"\u{1D50D}","&Jopf;":"\u{1D541}","&Jscr;":"\u{1D4A5}","&Jsercy;":"\u0408","&Jukcy;":"\u0404","&KHcy;":"\u0425","&KJcy;":"\u040C","&Kappa;":"\u039A","&Kcedil;":"\u0136","&Kcy;":"\u041A","&Kfr;":"\u{1D50E}","&Kopf;":"\u{1D542}","&Kscr;":"\u{1D4A6}","&LJcy;":"\u0409","&LT":"<","&LT;":"<","&Lacute;":"\u0139","&Lambda;":"\u039B","&Lang;":"\u27EA","&Laplacetrf;":"\u2112","&Larr;":"\u219E","&Lcaron;":"\u013D","&Lcedil;":"\u013B","&Lcy;":"\u041B","&LeftAngleBracket;":"\u27E8","&LeftArrow;":"\u2190","&LeftArrowBar;":"\u21E4","&LeftArrowRightArrow;":"\u21C6","&LeftCeiling;":"\u2308","&LeftDoubleBracket;":"\u27E6","&LeftDownTeeVector;":"\u2961","&LeftDownVector;":"\u21C3","&LeftDownVectorBar;":"\u2959","&LeftFloor;":"\u230A","&LeftRightArrow;":"\u2194","&LeftRightVector;":"\u294E","&LeftTee;":"\u22A3","&LeftTeeArrow;":"\u21A4","&LeftTeeVector;":"\u295A","&LeftTriangle;":"\u22B2","&LeftTriangleBar;":"\u29CF","&LeftTriangleEqual;":"\u22B4","&LeftUpDownVector;":"\u2951","&LeftUpTeeVector;":"\u2960","&LeftUpVector;":"\u21BF","&LeftUpVectorBar;":"\u2958","&LeftVector;":"\u21BC","&LeftVectorBar;":"\u2952","&Leftarrow;":"\u21D0","&Leftrightarrow;":"\u21D4","&LessEqualGreater;":"\u22DA","&LessFullEqual;":"\u2266","&LessGreater;":"\u2276","&LessLess;":"\u2AA1","&LessSlantEqual;":"\u2A7D","&LessTilde;":"\u2272","&Lfr;":"\u{1D50F}","&Ll;":"\u22D8","&Lleftarrow;":"\u21DA","&Lmidot;":"\u013F","&LongLeftArrow;":"\u27F5","&LongLeftRightArrow;":"\u27F7","&LongRightArrow;":"\u27F6","&Longleftarrow;":"\u27F8","&Longleftrightarrow;":"\u27FA","&Longrightarrow;":"\u27F9","&Lopf;":"\u{1D543}","&LowerLeftArrow;":"\u2199","&LowerRightArrow;":"\u2198","&Lscr;":"\u2112","&Lsh;":"\u21B0","&Lstrok;":"\u0141","&Lt;":"\u226A","&Map;":"\u2905","&Mcy;":"\u041C","&MediumSpace;":"\u205F","&Mellintrf;":"\u2133","&Mfr;":"\u{1D510}","&MinusPlus;":"\u2213","&Mopf;":"\u{1D544}","&Mscr;":"\u2133","&Mu;":"\u039C","&NJcy;":"\u040A","&Nacute;":"\u0143","&Ncaron;":"\u0147","&Ncedil;":"\u0145","&Ncy;":"\u041D","&NegativeMediumSpace;":"\u200B","&NegativeThickSpace;":"\u200B","&NegativeThinSpace;":"\u200B","&NegativeVeryThinSpace;":"\u200B","&NestedGreaterGreater;":"\u226B","&NestedLessLess;":"\u226A","&NewLine;":`
6
+ `,"&Nfr;":"\u{1D511}","&NoBreak;":"\u2060","&NonBreakingSpace;":"\xA0","&Nopf;":"\u2115","&Not;":"\u2AEC","&NotCongruent;":"\u2262","&NotCupCap;":"\u226D","&NotDoubleVerticalBar;":"\u2226","&NotElement;":"\u2209","&NotEqual;":"\u2260","&NotEqualTilde;":"\u2242\u0338","&NotExists;":"\u2204","&NotGreater;":"\u226F","&NotGreaterEqual;":"\u2271","&NotGreaterFullEqual;":"\u2267\u0338","&NotGreaterGreater;":"\u226B\u0338","&NotGreaterLess;":"\u2279","&NotGreaterSlantEqual;":"\u2A7E\u0338","&NotGreaterTilde;":"\u2275","&NotHumpDownHump;":"\u224E\u0338","&NotHumpEqual;":"\u224F\u0338","&NotLeftTriangle;":"\u22EA","&NotLeftTriangleBar;":"\u29CF\u0338","&NotLeftTriangleEqual;":"\u22EC","&NotLess;":"\u226E","&NotLessEqual;":"\u2270","&NotLessGreater;":"\u2278","&NotLessLess;":"\u226A\u0338","&NotLessSlantEqual;":"\u2A7D\u0338","&NotLessTilde;":"\u2274","&NotNestedGreaterGreater;":"\u2AA2\u0338","&NotNestedLessLess;":"\u2AA1\u0338","&NotPrecedes;":"\u2280","&NotPrecedesEqual;":"\u2AAF\u0338","&NotPrecedesSlantEqual;":"\u22E0","&NotReverseElement;":"\u220C","&NotRightTriangle;":"\u22EB","&NotRightTriangleBar;":"\u29D0\u0338","&NotRightTriangleEqual;":"\u22ED","&NotSquareSubset;":"\u228F\u0338","&NotSquareSubsetEqual;":"\u22E2","&NotSquareSuperset;":"\u2290\u0338","&NotSquareSupersetEqual;":"\u22E3","&NotSubset;":"\u2282\u20D2","&NotSubsetEqual;":"\u2288","&NotSucceeds;":"\u2281","&NotSucceedsEqual;":"\u2AB0\u0338","&NotSucceedsSlantEqual;":"\u22E1","&NotSucceedsTilde;":"\u227F\u0338","&NotSuperset;":"\u2283\u20D2","&NotSupersetEqual;":"\u2289","&NotTilde;":"\u2241","&NotTildeEqual;":"\u2244","&NotTildeFullEqual;":"\u2247","&NotTildeTilde;":"\u2249","&NotVerticalBar;":"\u2224","&Nscr;":"\u{1D4A9}","&Ntilde":"\xD1","&Ntilde;":"\xD1","&Nu;":"\u039D","&OElig;":"\u0152","&Oacute":"\xD3","&Oacute;":"\xD3","&Ocirc":"\xD4","&Ocirc;":"\xD4","&Ocy;":"\u041E","&Odblac;":"\u0150","&Ofr;":"\u{1D512}","&Ograve":"\xD2","&Ograve;":"\xD2","&Omacr;":"\u014C","&Omega;":"\u03A9","&Omicron;":"\u039F","&Oopf;":"\u{1D546}","&OpenCurlyDoubleQuote;":"\u201C","&OpenCurlyQuote;":"\u2018","&Or;":"\u2A54","&Oscr;":"\u{1D4AA}","&Oslash":"\xD8","&Oslash;":"\xD8","&Otilde":"\xD5","&Otilde;":"\xD5","&Otimes;":"\u2A37","&Ouml":"\xD6","&Ouml;":"\xD6","&OverBar;":"\u203E","&OverBrace;":"\u23DE","&OverBracket;":"\u23B4","&OverParenthesis;":"\u23DC","&PartialD;":"\u2202","&Pcy;":"\u041F","&Pfr;":"\u{1D513}","&Phi;":"\u03A6","&Pi;":"\u03A0","&PlusMinus;":"\xB1","&Poincareplane;":"\u210C","&Popf;":"\u2119","&Pr;":"\u2ABB","&Precedes;":"\u227A","&PrecedesEqual;":"\u2AAF","&PrecedesSlantEqual;":"\u227C","&PrecedesTilde;":"\u227E","&Prime;":"\u2033","&Product;":"\u220F","&Proportion;":"\u2237","&Proportional;":"\u221D","&Pscr;":"\u{1D4AB}","&Psi;":"\u03A8","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"\u{1D514}","&Qopf;":"\u211A","&Qscr;":"\u{1D4AC}","&RBarr;":"\u2910","&REG":"\xAE","&REG;":"\xAE","&Racute;":"\u0154","&Rang;":"\u27EB","&Rarr;":"\u21A0","&Rarrtl;":"\u2916","&Rcaron;":"\u0158","&Rcedil;":"\u0156","&Rcy;":"\u0420","&Re;":"\u211C","&ReverseElement;":"\u220B","&ReverseEquilibrium;":"\u21CB","&ReverseUpEquilibrium;":"\u296F","&Rfr;":"\u211C","&Rho;":"\u03A1","&RightAngleBracket;":"\u27E9","&RightArrow;":"\u2192","&RightArrowBar;":"\u21E5","&RightArrowLeftArrow;":"\u21C4","&RightCeiling;":"\u2309","&RightDoubleBracket;":"\u27E7","&RightDownTeeVector;":"\u295D","&RightDownVector;":"\u21C2","&RightDownVectorBar;":"\u2955","&RightFloor;":"\u230B","&RightTee;":"\u22A2","&RightTeeArrow;":"\u21A6","&RightTeeVector;":"\u295B","&RightTriangle;":"\u22B3","&RightTriangleBar;":"\u29D0","&RightTriangleEqual;":"\u22B5","&RightUpDownVector;":"\u294F","&RightUpTeeVector;":"\u295C","&RightUpVector;":"\u21BE","&RightUpVectorBar;":"\u2954","&RightVector;":"\u21C0","&RightVectorBar;":"\u2953","&Rightarrow;":"\u21D2","&Ropf;":"\u211D","&RoundImplies;":"\u2970","&Rrightarrow;":"\u21DB","&Rscr;":"\u211B","&Rsh;":"\u21B1","&RuleDelayed;":"\u29F4","&SHCHcy;":"\u0429","&SHcy;":"\u0428","&SOFTcy;":"\u042C","&Sacute;":"\u015A","&Sc;":"\u2ABC","&Scaron;":"\u0160","&Scedil;":"\u015E","&Scirc;":"\u015C","&Scy;":"\u0421","&Sfr;":"\u{1D516}","&ShortDownArrow;":"\u2193","&ShortLeftArrow;":"\u2190","&ShortRightArrow;":"\u2192","&ShortUpArrow;":"\u2191","&Sigma;":"\u03A3","&SmallCircle;":"\u2218","&Sopf;":"\u{1D54A}","&Sqrt;":"\u221A","&Square;":"\u25A1","&SquareIntersection;":"\u2293","&SquareSubset;":"\u228F","&SquareSubsetEqual;":"\u2291","&SquareSuperset;":"\u2290","&SquareSupersetEqual;":"\u2292","&SquareUnion;":"\u2294","&Sscr;":"\u{1D4AE}","&Star;":"\u22C6","&Sub;":"\u22D0","&Subset;":"\u22D0","&SubsetEqual;":"\u2286","&Succeeds;":"\u227B","&SucceedsEqual;":"\u2AB0","&SucceedsSlantEqual;":"\u227D","&SucceedsTilde;":"\u227F","&SuchThat;":"\u220B","&Sum;":"\u2211","&Sup;":"\u22D1","&Superset;":"\u2283","&SupersetEqual;":"\u2287","&Supset;":"\u22D1","&THORN":"\xDE","&THORN;":"\xDE","&TRADE;":"\u2122","&TSHcy;":"\u040B","&TScy;":"\u0426","&Tab;":" ","&Tau;":"\u03A4","&Tcaron;":"\u0164","&Tcedil;":"\u0162","&Tcy;":"\u0422","&Tfr;":"\u{1D517}","&Therefore;":"\u2234","&Theta;":"\u0398","&ThickSpace;":"\u205F\u200A","&ThinSpace;":"\u2009","&Tilde;":"\u223C","&TildeEqual;":"\u2243","&TildeFullEqual;":"\u2245","&TildeTilde;":"\u2248","&Topf;":"\u{1D54B}","&TripleDot;":"\u20DB","&Tscr;":"\u{1D4AF}","&Tstrok;":"\u0166","&Uacute":"\xDA","&Uacute;":"\xDA","&Uarr;":"\u219F","&Uarrocir;":"\u2949","&Ubrcy;":"\u040E","&Ubreve;":"\u016C","&Ucirc":"\xDB","&Ucirc;":"\xDB","&Ucy;":"\u0423","&Udblac;":"\u0170","&Ufr;":"\u{1D518}","&Ugrave":"\xD9","&Ugrave;":"\xD9","&Umacr;":"\u016A","&UnderBar;":"_","&UnderBrace;":"\u23DF","&UnderBracket;":"\u23B5","&UnderParenthesis;":"\u23DD","&Union;":"\u22C3","&UnionPlus;":"\u228E","&Uogon;":"\u0172","&Uopf;":"\u{1D54C}","&UpArrow;":"\u2191","&UpArrowBar;":"\u2912","&UpArrowDownArrow;":"\u21C5","&UpDownArrow;":"\u2195","&UpEquilibrium;":"\u296E","&UpTee;":"\u22A5","&UpTeeArrow;":"\u21A5","&Uparrow;":"\u21D1","&Updownarrow;":"\u21D5","&UpperLeftArrow;":"\u2196","&UpperRightArrow;":"\u2197","&Upsi;":"\u03D2","&Upsilon;":"\u03A5","&Uring;":"\u016E","&Uscr;":"\u{1D4B0}","&Utilde;":"\u0168","&Uuml":"\xDC","&Uuml;":"\xDC","&VDash;":"\u22AB","&Vbar;":"\u2AEB","&Vcy;":"\u0412","&Vdash;":"\u22A9","&Vdashl;":"\u2AE6","&Vee;":"\u22C1","&Verbar;":"\u2016","&Vert;":"\u2016","&VerticalBar;":"\u2223","&VerticalLine;":"|","&VerticalSeparator;":"\u2758","&VerticalTilde;":"\u2240","&VeryThinSpace;":"\u200A","&Vfr;":"\u{1D519}","&Vopf;":"\u{1D54D}","&Vscr;":"\u{1D4B1}","&Vvdash;":"\u22AA","&Wcirc;":"\u0174","&Wedge;":"\u22C0","&Wfr;":"\u{1D51A}","&Wopf;":"\u{1D54E}","&Wscr;":"\u{1D4B2}","&Xfr;":"\u{1D51B}","&Xi;":"\u039E","&Xopf;":"\u{1D54F}","&Xscr;":"\u{1D4B3}","&YAcy;":"\u042F","&YIcy;":"\u0407","&YUcy;":"\u042E","&Yacute":"\xDD","&Yacute;":"\xDD","&Ycirc;":"\u0176","&Ycy;":"\u042B","&Yfr;":"\u{1D51C}","&Yopf;":"\u{1D550}","&Yscr;":"\u{1D4B4}","&Yuml;":"\u0178","&ZHcy;":"\u0416","&Zacute;":"\u0179","&Zcaron;":"\u017D","&Zcy;":"\u0417","&Zdot;":"\u017B","&ZeroWidthSpace;":"\u200B","&Zeta;":"\u0396","&Zfr;":"\u2128","&Zopf;":"\u2124","&Zscr;":"\u{1D4B5}","&aacute":"\xE1","&aacute;":"\xE1","&abreve;":"\u0103","&ac;":"\u223E","&acE;":"\u223E\u0333","&acd;":"\u223F","&acirc":"\xE2","&acirc;":"\xE2","&acute":"\xB4","&acute;":"\xB4","&acy;":"\u0430","&aelig":"\xE6","&aelig;":"\xE6","&af;":"\u2061","&afr;":"\u{1D51E}","&agrave":"\xE0","&agrave;":"\xE0","&alefsym;":"\u2135","&aleph;":"\u2135","&alpha;":"\u03B1","&amacr;":"\u0101","&amalg;":"\u2A3F","&amp":"&","&amp;":"&","&and;":"\u2227","&andand;":"\u2A55","&andd;":"\u2A5C","&andslope;":"\u2A58","&andv;":"\u2A5A","&ang;":"\u2220","&ange;":"\u29A4","&angle;":"\u2220","&angmsd;":"\u2221","&angmsdaa;":"\u29A8","&angmsdab;":"\u29A9","&angmsdac;":"\u29AA","&angmsdad;":"\u29AB","&angmsdae;":"\u29AC","&angmsdaf;":"\u29AD","&angmsdag;":"\u29AE","&angmsdah;":"\u29AF","&angrt;":"\u221F","&angrtvb;":"\u22BE","&angrtvbd;":"\u299D","&angsph;":"\u2222","&angst;":"\xC5","&angzarr;":"\u237C","&aogon;":"\u0105","&aopf;":"\u{1D552}","&ap;":"\u2248","&apE;":"\u2A70","&apacir;":"\u2A6F","&ape;":"\u224A","&apid;":"\u224B","&apos;":"'","&approx;":"\u2248","&approxeq;":"\u224A","&aring":"\xE5","&aring;":"\xE5","&ascr;":"\u{1D4B6}","&ast;":"*","&asymp;":"\u2248","&asympeq;":"\u224D","&atilde":"\xE3","&atilde;":"\xE3","&auml":"\xE4","&auml;":"\xE4","&awconint;":"\u2233","&awint;":"\u2A11","&bNot;":"\u2AED","&backcong;":"\u224C","&backepsilon;":"\u03F6","&backprime;":"\u2035","&backsim;":"\u223D","&backsimeq;":"\u22CD","&barvee;":"\u22BD","&barwed;":"\u2305","&barwedge;":"\u2305","&bbrk;":"\u23B5","&bbrktbrk;":"\u23B6","&bcong;":"\u224C","&bcy;":"\u0431","&bdquo;":"\u201E","&becaus;":"\u2235","&because;":"\u2235","&bemptyv;":"\u29B0","&bepsi;":"\u03F6","&bernou;":"\u212C","&beta;":"\u03B2","&beth;":"\u2136","&between;":"\u226C","&bfr;":"\u{1D51F}","&bigcap;":"\u22C2","&bigcirc;":"\u25EF","&bigcup;":"\u22C3","&bigodot;":"\u2A00","&bigoplus;":"\u2A01","&bigotimes;":"\u2A02","&bigsqcup;":"\u2A06","&bigstar;":"\u2605","&bigtriangledown;":"\u25BD","&bigtriangleup;":"\u25B3","&biguplus;":"\u2A04","&bigvee;":"\u22C1","&bigwedge;":"\u22C0","&bkarow;":"\u290D","&blacklozenge;":"\u29EB","&blacksquare;":"\u25AA","&blacktriangle;":"\u25B4","&blacktriangledown;":"\u25BE","&blacktriangleleft;":"\u25C2","&blacktriangleright;":"\u25B8","&blank;":"\u2423","&blk12;":"\u2592","&blk14;":"\u2591","&blk34;":"\u2593","&block;":"\u2588","&bne;":"=\u20E5","&bnequiv;":"\u2261\u20E5","&bnot;":"\u2310","&bopf;":"\u{1D553}","&bot;":"\u22A5","&bottom;":"\u22A5","&bowtie;":"\u22C8","&boxDL;":"\u2557","&boxDR;":"\u2554","&boxDl;":"\u2556","&boxDr;":"\u2553","&boxH;":"\u2550","&boxHD;":"\u2566","&boxHU;":"\u2569","&boxHd;":"\u2564","&boxHu;":"\u2567","&boxUL;":"\u255D","&boxUR;":"\u255A","&boxUl;":"\u255C","&boxUr;":"\u2559","&boxV;":"\u2551","&boxVH;":"\u256C","&boxVL;":"\u2563","&boxVR;":"\u2560","&boxVh;":"\u256B","&boxVl;":"\u2562","&boxVr;":"\u255F","&boxbox;":"\u29C9","&boxdL;":"\u2555","&boxdR;":"\u2552","&boxdl;":"\u2510","&boxdr;":"\u250C","&boxh;":"\u2500","&boxhD;":"\u2565","&boxhU;":"\u2568","&boxhd;":"\u252C","&boxhu;":"\u2534","&boxminus;":"\u229F","&boxplus;":"\u229E","&boxtimes;":"\u22A0","&boxuL;":"\u255B","&boxuR;":"\u2558","&boxul;":"\u2518","&boxur;":"\u2514","&boxv;":"\u2502","&boxvH;":"\u256A","&boxvL;":"\u2561","&boxvR;":"\u255E","&boxvh;":"\u253C","&boxvl;":"\u2524","&boxvr;":"\u251C","&bprime;":"\u2035","&breve;":"\u02D8","&brvbar":"\xA6","&brvbar;":"\xA6","&bscr;":"\u{1D4B7}","&bsemi;":"\u204F","&bsim;":"\u223D","&bsime;":"\u22CD","&bsol;":"\\","&bsolb;":"\u29C5","&bsolhsub;":"\u27C8","&bull;":"\u2022","&bullet;":"\u2022","&bump;":"\u224E","&bumpE;":"\u2AAE","&bumpe;":"\u224F","&bumpeq;":"\u224F","&cacute;":"\u0107","&cap;":"\u2229","&capand;":"\u2A44","&capbrcup;":"\u2A49","&capcap;":"\u2A4B","&capcup;":"\u2A47","&capdot;":"\u2A40","&caps;":"\u2229\uFE00","&caret;":"\u2041","&caron;":"\u02C7","&ccaps;":"\u2A4D","&ccaron;":"\u010D","&ccedil":"\xE7","&ccedil;":"\xE7","&ccirc;":"\u0109","&ccups;":"\u2A4C","&ccupssm;":"\u2A50","&cdot;":"\u010B","&cedil":"\xB8","&cedil;":"\xB8","&cemptyv;":"\u29B2","&cent":"\xA2","&cent;":"\xA2","&centerdot;":"\xB7","&cfr;":"\u{1D520}","&chcy;":"\u0447","&check;":"\u2713","&checkmark;":"\u2713","&chi;":"\u03C7","&cir;":"\u25CB","&cirE;":"\u29C3","&circ;":"\u02C6","&circeq;":"\u2257","&circlearrowleft;":"\u21BA","&circlearrowright;":"\u21BB","&circledR;":"\xAE","&circledS;":"\u24C8","&circledast;":"\u229B","&circledcirc;":"\u229A","&circleddash;":"\u229D","&cire;":"\u2257","&cirfnint;":"\u2A10","&cirmid;":"\u2AEF","&cirscir;":"\u29C2","&clubs;":"\u2663","&clubsuit;":"\u2663","&colon;":":","&colone;":"\u2254","&coloneq;":"\u2254","&comma;":",","&commat;":"@","&comp;":"\u2201","&compfn;":"\u2218","&complement;":"\u2201","&complexes;":"\u2102","&cong;":"\u2245","&congdot;":"\u2A6D","&conint;":"\u222E","&copf;":"\u{1D554}","&coprod;":"\u2210","&copy":"\xA9","&copy;":"\xA9","&copysr;":"\u2117","&crarr;":"\u21B5","&cross;":"\u2717","&cscr;":"\u{1D4B8}","&csub;":"\u2ACF","&csube;":"\u2AD1","&csup;":"\u2AD0","&csupe;":"\u2AD2","&ctdot;":"\u22EF","&cudarrl;":"\u2938","&cudarrr;":"\u2935","&cuepr;":"\u22DE","&cuesc;":"\u22DF","&cularr;":"\u21B6","&cularrp;":"\u293D","&cup;":"\u222A","&cupbrcap;":"\u2A48","&cupcap;":"\u2A46","&cupcup;":"\u2A4A","&cupdot;":"\u228D","&cupor;":"\u2A45","&cups;":"\u222A\uFE00","&curarr;":"\u21B7","&curarrm;":"\u293C","&curlyeqprec;":"\u22DE","&curlyeqsucc;":"\u22DF","&curlyvee;":"\u22CE","&curlywedge;":"\u22CF","&curren":"\xA4","&curren;":"\xA4","&curvearrowleft;":"\u21B6","&curvearrowright;":"\u21B7","&cuvee;":"\u22CE","&cuwed;":"\u22CF","&cwconint;":"\u2232","&cwint;":"\u2231","&cylcty;":"\u232D","&dArr;":"\u21D3","&dHar;":"\u2965","&dagger;":"\u2020","&daleth;":"\u2138","&darr;":"\u2193","&dash;":"\u2010","&dashv;":"\u22A3","&dbkarow;":"\u290F","&dblac;":"\u02DD","&dcaron;":"\u010F","&dcy;":"\u0434","&dd;":"\u2146","&ddagger;":"\u2021","&ddarr;":"\u21CA","&ddotseq;":"\u2A77","&deg":"\xB0","&deg;":"\xB0","&delta;":"\u03B4","&demptyv;":"\u29B1","&dfisht;":"\u297F","&dfr;":"\u{1D521}","&dharl;":"\u21C3","&dharr;":"\u21C2","&diam;":"\u22C4","&diamond;":"\u22C4","&diamondsuit;":"\u2666","&diams;":"\u2666","&die;":"\xA8","&digamma;":"\u03DD","&disin;":"\u22F2","&div;":"\xF7","&divide":"\xF7","&divide;":"\xF7","&divideontimes;":"\u22C7","&divonx;":"\u22C7","&djcy;":"\u0452","&dlcorn;":"\u231E","&dlcrop;":"\u230D","&dollar;":"$","&dopf;":"\u{1D555}","&dot;":"\u02D9","&doteq;":"\u2250","&doteqdot;":"\u2251","&dotminus;":"\u2238","&dotplus;":"\u2214","&dotsquare;":"\u22A1","&doublebarwedge;":"\u2306","&downarrow;":"\u2193","&downdownarrows;":"\u21CA","&downharpoonleft;":"\u21C3","&downharpoonright;":"\u21C2","&drbkarow;":"\u2910","&drcorn;":"\u231F","&drcrop;":"\u230C","&dscr;":"\u{1D4B9}","&dscy;":"\u0455","&dsol;":"\u29F6","&dstrok;":"\u0111","&dtdot;":"\u22F1","&dtri;":"\u25BF","&dtrif;":"\u25BE","&duarr;":"\u21F5","&duhar;":"\u296F","&dwangle;":"\u29A6","&dzcy;":"\u045F","&dzigrarr;":"\u27FF","&eDDot;":"\u2A77","&eDot;":"\u2251","&eacute":"\xE9","&eacute;":"\xE9","&easter;":"\u2A6E","&ecaron;":"\u011B","&ecir;":"\u2256","&ecirc":"\xEA","&ecirc;":"\xEA","&ecolon;":"\u2255","&ecy;":"\u044D","&edot;":"\u0117","&ee;":"\u2147","&efDot;":"\u2252","&efr;":"\u{1D522}","&eg;":"\u2A9A","&egrave":"\xE8","&egrave;":"\xE8","&egs;":"\u2A96","&egsdot;":"\u2A98","&el;":"\u2A99","&elinters;":"\u23E7","&ell;":"\u2113","&els;":"\u2A95","&elsdot;":"\u2A97","&emacr;":"\u0113","&empty;":"\u2205","&emptyset;":"\u2205","&emptyv;":"\u2205","&emsp13;":"\u2004","&emsp14;":"\u2005","&emsp;":"\u2003","&eng;":"\u014B","&ensp;":"\u2002","&eogon;":"\u0119","&eopf;":"\u{1D556}","&epar;":"\u22D5","&eparsl;":"\u29E3","&eplus;":"\u2A71","&epsi;":"\u03B5","&epsilon;":"\u03B5","&epsiv;":"\u03F5","&eqcirc;":"\u2256","&eqcolon;":"\u2255","&eqsim;":"\u2242","&eqslantgtr;":"\u2A96","&eqslantless;":"\u2A95","&equals;":"=","&equest;":"\u225F","&equiv;":"\u2261","&equivDD;":"\u2A78","&eqvparsl;":"\u29E5","&erDot;":"\u2253","&erarr;":"\u2971","&escr;":"\u212F","&esdot;":"\u2250","&esim;":"\u2242","&eta;":"\u03B7","&eth":"\xF0","&eth;":"\xF0","&euml":"\xEB","&euml;":"\xEB","&euro;":"\u20AC","&excl;":"!","&exist;":"\u2203","&expectation;":"\u2130","&exponentiale;":"\u2147","&fallingdotseq;":"\u2252","&fcy;":"\u0444","&female;":"\u2640","&ffilig;":"\uFB03","&fflig;":"\uFB00","&ffllig;":"\uFB04","&ffr;":"\u{1D523}","&filig;":"\uFB01","&fjlig;":"fj","&flat;":"\u266D","&fllig;":"\uFB02","&fltns;":"\u25B1","&fnof;":"\u0192","&fopf;":"\u{1D557}","&forall;":"\u2200","&fork;":"\u22D4","&forkv;":"\u2AD9","&fpartint;":"\u2A0D","&frac12":"\xBD","&frac12;":"\xBD","&frac13;":"\u2153","&frac14":"\xBC","&frac14;":"\xBC","&frac15;":"\u2155","&frac16;":"\u2159","&frac18;":"\u215B","&frac23;":"\u2154","&frac25;":"\u2156","&frac34":"\xBE","&frac34;":"\xBE","&frac35;":"\u2157","&frac38;":"\u215C","&frac45;":"\u2158","&frac56;":"\u215A","&frac58;":"\u215D","&frac78;":"\u215E","&frasl;":"\u2044","&frown;":"\u2322","&fscr;":"\u{1D4BB}","&gE;":"\u2267","&gEl;":"\u2A8C","&gacute;":"\u01F5","&gamma;":"\u03B3","&gammad;":"\u03DD","&gap;":"\u2A86","&gbreve;":"\u011F","&gcirc;":"\u011D","&gcy;":"\u0433","&gdot;":"\u0121","&ge;":"\u2265","&gel;":"\u22DB","&geq;":"\u2265","&geqq;":"\u2267","&geqslant;":"\u2A7E","&ges;":"\u2A7E","&gescc;":"\u2AA9","&gesdot;":"\u2A80","&gesdoto;":"\u2A82","&gesdotol;":"\u2A84","&gesl;":"\u22DB\uFE00","&gesles;":"\u2A94","&gfr;":"\u{1D524}","&gg;":"\u226B","&ggg;":"\u22D9","&gimel;":"\u2137","&gjcy;":"\u0453","&gl;":"\u2277","&glE;":"\u2A92","&gla;":"\u2AA5","&glj;":"\u2AA4","&gnE;":"\u2269","&gnap;":"\u2A8A","&gnapprox;":"\u2A8A","&gne;":"\u2A88","&gneq;":"\u2A88","&gneqq;":"\u2269","&gnsim;":"\u22E7","&gopf;":"\u{1D558}","&grave;":"`","&gscr;":"\u210A","&gsim;":"\u2273","&gsime;":"\u2A8E","&gsiml;":"\u2A90","&gt":">","&gt;":">","&gtcc;":"\u2AA7","&gtcir;":"\u2A7A","&gtdot;":"\u22D7","&gtlPar;":"\u2995","&gtquest;":"\u2A7C","&gtrapprox;":"\u2A86","&gtrarr;":"\u2978","&gtrdot;":"\u22D7","&gtreqless;":"\u22DB","&gtreqqless;":"\u2A8C","&gtrless;":"\u2277","&gtrsim;":"\u2273","&gvertneqq;":"\u2269\uFE00","&gvnE;":"\u2269\uFE00","&hArr;":"\u21D4","&hairsp;":"\u200A","&half;":"\xBD","&hamilt;":"\u210B","&hardcy;":"\u044A","&harr;":"\u2194","&harrcir;":"\u2948","&harrw;":"\u21AD","&hbar;":"\u210F","&hcirc;":"\u0125","&hearts;":"\u2665","&heartsuit;":"\u2665","&hellip;":"\u2026","&hercon;":"\u22B9","&hfr;":"\u{1D525}","&hksearow;":"\u2925","&hkswarow;":"\u2926","&hoarr;":"\u21FF","&homtht;":"\u223B","&hookleftarrow;":"\u21A9","&hookrightarrow;":"\u21AA","&hopf;":"\u{1D559}","&horbar;":"\u2015","&hscr;":"\u{1D4BD}","&hslash;":"\u210F","&hstrok;":"\u0127","&hybull;":"\u2043","&hyphen;":"\u2010","&iacute":"\xED","&iacute;":"\xED","&ic;":"\u2063","&icirc":"\xEE","&icirc;":"\xEE","&icy;":"\u0438","&iecy;":"\u0435","&iexcl":"\xA1","&iexcl;":"\xA1","&iff;":"\u21D4","&ifr;":"\u{1D526}","&igrave":"\xEC","&igrave;":"\xEC","&ii;":"\u2148","&iiiint;":"\u2A0C","&iiint;":"\u222D","&iinfin;":"\u29DC","&iiota;":"\u2129","&ijlig;":"\u0133","&imacr;":"\u012B","&image;":"\u2111","&imagline;":"\u2110","&imagpart;":"\u2111","&imath;":"\u0131","&imof;":"\u22B7","&imped;":"\u01B5","&in;":"\u2208","&incare;":"\u2105","&infin;":"\u221E","&infintie;":"\u29DD","&inodot;":"\u0131","&int;":"\u222B","&intcal;":"\u22BA","&integers;":"\u2124","&intercal;":"\u22BA","&intlarhk;":"\u2A17","&intprod;":"\u2A3C","&iocy;":"\u0451","&iogon;":"\u012F","&iopf;":"\u{1D55A}","&iota;":"\u03B9","&iprod;":"\u2A3C","&iquest":"\xBF","&iquest;":"\xBF","&iscr;":"\u{1D4BE}","&isin;":"\u2208","&isinE;":"\u22F9","&isindot;":"\u22F5","&isins;":"\u22F4","&isinsv;":"\u22F3","&isinv;":"\u2208","&it;":"\u2062","&itilde;":"\u0129","&iukcy;":"\u0456","&iuml":"\xEF","&iuml;":"\xEF","&jcirc;":"\u0135","&jcy;":"\u0439","&jfr;":"\u{1D527}","&jmath;":"\u0237","&jopf;":"\u{1D55B}","&jscr;":"\u{1D4BF}","&jsercy;":"\u0458","&jukcy;":"\u0454","&kappa;":"\u03BA","&kappav;":"\u03F0","&kcedil;":"\u0137","&kcy;":"\u043A","&kfr;":"\u{1D528}","&kgreen;":"\u0138","&khcy;":"\u0445","&kjcy;":"\u045C","&kopf;":"\u{1D55C}","&kscr;":"\u{1D4C0}","&lAarr;":"\u21DA","&lArr;":"\u21D0","&lAtail;":"\u291B","&lBarr;":"\u290E","&lE;":"\u2266","&lEg;":"\u2A8B","&lHar;":"\u2962","&lacute;":"\u013A","&laemptyv;":"\u29B4","&lagran;":"\u2112","&lambda;":"\u03BB","&lang;":"\u27E8","&langd;":"\u2991","&langle;":"\u27E8","&lap;":"\u2A85","&laquo":"\xAB","&laquo;":"\xAB","&larr;":"\u2190","&larrb;":"\u21E4","&larrbfs;":"\u291F","&larrfs;":"\u291D","&larrhk;":"\u21A9","&larrlp;":"\u21AB","&larrpl;":"\u2939","&larrsim;":"\u2973","&larrtl;":"\u21A2","&lat;":"\u2AAB","&latail;":"\u2919","&late;":"\u2AAD","&lates;":"\u2AAD\uFE00","&lbarr;":"\u290C","&lbbrk;":"\u2772","&lbrace;":"{","&lbrack;":"[","&lbrke;":"\u298B","&lbrksld;":"\u298F","&lbrkslu;":"\u298D","&lcaron;":"\u013E","&lcedil;":"\u013C","&lceil;":"\u2308","&lcub;":"{","&lcy;":"\u043B","&ldca;":"\u2936","&ldquo;":"\u201C","&ldquor;":"\u201E","&ldrdhar;":"\u2967","&ldrushar;":"\u294B","&ldsh;":"\u21B2","&le;":"\u2264","&leftarrow;":"\u2190","&leftarrowtail;":"\u21A2","&leftharpoondown;":"\u21BD","&leftharpoonup;":"\u21BC","&leftleftarrows;":"\u21C7","&leftrightarrow;":"\u2194","&leftrightarrows;":"\u21C6","&leftrightharpoons;":"\u21CB","&leftrightsquigarrow;":"\u21AD","&leftthreetimes;":"\u22CB","&leg;":"\u22DA","&leq;":"\u2264","&leqq;":"\u2266","&leqslant;":"\u2A7D","&les;":"\u2A7D","&lescc;":"\u2AA8","&lesdot;":"\u2A7F","&lesdoto;":"\u2A81","&lesdotor;":"\u2A83","&lesg;":"\u22DA\uFE00","&lesges;":"\u2A93","&lessapprox;":"\u2A85","&lessdot;":"\u22D6","&lesseqgtr;":"\u22DA","&lesseqqgtr;":"\u2A8B","&lessgtr;":"\u2276","&lesssim;":"\u2272","&lfisht;":"\u297C","&lfloor;":"\u230A","&lfr;":"\u{1D529}","&lg;":"\u2276","&lgE;":"\u2A91","&lhard;":"\u21BD","&lharu;":"\u21BC","&lharul;":"\u296A","&lhblk;":"\u2584","&ljcy;":"\u0459","&ll;":"\u226A","&llarr;":"\u21C7","&llcorner;":"\u231E","&llhard;":"\u296B","&lltri;":"\u25FA","&lmidot;":"\u0140","&lmoust;":"\u23B0","&lmoustache;":"\u23B0","&lnE;":"\u2268","&lnap;":"\u2A89","&lnapprox;":"\u2A89","&lne;":"\u2A87","&lneq;":"\u2A87","&lneqq;":"\u2268","&lnsim;":"\u22E6","&loang;":"\u27EC","&loarr;":"\u21FD","&lobrk;":"\u27E6","&longleftarrow;":"\u27F5","&longleftrightarrow;":"\u27F7","&longmapsto;":"\u27FC","&longrightarrow;":"\u27F6","&looparrowleft;":"\u21AB","&looparrowright;":"\u21AC","&lopar;":"\u2985","&lopf;":"\u{1D55D}","&loplus;":"\u2A2D","&lotimes;":"\u2A34","&lowast;":"\u2217","&lowbar;":"_","&loz;":"\u25CA","&lozenge;":"\u25CA","&lozf;":"\u29EB","&lpar;":"(","&lparlt;":"\u2993","&lrarr;":"\u21C6","&lrcorner;":"\u231F","&lrhar;":"\u21CB","&lrhard;":"\u296D","&lrm;":"\u200E","&lrtri;":"\u22BF","&lsaquo;":"\u2039","&lscr;":"\u{1D4C1}","&lsh;":"\u21B0","&lsim;":"\u2272","&lsime;":"\u2A8D","&lsimg;":"\u2A8F","&lsqb;":"[","&lsquo;":"\u2018","&lsquor;":"\u201A","&lstrok;":"\u0142","&lt":"<","&lt;":"<","&ltcc;":"\u2AA6","&ltcir;":"\u2A79","&ltdot;":"\u22D6","&lthree;":"\u22CB","&ltimes;":"\u22C9","&ltlarr;":"\u2976","&ltquest;":"\u2A7B","&ltrPar;":"\u2996","&ltri;":"\u25C3","&ltrie;":"\u22B4","&ltrif;":"\u25C2","&lurdshar;":"\u294A","&luruhar;":"\u2966","&lvertneqq;":"\u2268\uFE00","&lvnE;":"\u2268\uFE00","&mDDot;":"\u223A","&macr":"\xAF","&macr;":"\xAF","&male;":"\u2642","&malt;":"\u2720","&maltese;":"\u2720","&map;":"\u21A6","&mapsto;":"\u21A6","&mapstodown;":"\u21A7","&mapstoleft;":"\u21A4","&mapstoup;":"\u21A5","&marker;":"\u25AE","&mcomma;":"\u2A29","&mcy;":"\u043C","&mdash;":"\u2014","&measuredangle;":"\u2221","&mfr;":"\u{1D52A}","&mho;":"\u2127","&micro":"\xB5","&micro;":"\xB5","&mid;":"\u2223","&midast;":"*","&midcir;":"\u2AF0","&middot":"\xB7","&middot;":"\xB7","&minus;":"\u2212","&minusb;":"\u229F","&minusd;":"\u2238","&minusdu;":"\u2A2A","&mlcp;":"\u2ADB","&mldr;":"\u2026","&mnplus;":"\u2213","&models;":"\u22A7","&mopf;":"\u{1D55E}","&mp;":"\u2213","&mscr;":"\u{1D4C2}","&mstpos;":"\u223E","&mu;":"\u03BC","&multimap;":"\u22B8","&mumap;":"\u22B8","&nGg;":"\u22D9\u0338","&nGt;":"\u226B\u20D2","&nGtv;":"\u226B\u0338","&nLeftarrow;":"\u21CD","&nLeftrightarrow;":"\u21CE","&nLl;":"\u22D8\u0338","&nLt;":"\u226A\u20D2","&nLtv;":"\u226A\u0338","&nRightarrow;":"\u21CF","&nVDash;":"\u22AF","&nVdash;":"\u22AE","&nabla;":"\u2207","&nacute;":"\u0144","&nang;":"\u2220\u20D2","&nap;":"\u2249","&napE;":"\u2A70\u0338","&napid;":"\u224B\u0338","&napos;":"\u0149","&napprox;":"\u2249","&natur;":"\u266E","&natural;":"\u266E","&naturals;":"\u2115","&nbsp":"\xA0","&nbsp;":"\xA0","&nbump;":"\u224E\u0338","&nbumpe;":"\u224F\u0338","&ncap;":"\u2A43","&ncaron;":"\u0148","&ncedil;":"\u0146","&ncong;":"\u2247","&ncongdot;":"\u2A6D\u0338","&ncup;":"\u2A42","&ncy;":"\u043D","&ndash;":"\u2013","&ne;":"\u2260","&neArr;":"\u21D7","&nearhk;":"\u2924","&nearr;":"\u2197","&nearrow;":"\u2197","&nedot;":"\u2250\u0338","&nequiv;":"\u2262","&nesear;":"\u2928","&nesim;":"\u2242\u0338","&nexist;":"\u2204","&nexists;":"\u2204","&nfr;":"\u{1D52B}","&ngE;":"\u2267\u0338","&nge;":"\u2271","&ngeq;":"\u2271","&ngeqq;":"\u2267\u0338","&ngeqslant;":"\u2A7E\u0338","&nges;":"\u2A7E\u0338","&ngsim;":"\u2275","&ngt;":"\u226F","&ngtr;":"\u226F","&nhArr;":"\u21CE","&nharr;":"\u21AE","&nhpar;":"\u2AF2","&ni;":"\u220B","&nis;":"\u22FC","&nisd;":"\u22FA","&niv;":"\u220B","&njcy;":"\u045A","&nlArr;":"\u21CD","&nlE;":"\u2266\u0338","&nlarr;":"\u219A","&nldr;":"\u2025","&nle;":"\u2270","&nleftarrow;":"\u219A","&nleftrightarrow;":"\u21AE","&nleq;":"\u2270","&nleqq;":"\u2266\u0338","&nleqslant;":"\u2A7D\u0338","&nles;":"\u2A7D\u0338","&nless;":"\u226E","&nlsim;":"\u2274","&nlt;":"\u226E","&nltri;":"\u22EA","&nltrie;":"\u22EC","&nmid;":"\u2224","&nopf;":"\u{1D55F}","&not":"\xAC","&not;":"\xAC","&notin;":"\u2209","&notinE;":"\u22F9\u0338","&notindot;":"\u22F5\u0338","&notinva;":"\u2209","&notinvb;":"\u22F7","&notinvc;":"\u22F6","&notni;":"\u220C","&notniva;":"\u220C","&notnivb;":"\u22FE","&notnivc;":"\u22FD","&npar;":"\u2226","&nparallel;":"\u2226","&nparsl;":"\u2AFD\u20E5","&npart;":"\u2202\u0338","&npolint;":"\u2A14","&npr;":"\u2280","&nprcue;":"\u22E0","&npre;":"\u2AAF\u0338","&nprec;":"\u2280","&npreceq;":"\u2AAF\u0338","&nrArr;":"\u21CF","&nrarr;":"\u219B","&nrarrc;":"\u2933\u0338","&nrarrw;":"\u219D\u0338","&nrightarrow;":"\u219B","&nrtri;":"\u22EB","&nrtrie;":"\u22ED","&nsc;":"\u2281","&nsccue;":"\u22E1","&nsce;":"\u2AB0\u0338","&nscr;":"\u{1D4C3}","&nshortmid;":"\u2224","&nshortparallel;":"\u2226","&nsim;":"\u2241","&nsime;":"\u2244","&nsimeq;":"\u2244","&nsmid;":"\u2224","&nspar;":"\u2226","&nsqsube;":"\u22E2","&nsqsupe;":"\u22E3","&nsub;":"\u2284","&nsubE;":"\u2AC5\u0338","&nsube;":"\u2288","&nsubset;":"\u2282\u20D2","&nsubseteq;":"\u2288","&nsubseteqq;":"\u2AC5\u0338","&nsucc;":"\u2281","&nsucceq;":"\u2AB0\u0338","&nsup;":"\u2285","&nsupE;":"\u2AC6\u0338","&nsupe;":"\u2289","&nsupset;":"\u2283\u20D2","&nsupseteq;":"\u2289","&nsupseteqq;":"\u2AC6\u0338","&ntgl;":"\u2279","&ntilde":"\xF1","&ntilde;":"\xF1","&ntlg;":"\u2278","&ntriangleleft;":"\u22EA","&ntrianglelefteq;":"\u22EC","&ntriangleright;":"\u22EB","&ntrianglerighteq;":"\u22ED","&nu;":"\u03BD","&num;":"#","&numero;":"\u2116","&numsp;":"\u2007","&nvDash;":"\u22AD","&nvHarr;":"\u2904","&nvap;":"\u224D\u20D2","&nvdash;":"\u22AC","&nvge;":"\u2265\u20D2","&nvgt;":">\u20D2","&nvinfin;":"\u29DE","&nvlArr;":"\u2902","&nvle;":"\u2264\u20D2","&nvlt;":"<\u20D2","&nvltrie;":"\u22B4\u20D2","&nvrArr;":"\u2903","&nvrtrie;":"\u22B5\u20D2","&nvsim;":"\u223C\u20D2","&nwArr;":"\u21D6","&nwarhk;":"\u2923","&nwarr;":"\u2196","&nwarrow;":"\u2196","&nwnear;":"\u2927","&oS;":"\u24C8","&oacute":"\xF3","&oacute;":"\xF3","&oast;":"\u229B","&ocir;":"\u229A","&ocirc":"\xF4","&ocirc;":"\xF4","&ocy;":"\u043E","&odash;":"\u229D","&odblac;":"\u0151","&odiv;":"\u2A38","&odot;":"\u2299","&odsold;":"\u29BC","&oelig;":"\u0153","&ofcir;":"\u29BF","&ofr;":"\u{1D52C}","&ogon;":"\u02DB","&ograve":"\xF2","&ograve;":"\xF2","&ogt;":"\u29C1","&ohbar;":"\u29B5","&ohm;":"\u03A9","&oint;":"\u222E","&olarr;":"\u21BA","&olcir;":"\u29BE","&olcross;":"\u29BB","&oline;":"\u203E","&olt;":"\u29C0","&omacr;":"\u014D","&omega;":"\u03C9","&omicron;":"\u03BF","&omid;":"\u29B6","&ominus;":"\u2296","&oopf;":"\u{1D560}","&opar;":"\u29B7","&operp;":"\u29B9","&oplus;":"\u2295","&or;":"\u2228","&orarr;":"\u21BB","&ord;":"\u2A5D","&order;":"\u2134","&orderof;":"\u2134","&ordf":"\xAA","&ordf;":"\xAA","&ordm":"\xBA","&ordm;":"\xBA","&origof;":"\u22B6","&oror;":"\u2A56","&orslope;":"\u2A57","&orv;":"\u2A5B","&oscr;":"\u2134","&oslash":"\xF8","&oslash;":"\xF8","&osol;":"\u2298","&otilde":"\xF5","&otilde;":"\xF5","&otimes;":"\u2297","&otimesas;":"\u2A36","&ouml":"\xF6","&ouml;":"\xF6","&ovbar;":"\u233D","&par;":"\u2225","&para":"\xB6","&para;":"\xB6","&parallel;":"\u2225","&parsim;":"\u2AF3","&parsl;":"\u2AFD","&part;":"\u2202","&pcy;":"\u043F","&percnt;":"%","&period;":".","&permil;":"\u2030","&perp;":"\u22A5","&pertenk;":"\u2031","&pfr;":"\u{1D52D}","&phi;":"\u03C6","&phiv;":"\u03D5","&phmmat;":"\u2133","&phone;":"\u260E","&pi;":"\u03C0","&pitchfork;":"\u22D4","&piv;":"\u03D6","&planck;":"\u210F","&planckh;":"\u210E","&plankv;":"\u210F","&plus;":"+","&plusacir;":"\u2A23","&plusb;":"\u229E","&pluscir;":"\u2A22","&plusdo;":"\u2214","&plusdu;":"\u2A25","&pluse;":"\u2A72","&plusmn":"\xB1","&plusmn;":"\xB1","&plussim;":"\u2A26","&plustwo;":"\u2A27","&pm;":"\xB1","&pointint;":"\u2A15","&popf;":"\u{1D561}","&pound":"\xA3","&pound;":"\xA3","&pr;":"\u227A","&prE;":"\u2AB3","&prap;":"\u2AB7","&prcue;":"\u227C","&pre;":"\u2AAF","&prec;":"\u227A","&precapprox;":"\u2AB7","&preccurlyeq;":"\u227C","&preceq;":"\u2AAF","&precnapprox;":"\u2AB9","&precneqq;":"\u2AB5","&precnsim;":"\u22E8","&precsim;":"\u227E","&prime;":"\u2032","&primes;":"\u2119","&prnE;":"\u2AB5","&prnap;":"\u2AB9","&prnsim;":"\u22E8","&prod;":"\u220F","&profalar;":"\u232E","&profline;":"\u2312","&profsurf;":"\u2313","&prop;":"\u221D","&propto;":"\u221D","&prsim;":"\u227E","&prurel;":"\u22B0","&pscr;":"\u{1D4C5}","&psi;":"\u03C8","&puncsp;":"\u2008","&qfr;":"\u{1D52E}","&qint;":"\u2A0C","&qopf;":"\u{1D562}","&qprime;":"\u2057","&qscr;":"\u{1D4C6}","&quaternions;":"\u210D","&quatint;":"\u2A16","&quest;":"?","&questeq;":"\u225F","&quot":'"',"&quot;":'"',"&rAarr;":"\u21DB","&rArr;":"\u21D2","&rAtail;":"\u291C","&rBarr;":"\u290F","&rHar;":"\u2964","&race;":"\u223D\u0331","&racute;":"\u0155","&radic;":"\u221A","&raemptyv;":"\u29B3","&rang;":"\u27E9","&rangd;":"\u2992","&range;":"\u29A5","&rangle;":"\u27E9","&raquo":"\xBB","&raquo;":"\xBB","&rarr;":"\u2192","&rarrap;":"\u2975","&rarrb;":"\u21E5","&rarrbfs;":"\u2920","&rarrc;":"\u2933","&rarrfs;":"\u291E","&rarrhk;":"\u21AA","&rarrlp;":"\u21AC","&rarrpl;":"\u2945","&rarrsim;":"\u2974","&rarrtl;":"\u21A3","&rarrw;":"\u219D","&ratail;":"\u291A","&ratio;":"\u2236","&rationals;":"\u211A","&rbarr;":"\u290D","&rbbrk;":"\u2773","&rbrace;":"}","&rbrack;":"]","&rbrke;":"\u298C","&rbrksld;":"\u298E","&rbrkslu;":"\u2990","&rcaron;":"\u0159","&rcedil;":"\u0157","&rceil;":"\u2309","&rcub;":"}","&rcy;":"\u0440","&rdca;":"\u2937","&rdldhar;":"\u2969","&rdquo;":"\u201D","&rdquor;":"\u201D","&rdsh;":"\u21B3","&real;":"\u211C","&realine;":"\u211B","&realpart;":"\u211C","&reals;":"\u211D","&rect;":"\u25AD","&reg":"\xAE","&reg;":"\xAE","&rfisht;":"\u297D","&rfloor;":"\u230B","&rfr;":"\u{1D52F}","&rhard;":"\u21C1","&rharu;":"\u21C0","&rharul;":"\u296C","&rho;":"\u03C1","&rhov;":"\u03F1","&rightarrow;":"\u2192","&rightarrowtail;":"\u21A3","&rightharpoondown;":"\u21C1","&rightharpoonup;":"\u21C0","&rightleftarrows;":"\u21C4","&rightleftharpoons;":"\u21CC","&rightrightarrows;":"\u21C9","&rightsquigarrow;":"\u219D","&rightthreetimes;":"\u22CC","&ring;":"\u02DA","&risingdotseq;":"\u2253","&rlarr;":"\u21C4","&rlhar;":"\u21CC","&rlm;":"\u200F","&rmoust;":"\u23B1","&rmoustache;":"\u23B1","&rnmid;":"\u2AEE","&roang;":"\u27ED","&roarr;":"\u21FE","&robrk;":"\u27E7","&ropar;":"\u2986","&ropf;":"\u{1D563}","&roplus;":"\u2A2E","&rotimes;":"\u2A35","&rpar;":")","&rpargt;":"\u2994","&rppolint;":"\u2A12","&rrarr;":"\u21C9","&rsaquo;":"\u203A","&rscr;":"\u{1D4C7}","&rsh;":"\u21B1","&rsqb;":"]","&rsquo;":"\u2019","&rsquor;":"\u2019","&rthree;":"\u22CC","&rtimes;":"\u22CA","&rtri;":"\u25B9","&rtrie;":"\u22B5","&rtrif;":"\u25B8","&rtriltri;":"\u29CE","&ruluhar;":"\u2968","&rx;":"\u211E","&sacute;":"\u015B","&sbquo;":"\u201A","&sc;":"\u227B","&scE;":"\u2AB4","&scap;":"\u2AB8","&scaron;":"\u0161","&sccue;":"\u227D","&sce;":"\u2AB0","&scedil;":"\u015F","&scirc;":"\u015D","&scnE;":"\u2AB6","&scnap;":"\u2ABA","&scnsim;":"\u22E9","&scpolint;":"\u2A13","&scsim;":"\u227F","&scy;":"\u0441","&sdot;":"\u22C5","&sdotb;":"\u22A1","&sdote;":"\u2A66","&seArr;":"\u21D8","&searhk;":"\u2925","&searr;":"\u2198","&searrow;":"\u2198","&sect":"\xA7","&sect;":"\xA7","&semi;":";","&seswar;":"\u2929","&setminus;":"\u2216","&setmn;":"\u2216","&sext;":"\u2736","&sfr;":"\u{1D530}","&sfrown;":"\u2322","&sharp;":"\u266F","&shchcy;":"\u0449","&shcy;":"\u0448","&shortmid;":"\u2223","&shortparallel;":"\u2225","&shy":"\xAD","&shy;":"\xAD","&sigma;":"\u03C3","&sigmaf;":"\u03C2","&sigmav;":"\u03C2","&sim;":"\u223C","&simdot;":"\u2A6A","&sime;":"\u2243","&simeq;":"\u2243","&simg;":"\u2A9E","&simgE;":"\u2AA0","&siml;":"\u2A9D","&simlE;":"\u2A9F","&simne;":"\u2246","&simplus;":"\u2A24","&simrarr;":"\u2972","&slarr;":"\u2190","&smallsetminus;":"\u2216","&smashp;":"\u2A33","&smeparsl;":"\u29E4","&smid;":"\u2223","&smile;":"\u2323","&smt;":"\u2AAA","&smte;":"\u2AAC","&smtes;":"\u2AAC\uFE00","&softcy;":"\u044C","&sol;":"/","&solb;":"\u29C4","&solbar;":"\u233F","&sopf;":"\u{1D564}","&spades;":"\u2660","&spadesuit;":"\u2660","&spar;":"\u2225","&sqcap;":"\u2293","&sqcaps;":"\u2293\uFE00","&sqcup;":"\u2294","&sqcups;":"\u2294\uFE00","&sqsub;":"\u228F","&sqsube;":"\u2291","&sqsubset;":"\u228F","&sqsubseteq;":"\u2291","&sqsup;":"\u2290","&sqsupe;":"\u2292","&sqsupset;":"\u2290","&sqsupseteq;":"\u2292","&squ;":"\u25A1","&square;":"\u25A1","&squarf;":"\u25AA","&squf;":"\u25AA","&srarr;":"\u2192","&sscr;":"\u{1D4C8}","&ssetmn;":"\u2216","&ssmile;":"\u2323","&sstarf;":"\u22C6","&star;":"\u2606","&starf;":"\u2605","&straightepsilon;":"\u03F5","&straightphi;":"\u03D5","&strns;":"\xAF","&sub;":"\u2282","&subE;":"\u2AC5","&subdot;":"\u2ABD","&sube;":"\u2286","&subedot;":"\u2AC3","&submult;":"\u2AC1","&subnE;":"\u2ACB","&subne;":"\u228A","&subplus;":"\u2ABF","&subrarr;":"\u2979","&subset;":"\u2282","&subseteq;":"\u2286","&subseteqq;":"\u2AC5","&subsetneq;":"\u228A","&subsetneqq;":"\u2ACB","&subsim;":"\u2AC7","&subsub;":"\u2AD5","&subsup;":"\u2AD3","&succ;":"\u227B","&succapprox;":"\u2AB8","&succcurlyeq;":"\u227D","&succeq;":"\u2AB0","&succnapprox;":"\u2ABA","&succneqq;":"\u2AB6","&succnsim;":"\u22E9","&succsim;":"\u227F","&sum;":"\u2211","&sung;":"\u266A","&sup1":"\xB9","&sup1;":"\xB9","&sup2":"\xB2","&sup2;":"\xB2","&sup3":"\xB3","&sup3;":"\xB3","&sup;":"\u2283","&supE;":"\u2AC6","&supdot;":"\u2ABE","&supdsub;":"\u2AD8","&supe;":"\u2287","&supedot;":"\u2AC4","&suphsol;":"\u27C9","&suphsub;":"\u2AD7","&suplarr;":"\u297B","&supmult;":"\u2AC2","&supnE;":"\u2ACC","&supne;":"\u228B","&supplus;":"\u2AC0","&supset;":"\u2283","&supseteq;":"\u2287","&supseteqq;":"\u2AC6","&supsetneq;":"\u228B","&supsetneqq;":"\u2ACC","&supsim;":"\u2AC8","&supsub;":"\u2AD4","&supsup;":"\u2AD6","&swArr;":"\u21D9","&swarhk;":"\u2926","&swarr;":"\u2199","&swarrow;":"\u2199","&swnwar;":"\u292A","&szlig":"\xDF","&szlig;":"\xDF","&target;":"\u2316","&tau;":"\u03C4","&tbrk;":"\u23B4","&tcaron;":"\u0165","&tcedil;":"\u0163","&tcy;":"\u0442","&tdot;":"\u20DB","&telrec;":"\u2315","&tfr;":"\u{1D531}","&there4;":"\u2234","&therefore;":"\u2234","&theta;":"\u03B8","&thetasym;":"\u03D1","&thetav;":"\u03D1","&thickapprox;":"\u2248","&thicksim;":"\u223C","&thinsp;":"\u2009","&thkap;":"\u2248","&thksim;":"\u223C","&thorn":"\xFE","&thorn;":"\xFE","&tilde;":"\u02DC","&times":"\xD7","&times;":"\xD7","&timesb;":"\u22A0","&timesbar;":"\u2A31","&timesd;":"\u2A30","&tint;":"\u222D","&toea;":"\u2928","&top;":"\u22A4","&topbot;":"\u2336","&topcir;":"\u2AF1","&topf;":"\u{1D565}","&topfork;":"\u2ADA","&tosa;":"\u2929","&tprime;":"\u2034","&trade;":"\u2122","&triangle;":"\u25B5","&triangledown;":"\u25BF","&triangleleft;":"\u25C3","&trianglelefteq;":"\u22B4","&triangleq;":"\u225C","&triangleright;":"\u25B9","&trianglerighteq;":"\u22B5","&tridot;":"\u25EC","&trie;":"\u225C","&triminus;":"\u2A3A","&triplus;":"\u2A39","&trisb;":"\u29CD","&tritime;":"\u2A3B","&trpezium;":"\u23E2","&tscr;":"\u{1D4C9}","&tscy;":"\u0446","&tshcy;":"\u045B","&tstrok;":"\u0167","&twixt;":"\u226C","&twoheadleftarrow;":"\u219E","&twoheadrightarrow;":"\u21A0","&uArr;":"\u21D1","&uHar;":"\u2963","&uacute":"\xFA","&uacute;":"\xFA","&uarr;":"\u2191","&ubrcy;":"\u045E","&ubreve;":"\u016D","&ucirc":"\xFB","&ucirc;":"\xFB","&ucy;":"\u0443","&udarr;":"\u21C5","&udblac;":"\u0171","&udhar;":"\u296E","&ufisht;":"\u297E","&ufr;":"\u{1D532}","&ugrave":"\xF9","&ugrave;":"\xF9","&uharl;":"\u21BF","&uharr;":"\u21BE","&uhblk;":"\u2580","&ulcorn;":"\u231C","&ulcorner;":"\u231C","&ulcrop;":"\u230F","&ultri;":"\u25F8","&umacr;":"\u016B","&uml":"\xA8","&uml;":"\xA8","&uogon;":"\u0173","&uopf;":"\u{1D566}","&uparrow;":"\u2191","&updownarrow;":"\u2195","&upharpoonleft;":"\u21BF","&upharpoonright;":"\u21BE","&uplus;":"\u228E","&upsi;":"\u03C5","&upsih;":"\u03D2","&upsilon;":"\u03C5","&upuparrows;":"\u21C8","&urcorn;":"\u231D","&urcorner;":"\u231D","&urcrop;":"\u230E","&uring;":"\u016F","&urtri;":"\u25F9","&uscr;":"\u{1D4CA}","&utdot;":"\u22F0","&utilde;":"\u0169","&utri;":"\u25B5","&utrif;":"\u25B4","&uuarr;":"\u21C8","&uuml":"\xFC","&uuml;":"\xFC","&uwangle;":"\u29A7","&vArr;":"\u21D5","&vBar;":"\u2AE8","&vBarv;":"\u2AE9","&vDash;":"\u22A8","&vangrt;":"\u299C","&varepsilon;":"\u03F5","&varkappa;":"\u03F0","&varnothing;":"\u2205","&varphi;":"\u03D5","&varpi;":"\u03D6","&varpropto;":"\u221D","&varr;":"\u2195","&varrho;":"\u03F1","&varsigma;":"\u03C2","&varsubsetneq;":"\u228A\uFE00","&varsubsetneqq;":"\u2ACB\uFE00","&varsupsetneq;":"\u228B\uFE00","&varsupsetneqq;":"\u2ACC\uFE00","&vartheta;":"\u03D1","&vartriangleleft;":"\u22B2","&vartriangleright;":"\u22B3","&vcy;":"\u0432","&vdash;":"\u22A2","&vee;":"\u2228","&veebar;":"\u22BB","&veeeq;":"\u225A","&vellip;":"\u22EE","&verbar;":"|","&vert;":"|","&vfr;":"\u{1D533}","&vltri;":"\u22B2","&vnsub;":"\u2282\u20D2","&vnsup;":"\u2283\u20D2","&vopf;":"\u{1D567}","&vprop;":"\u221D","&vrtri;":"\u22B3","&vscr;":"\u{1D4CB}","&vsubnE;":"\u2ACB\uFE00","&vsubne;":"\u228A\uFE00","&vsupnE;":"\u2ACC\uFE00","&vsupne;":"\u228B\uFE00","&vzigzag;":"\u299A","&wcirc;":"\u0175","&wedbar;":"\u2A5F","&wedge;":"\u2227","&wedgeq;":"\u2259","&weierp;":"\u2118","&wfr;":"\u{1D534}","&wopf;":"\u{1D568}","&wp;":"\u2118","&wr;":"\u2240","&wreath;":"\u2240","&wscr;":"\u{1D4CC}","&xcap;":"\u22C2","&xcirc;":"\u25EF","&xcup;":"\u22C3","&xdtri;":"\u25BD","&xfr;":"\u{1D535}","&xhArr;":"\u27FA","&xharr;":"\u27F7","&xi;":"\u03BE","&xlArr;":"\u27F8","&xlarr;":"\u27F5","&xmap;":"\u27FC","&xnis;":"\u22FB","&xodot;":"\u2A00","&xopf;":"\u{1D569}","&xoplus;":"\u2A01","&xotime;":"\u2A02","&xrArr;":"\u27F9","&xrarr;":"\u27F6","&xscr;":"\u{1D4CD}","&xsqcup;":"\u2A06","&xuplus;":"\u2A04","&xutri;":"\u25B3","&xvee;":"\u22C1","&xwedge;":"\u22C0","&yacute":"\xFD","&yacute;":"\xFD","&yacy;":"\u044F","&ycirc;":"\u0177","&ycy;":"\u044B","&yen":"\xA5","&yen;":"\xA5","&yfr;":"\u{1D536}","&yicy;":"\u0457","&yopf;":"\u{1D56A}","&yscr;":"\u{1D4CE}","&yucy;":"\u044E","&yuml":"\xFF","&yuml;":"\xFF","&zacute;":"\u017A","&zcaron;":"\u017E","&zcy;":"\u0437","&zdot;":"\u017C","&zeetrf;":"\u2128","&zeta;":"\u03B6","&zfr;":"\u{1D537}","&zhcy;":"\u0436","&zigrarr;":"\u21DD","&zopf;":"\u{1D56B}","&zscr;":"\u{1D4CF}","&zwj;":"\u200D","&zwnj;":"\u200C"};var Gi=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Vi(t){return t.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof xr[e]=="string")return xr[e];if(r.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;r.charAt(1).toLowerCase()==="x"?n=parseInt(r.slice(2),16):n=parseInt(r.slice(1),10);let s="";return n===0||n>=55296&&n<=57343||n>1114111?"\uFFFD":(n=Gi.get(n)??n,n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}var Ds=t=>t.toString(16).toUpperCase().padStart(2,"0");function Ce(t){return t.trim().replace(/[<>"'?&]/g,e=>"&#x"+Ds(e.charCodeAt(0))+";")}var Wi=/[^A-Za-z0-9\-._~!$'()*+,;:@]+/g,Zi=Array.from({length:256},(t,e)=>"%"+Ds(e));function Yi(t){return t.replace(Wi,e=>Array.from(ne.encode(e),r=>Zi[r]).join(""))}function Es(t){return"<div>"+Ce(t).replace(/\n/g,"<br />")+"</div>"}function xs(t,e){let r=1/0,n=null;return s=>((s<r||n&&s>n.index)&&(e.lastIndex=s,n=e.exec(t),r=s),n)}function Bs(t,e){let r=t.lastIndexOf(">")+1;return e(t.slice(0,r))+t.slice(r)}function Je(t,e,r){return Bs(t,n=>n.replace(e,r))}function bs(t,e,r,n){let s=[],i=0,o=0;for(;;){e.lastIndex=o;let u=e.exec(t);if(!u)break;let a=u.index,c=t.indexOf(">",a);if(c<0)break;r.lastIndex=a;let l=r.exec(t);if(!l){o=c+1;continue}s.push(t.slice(i,a),n(...l)),i=o=a+l[0].length}return s.push(t.slice(i)),s.join("")}function br(t,e,r,n,s,i){let o=xs(t,/>/g),u=xs(t,n),a=[],c=0,l=0;for(;;){e.lastIndex=l;let f=e.exec(t);if(!f)break;let h=f.index;l=h+1;let p=h+f[0].length;if(r){let x=o(p);if(!x)break;p=x.index+1}let m=u(p);if(!m)break;let g=m.index+m[0].length;if(s){let x=o(g);if(!x)break;g=x.index+1}a.push(t.slice(c,h),i),c=l=g}return a.push(t.slice(c)),a.join("")}function Ar(t,e){let r=t.lastIndexOf(">"),n=-1;e.lastIndex=0;let s;for(;(s=e.exec(t))&&s.index<r;)n=s.index;return n<0?t:t.slice(t.indexOf(">",n)+1)}function As(t,e){e.lastIndex=0;let r=e.exec(t);return r&&r.index<t.lastIndexOf(">")?t.slice(0,r.index):t}function Cs(t){return t=t.replace(/\r\n|[\n\r\u2028\u2029]/g,""),t=br(t,/<!--/g,!1,/-->/g,!1," "),t=Je(t,/<br\b[^>]*>/gi,`
7
7
  `),t=Je(t,/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
8
8
 
9
- `),t=xr(t,/<script\b/gi,!0,/<\/script\b/gi,!0," "),t=xr(t,/<style\b/gi,!0,/<\/style\b/gi,!0," "),t=yr(t,/<body\b/gi),t=yr(t,/<\/head\b/gi),t=yr(t,/<!doctype\b/gi),t=bs(t,/<\/body\b/gi),t=bs(t,/<\/html\b/gi),t=Es(t,e=>ys(e,/<a\b/gi,/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/iy,(r,n)=>` (${n}) `)),t=Je(t,/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,""),t=ys(t,/<li\b/gi,/<li\b[^>]*>[\n\u0001\s]*/iy,()=>"* "),t=Je(t,/<hr\b[^>]*>/g,`
9
+ `),t=br(t,/<script\b/gi,!0,/<\/script\b/gi,!0," "),t=br(t,/<style\b/gi,!0,/<\/style\b/gi,!0," "),t=Ar(t,/<body\b/gi),t=Ar(t,/<\/head\b/gi),t=Ar(t,/<!doctype\b/gi),t=As(t,/<\/body\b/gi),t=As(t,/<\/html\b/gi),t=Bs(t,e=>bs(e,/<a\b/gi,/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/iy,(r,n)=>` (${n}) `)),t=Je(t,/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,""),t=bs(t,/<li\b/gi,/<li\b[^>]*>[\n\u0001\s]*/iy,()=>"* "),t=Je(t,/<hr\b[^>]*>/g,`
10
10
  -------------
11
11
  `),t=Je(t,/<[^>]*>/g," "),t=t.replace(/\u0001/g,`
12
12
  `).replace(/[ \t]+/g," ").replace(/^\s+$/gm,"").replace(/\n\n+/g,`
13
13
 
14
14
  `).replace(/^\n+/,`
15
15
  `).replace(/\n+$/,`
16
- `),t=Vi(t),t}var As=null;function Cs(t){if(typeof Intl>"u")return t;let e=new Date(t);return isNaN(e.getTime())?t:(As??=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),As.format(e))}function Xi(t){return(t.name?[t.name,`<${t.address}>`]:[t.address]).join(" ")}function St(t){let e=[],r=(n,s)=>{if(s&&e.push(", "),n.group){let i=`${n.name}:`,o=";";e.push(i),n.group.forEach(r),e.push(o)}else e.push(Xi(n))};return t.forEach(r),e.join("")}function Qi(t){return`<a href="mailto:${Ce(Yi(t.address))}" class="postal-email-address">${Ce(t.name||`<${t.address}>`)}</a>`}function Ft(t){let e=[],r=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let i=`<span class="postal-email-address-group">${Ce(n.name)}:</span>`,o='<span class="postal-email-address-group">;</span>';e.push(i),n.group.forEach(r),e.push(o)}else e.push(Qi(n))};return t.forEach(r),e.join(" ")}function Ji(t,e,r){t=(t||"").toString(),e=e||76;let n=0,s=t.length,i="",o,u;for(;n<s;){if(o=t.slice(n,n+e),o.length<e){i+=o;break}if(u=o.match(/^[^\n\r]*(\r?\n|\r)/)){o=u[0],i+=o,n+=o.length;continue}else(u=o.match(/(\s+)[^\s]*$/))&&u[0].length-(r?(u[1]||"").length:0)<o.length?o=o.slice(0,o.length-(u[0].length-(r?(u[1]||"").length:0))):(u=t.slice(n+o.length).match(/^[^\s]+(\s*)/))&&(o=o+u[0].slice(0,u[0].length-(r?0:(u[1]||"").length)));i+=o,n+=o.length,n<s&&(i+=`\r
17
- `)}return i}function vs(t){let e=[];t.from&&e.push({key:"From",val:St([t.from])}),t.subject&&e.push({key:"Subject",val:t.subject}),t.date&&e.push({key:"Date",val:Cs(t.date)}),t.to&&t.to.length&&e.push({key:"To",val:St(t.to)}),t.cc&&t.cc.length&&e.push({key:"Cc",val:St(t.cc)}),t.bcc&&t.bcc.length&&e.push({key:"Bcc",val:St(t.bcc)});let r=e.map(u=>u.key.length).reduce((u,a)=>a>u?a:u,0),n=e.flatMap(u=>{let a=r-u.key.length,c=`${u.key}: ${" ".repeat(a)}`,l=`${" ".repeat(u.key.length+1)} ${" ".repeat(a)}`;return Ji(u.val,80,!0).split(/\r?\n/).map(h=>h.trim()).map((h,p)=>`${p?l:c}${h}`)}),s=n.map(u=>u.length).reduce((u,a)=>a>u?a:u,0),i="-".repeat(s);return`
16
+ `),t=Vi(t),t}var ws=null;function vs(t){if(typeof Intl>"u")return t;let e=new Date(t);return isNaN(e.getTime())?t:(ws??=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),ws.format(e))}function Xi(t){return(t.name?[t.name,`<${t.address}>`]:[t.address]).join(" ")}function St(t){let e=[],r=(n,s)=>{if(s&&e.push(", "),n.group){let i=`${n.name}:`,o=";";e.push(i),n.group.forEach(r),e.push(o)}else e.push(Xi(n))};return t.forEach(r),e.join("")}function Qi(t){return`<a href="mailto:${Ce(Yi(t.address))}" class="postal-email-address">${Ce(t.name||`<${t.address}>`)}</a>`}function Ft(t){let e=[],r=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let i=`<span class="postal-email-address-group">${Ce(n.name)}:</span>`,o='<span class="postal-email-address-group">;</span>';e.push(i),n.group.forEach(r),e.push(o)}else e.push(Qi(n))};return t.forEach(r),e.join(" ")}function Ji(t,e,r){t=(t||"").toString(),e=e||76;let n=0,s=t.length,i="",o,u;for(;n<s;){if(o=t.slice(n,n+e),o.length<e){i+=o;break}if(u=o.match(/^[^\n\r]*(\r?\n|\r)/)){o=u[0],i+=o,n+=o.length;continue}else(u=o.match(/(\s+)[^\s]*$/))&&u[0].length-(r?(u[1]||"").length:0)<o.length?o=o.slice(0,o.length-(u[0].length-(r?(u[1]||"").length:0))):(u=t.slice(n+o.length).match(/^[^\s]+(\s*)/))&&(o=o+u[0].slice(0,u[0].length-(r?0:(u[1]||"").length)));i+=o,n+=o.length,n<s&&(i+=`\r
17
+ `)}return i}function Ts(t){let e=[];t.from&&e.push({key:"From",val:St([t.from])}),t.subject&&e.push({key:"Subject",val:t.subject}),t.date&&e.push({key:"Date",val:vs(t.date)}),t.to&&t.to.length&&e.push({key:"To",val:St(t.to)}),t.cc&&t.cc.length&&e.push({key:"Cc",val:St(t.cc)}),t.bcc&&t.bcc.length&&e.push({key:"Bcc",val:St(t.bcc)});let r=e.map(u=>u.key.length).reduce((u,a)=>a>u?a:u,0),n=e.flatMap(u=>{let a=r-u.key.length,c=`${u.key}: ${" ".repeat(a)}`,l=`${" ".repeat(u.key.length+1)} ${" ".repeat(a)}`;return Ji(u.val,80,!0).split(/\r?\n/).map(h=>h.trim()).map((h,p)=>`${p?l:c}${h}`)}),s=n.map(u=>u.length).reduce((u,a)=>a>u?a:u,0),i="-".repeat(s);return`
18
18
  ${i}
19
19
  ${n.join(`
20
20
  `)}
21
21
  ${i}
22
- `}function Ts(t){let e=[];return t.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${Ft([t.from])}</div>`),t.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Ce(t.subject)}</div>`),t.date&&e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Ce(t.date)}">${Ce(Cs(t.date))}</div>`),t.to&&t.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Ft(t.to)}</div>`),t.cc&&t.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Ft(t.cc)}</div>`),t.bcc&&t.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Ft(t.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
23
- <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}var Oe=1,Ns=2,kt=4,Ss=8,Fs=16,br=class{constructor(e){this.str=e,this.slots=new Int32Array(48),this.length=0,this.cleaned=new Map}push(e,r,n){if((this.length+1)*3>this.slots.length){let i=new Int32Array(this.slots.length*2);i.set(this.slots),this.slots=i}let s=this.length*3;return this.slots[s]=e,this.slots[s+1]=r,this.slots[s+2]=n,this.length++}operatorAt(e){let r=e*3;return this.slots[r]&Oe?this.str.charAt(this.slots[r+1]):""}isOperator(e){return(this.slots[e*3]&Oe)!==0}noBreak(e){return(this.slots[e*3]&Ns)!==0}value(e){let r=this.cleaned.get(e);return r!==void 0?r:this.str.slice(this.slots[e*3+1],this.slots[e*3+2])}},eu=/\s/,tu=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,ru=/^[^@\s]+@[^@\s]+$/,nu=/^[^@\s]+@\[[^[\]\\\s]*\]$/,su=/^@(?:[^@\s"]+|\[[^[\]\\\s]*\])$/;function Us(t){return ru.test(t)||nu.test(t)}var ou=/^[^@\s]+@\S+$/,ks=/\s*\b[^@\s]+@[^\s]+\b\s*/y,iu=/@(\[[^[\]\\]*\])$/;function Is(t){let e=t.charAt(t.length-1)==="]"?iu.exec(t):null;return e?t.length-e[1].length-1:t.lastIndexOf("@")}function Rs(t){let e=Is(t);if(e<0)return t;let r=t.substring(0,e);return/^[^\s"(),:;<>@[\\\]]+$/.test(r)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(r)?t:'"'+r.replace(/["\\]/g,"\\$&")+'"@'+t.substring(e+1)}function Q(t){return t===32||t>=9&&t<=13||t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279}function Ls(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95}function Os(t,e){return Ls(t.charCodeAt(e-1))!==Ls(t.charCodeAt(e))}function qs(t,e,r){for(let n=e;n<r;n++)if(t.charCodeAt(n)===64)return n;return-1}var uu=/^"(?:[^"\\]|\\[\s\S])*"/;function Ar(t,e){if(e<0)return t;let r=e;for(;r>0&&Q(t.charCodeAt(r-1));)r--;let n=e+1;for(;n<t.length&&Q(t.charCodeAt(n));)n++;return r===e&&n===e+1?t:t.slice(0,r)+"@"+t.slice(n)}function Ps(t){let e=uu.exec(t);if(e){let n=e[0].length;for(;n<t.length&&Q(t.charCodeAt(n));)n++;if(t.charAt(n)==="@"&&t.indexOf("@",n+1)<0)return Ar(t,n)}let r=t.indexOf("@");return r<0||t.indexOf("@",r+1)>=0||t.lastIndexOf('"')>r?t:Ar(t,r)}function au(t){let e=t.length,r=0;for(;r<e;){for(;r<e&&Q(t.charCodeAt(r));)r++;if(r>=e)break;let n=r,s=r;for(;s<e&&!Q(t.charCodeAt(s));)s++;let i=qs(t,n,s);if(i>=0){let o=-1;for(let a=s;a>n;a--)if(Os(t,a)){o=a;break}let u=n;for(;o>=0&&i>=0;){if(i>u&&s>i+1&&o>i+1){for(let a=u;a<i;a++)if(Os(t,a)){if(a>n)return a;let c=n;for(;c>0&&Q(t.charCodeAt(c-1));)c--;return c}}u=i+1,i=qs(t,u,s)}}r=s}return-1}function cu(t,e){if(t=Ps(t),!eu.test(t))return{address:t,text:e};let r,n=t.match(tu);if(n){if(!n[2])return{address:t,text:e};t=n[1],r=[n[2]]}else{if(t.indexOf('"')>=0)return{address:t,text:e};let s=t.split(/\s+/),i=s.findIndex(Us);if(i<0&&(i=s.findIndex(o=>ou.test(o))),i<0)return{address:t,text:e};t=s.splice(i,1)[0],r=s}return{address:t,text:[e,...r].filter(s=>s).join(" ")}}function lu(t){let e=[],r="",n="",s=0,i="",o="",u=!1,a="",c=!1,l=-1;for(let f=0,h=t.length;f<h;f++){let p=t.charAt(f);if(s){p==="\\"&&f<h-1?n+=t.charAt(++f):p==="("?(s++,n+=p):p===")"&&!--s?(e.push(n.trim()),n="",u=o!=="@"):n+=p;continue}if(u&&p!=="("&&(u=!1,p!=="@"&&p!=="<"&&!Q(t.charCodeAt(f))&&(r+=" ",o=" ")),i){if(p==="\\"&&i==='"'&&f<h-1){r+=p+t.charAt(++f),o=t.charAt(f);continue}p===i&&(i="")}else if(p==='"')i='"',c=!0;else if(p===":"&&l<0&&a==="@"&&!c)l=r.length+1;else if(p==="[")i="]";else if(p==="("){s=1;continue}else if(p==="<"){r="",o="",e.length=0,a="",c=!1,l=-1;continue}r+=p,o=p,!a&&!Q(t.charCodeAt(f))&&(a=p)}return l>=0&&r.indexOf("@",l)>=0&&(r=r.slice(l)),s&&e.push(n.trim()),{address:r.trim(),comments:e.filter(f=>f)}}function Ms(t,e,r){let n="text",s={address:[],comment:[],text:[],textWasQuoted:[],quotedLocalAt:[]},i=!1,o,u=!1,a={address:"",comment:"",text:""};for(o=e;o<r;o++){let l=t.value(o),f=o>e?t.operatorAt(o-1):"",h=o>e&&t.noBreak(o-1);if(t.isOperator(o))switch(l){case"<":n="address",u=!1;break;case"(":n="comment",u=!1;break;case'"':u=!u,n="text";break;default:n="text",u=!1;break}else{let p=f==='"'&&h&&o>e+1&&t.operatorAt(o-2)==='"';if(h&&s[n].length&&(f!==")"||a[n]==="@"||l.charAt(0)==="@")){let m=s[n].length-1;n==="text"&&!u&&(i&&l.charAt(0)==="@"&&(s.quotedLocalAt[m]=s.text[m].length),i=!1),s[n][m]+=l,n==="text"&&u&&(s.textWasQuoted[m]=!0)}else s[n].push(l),n==="text"&&(s.textWasQuoted.push(u||p),s.quotedLocalAt.push(p&&l.charAt(0)==="@"?0:-1),i=u);a[n]=l.charAt(l.length-1)}}let c=!1;return!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[],c=!0),{data:s,textFromComment:c}}function fu(t,e,r){return pe(Ms(t,e,r).data.text.join(" "))}function du(t,e,r){let n=Ms(t,e,r),s=n.data,i=n.textFromComment,o,u=[],a=[];for(let g of s.address){let m=lu(g);for(let y of m.comments)u.push(y);m.address&&a.push(m.address)}if(s.address=a,!s.address.length&&s.text.length&&!i){let g=s.text.map(m=>Ps(m));for(o=0;o<s.text.length;o++){let m=s.quotedLocalAt[o],y=s.textWasQuoted[o]&&m>=0&&su.test(s.text[o].slice(m))?Rs(s.text[o]):"";if(y||!s.textWasQuoted[o]&&Us(g[o])){s.address=[y||g[o]],s.text.splice(o,1),s.textWasQuoted.splice(o,1),s.quotedLocalAt.splice(o,1);break}}if(!s.address.length){for(o=0;o<s.text.length;o++)if(!s.textWasQuoted[o]){let m=g[o],y=au(m);if(y>=0){ks.lastIndex=y;let v=ks.exec(m);if(v){s.address=[v[0].trim()],s.text[o]=(m.slice(0,y)+" "+m.slice(y+v[0].length)).trim();break}}s.text[o]=s.text[o].trim()}}}!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),s.address.length>1&&(s.text=s.text.concat(s.address.splice(1)));let c=!s.address.length&&s.textWasQuoted.some(g=>g),l=s.text.join(" "),f=s.address.join(" ");if(!f&&ps(l.trim()))return{address:"",name:pe(l)};c&&l.indexOf("@")>=0&&(f=Rs(Ar(l,Is(l))),l=""),{address:f,text:l}=cu(f,l),!l&&u.length&&(l=u.join(" "),i=!0);let h=l||f||"",p={address:f||(i?"":l)||"",name:pe(h)};return(p.address===h||p.address===p.name)&&(p.address.match(/@/)?p.name="":p.address=""),p}var wr=class{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=-1,this.escaped=!1,this.inDomainLiteral=!1,this.afterAt=!1,this.inGroup=!1,this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1,this.list=new br(this.str),this.operators={'"':'"',"(":")","<":">",",":"",":":"",";":""}}tokenize(){let e=this.str,r=e.length;for(let o=0;o<r;o++)this.checkChar(e.charAt(o),o);this.closeText(r);let n=this.list,s=n.slots,i=0;for(let o=0,u=n.length;o<u;o++){let a=s[o*3],c=s[o*3+1],l=s[o*3+2];if(a&kt){let f=this.cleanValue(c,l,a).trim();if(!f)continue;n.cleaned.set(i,f)}else if(!(a&Oe)){for(;c<l&&Q(e.charCodeAt(c));)c++;for(;l>c&&Q(e.charCodeAt(l-1));)l--;if(c===l)continue}s[i*3]=a,s[i*3+1]=c,s[i*3+2]=l,i++}return n.length=i,n}closeText(e){this.node>=0&&(this.list.slots[this.node*3+2]=e,this.node=-1)}cleanValue(e,r,n){let s=this.str,i=(n&Ss)!==0,o=(n&Fs)!==0,u="";for(let a=e;a<r;a++){let c=s.charAt(a);if(i&&!o&&c==="\\"){o=!0;continue}o=!1,c===`
22
+ `}function Ss(t){let e=[];return t.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${Ft([t.from])}</div>`),t.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Ce(t.subject)}</div>`),t.date&&e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Ce(t.date)}">${Ce(vs(t.date))}</div>`),t.to&&t.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Ft(t.to)}</div>`),t.cc&&t.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Ft(t.cc)}</div>`),t.bcc&&t.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Ft(t.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
23
+ <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}var Oe=1,Us=2,kt=4,Fs=8,ks=16,wr=class{constructor(e){this.str=e,this.slots=new Int32Array(48),this.length=0,this.cleaned=new Map}push(e,r,n){if((this.length+1)*3>this.slots.length){let i=new Int32Array(this.slots.length*2);i.set(this.slots),this.slots=i}let s=this.length*3;return this.slots[s]=e,this.slots[s+1]=r,this.slots[s+2]=n,this.length++}operatorAt(e){let r=e*3;return this.slots[r]&Oe?this.str.charAt(this.slots[r+1]):""}isOperator(e){return(this.slots[e*3]&Oe)!==0}noBreak(e){return(this.slots[e*3]&Us)!==0}value(e){let r=this.cleaned.get(e);return r!==void 0?r:this.str.slice(this.slots[e*3+1],this.slots[e*3+2])}},eu=/\s/,tu=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,ru=/^[^@\s]+@[^@\s]+$/,nu=/^[^@\s]+@\[[^[\]\\\s]*\]$/,su=/^@(?:[^@\s"]+|\[[^[\]\\\s]*\])$/;function Is(t){return ru.test(t)||nu.test(t)}var ou=/^[^@\s]+@\S+$/,Rs=/\s*\b[^@\s]+@[^\s]+\b\s*/y,iu=/@(\[[^[\]\\]*\])$/;function Ps(t){let e=t.charAt(t.length-1)==="]"?iu.exec(t):null;return e?t.length-e[1].length-1:t.lastIndexOf("@")}function Ls(t){let e=Ps(t);if(e<0)return t;let r=t.substring(0,e);return/^[^\s"(),:;<>@[\\\]]+$/.test(r)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(r)?t:'"'+r.replace(/["\\]/g,"\\$&")+'"@'+t.substring(e+1)}function J(t){return t===32||t>=9&&t<=13||t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279}function Os(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95}function qs(t,e){return Os(t.charCodeAt(e-1))!==Os(t.charCodeAt(e))}function _s(t,e,r){for(let n=e;n<r;n++)if(t.charCodeAt(n)===64)return n;return-1}var uu=/^"(?:[^"\\]|\\[\s\S])*"/;function Dr(t,e){if(e<0)return t;let r=e;for(;r>0&&J(t.charCodeAt(r-1));)r--;let n=e+1;for(;n<t.length&&J(t.charCodeAt(n));)n++;return r===e&&n===e+1?t:t.slice(0,r)+"@"+t.slice(n)}function Ms(t){let e=uu.exec(t);if(e){let n=e[0].length;for(;n<t.length&&J(t.charCodeAt(n));)n++;if(t.charAt(n)==="@"&&t.indexOf("@",n+1)<0)return Dr(t,n)}let r=t.indexOf("@");return r<0||t.indexOf("@",r+1)>=0||t.lastIndexOf('"')>r?t:Dr(t,r)}function au(t){let e=t.length,r=0;for(;r<e;){for(;r<e&&J(t.charCodeAt(r));)r++;if(r>=e)break;let n=r,s=r;for(;s<e&&!J(t.charCodeAt(s));)s++;let i=_s(t,n,s);if(i>=0){let o=-1;for(let a=s;a>n;a--)if(qs(t,a)){o=a;break}let u=n;for(;o>=0&&i>=0;){if(i>u&&s>i+1&&o>i+1){for(let a=u;a<i;a++)if(qs(t,a)){if(a>n)return a;let c=n;for(;c>0&&J(t.charCodeAt(c-1));)c--;return c}}u=i+1,i=_s(t,u,s)}}r=s}return-1}function cu(t,e){if(t=Ms(t),!eu.test(t))return{address:t,text:e};let r,n=t.match(tu);if(n){if(!n[2])return{address:t,text:e};t=n[1],r=[n[2]]}else{if(t.indexOf('"')>=0)return{address:t,text:e};let s=t.split(/\s+/),i=s.findIndex(Is);if(i<0&&(i=s.findIndex(o=>ou.test(o))),i<0)return{address:t,text:e};t=s.splice(i,1)[0],r=s}return{address:t,text:[e,...r].filter(s=>s).join(" ")}}function lu(t){let e=[],r="",n="",s=0,i="",o="",u=!1,a="",c=!1,l=-1;for(let f=0,h=t.length;f<h;f++){let p=t.charAt(f);if(s){p==="\\"&&f<h-1?n+=t.charAt(++f):p==="("?(s++,n+=p):p===")"&&!--s?(e.push(n.trim()),n="",u=o!=="@"):n+=p;continue}if(u&&p!=="("&&(u=!1,p!=="@"&&p!=="<"&&!J(t.charCodeAt(f))&&(r+=" ",o=" ")),i){if(p==="\\"&&i==='"'&&f<h-1){r+=p+t.charAt(++f),o=t.charAt(f);continue}p===i&&(i="")}else if(p==='"')i='"',c=!0;else if(p===":"&&l<0&&a==="@"&&!c)l=r.length+1;else if(p==="[")i="]";else if(p==="("){s=1;continue}else if(p==="<"){r="",o="",e.length=0,a="",c=!1,l=-1;continue}r+=p,o=p,!a&&!J(t.charCodeAt(f))&&(a=p)}return l>=0&&r.indexOf("@",l)>=0&&(r=r.slice(l)),s&&e.push(n.trim()),{address:r.trim(),comments:e.filter(f=>f)}}function Hs(t,e,r){let n="text",s={address:[],comment:[],text:[],textWasQuoted:[],quotedLocalAt:[]},i=!1,o,u=!1,a={address:"",comment:"",text:""};for(o=e;o<r;o++){let l=t.value(o),f=o>e?t.operatorAt(o-1):"",h=o>e&&t.noBreak(o-1);if(t.isOperator(o))switch(l){case"<":n="address",u=!1;break;case"(":n="comment",u=!1;break;case'"':u=!u,n="text";break;default:n="text",u=!1;break}else{let p=f==='"'&&h&&o>e+1&&t.operatorAt(o-2)==='"';if(h&&s[n].length&&(f!==")"||a[n]==="@"||l.charAt(0)==="@")){let g=s[n].length-1;n==="text"&&!u&&(i&&l.charAt(0)==="@"&&(s.quotedLocalAt[g]=s.text[g].length),i=!1),s[n][g]+=l,n==="text"&&u&&(s.textWasQuoted[g]=!0)}else s[n].push(l),n==="text"&&(s.textWasQuoted.push(u||p),s.quotedLocalAt.push(p&&l.charAt(0)==="@"?0:-1),i=u);a[n]=l.charAt(l.length-1)}}let c=!1;return!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[],c=!0),{data:s,textFromComment:c}}function fu(t,e,r){return pe(Hs(t,e,r).data.text.join(" "))}function du(t,e,r){let n=Hs(t,e,r),s=n.data,i=n.textFromComment,o,u=[],a=[];for(let m of s.address){let g=lu(m);for(let x of g.comments)u.push(x);g.address&&a.push(g.address)}if(s.address=a,!s.address.length&&s.text.length&&!i){let m=s.text.map(g=>Ms(g));for(o=0;o<s.text.length;o++){let g=s.quotedLocalAt[o],x=s.textWasQuoted[o]&&g>=0&&su.test(s.text[o].slice(g))?Ls(s.text[o]):"";if(x||!s.textWasQuoted[o]&&Is(m[o])){s.address=[x||m[o]],s.text.splice(o,1),s.textWasQuoted.splice(o,1),s.quotedLocalAt.splice(o,1);break}}if(!s.address.length){for(o=0;o<s.text.length;o++)if(!s.textWasQuoted[o]){let g=m[o],x=au(g);if(x>=0){Rs.lastIndex=x;let v=Rs.exec(g);if(v){s.address=[v[0].trim()],s.text[o]=(g.slice(0,x)+" "+g.slice(x+v[0].length)).trim();break}}s.text[o]=s.text[o].trim()}}}!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),s.address.length>1&&(s.text=s.text.concat(s.address.splice(1)));let c=!s.address.length&&s.textWasQuoted.some(m=>m),l=s.text.join(" "),f=s.address.join(" ");if(!f&&gs(l.trim()))return{address:"",name:pe(l)};c&&l.indexOf("@")>=0&&(f=Ls(Dr(l,Ps(l))),l=""),{address:f,text:l}=cu(f,l),!l&&u.length&&(l=u.join(" "),i=!0);let h=l||f||"",p={address:f||(i?"":l)||"",name:pe(h)};return(p.address===h||p.address===p.name)&&(p.address.match(/@/)?p.name="":p.address=""),p}var Er=class{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=-1,this.escaped=!1,this.inDomainLiteral=!1,this.afterAt=!1,this.inGroup=!1,this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1,this.list=new wr(this.str),this.operators={'"':'"',"(":")","<":">",",":"",":":"",";":""}}tokenize(){let e=this.str,r=e.length;for(let o=0;o<r;o++)this.checkChar(e.charAt(o),o);this.closeText(r);let n=this.list,s=n.slots,i=0;for(let o=0,u=n.length;o<u;o++){let a=s[o*3],c=s[o*3+1],l=s[o*3+2];if(a&kt){let f=this.cleanValue(c,l,a).trim();if(!f)continue;n.cleaned.set(i,f)}else if(!(a&Oe)){for(;c<l&&J(e.charCodeAt(c));)c++;for(;l>c&&J(e.charCodeAt(l-1));)l--;if(c===l)continue}s[i*3]=a,s[i*3+1]=c,s[i*3+2]=l,i++}return n.length=i,n}closeText(e){this.node>=0&&(this.list.slots[this.node*3+2]=e,this.node=-1)}cleanValue(e,r,n){let s=this.str,i=(n&Fs)!==0,o=(n&ks)!==0,u="";for(let a=e;a<r;a++){let c=s.charAt(a);if(i&&!o&&c==="\\"){o=!0;continue}o=!1,c===`
24
24
  `?u+=" ":(c.charCodeAt(0)>=33||c===" "||c===" ")&&(u+=c)}return u}checkChar(e,r){!this.escaped&&!this.operatorExpecting&&(!this.inDomainLiteral&&e==="["&&this.afterAt?this.inDomainLiteral=!0:this.inDomainLiteral&&(e==="]"||e===","||e===";")&&(this.inDomainLiteral=!1));let n=!1;if(this.operatorExpecting===">"?(n=this.trackInner(e),!n&&e===";"&&this.inGroup&&(this.closeText(r),this.operatorExpecting="",this.resetInner())):this.operatorExpecting===")"&&!this.escaped&&(e==="("?this.innerComment++:e===")"&&this.innerComment&&(this.innerComment--,n=!0)),!this.escaped){if(e===this.operatorExpecting&&!n){let s=this.str.charAt(r+1);this.closeText(r),this.list.push(s&&![" "," ","\r",`
25
- `,",",";"].includes(s)?Oe|Ns:Oe,r,r+1),e!==")"&&(this.afterAt=!1),this.operatorExpecting="",this.escaped=!1,this.resetInner();return}else if(!this.operatorExpecting&&!(this.inDomainLiteral&&e===":")&&e in this.operators){this.closeText(r),this.list.push(Oe,r,r+1),e===":"?this.inGroup=!0:e===";"&&(this.inGroup=!1),e!=="("&&(this.afterAt=!1),this.operatorExpecting=this.operators[e],this.escaped=!1,this.resetInner();return}else if((this.operatorExpecting==='"'||this.operatorExpecting===")")&&e==="\\"){this.escaped=!0,this.node>=0&&(this.list.slots[this.node*3]|=kt);return}}this.node<0&&(this.node=this.list.push((this.operatorExpecting==='"'||this.operatorExpecting===")"?Ss:0)|(this.escaped?Fs:0),r,r)),e===`
26
- `&&(e=" ",this.list.slots[this.node*3]|=kt),e.charCodeAt(0)>=33||e===" "||e===" "?!this.operatorExpecting&&e!==" "&&e!==" "&&(this.afterAt=e==="@"):this.list.slots[this.node*3]|=kt,this.escaped=!1}trackInner(e){return this.innerEscaped?(this.innerEscaped=!1,!0):this.innerQuoted?(e==="\\"?this.innerEscaped=!0:e==='"'&&(this.innerQuoted=!1),!0):this.innerComment?(e==="\\"?this.innerEscaped=!0:e==="("?this.innerComment++:e===")"&&this.innerComment--,!0):this.innerLiteral?(e==="]"&&(this.innerLiteral=!1),!0):e==='"'?(this.innerQuoted=!0,!0):e==="("?(this.innerComment=1,!0):e==="["&&this.afterAt?(this.innerLiteral=!0,!0):(Q(e.charCodeAt(0))||(this.afterAt=e==="@"),!1)}resetInner(){this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1}};function _s(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=t[r],s=e.length?e[e.length-1]:null;s&&n.address===""&&n.name&&!n.group&&s.address&&s.name?s.name=n.name+", "+s.name:e.push(n)}return e.reverse()}function hu(t){let e=new wr(t).tokenize(),r=[],n=null,s=[],i=0;for(let o=0,u=e.length;o<=u;o++){let a=o<u?e.operatorAt(o):"";if(!(o<u&&a!==","&&a!==";"&&a!==":")){if(a===":"){n||(n={name:fu(e,i,o),group:[]},s=[]),i=o+1;continue}o>i&&(n?s:r).push(du(e,i,o)),i=o+1,n&&(a===";"||o===u)&&(n.group=_s(s),r.push(n),n=null)}}return _s(r)}function pu(t,e){let r=hu(t);if(e&&e.flatten){let n=[],s=i=>{i.forEach(o=>{if(o.group)return s(o.group);n.push(o)})};return s(r),n}return r}var Rt=pu;function Hs(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(t),s=n.byteLength,i=s%3,o=s-i,u,a,c,l,f;for(let h=0;h<o;h=h+3)f=n[h]<<16|n[h+1]<<8|n[h+2],u=(f&16515072)>>18,a=(f&258048)>>12,c=(f&4032)>>6,l=f&63,e+=r[u]+r[a]+r[c]+r[l];return i===1?(f=n[o],u=(f&252)>>2,a=(f&3)<<4,e+=r[u]+r[a]+"=="):i===2&&(f=n[o]<<8|n[o+1],u=(f&64512)>>10,a=(f&1008)>>4,c=(f&15)<<2,e+=r[u]+r[a]+r[c]+"="),e}var mu=/-?(?:\d{1,12}\.\d{1,3}|\d{1,15})/y,gu=/"((?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\["\\])*)"/y,xu=/[A-Za-z*][!#$%&'*+\-.^_`|~0-9A-Za-z:/]*/y,yu=/:[A-Za-z0-9+/=]*:/y,bu=/\?[01]/y,Au=/@-?\d{1,15}/y,wu=/%"((?:[\x20\x21\x23\x24\x26-\x7e]|%[0-9a-f]{2})*)"/y,Du=/[a-z*][a-z0-9_\-.*]*/y,Dr=/ */y;function se(t,e){e.lastIndex=t.pos;let r=e.exec(t.input);return r&&(t.pos=e.lastIndex),r}function $s(t){let e=se(t,gu);return e&&e[1].replace(/\\(["\\])/g,"$1")}function Eu(t){let e=se(t,wu);if(!e)return!1;try{return decodeURIComponent(e[1]),!0}catch{return!1}}function Bu(t){let e=t.input.charAt(t.pos);switch(e){case'"':return $s(t)??!1;case":":return!!se(t,yu);case"?":return!!se(t,bu);case"@":return!!se(t,Au);case"%":return Eu(t)}return!!se(t,e==="-"||e>="0"&&e<="9"?mu:xu)}function Cu(t){let e={input:t,pos:0};se(e,Dr);let r=$s(e);if(r===null)return null;let n=new Map;for(;e.input[e.pos]===";";){e.pos++,se(e,Dr);let s=se(e,Du);if(!s)return null;let i=!0;if(e.input[e.pos]==="="&&(e.pos++,i=Bu(e),i===!1))return null;n.set(s[0],i)}return se(e,Dr),e.pos===e.input.length?{value:r,params:n}:null}function vu(t){let e;try{e=new URL(t)}catch{return!1}if(e.origin!==t||!/^([a-z0-9_-]+\.)*[a-z0-9_-]+$|^\[[0-9a-f:.]+\]$/.test(e.hostname))return!1;let r=/^(localhost|.+\.localhost|127(\.\d+){3}|\[::1\])$/.test(e.hostname);return e.protocol==="https:"||e.protocol==="http:"&&r}function js(t){let e;for(let s of t)if(s.key==="otp-token"){if(e)return;e=s}if(!e||e.value.length>8192)return;let r=Cu(e.value),n=r?.params.get("origin");if(!(!r?.value||typeof n!="string"||!vu(n)))return{code:r.value,origin:n}}function Tu(t){return!!t&&typeof t.getReader=="function"}function Su(t){return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}function Fu(t){let e=Object.prototype.toString.call(t);return e==="[object ArrayBuffer]"||e==="[object SharedArrayBuffer]"}var ku=new Set(["arraybuffer","base64","utf8"]);function Ru(t){let e=String(t||"").replace(/[-_\s]/g,"").toLowerCase()||"arraybuffer";if(!ku.has(e))throw X("EINVALIDOPTION",`Unknown attachment encoding ${e}`);return e}function Lu(t,e,r){return t.type==="subMessage"?e==="html"?Ts(t.value):vs(t.value):r?e==="html"?Ds(t.value):Bs(t.value):t.value}var Ou=new Uint8Array([10]),qu=256,_u=2*1024*1024,Nu=1e4,Uu=10,Iu=1e4;function Lt(t){if(!t)return 0;let e=0;for(let r of Array.isArray(t)?t:[t])e+=1+(r.group?r.group.length:0);return e}function et(t,e,r,n=0){if(t==null)return e;if(typeof t!="number"||!Number.isInteger(t)||t<n)throw X("EINVALIDOPTION",`${r} must be a ${n?"positive":"non-negative"} integer`);return t}function Pu(t){return{maxNestingDepth:et(t.maxNestingDepth,qu,"maxNestingDepth"),maxHeadersSize:et(t.maxHeadersSize,_u,"maxHeadersSize"),maxPartCount:et(t.maxPartCount,Nu,"maxPartCount",1),maxRfc822NestingDepth:et(t.maxRfc822NestingDepth,Uu,"maxRfc822NestingDepth"),maxForwardedAddresses:et(t.maxForwardedAddresses,Iu,"maxForwardedAddresses")}}var qe=class t{static async parse(e,r){return new t(r).parse(e)}constructor(e,r){this.options=e||{},this.rfc822NestingDepth=r?r.rfc822NestingDepth+1:0,this.limits=r?r.limits:Pu(this.options),this.counters=r?r.counters:{headerSize:0,partCount:0,forwardedAddresses:0},this.root=this.currentNode=new Le({postalMime:this}),this.boundaries=[],this.textContent={},this.textMap=new Map,this.textTypes=new Set,this.attachments=[],this.forceRfc822Attachments=!1,this.attachmentEncoding=Ru(this.options.attachmentEncoding),this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,r,n){let s=this.boundaries;if(s.length&&e.length>2&&e[0]===45&&e[1]===45)for(let i=0;i<s.length;i++){let o=s[i];if(e.length<o.value.length+2)continue;let u=!0;for(let f=0;f<o.value.length;f++)if(e[f+2]!==o.value[f]){u=!1;break}if(!u)continue;let a=o.value.length+2,c=!1;e.length>=o.value.length+4&&e[o.value.length+2]===45&&e[o.value.length+3]===45&&(c=!0,a=o.value.length+4);let l=!0;for(let f=a;f<e.length;f++)if(!ae(e[f])){l=!1;break}if(l)return c?(await o.node.finalize(!0),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(!0),this.currentNode=new Le({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart})),n?this.finalize():void 0}if(this.currentNode.feed(e,r))return this.processLine(e,r,n);if(n)return this.finalize()}readLine(){let e=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let n=this.av[this.readPos++];if(n!==13&&n!==10&&(r=this.readPos),n===10)return{bytes:new Uint8Array(this.buf,e,r-e),lineBreak:this.av.subarray(r,this.readPos),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,e,r-e),lineBreak:Ou,done:this.readPos>=this.av.length}}addTextEntry(e,r,n){let s=this.textMap.get(e);s||(s={},this.textMap.set(e,s));let i=s[r]||[];s[r]=i,i.push(n),this.textTypes.add(r)}async collectNode(e,r,n){if(e.contentType.multipart)e.contentType.multipart==="alternative"?r=e:e.contentType.multipart==="related"&&(n=!0);else{let s=this.isInlineMessageRfc822(e),i=s&&this.rfc822NestingDepth>=this.limits.maxRfc822NestingDepth;if(s&&!i)await this.collectSubMessage(e);else if(this.isInlineTextNode(e)){let o=e.contentType.parsed.value==="text/html"?"html":"plain";this.addTextEntry(r||e,o,{type:"text",value:e.getTextContent()})}else e.content&&this.collectAttachment(e,e.content,n,i)}for(let s of e.childNodes)await this.collectNode(s,r,n)}async collectSubMessage(e){let r=new t({attachmentEncoding:"arraybuffer"},this),n=await r.parse(e.content||new ArrayBuffer(0));if(this.counters.forwardedAddresses+=Lt(n.from)+Lt(n.to)+Lt(n.cc)+Lt(n.bcc),this.counters.forwardedAddresses>this.limits.maxForwardedAddresses)throw X("EMAXFORWARDEDADDRESSES",`Maximum forwarded address count of ${this.limits.maxForwardedAddresses} addresses exceeded`);let s=r.textTypes.has("plain"),i=r.textTypes.has("html");(s||!i)&&this.addTextEntry(e,"plain",{type:"subMessage",value:n}),i&&this.addTextEntry(e,"html",{type:"subMessage",value:n}),r.textMap.forEach((o,u)=>{this.textMap.set(u,o)});for(let o of n.attachments)this.attachments.push(o)}collectAttachment(e,r,n,s){let i=e.contentDisposition.parsed.params.filename||e.contentType.parsed.params.name||null,o={filename:i?pe(Ze(i)):null,mimeType:e.contentType.parsed.value,disposition:e.contentDisposition.parsed.value||null};switch(n&&e.contentId&&!s&&(o.related=!0),s&&(o.rfc822DepthExceeded=!0),e.contentDescription&&(o.description=pe(e.contentDescription)),e.contentId&&(o.contentId=e.contentId),e.contentType.parsed.value){case"text/calendar":case"application/ics":{e.contentType.parsed.params.method&&(o.method=e.contentType.parsed.params.method.toString().toUpperCase().trim());let u=e.getTextContent(),a=u.length;for(;a>0&&u.charCodeAt(a-1)===10;)a--;o.content=ne.encode(u.slice(0,a)+`
25
+ `,",",";"].includes(s)?Oe|Us:Oe,r,r+1),e!==")"&&(this.afterAt=!1),this.operatorExpecting="",this.escaped=!1,this.resetInner();return}else if(!this.operatorExpecting&&!(this.inDomainLiteral&&e===":")&&e in this.operators){this.closeText(r),this.list.push(Oe,r,r+1),e===":"?this.inGroup=!0:e===";"&&(this.inGroup=!1),e!=="("&&(this.afterAt=!1),this.operatorExpecting=this.operators[e],this.escaped=!1,this.resetInner();return}else if((this.operatorExpecting==='"'||this.operatorExpecting===")")&&e==="\\"){this.escaped=!0,this.node>=0&&(this.list.slots[this.node*3]|=kt);return}}this.node<0&&(this.node=this.list.push((this.operatorExpecting==='"'||this.operatorExpecting===")"?Fs:0)|(this.escaped?ks:0),r,r)),e===`
26
+ `&&(e=" ",this.list.slots[this.node*3]|=kt),e.charCodeAt(0)>=33||e===" "||e===" "?!this.operatorExpecting&&e!==" "&&e!==" "&&(this.afterAt=e==="@"):this.list.slots[this.node*3]|=kt,this.escaped=!1}trackInner(e){return this.innerEscaped?(this.innerEscaped=!1,!0):this.innerQuoted?(e==="\\"?this.innerEscaped=!0:e==='"'&&(this.innerQuoted=!1),!0):this.innerComment?(e==="\\"?this.innerEscaped=!0:e==="("?this.innerComment++:e===")"&&this.innerComment--,!0):this.innerLiteral?(e==="]"&&(this.innerLiteral=!1),!0):e==='"'?(this.innerQuoted=!0,!0):e==="("?(this.innerComment=1,!0):e==="["&&this.afterAt?(this.innerLiteral=!0,!0):(J(e.charCodeAt(0))||(this.afterAt=e==="@"),!1)}resetInner(){this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1}};function Ns(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=t[r],s=e.length?e[e.length-1]:null;s&&n.address===""&&n.name&&!n.group&&s.address&&s.name?s.name=n.name+", "+s.name:e.push(n)}return e.reverse()}function hu(t){let e=new Er(t).tokenize(),r=[],n=null,s=[],i=0;for(let o=0,u=e.length;o<=u;o++){let a=o<u?e.operatorAt(o):"";if(!(o<u&&a!==","&&a!==";"&&a!==":")){if(a===":"){n||(n={name:fu(e,i,o),group:[]},s=[]),i=o+1;continue}o>i&&(n?s:r).push(du(e,i,o)),i=o+1,n&&(a===";"||o===u)&&(n.group=Ns(s),r.push(n),n=null)}}return Ns(r)}function pu(t,e){let r=hu(t);if(e&&e.flatten){let n=[],s=i=>{i.forEach(o=>{if(o.group)return s(o.group);n.push(o)})};return s(r),n}return r}var Rt=pu;function $s(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(t),s=n.byteLength,i=s%3,o=s-i,u,a,c,l,f;for(let h=0;h<o;h=h+3)f=n[h]<<16|n[h+1]<<8|n[h+2],u=(f&16515072)>>18,a=(f&258048)>>12,c=(f&4032)>>6,l=f&63,e+=r[u]+r[a]+r[c]+r[l];return i===1?(f=n[o],u=(f&252)>>2,a=(f&3)<<4,e+=r[u]+r[a]+"=="):i===2&&(f=n[o]<<8|n[o+1],u=(f&64512)>>10,a=(f&1008)>>4,c=(f&15)<<2,e+=r[u]+r[a]+r[c]+"="),e}var gu=/-?(?:\d{1,12}\.\d{1,3}|\d{1,15})/y,mu=/"((?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\["\\])*)"/y,yu=/[A-Za-z*][!#$%&'*+\-.^_`|~0-9A-Za-z:/]*/y,xu=/:[A-Za-z0-9+/=]*:/y,bu=/\?[01]/y,Au=/@-?\d{1,15}/y,wu=/%"((?:[\x20\x21\x23\x24\x26-\x7e]|%[0-9a-f]{2})*)"/y,Du=/[a-z*][a-z0-9_\-.*]*/y,Br=/ */y;function se(t,e){e.lastIndex=t.pos;let r=e.exec(t.input);return r&&(t.pos=e.lastIndex),r}function js(t){let e=se(t,mu);return e&&e[1].replace(/\\(["\\])/g,"$1")}function Eu(t){let e=se(t,wu);if(!e)return!1;try{return decodeURIComponent(e[1]),!0}catch{return!1}}function Bu(t){let e=t.input.charAt(t.pos);switch(e){case'"':return js(t)??!1;case":":return!!se(t,xu);case"?":return!!se(t,bu);case"@":return!!se(t,Au);case"%":return Eu(t)}return!!se(t,e==="-"||e>="0"&&e<="9"?gu:yu)}function Cu(t){let e={input:t,pos:0};se(e,Br);let r=js(e);if(r===null)return null;let n=new Map;for(;e.input[e.pos]===";";){e.pos++,se(e,Br);let s=se(e,Du);if(!s)return null;let i=!0;if(e.input[e.pos]==="="&&(e.pos++,i=Bu(e),i===!1))return null;n.set(s[0],i)}return se(e,Br),e.pos===e.input.length?{value:r,params:n}:null}function vu(t){let e;try{e=new URL(t)}catch{return!1}if(e.origin!==t||!/^([a-z0-9_-]+\.)*[a-z0-9_-]+$|^\[[0-9a-f:.]+\]$/.test(e.hostname))return!1;let r=/^(localhost|.+\.localhost|127(\.\d+){3}|\[::1\])$/.test(e.hostname);return e.protocol==="https:"||e.protocol==="http:"&&r}function zs(t){let e;for(let s of t)if(s.key==="otp-token"){if(e)return;e=s}if(!e||e.value.length>8192)return;let r=Cu(e.value),n=r?.params.get("origin");if(!(!r?.value||typeof n!="string"||!vu(n)))return{code:r.value,origin:n}}function Tu(t){return!!t&&typeof t.getReader=="function"}function Su(t){return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}function Fu(t){let e=Object.prototype.toString.call(t);return e==="[object ArrayBuffer]"||e==="[object SharedArrayBuffer]"}var ku=new Set(["arraybuffer","base64","utf8"]);function Ru(t){let e=String(t||"").replace(/[-_\s]/g,"").toLowerCase()||"arraybuffer";if(!ku.has(e))throw Q("EINVALIDOPTION",`Unknown attachment encoding ${e}`);return e}function Lu(t,e,r){return t.type==="subMessage"?e==="html"?Ss(t.value):Ts(t.value):r?e==="html"?Es(t.value):Cs(t.value):t.value}var Ou=new Uint8Array([10]),qu=256,_u=2*1024*1024,Nu=1e4,Uu=10,Iu=1e4;function Lt(t){if(!t)return 0;let e=0;for(let r of Array.isArray(t)?t:[t])e+=1+(r.group?r.group.length:0);return e}function et(t,e,r,n=0){if(t==null)return e;if(typeof t!="number"||!Number.isInteger(t)||t<n)throw Q("EINVALIDOPTION",`${r} must be a ${n?"positive":"non-negative"} integer`);return t}function Pu(t){return{maxNestingDepth:et(t.maxNestingDepth,qu,"maxNestingDepth"),maxHeadersSize:et(t.maxHeadersSize,_u,"maxHeadersSize"),maxPartCount:et(t.maxPartCount,Nu,"maxPartCount",1),maxRfc822NestingDepth:et(t.maxRfc822NestingDepth,Uu,"maxRfc822NestingDepth"),maxForwardedAddresses:et(t.maxForwardedAddresses,Iu,"maxForwardedAddresses")}}var qe=class t{static async parse(e,r){return new t(r).parse(e)}constructor(e,r){this.options=e||{},this.rfc822NestingDepth=r?r.rfc822NestingDepth+1:0,this.limits=r?r.limits:Pu(this.options),this.counters=r?r.counters:{headerSize:0,partCount:0,forwardedAddresses:0},this.root=this.currentNode=new Le({postalMime:this}),this.boundaries=[],this.textContent={},this.textMap=new Map,this.textTypes=new Set,this.attachments=[],this.forceRfc822Attachments=!1,this.attachmentEncoding=Ru(this.options.attachmentEncoding),this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,r,n){let s=this.boundaries;if(s.length&&e.length>2&&e[0]===45&&e[1]===45)for(let i=0;i<s.length;i++){let o=s[i];if(e.length<o.value.length+2)continue;let u=!0;for(let f=0;f<o.value.length;f++)if(e[f+2]!==o.value[f]){u=!1;break}if(!u)continue;let a=o.value.length+2,c=!1;e.length>=o.value.length+4&&e[o.value.length+2]===45&&e[o.value.length+3]===45&&(c=!0,a=o.value.length+4);let l=!0;for(let f=a;f<e.length;f++)if(!ae(e[f])){l=!1;break}if(l)return c?(await o.node.finalize(!0),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(!0),this.currentNode=new Le({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart})),n?this.finalize():void 0}if(this.currentNode.feed(e,r))return this.processLine(e,r,n);if(n)return this.finalize()}readLine(){let e=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let n=this.av[this.readPos++];if(n!==13&&n!==10&&(r=this.readPos),n===10)return{bytes:new Uint8Array(this.buf,e,r-e),lineBreak:this.av.subarray(r,this.readPos),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,e,r-e),lineBreak:Ou,done:this.readPos>=this.av.length}}addTextEntry(e,r,n){let s=this.textMap.get(e);s||(s={},this.textMap.set(e,s));let i=s[r]||[];s[r]=i,i.push(n),this.textTypes.add(r)}async collectNode(e,r,n){if(e.contentType.multipart)e.contentType.multipart==="alternative"?r=e:e.contentType.multipart==="related"&&(n=!0);else{let s=this.isInlineMessageRfc822(e),i=s&&this.rfc822NestingDepth>=this.limits.maxRfc822NestingDepth;if(s&&!i)await this.collectSubMessage(e);else if(this.isInlineTextNode(e)){let o=e.contentType.parsed.value==="text/html"?"html":"plain";this.addTextEntry(r||e,o,{type:"text",value:e.getTextContent()})}else e.content&&this.collectAttachment(e,e.content,n,i)}for(let s of e.childNodes)await this.collectNode(s,r,n)}async collectSubMessage(e){let r=new t({attachmentEncoding:"arraybuffer"},this),n=await r.parse(e.content||new ArrayBuffer(0));if(this.counters.forwardedAddresses+=Lt(n.from)+Lt(n.to)+Lt(n.cc)+Lt(n.bcc),this.counters.forwardedAddresses>this.limits.maxForwardedAddresses)throw Q("EMAXFORWARDEDADDRESSES",`Maximum forwarded address count of ${this.limits.maxForwardedAddresses} addresses exceeded`);let s=r.textTypes.has("plain"),i=r.textTypes.has("html");(s||!i)&&this.addTextEntry(e,"plain",{type:"subMessage",value:n}),i&&this.addTextEntry(e,"html",{type:"subMessage",value:n}),r.textMap.forEach((o,u)=>{this.textMap.set(u,o)});for(let o of n.attachments)this.attachments.push(o)}collectAttachment(e,r,n,s){let i=e.contentDisposition.parsed.params.filename||e.contentType.parsed.params.name||null,o={filename:i?pe(Ze(i)):null,mimeType:e.contentType.parsed.value,disposition:e.contentDisposition.parsed.value||null};switch(n&&e.contentId&&!s&&(o.related=!0),s&&(o.rfc822DepthExceeded=!0),e.contentDescription&&(o.description=pe(e.contentDescription)),e.contentId&&(o.contentId=e.contentId),e.contentType.parsed.value){case"text/calendar":case"application/ics":{e.contentType.parsed.params.method&&(o.method=e.contentType.parsed.params.method.toString().toUpperCase().trim());let u=e.getTextContent(),a=u.length;for(;a>0&&u.charCodeAt(a-1)===10;)a--;o.content=ne.encode(u.slice(0,a)+`
27
27
  `);break}default:o.content=r}this.attachments.push(o)}renderTextContent(){let e={};this.textMap.forEach(r=>{this.textTypes.forEach(n=>{let s=e[n]||[];e[n]=s;let i=r[n],o=i||r[n==="html"?"plain":"html"]||[];for(let u of o)s.push(Lu(u,n,!i))})}),Object.keys(e).forEach(r=>{this.textContent[r]=e[r].join(`
28
- `)})}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(e){if(this.forceRfc822Attachments||e.contentType.parsed.value!=="message/rfc822")return!1;let r=e.contentTransferEncoding.encoding;return r==="base64"||r==="quoted-printable"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}hasReportParts(){let e=!1,r=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)r(s)};return r(this.root),e}async resolveStream(e){let r=0,n=[],s=e.getReader();for(;;){let{done:u,value:a}=await s.read();if(u)break;if(!ArrayBuffer.isView(a)){let c=X("EINVALIDINPUT","Stream chunks must be Uint8Array values");throw s.cancel(c).catch(()=>{}),c}n.push(new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),r+=a.byteLength}let i=new Uint8Array(r),o=0;for(let u of n)i.set(u,o),o+=u.length;return i}async resolveInput(e){let r=e;if(Tu(r)&&(r=await this.resolveStream(r)),r=r||new ArrayBuffer(0),typeof r=="string"&&(r=ne.encode(r)),Su(r)&&(r=await Re(r)),ArrayBuffer.isView(r))return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(!Fu(r))throw X("EINVALIDINPUT","Unsupported email input type");return r}buildMessage(){let e=this.root.headers,r={headers:e.map(i=>({key:i.key,originalKey:i.originalKey,value:i.value}))};for(let i of["from","sender"]){let o=e.find(u=>u.key===i);if(o&&o.value){let u=Rt(o.value);u&&u.length&&(r[i]=u[0])}}for(let[i,o]of[["delivered-to","deliveredTo"],["return-path","returnPath"]]){let u=e.find(a=>a.key===i);if(u&&u.value){let a=Rt(u.value);a&&a.length&&a[0].address&&(r[o]=a[0].address)}}for(let[i,o]of[["to","to"],["cc","cc"],["bcc","bcc"],["reply-to","replyTo"]]){let u=[];for(let a of e)if(a.key===i&&a.value)for(let c of Rt(a.value))u.push(c);u.length&&(r[o]=u)}for(let[i,o]of[["subject","subject"],["message-id","messageId"],["in-reply-to","inReplyTo"],["references","references"]]){let u=e.find(a=>a.key===i);u&&u.value&&(r[o]=pe(u.value))}let n=e.find(i=>i.key==="date");if(n){let i=new Date(n.value);r.date=i.toString()==="Invalid Date"?n.value:i.toISOString()}let s=js(e);return s&&(r.otp=s),this.textContent.html&&(r.html=this.textContent.html),this.textContent.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=this.root.rawHeaderLines.slice(),r}encodeAttachments(){switch(this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let e of this.attachments)e.content&&typeof e.content!="string"&&(e.content=Hs(e.content),e.encoding="base64");break;case"utf8":{let e=new TextDecoder("utf8");for(let r of this.attachments)r.content&&typeof r.content!="string"&&(r.content=e.decode(r.content),r.encoding="utf8");break}}}async parse(e){if(this.started)throw X("EPARSERREUSED","Can not reuse parser, create a new PostalMime object");for(this.started=!0,this.buf=await this.resolveInput(e),this.av=new Uint8Array(this.buf),this.readPos=0;this.readPos<this.av.length;){let n=this.readLine();await this.processLine(n.bytes,n.lineBreak,n.done)}this.forceRfc822Attachments=!!this.options.forceRfc822Attachments||this.hasReportParts(),await this.collectNode(this.root,!1,!1),this.rfc822NestingDepth===0&&this.renderTextContent();let r=this.buildMessage();return this.encodeAttachments(),r}};var Mu=t=>{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4));return Uint8Array.from(e,r=>r.charCodeAt(0))},Hu=t=>{let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},Er=t=>t.reduce((e,r)=>e<<8n|BigInt(r),0n);function $u(t,e){let r=new Uint8Array(e);for(let n=e-1;n>=0;n--)r[n]=Number(t&0xffn),t>>=8n;return r}var Br=(t,e)=>Hu($u(t,e)),Ot=t=>Er(Mu(t)),qt=t=>Math.ceil(t.toString(16).length/2);function zs(t,e,r){let n=1n;for(t%=r;e>0n;)e&1n&&(n=n*t%r),t=t*t%r,e>>=1n;return n}function Ks(t,e){let[r,n]=[t%e,e],[s,i]=[1n,0n];for(;n!==0n;){let o=r/n;[r,n]=[n,r-o*n],[s,i]=[i,s-o*i]}if(r!==1n)throw new Error("sem inverso");return(s%e+e)%e}async function Gs(t,e){let r=qt(e)+32,n=[];for(let o=0,u=0;u<r;o++){let a=new Uint8Array(t.length+4);a.set(t),new DataView(a.buffer).setUint32(t.length,o);let c=new Uint8Array(await crypto.subtle.digest("SHA-256",a));n.push(c),u+=c.length}let s=new Uint8Array(n.reduce((o,u)=>o+u.length,0)),i=0;for(let o of n)s.set(o,i),i+=o.length;return Er(s)%e}var ju=(t=Date.now())=>Math.floor(t/(168*3600*1e3));function Vs(t=ju()){let e=new Uint8Array(36);return new DataView(e.buffer).setUint32(0,t),e.set(crypto.getRandomValues(new Uint8Array(32)),4),e}async function Ws(t,e){let r=qt(t.n);for(;;){let n=Er(crypto.getRandomValues(new Uint8Array(r)))%t.n;if(!(n<2n)){try{Ks(n,t.n)}catch{continue}return{blinded:await Gs(e,t.n)*zs(n,t.e,t.n)%t.n,r:n}}}}function Zs(t,e,r){return e*Ks(r,t.n)%t.n}async function Ys(t,e,r){return r>0n&&r<t.n&&zs(r,t.e,t.n)===await Gs(e,t.n)}var Xs=t=>({n:Ot(t.n),e:Ot(t.e)});function Qs(t){if(!t)return[];let e=[];for(let r of Array.isArray(t)?t:[t])if(r.group)for(let n of r.group)e.push({name:n.name||"",address:(n.address||"").toLowerCase()});else r.address&&e.push({name:r.name||"",address:r.address.toLowerCase()});return e}function zu(t,e){let r=t||"";return!r&&e&&(r=e.replace(/<(style|script|head)[\s\S]*?<\/\1>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")),r.replace(/\s+/g," ").trim().slice(0,110)}function Ku(t){let e=t.find(n=>n.key==="arc-authentication-results"||n.key==="authentication-results");if(!e||!/^\s*(i=1;\s*)?mx\.cloudflare\.net\s*;/i.test(e.value))return"unknown";let r=/\bdmarc=(\w+)/i.exec(e.value)?.[1]?.toLowerCase();return r==="pass"?"pass":r==="fail"?"fail":"unknown"}function Gu(t){let e=3735928559^t.length,r=1103547991^t.length;for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);e=Math.imul(e^s,2654435761),r=Math.imul(r^s,1597334677)}return e=Math.imul(e^e>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),(4294967296*(2097151&r)+(e>>>0)).toString(36)}var Cr=t=>(t||"").match(/<[^<>\s]+>/)?.[0]??(t||"").trim().split(/\s+/)[0]??"";function Vu(t){let e=Cr(t.references)||Cr(t.inReplyTo)||Cr(t.messageId);return e?Gu(e.toLowerCase()):""}function Js(t,e,r){let n=t.date&&!Number.isNaN(Date.parse(t.date))?new Date(t.date):r;return{from:Qs(t.from)[0]??null,to:Qs(t.to).slice(0,5),subject:(t.subject||"").trim().slice(0,200),date:n.toISOString(),snippet:zu(t.text,t.html),attachments:t.attachments.filter(s=>s.disposition!=="inline"||!s.contentId).length,t:Vu(t)||void 0,auth:e?"pass":Ku(t.headers),e2e:e}}async function vr(t,e){let r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}var me=[0,83,72,1],eo=t=>Math.max(256,2**(Math.ceil(Math.log2(t))-4));async function to(t){let e=await vr(t,new CompressionStream("gzip")),r=me.length+4+e.length,n=new Uint8Array(Math.ceil(r/eo(r))*eo(r));return n.set(me),new DataView(n.buffer).setUint32(me.length,e.length),n.set(e,me.length+4),n}var Wu=t=>t.length>2&&t[0]===31&&t[1]===139,Zu=t=>t.length>=8&&me.every((e,r)=>t[r]===e);async function ro(t){if(Zu(t)){let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(me.length);return vr(t.subarray(me.length+4,me.length+4+e),new DecompressionStream("gzip"))}return Wu(t)?vr(t,new DecompressionStream("gzip")):t}async function Tr(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-256",t)),r="";for(let n of e)r+=String.fromCharCode(n);return btoa(r)}var Sr=3,Yu=new TextEncoder,no=new TextDecoder;function Xu(t,e){let r=Y(t.c);if(!Vn.verify(Y(t.s),r,e))throw new Error("certificado do remetente com assinatura inv\xE1lida");let n=JSON.parse(no.decode(r));if(typeof n.a!="string"||typeof n.k!="string"||typeof n.i!="number"||typeof n.e!="number")throw new Error("certificado do remetente malformado");return n}async function Fr(t,e,r,n,s){let i=await Qn(t,Yu.encode(JSON.stringify(r)),"cert"),o=await ts(t,e,n,s);return Z(new Uint8Array([Sr,i.length>>8,i.length&255]),i,o)}var kr=t=>t[0]===Sr;async function Rr(t,e,r,n,s){if(e.length<4||e[0]!==Sr)throw new Error("n\xE3o \xE9 uma mensagem com remetente lacrado");let i=e[1]<<8|e[2],o=e.subarray(3,3+i),u=e.subarray(3+i),a=JSON.parse(no.decode(await Ve(t,o,"cert"))),c=Xu(a,n);if(s>c.e+300*1e3||s<c.i-300*1e3)throw new Error("certificado do remetente fora da validade");return{payload:await rs(t,Y(c.k),u,r),sender:{address:c.a.toLowerCase(),publicKey:c.k}}}var Ut=new TextEncoder,uo=t=>/^[\x20-\x7e]*$/.test(t);function Lr(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function Or(t){if(uo(t))return t;let e=[],r="";for(let n of t)Ut.encode(r+n).length>45&&(e.push(r),r=""),r+=n;return r&&e.push(r),e.map(n=>`=?UTF-8?B?${Lr(Ut.encode(n))}?=`).join(`\r
29
- `)}function _t(t){return t.name?`${uo(t.name)?`"${t.name.replace(/["\\]/g,"\\$&")}"`:Or(t.name)} <${t.address}>`:t.address}var Nt=t=>t.replace(/[\r\n]+/g," ");function so(t,e){let r=Lr(Ut.encode(e)).replace(/.{1,76}/g,`$&\r
28
+ `)})}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(e){if(this.forceRfc822Attachments||e.contentType.parsed.value!=="message/rfc822")return!1;let r=e.contentTransferEncoding.encoding;return r==="base64"||r==="quoted-printable"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}hasReportParts(){let e=!1,r=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)r(s)};return r(this.root),e}async resolveStream(e){let r=0,n=[],s=e.getReader();for(;;){let{done:u,value:a}=await s.read();if(u)break;if(!ArrayBuffer.isView(a)){let c=Q("EINVALIDINPUT","Stream chunks must be Uint8Array values");throw s.cancel(c).catch(()=>{}),c}n.push(new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),r+=a.byteLength}let i=new Uint8Array(r),o=0;for(let u of n)i.set(u,o),o+=u.length;return i}async resolveInput(e){let r=e;if(Tu(r)&&(r=await this.resolveStream(r)),r=r||new ArrayBuffer(0),typeof r=="string"&&(r=ne.encode(r)),Su(r)&&(r=await Re(r)),ArrayBuffer.isView(r))return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(!Fu(r))throw Q("EINVALIDINPUT","Unsupported email input type");return r}buildMessage(){let e=this.root.headers,r={headers:e.map(i=>({key:i.key,originalKey:i.originalKey,value:i.value}))};for(let i of["from","sender"]){let o=e.find(u=>u.key===i);if(o&&o.value){let u=Rt(o.value);u&&u.length&&(r[i]=u[0])}}for(let[i,o]of[["delivered-to","deliveredTo"],["return-path","returnPath"]]){let u=e.find(a=>a.key===i);if(u&&u.value){let a=Rt(u.value);a&&a.length&&a[0].address&&(r[o]=a[0].address)}}for(let[i,o]of[["to","to"],["cc","cc"],["bcc","bcc"],["reply-to","replyTo"]]){let u=[];for(let a of e)if(a.key===i&&a.value)for(let c of Rt(a.value))u.push(c);u.length&&(r[o]=u)}for(let[i,o]of[["subject","subject"],["message-id","messageId"],["in-reply-to","inReplyTo"],["references","references"]]){let u=e.find(a=>a.key===i);u&&u.value&&(r[o]=pe(u.value))}let n=e.find(i=>i.key==="date");if(n){let i=new Date(n.value);r.date=i.toString()==="Invalid Date"?n.value:i.toISOString()}let s=zs(e);return s&&(r.otp=s),this.textContent.html&&(r.html=this.textContent.html),this.textContent.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=this.root.rawHeaderLines.slice(),r}encodeAttachments(){switch(this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let e of this.attachments)e.content&&typeof e.content!="string"&&(e.content=$s(e.content),e.encoding="base64");break;case"utf8":{let e=new TextDecoder("utf8");for(let r of this.attachments)r.content&&typeof r.content!="string"&&(r.content=e.decode(r.content),r.encoding="utf8");break}}}async parse(e){if(this.started)throw Q("EPARSERREUSED","Can not reuse parser, create a new PostalMime object");for(this.started=!0,this.buf=await this.resolveInput(e),this.av=new Uint8Array(this.buf),this.readPos=0;this.readPos<this.av.length;){let n=this.readLine();await this.processLine(n.bytes,n.lineBreak,n.done)}this.forceRfc822Attachments=!!this.options.forceRfc822Attachments||this.hasReportParts(),await this.collectNode(this.root,!1,!1),this.rfc822NestingDepth===0&&this.renderTextContent();let r=this.buildMessage();return this.encodeAttachments(),r}};var Mu=t=>{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4));return Uint8Array.from(e,r=>r.charCodeAt(0))},Hu=t=>{let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},Cr=t=>t.reduce((e,r)=>e<<8n|BigInt(r),0n);function $u(t,e){let r=new Uint8Array(e);for(let n=e-1;n>=0;n--)r[n]=Number(t&0xffn),t>>=8n;return r}var vr=(t,e)=>Hu($u(t,e)),Ot=t=>Cr(Mu(t)),qt=t=>Math.ceil(t.toString(16).length/2);function Ks(t,e,r){let n=1n;for(t%=r;e>0n;)e&1n&&(n=n*t%r),t=t*t%r,e>>=1n;return n}function Gs(t,e){let[r,n]=[t%e,e],[s,i]=[1n,0n];for(;n!==0n;){let o=r/n;[r,n]=[n,r-o*n],[s,i]=[i,s-o*i]}if(r!==1n)throw new Error("sem inverso");return(s%e+e)%e}async function Vs(t,e){let r=qt(e)+32,n=[];for(let o=0,u=0;u<r;o++){let a=new Uint8Array(t.length+4);a.set(t),new DataView(a.buffer).setUint32(t.length,o);let c=new Uint8Array(await crypto.subtle.digest("SHA-256",a));n.push(c),u+=c.length}let s=new Uint8Array(n.reduce((o,u)=>o+u.length,0)),i=0;for(let o of n)s.set(o,i),i+=o.length;return Cr(s)%e}var ju=(t=Date.now())=>Math.floor(t/(168*3600*1e3));function Ws(t=ju()){let e=new Uint8Array(36);return new DataView(e.buffer).setUint32(0,t),e.set(crypto.getRandomValues(new Uint8Array(32)),4),e}async function Zs(t,e){let r=qt(t.n);for(;;){let n=Cr(crypto.getRandomValues(new Uint8Array(r)))%t.n;if(!(n<2n)){try{Gs(n,t.n)}catch{continue}return{blinded:await Vs(e,t.n)*Ks(n,t.e,t.n)%t.n,r:n}}}}function Ys(t,e,r){return e*Gs(r,t.n)%t.n}async function Xs(t,e,r){return r>0n&&r<t.n&&Ks(r,t.e,t.n)===await Vs(e,t.n)}var Qs=t=>({n:Ot(t.n),e:Ot(t.e)});function Js(t){if(!t)return[];let e=[];for(let r of Array.isArray(t)?t:[t])if(r.group)for(let n of r.group)e.push({name:n.name||"",address:(n.address||"").toLowerCase()});else r.address&&e.push({name:r.name||"",address:r.address.toLowerCase()});return e}function zu(t,e){let r=t||"";return!r&&e&&(r=e.replace(/<(style|script|head)[\s\S]*?<\/\1>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")),r.replace(/\s+/g," ").trim().slice(0,110)}function Ku(t){let e=t.find(n=>n.key==="arc-authentication-results"||n.key==="authentication-results");if(!e||!/^\s*(i=1;\s*)?mx\.cloudflare\.net\s*;/i.test(e.value))return"unknown";let r=/\bdmarc=(\w+)/i.exec(e.value)?.[1]?.toLowerCase();return r==="pass"?"pass":r==="fail"?"fail":"unknown"}function Gu(t){let e=3735928559^t.length,r=1103547991^t.length;for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);e=Math.imul(e^s,2654435761),r=Math.imul(r^s,1597334677)}return e=Math.imul(e^e>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),(4294967296*(2097151&r)+(e>>>0)).toString(36)}var Tr=t=>(t||"").match(/<[^<>\s]+>/)?.[0]??(t||"").trim().split(/\s+/)[0]??"";function Vu(t){let e=Tr(t.references)||Tr(t.inReplyTo)||Tr(t.messageId);return e?Gu(e.toLowerCase()):""}function eo(t,e,r){let n=t.date&&!Number.isNaN(Date.parse(t.date))?new Date(t.date):r;return{from:Js(t.from)[0]??null,to:Js(t.to).slice(0,5),subject:(t.subject||"").trim().slice(0,200),date:n.toISOString(),snippet:zu(t.text,t.html),attachments:t.attachments.filter(s=>s.disposition!=="inline"||!s.contentId).length,t:Vu(t)||void 0,auth:e?"pass":Ku(t.headers),e2e:e}}async function Sr(t,e){let r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}var ge=[0,83,72,1],to=t=>Math.max(256,2**(Math.ceil(Math.log2(t))-4));async function ro(t){let e=await Sr(t,new CompressionStream("gzip")),r=ge.length+4+e.length,n=new Uint8Array(Math.ceil(r/to(r))*to(r));return n.set(ge),new DataView(n.buffer).setUint32(ge.length,e.length),n.set(e,ge.length+4),n}var Wu=t=>t.length>2&&t[0]===31&&t[1]===139,Zu=t=>t.length>=8&&ge.every((e,r)=>t[r]===e);async function no(t){if(Zu(t)){let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(ge.length);return Sr(t.subarray(ge.length+4,ge.length+4+e),new DecompressionStream("gzip"))}return Wu(t)?Sr(t,new DecompressionStream("gzip")):t}async function Fr(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-256",t)),r="";for(let n of e)r+=String.fromCharCode(n);return btoa(r)}var kr=3,Yu=new TextEncoder,so=new TextDecoder;function Xu(t,e){let r=X(t.c);if(!Zn.verify(X(t.s),r,e))throw new Error("certificado do remetente com assinatura inv\xE1lida");let n=JSON.parse(so.decode(r));if(typeof n.a!="string"||typeof n.k!="string"||typeof n.i!="number"||typeof n.e!="number")throw new Error("certificado do remetente malformado");return n}async function Rr(t,e,r,n,s){let i=await Jn(t,Yu.encode(JSON.stringify(r)),"cert"),o=await rs(t,e,n,s);return Z(new Uint8Array([kr,i.length>>8,i.length&255]),i,o)}var Lr=t=>t[0]===kr;async function Or(t,e,r,n,s){if(e.length<4||e[0]!==kr)throw new Error("n\xE3o \xE9 uma mensagem com remetente lacrado");let i=e[1]<<8|e[2],o=e.subarray(3,3+i),u=e.subarray(3+i),a=JSON.parse(so.decode(await Ve(t,o,"cert"))),c=Xu(a,n);if(s>c.e+300*1e3||s<c.i-300*1e3)throw new Error("certificado do remetente fora da validade");return{payload:await ns(t,X(c.k),u,r),sender:{address:c.a.toLowerCase(),publicKey:c.k}}}var Ut=new TextEncoder,ao=t=>/^[\x20-\x7e]*$/.test(t);function qr(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function _r(t){if(ao(t))return t;let e=[],r="";for(let n of t)Ut.encode(r+n).length>45&&(e.push(r),r=""),r+=n;return r&&e.push(r),e.map(n=>`=?UTF-8?B?${qr(Ut.encode(n))}?=`).join(`\r
29
+ `)}function _t(t){return t.name?`${ao(t.name)?`"${t.name.replace(/["\\]/g,"\\$&")}"`:_r(t.name)} <${t.address}>`:t.address}var Nt=t=>t.replace(/[\r\n]+/g," ");function oo(t,e){let r=qr(Ut.encode(e)).replace(/.{1,76}/g,`$&\r
30
30
  `);return`Content-Type: ${t}; charset=utf-8\r
31
31
  Content-Transfer-Encoding: base64\r
32
32
  \r
33
- ${r}`}function oo(t){let e=Or(Nt(t.filename)).replace(/"/g,""),r=t.cid?"inline":"attachment";return`${[`Content-Type: ${t.type}; name="${e}"`,`Content-Disposition: ${r}; filename="${e}"`,"Content-Transfer-Encoding: base64",t.cid?`Content-ID: <${t.cid}>`:""].filter(Boolean).join(`\r
33
+ ${r}`}function io(t){let e=_r(Nt(t.filename)).replace(/"/g,""),r=t.cid?"inline":"attachment";return`${[`Content-Type: ${t.type}; name="${e}"`,`Content-Disposition: ${r}; filename="${e}"`,"Content-Transfer-Encoding: base64",t.cid?`Content-ID: <${t.cid}>`:""].filter(Boolean).join(`\r
34
34
  `)}\r
35
35
  \r
36
- ${Lr(t.content).replace(/.{1,76}/g,`$&\r
36
+ ${qr(t.content).replace(/.{1,76}/g,`$&\r
37
37
  `)}`}function Qu(t){let e=`alt-${crypto.randomUUID()}`,r={type:`multipart/alternative; boundary="${e}"`,content:`--${e}\r
38
- ${so("text/plain",t.text)}--${e}\r
39
- ${so("text/html",t.html)}--${e}--\r
38
+ ${oo("text/plain",t.text)}--${e}\r
39
+ ${oo("text/html",t.html)}--${e}--\r
40
40
  `},n=(t.attachments??[]).filter(i=>i.cid),s=(t.attachments??[]).filter(i=>!i.cid);if(n.length){let i=`rel-${crypto.randomUUID()}`;r={type:`multipart/related; boundary="${i}"`,content:`--${i}\r
41
41
  Content-Type: ${r.type}\r
42
42
  \r
43
43
  ${r.content}${n.map(o=>`--${i}\r
44
- ${oo(o)}`).join("")}--${i}--\r
44
+ ${io(o)}`).join("")}--${i}--\r
45
45
  `}}if(s.length){let i=`mix-${crypto.randomUUID()}`;r={type:`multipart/mixed; boundary="${i}"`,content:`--${i}\r
46
46
  Content-Type: ${r.type}\r
47
47
  \r
48
48
  ${r.content}${s.map(o=>`--${i}\r
49
- ${oo(o)}`).join("")}--${i}--\r
50
- `}}return r}function qr(t,e){let r=[`From: ${_t(t.from)}`,t.to.length?`To: ${t.to.map(_t).join(", ")}`:"",t.cc.length?`Cc: ${t.cc.map(_t).join(", ")}`:"",e&&t.bcc.length?`Bcc: ${t.bcc.map(_t).join(", ")}`:"",`Subject: ${Or(Nt(t.subject))}`,`Date: ${t.date.toUTCString().replace("GMT","+0000")}`,`Message-ID: ${t.messageId}`,t.inReplyTo?`In-Reply-To: ${Nt(t.inReplyTo)}`:"",t.references?`References: ${Nt(t.references)}`:"","MIME-Version: 1.0"].filter(Boolean),n=Qu(t);return Ut.encode(`${r.join(`\r
49
+ ${io(o)}`).join("")}--${i}--\r
50
+ `}}return r}function Nr(t,e){let r=[`From: ${_t(t.from)}`,t.to.length?`To: ${t.to.map(_t).join(", ")}`:"",t.cc.length?`Cc: ${t.cc.map(_t).join(", ")}`:"",e&&t.bcc.length?`Bcc: ${t.bcc.map(_t).join(", ")}`:"",`Subject: ${_r(Nt(t.subject))}`,`Date: ${t.date.toUTCString().replace("GMT","+0000")}`,`Message-ID: ${t.messageId}`,t.inReplyTo?`In-Reply-To: ${Nt(t.inReplyTo)}`:"",t.references?`References: ${Nt(t.references)}`:"","MIME-Version: 1.0"].filter(Boolean),n=Qu(t);return Ut.encode(`${r.join(`\r
51
51
  `)}\r
52
52
  Content-Type: ${n.type}\r
53
53
  \r
54
- ${n.content}`)}function ao(t){return`<${crypto.randomUUID()}@${t}>`}var io=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function co(t,e){let r=io(t).replace(/https?:\/\/[^\s<]+/g,s=>`<a href="${s}">${s}</a>`).replace(/\n/g,"<br>"),n=e?`<br><div>${io(e.header)}</div><blockquote style="margin:0 0 0 .8ex;border-left:2px solid #ccc;padding-left:1ex">${e.html}</blockquote>`:"";return`<div style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5">${r}${n}</div>`}var _e="shalomail.com",q=class extends Error{constructor(r,n,s){super(s);this.status=r;this.code=n}status;code},Ju={bad_key:"Invalid or revoked API key. For your account, run `shalom login`; for an agent mailbox, run `shalom agents rotate <address>` on the machine that has it.",reserved:"That address is reserved. Pick another name, for example yourname-bot.",bad_recipient:"Invalid recipient address.",bad_folder:"Unknown folder.",too_big:"Too large: up to 4 MB of attachments to outside addresses and 5 MB per message to Shalom addresses.",full:"The mailbox is full.",no_such_user:"That Shalom address does not exist.",not_found:"Not found.",key_scope:"This key cannot do that. Account keys manage agents; agent keys read and send mail.",agent_limit:"Your plan has no free agent mailbox left. Delete one, or upgrade with `shalom upgrade`.",create_limit:"You reached the daily limit of new agent mailboxes. Try again tomorrow.",agent_paused:"This agent mailbox is paused because the owner's plan no longer covers it. It still receives mail.",taken:"That address is already taken.",bad_address:"That address cannot be used. Use letters, numbers, dots, dashes or underscores.",send_limit:"Daily sending limit reached for this mailbox.",send_limit_all:"Shalom's daily limit for mail to outside addresses was reached. Mail to Shalom addresses still works.",too_many:"Too many requests. Try again later.",slow_down:"Too many requests in a row. Wait a minute.",billing_off:"Billing is not enabled yet.",no_session:"Not logged in. Run `shalom login`."};async function j(t,e,r,n,s={}){let i={"x-shalom":"1","user-agent":"shalom-cli"};s.anonymous||(i.authorization=`Bearer ${t.key}`),n!==void 0&&(i["content-type"]="application/json");let o;try{o=await fetch(`${t.api}/api${r}`,{method:e,headers:i,body:n===void 0?void 0:JSON.stringify(n)})}catch(a){throw new q(0,"offline",`Could not reach ${t.api} (${a.message}).`)}if(s.raw&&o.ok)return new Uint8Array(await o.arrayBuffer());let u=await o.json().catch(()=>({}));if(!o.ok){let a=u.error??`http_${o.status}`;throw new q(o.status,a,Ju[a]??u.message??`Request failed (${o.status}).`)}return u}var ea={"https://shalomail.com":"e8088912b446162136659e1674b67e8d4cd9435c1b7a89057492365d715e9004"},ta=async t=>[...new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)))].map(e=>e.toString(16).padStart(2,"0")).join("");async function ra(t,e){let r=await j({api:t,key:""},"GET","/auth/config",void 0,{anonymous:!0}),n=JSON.stringify({certKey:r.certKey,tokenKey:r.tokenKey}),s=ea[t.replace(/\/+$/,"")];if(s&&s!==await ta(n)||e&&e!==n)throw new q(0,"server_keys","The server's signing keys are not the ones this package trusts. Stopping for safety.");return{cert:Y(r.certKey),token:Xs(r.tokenKey),wire:n}}var It=class{constructor(e,r){this.agent=e;this.pins=r}agent;pins;keys=null;bodyHashes=new Map;cert=null;get creds(){return{api:this.agent.api,key:this.agent.key}}server(){return this.keys??=ra(this.agent.api,this.pins.server).then(e=>(this.pins.server||this.pins.onServer(e.wire),e)),this.keys}async summarize(e){let r=Y(e.head),n,s=!1;try{if(kr(r)){let{payload:i,sender:o}=await Rr(this.agent.secretKey,r,"head",(await this.server()).cert,e.received_at);n=JSON.parse(new TextDecoder().decode(i)),n={...n,from:{name:n.from?.name??"",address:o.address}},s=!0,n.b&&this.bodyHashes.set(e.id,n.b)}else n=await Jn(this.agent.secretKey,r)}catch{n={from:null,to:[],subject:"(unreadable)",date:new Date(e.received_at).toISOString(),snippet:"",attachments:0,auth:"fail",e2e:!1}}return{id:e.id,folder:e.folder,from:n.from,to:n.to,subject:n.subject,date:n.date,receivedAt:e.received_at,snippet:n.snippet,attachments:n.attachments,unread:!e.seen,starred:!!e.starred,verifiedSender:s,auth:n.auth}}async list(e="inbox",r=20,n){let s=new URLSearchParams({folder:e,limit:String(Math.min(Math.max(r,1),100))});n&&s.set("before",String(n));let{messages:i,more:o}=await j(this.creds,"GET",`/messages?${s}`);return{messages:await Promise.all(i.map(u=>this.summarize(u))),more:o}}async find(e){if(/^[0-9a-f-]{36}$/i.test(e))try{return(await j(this.creds,"GET",`/messages/${e}`)).message}catch(r){throw r instanceof q&&r.status===404?new q(404,"not_found",`Message ${e} not found.`):r}for(let r of["inbox","archive","sent","spam","trash"]){let n;for(let s=0;s<5;s++){let i=new URLSearchParams({folder:r,limit:"100"});n&&i.set("before",String(n));let{messages:o,more:u}=await j(this.creds,"GET",`/messages?${i}`),a=o.find(c=>c.id===e||e.length>=6&&c.id.startsWith(e));if(a)return a;if(!u||!o.length)break;n=o[o.length-1].received_at}}throw new q(404,"not_found",`Message ${e} not found.`)}async read(e){let r=await this.find(e),n=await this.summarize(r),s=await j(this.creds,"GET",`/messages/${r.id}/raw`,void 0,{raw:!0}),i;if(kr(s)){let u=await Rr(this.agent.secretKey,s,"raw",(await this.server()).cert,r.received_at);if(n.verifiedSender&&u.sender.address!==n.from?.address)throw new q(0,"tampered","The message body does not match its sender.");let a=this.bodyHashes.get(r.id);if(a&&await Tr(u.payload)!==a)throw new q(0,"tampered","The message body does not belong to this message.");i=u.payload}else{if(n.verifiedSender)throw new q(0,"tampered","The message body is not sealed by its sender.");i=await Ve(this.agent.secretKey,s,"raw")}let o=await qe.parse(await ro(i),{attachmentEncoding:"arraybuffer"});return{summary:n,email:o}}update(e,r){return j(this.creds,"POST","/messages/update",{ids:e,...r})}async myCert(){if(this.cert&&this.cert.until>Date.now()+24*3600*1e3)return this.cert.signed;let{cert:e}=await j(this.creds,"POST","/cert",{});return this.cert={signed:e,until:JSON.parse(new TextDecoder().decode(Y(e.c))).e},e}async tokens(e){let r=[],n=(await this.server()).token,s=qt(n.n);for(;r.length<e;){let i=await Promise.all(Array.from({length:Math.min(20,e-r.length)},async()=>{let u=Vs();return{token:u,...await Ws(n,u)}})),{signed:o}=await j(this.creds,"POST","/tokens",{blinded:i.map(u=>Br(u.blinded,s))});for(let u=0;u<i.length;u++){let a=Zs(n,Ot(o[u]),i[u].r);if(!await Ys(n,i[u].token,a))throw new q(0,"bad_tokens","The server returned an invalid delivery ticket.");r.push({token:i[u].token,sig:Br(a,s)})}}return r}async unread(e="inbox",r=20,n=10){let s=[],i;for(let o=0;o<n&&s.length<r;o++){let{messages:u,more:a}=await this.list(e,100,i);if(s.push(...u.filter(c=>c.unread)),!a||!u.length)break;i=u[u.length-1].receivedAt}return s.slice(0,r)}async unseen(e,r=10){let n=[],s;for(let i=0;i<r;i++){let{messages:o,more:u}=await this.list("inbox",100,s),a=o.filter(c=>!e.has(c.id));if(n.push(...a),a.length<o.length||!u||!o.length)break;s=o[o.length-1].receivedAt}return n.sort((i,o)=>i.receivedAt-o.receivedAt)}async sealed(e,r,n){let s=await to(r),i={...Js(await qe.parse(r),!0,new Date),b:await Tr(s)};return{head:re(await Fr(e,this.agent.secretKey,n,new TextEncoder().encode(JSON.stringify(i)),"head")),raw:re(await Fr(e,this.agent.secretKey,n,s,"raw"))}}async publicKeyOf(e){return(await j(this.creds,"POST","/keys",{address:e},{anonymous:!0})).publicKey}async send(e,r){let n=e.cc??[],s=e.bcc??[],i=[...e.to,...n,...s],o=d=>d.toLowerCase().endsWith(`@${_e}`),u=e.html??co(e.text),a={from:e.from,to:e.to,cc:n,bcc:s,subject:e.subject,text:e.text,html:u,messageId:ao(_e),inReplyTo:e.inReplyTo,references:e.references,date:new Date,attachments:e.attachments},c=qr(a,!1),l=qr(a,!0),f=await this.myCert(),h=[...new Set(i.map(d=>d.address.toLowerCase()).filter(o))],p=[];for(let d of h){let x=await this.publicKeyOf(d);if(!x)throw new q(404,"no_such_user",`${d} does not exist.`);r(d,x),p.push({address:d,...await this.sealed(Y(x),c,f)})}let g=Math.ceil((5*1024*1024+2048)/3)*4;if(p.some(d=>d.raw.length>g))throw new q(413,"too_big","Too large for Shalom addresses: up to 5 MB per message.");let m=await this.tokens(p.length),y=d=>d.filter(x=>!o(x.address)),v=i.filter(d=>!o(d.address)).length,D=await j(this.creds,"POST","/send",{...v?{to:y(e.to),cc:y(n),bcc:y(s),subject:e.subject,text:e.text,html:u,inReplyTo:e.inReplyTo,references:e.references,messageId:a.messageId,attachments:(e.attachments??[]).map(d=>({filename:d.filename,type:d.type,content:re(d.content),cid:d.cid}))}:{},sentCopy:await this.sealed(Xn(this.agent.secretKey),l,f)});for(let[d,x]of p.entries()){let w=m[d];await j(this.creds,"POST","/deliver",{to:x.address,head:x.head,raw:x.raw,token:re(w.token),sig:w.sig},{anonymous:!0})}return{id:D.id,external:v,internal:p.length}}};var na=t=>t?t.name?`${t.name} <${t.address}>`:t.address:"(unknown)",sa=t=>new Date(t).toISOString().replace("T"," ").slice(0,16);function oa(t){return t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
54
+ ${n.content}`)}function co(t){return`<${crypto.randomUUID()}@${t}>`}var uo=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function lo(t,e){let r=uo(t).replace(/https?:\/\/[^\s<]+/g,s=>`<a href="${s}">${s}</a>`).replace(/\n/g,"<br>"),n=e?`<br><div>${uo(e.header)}</div><blockquote style="margin:0 0 0 .8ex;border-left:2px solid #ccc;padding-left:1ex">${e.html}</blockquote>`:"";return`<div style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5">${r}${n}</div>`}var _e="shalomail.com",q=class extends Error{constructor(r,n,s){super(s);this.status=r;this.code=n}status;code},Ju={bad_key:"Invalid or revoked API key. For your account, run `shalom login`; for an agent mailbox, run `shalom agents rotate <address>` on the machine that has it.",reserved:"That address is reserved. Pick another name, for example yourname-bot.",bad_recipient:"Invalid recipient address.",bad_folder:"Unknown folder.",too_big:"Too large: up to 4 MB of attachments to outside addresses and 5 MB per message to Shalom addresses.",full:"The mailbox is full.",no_such_user:"That Shalom address does not exist.",not_found:"Not found.",key_scope:"This key cannot do that. Account keys manage agents; agent keys read and send mail.",agent_limit:"Your plan has no free agent mailbox left. Delete one, or upgrade with `shalom upgrade`.",create_limit:"You reached the daily limit of new agent mailboxes. Try again tomorrow.",agent_paused:"This agent mailbox is paused because the owner's plan no longer covers it. It still receives mail.",taken:"That address is already taken.",bad_address:"That address cannot be used. Use letters, numbers, dots, dashes or underscores.",send_limit:"Daily sending limit reached for this mailbox.",send_limit_all:"Shalom's daily limit for mail to outside addresses was reached. Mail to Shalom addresses still works.",too_many:"Too many requests. Try again later.",slow_down:"Too many requests in a row. Wait a minute.",billing_off:"Billing is not enabled yet.",no_session:"Not logged in. Run `shalom login`."};async function j(t,e,r,n,s={}){let i={"x-shalom":"1","user-agent":"shalom-cli"};s.anonymous||(i.authorization=`Bearer ${t.key}`),n!==void 0&&(i["content-type"]="application/json");let o;try{o=await fetch(`${t.api}/api${r}`,{method:e,headers:i,body:n===void 0?void 0:JSON.stringify(n)})}catch(a){throw new q(0,"offline",`Could not reach ${t.api} (${a.message}).`)}if(s.raw&&o.ok)return new Uint8Array(await o.arrayBuffer());let u=await o.json().catch(()=>({}));if(!o.ok){let a=u.error??`http_${o.status}`;throw new q(o.status,a,Ju[a]??u.message??`Request failed (${o.status}).`)}return u}var ea={"https://shalomail.com":"e8088912b446162136659e1674b67e8d4cd9435c1b7a89057492365d715e9004"},ta=async t=>[...new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)))].map(e=>e.toString(16).padStart(2,"0")).join("");async function ra(t,e){let r=await j({api:t,key:""},"GET","/auth/config",void 0,{anonymous:!0}),n=JSON.stringify({certKey:r.certKey,tokenKey:r.tokenKey}),s=ea[t.replace(/\/+$/,"")];if(s&&s!==await ta(n)||e&&e!==n)throw new q(0,"server_keys","The server's signing keys are not the ones this package trusts. Stopping for safety.");return{cert:X(r.certKey),token:Qs(r.tokenKey),wire:n}}var It=class{constructor(e,r){this.agent=e;this.pins=r}agent;pins;keys=null;bodyHashes=new Map;cert=null;get creds(){return{api:this.agent.api,key:this.agent.key}}server(){return this.keys??=ra(this.agent.api,this.pins.server).then(e=>(this.pins.server||this.pins.onServer(e.wire),e)),this.keys}async summarize(e){let r=X(e.head),n,s=!1,i=!1;try{if(Lr(r)){let{payload:o,sender:u}=await Or(this.agent.secretKey,r,"head",(await this.server()).cert,e.received_at);n=JSON.parse(new TextDecoder().decode(o)),n={...n,from:{name:n.from?.name??"",address:u.address}};let a=u.address===this.agent.address.toLowerCase()?u.publicKey===Y(hr(this.agent.secretKey)):this.pins.contactKey?.(u.address,u.publicKey)??!0;s=a,i=!a,n.b&&this.bodyHashes.set(e.id,n.b)}else n=await es(this.agent.secretKey,r)}catch{n={from:null,to:[],subject:"(unreadable)",date:new Date(e.received_at).toISOString(),snippet:"",attachments:0,auth:"fail",e2e:!1}}return{id:e.id,folder:e.folder,from:n.from,to:n.to,subject:n.subject,date:n.date,receivedAt:e.received_at,snippet:n.snippet,attachments:n.attachments,unread:!e.seen,starred:!!e.starred,verifiedSender:s,auth:n.auth,...i?{keyChanged:!0}:{}}}async list(e="inbox",r=20,n){let s=new URLSearchParams({folder:e,limit:String(Math.min(Math.max(r,1),100))});n&&s.set("before",String(n));let{messages:i,more:o}=await j(this.creds,"GET",`/messages?${s}`);return{messages:await Promise.all(i.map(u=>this.summarize(u))),more:o}}async find(e){if(/^[0-9a-f-]{36}$/i.test(e))try{return(await j(this.creds,"GET",`/messages/${e}`)).message}catch(r){throw r instanceof q&&r.status===404?new q(404,"not_found",`Message ${e} not found.`):r}for(let r of["inbox","archive","sent","spam","trash"]){let n;for(let s=0;s<5;s++){let i=new URLSearchParams({folder:r,limit:"100"});n&&i.set("before",String(n));let{messages:o,more:u}=await j(this.creds,"GET",`/messages?${i}`),a=o.find(c=>c.id===e||e.length>=6&&c.id.startsWith(e));if(a)return a;if(!u||!o.length)break;n=o[o.length-1].received_at}}throw new q(404,"not_found",`Message ${e} not found.`)}async read(e){let r=await this.find(e),n=await this.summarize(r),s=await j(this.creds,"GET",`/messages/${r.id}/raw`,void 0,{raw:!0}),i;if(Lr(s)){let u=await Or(this.agent.secretKey,s,"raw",(await this.server()).cert,r.received_at);if(n.verifiedSender&&u.sender.address!==n.from?.address)throw new q(0,"tampered","The message body does not match its sender.");let a=this.bodyHashes.get(r.id);if(a&&await Fr(u.payload)!==a)throw new q(0,"tampered","The message body does not belong to this message.");i=u.payload}else{if(n.verifiedSender)throw new q(0,"tampered","The message body is not sealed by its sender.");i=await Ve(this.agent.secretKey,s,"raw")}let o=await qe.parse(await no(i),{attachmentEncoding:"arraybuffer"});return{summary:n,email:o}}update(e,r){return j(this.creds,"POST","/messages/update",{ids:e,...r})}async myCert(){if(this.cert&&this.cert.until>Date.now()+24*3600*1e3)return this.cert.signed;let{cert:e}=await j(this.creds,"POST","/cert",{});return this.cert={signed:e,until:JSON.parse(new TextDecoder().decode(X(e.c))).e},e}async tokens(e){let r=[],n=(await this.server()).token,s=qt(n.n);for(;r.length<e;){let i=await Promise.all(Array.from({length:Math.min(20,e-r.length)},async()=>{let u=Ws();return{token:u,...await Zs(n,u)}})),{signed:o}=await j(this.creds,"POST","/tokens",{blinded:i.map(u=>vr(u.blinded,s))});for(let u=0;u<i.length;u++){let a=Ys(n,Ot(o[u]),i[u].r);if(!await Xs(n,i[u].token,a))throw new q(0,"bad_tokens","The server returned an invalid delivery ticket.");r.push({token:i[u].token,sig:vr(a,s)})}}return r}async unread(e="inbox",r=20,n=10){let s=[],i;for(let o=0;o<n&&s.length<r;o++){let{messages:u,more:a}=await this.list(e,100,i);if(s.push(...u.filter(c=>c.unread)),!a||!u.length)break;i=u[u.length-1].receivedAt}return s.slice(0,r)}async unseen(e,r=10){let n=[],s;for(let i=0;i<r;i++){let{messages:o,more:u}=await this.list("inbox",100,s),a=o.filter(c=>!e.has(c.id));if(n.push(...a),a.length<o.length||!u||!o.length)break;s=o[o.length-1].receivedAt}return n.sort((i,o)=>i.receivedAt-o.receivedAt)}async sealed(e,r,n){let s=await ro(r),i={...eo(await qe.parse(r),!0,new Date),b:await Fr(s)};return{head:Y(await Rr(e,this.agent.secretKey,n,new TextEncoder().encode(JSON.stringify(i)),"head")),raw:Y(await Rr(e,this.agent.secretKey,n,s,"raw"))}}async publicKeyOf(e){return(await j(this.creds,"POST","/keys",{address:e},{anonymous:!0})).publicKey}async send(e,r){let n=e.cc??[],s=e.bcc??[],i=[...e.to,...n,...s],o=d=>d.toLowerCase().endsWith(`@${_e}`),u=e.html??lo(e.text),a={from:e.from,to:e.to,cc:n,bcc:s,subject:e.subject,text:e.text,html:u,messageId:co(_e),inReplyTo:e.inReplyTo,references:e.references,date:new Date,attachments:e.attachments},c=Nr(a,!1),l=Nr(a,!0),f=await this.myCert(),h=[...new Set(i.map(d=>d.address.toLowerCase()).filter(o))],p=[];for(let d of h){let y=await this.publicKeyOf(d);if(!y)throw new q(404,"no_such_user",`${d} does not exist.`);r(d,y),p.push({address:d,...await this.sealed(X(y),c,f)})}let m=Math.ceil((5*1024*1024+2048)/3)*4;if(p.some(d=>d.raw.length>m))throw new q(413,"too_big","Too large for Shalom addresses: up to 5 MB per message.");let g=await this.tokens(p.length),x=d=>d.filter(y=>!o(y.address)),v=i.filter(d=>!o(d.address)).length,D=await j(this.creds,"POST","/send",{...v?{to:x(e.to),cc:x(n),bcc:x(s),subject:e.subject,text:e.text,html:u,inReplyTo:e.inReplyTo,references:e.references,messageId:a.messageId,attachments:(e.attachments??[]).map(d=>({filename:d.filename,type:d.type,content:Y(d.content),cid:d.cid}))}:{},sentCopy:await this.sealed(hr(this.agent.secretKey),l,f)});for(let[d,y]of p.entries()){let w=g[d];await j(this.creds,"POST","/deliver",{to:y.address,head:y.head,raw:y.raw,token:Y(w.token),sig:w.sig},{anonymous:!0})}return{id:D.id,external:v,internal:p.length}}};var na=/[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,sa=t=>t.replace(/[\r\n\t]+/g," ").replace(na,"");var oa=t=>t?sa(t.name?`${t.name} <${t.address}>`:t.address):"(unknown)",ia=t=>new Date(t).toISOString().replace("T"," ").slice(0,16);function ua(t){return t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
55
55
  `).replace(/<\/(p|div|li|h\d|tr)>/gi,`
56
56
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&").replace(/\n{3,}/g,`
57
57
 
58
- `).trim()}var _r=t=>t.text?.trim()?t.text.trim():t.html?oa(t.html):"",ve=t=>(t??[]).filter(e=>e.address).map(e=>({name:e.name??"",address:e.address}));var ia={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",txt:"text/plain",md:"text/markdown",csv:"text/csv",json:"application/json",html:"text/html",zip:"application/zip",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},Nr=t=>ia[t.split(".").pop()?.toLowerCase()??""]??"application/octet-stream";function ua(t){let e=[],r="",n=!1,s=!1;for(let i of t)i==='"'&&!s?n=!n:i==="<"&&!n?s=!0:i===">"&&!n&&(s=!1),i===","&&!n&&!s?(e.push(r),r=""):r+=i;return[...e,r]}var Pt=t=>(Array.isArray(t)?t:t?[t]:[]).flatMap(ua).map(e=>e.trim()).filter(Boolean).map(e=>{let r=/^(.*?)\s*<([^>]+)>$/.exec(e);return r?{name:r[1].replace(/^"|"$/g,""),address:r[2].trim().toLowerCase()}:{name:"",address:e.toLowerCase()}});function lo(t,e,r,n){let s=ve(e.replyTo).length?ve(e.replyTo):t.from?[t.from]:[],i=n.to?.length?n.to:s,o=new Set([r,...i.map(f=>f.address)].map(f=>f.toLowerCase())),u=n.all?[...ve(e.to),...ve(e.cc),...n.cc??[]].filter(f=>{let h=f.address.toLowerCase();return o.has(h)?!1:(o.add(h),!0)}):n.cc??[],a=/^\s*re\s*:/i.test(t.subject)?t.subject:`Re: ${t.subject}`,c=n.quote===!1?"":`
58
+ `).trim()}var Ur=t=>t.text?.trim()?t.text.trim():t.html?ua(t.html):"",ve=t=>(t??[]).filter(e=>e.address).map(e=>({name:e.name??"",address:e.address}));var aa={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",txt:"text/plain",md:"text/markdown",csv:"text/csv",json:"application/json",html:"text/html",zip:"application/zip",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},Ir=t=>aa[t.split(".").pop()?.toLowerCase()??""]??"application/octet-stream";function ca(t){let e=[],r="",n=!1,s=!1;for(let i of t)i==='"'&&!s?n=!n:i==="<"&&!n?s=!0:i===">"&&!n&&(s=!1),i===","&&!n&&!s?(e.push(r),r=""):r+=i;return[...e,r]}var Pt=t=>(Array.isArray(t)?t:t?[t]:[]).flatMap(ca).map(e=>e.trim()).filter(Boolean).map(e=>{let r=/^(.*?)\s*<([^>]+)>$/.exec(e);return r?{name:r[1].replace(/^"|"$/g,""),address:r[2].trim().toLowerCase()}:{name:"",address:e.toLowerCase()}});function fo(t,e,r,n){let s=ve(e.replyTo).length?ve(e.replyTo):t.from?[t.from]:[],i=n.to?.length?n.to:s,o=new Set([r,...i.map(f=>f.address)].map(f=>f.toLowerCase())),u=n.all?[...ve(e.to),...ve(e.cc),...n.cc??[]].filter(f=>{let h=f.address.toLowerCase();return o.has(h)?!1:(o.add(h),!0)}):n.cc??[],a=/^\s*re\s*:/i.test(t.subject)?t.subject:`Re: ${t.subject}`,c=n.quote===!1?"":`
59
59
 
60
- On ${e.date??sa(t.receivedAt)}, ${na(t.from)} wrote:
61
- ${_r(e).split(`
60
+ On ${e.date??ia(t.receivedAt)}, ${oa(t.from)} wrote:
61
+ ${Ur(e).split(`
62
62
  `).map(f=>`> ${f}`).join(`
63
- `)}`,l=[e.references,e.messageId].filter(Boolean).join(" ")||void 0;return{to:i,cc:u,subject:a,text:n.text+c,inReplyTo:e.messageId,references:l}}import{chmodSync as fo,existsSync as ho,mkdirSync as aa,readdirSync as Yc,readFileSync as po,renameSync as ca,rmSync as la,writeFileSync as fa}from"node:fs";import{homedir as da}from"node:os";import{join as ge}from"node:path";var mo="https://shalomail.com",Te=()=>process.env.SHALOM_CONFIG_DIR||(process.platform==="win32"&&process.env.APPDATA?ge(process.env.APPDATA,"shalom"):ge(process.env.XDG_CONFIG_HOME||ge(da(),".config"),"shalom"));function tt(t){ho(t)||aa(t,{recursive:!0,mode:448});try{fo(t,448)}catch{}}function Pr(t,e){let r=`${t}.${process.pid}.tmp`;fa(r,JSON.stringify(e,null,2)+`
64
- `,{mode:384});try{fo(r,384)}catch{}try{ca(r,t)}catch(n){throw la(r,{force:!0}),n}}var Ur=class extends Error{},Mr=t=>{if(!ho(t))return null;try{return JSON.parse(po(t,"utf8"))}catch(e){throw new Ur(`${t} exists but could not be read (${e.message}). Fix it or move it away; it was left as is.`)}},go=()=>ge(Te(),"config.json"),Hr=()=>Mr(go())??{};function xo(t){tt(Te()),Pr(go(),t)}var yo=()=>ge(Te(),"agents"),bo=t=>ge(yo(),`${t.toLowerCase()}.json`);function $r(t){tt(Te()),tt(yo()),Pr(bo(t.address),t)}var jr=t=>Mr(bo(t));var Ir="shalom_agent_",Ao=t=>Ir+Buffer.from(JSON.stringify({a:t.address,i:t.id,n:t.name,u:t.api,k:t.key,s:t.secretKey})).toString("base64url");function zr(t){if(!t.startsWith(Ir))throw new Error("SHALOM_AGENT_TOKEN is not a Shalom agent token.");let e=JSON.parse(Buffer.from(t.slice(Ir.length),"base64url").toString("utf8"));return{address:e.a,id:e.i,name:e.n,api:e.u,key:e.k,secretKey:e.s,createdAt:0}}function wo(){if(process.env.SHALOM_AGENT_TOKEN)return process.env.SHALOM_AGENT_TOKEN.trim();let t=process.env.SHALOM_AGENT_TOKEN_FILE;return t?po(t,"utf8").trim():void 0}var Do=t=>ge(Te(),"pins",`${t.toLowerCase()}.json`),Eo=t=>Mr(Do(t))??{};function Bo(t,e){try{tt(Te()),tt(ge(Te(),"pins")),Pr(Do(t),e)}catch{}}var Co=(t,e)=>({address:t.address,key:t.key,secretKey:Y(t.secretKey),api:e??t.api});var ha=(t,e)=>({...t,messageId:e.messageId??null,inReplyTo:e.inReplyTo??null,references:e.references??null,replyTo:ve(e.replyTo),cc:ve(e.cc),text:_r(e),html:e.html??null,attachments:e.attachments.map(r=>({filename:r.filename??"attachment",mimeType:r.mimeType,size:r.content.byteLength,content:new Uint8Array(r.content)}))}),So=t=>(t||process.env.SHALOM_API_URL||mo).replace(/\/+$/,""),vo=class t{constructor(e,r,n){this.file=e;this.persist=r;this.pins={...r?e.pins??{}:Eo(e.address)};let s=n?So(n):e.api;this.box=new It(Co(e,s),{server:Hr().serverKeys?.[s],onServer:i=>{try{let o=Hr();xo({...o,serverKeys:{...o.serverKeys,[s]:i}})}catch{}}})}file;persist;box;pins;static fromToken(e=wo(),r={}){if(!e)throw new q(0,"no_token","Pass an agent token or set SHALOM_AGENT_TOKEN or SHALOM_AGENT_TOKEN_FILE (run `shalom agents export <address>`).");return new t(zr(e),!1,r.api)}static fromFile(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),s=jr(n);if(!s)throw new q(0,"no_agent",`${n} is not saved on this machine.`);return new t(s,!0,r.api)}get address(){return this.file.address}checkPin(e){return(r,n)=>{if(this.pins[r]&&this.pins[r]!==n&&!e)throw new q(0,"key_changed",`The encryption key of ${r} changed since the last time. Confirm with them, then pass { trustNewKey: true }.`);this.pins[r]!==n&&(this.pins[r]=n,this.persist?(this.file.pins={...this.pins},$r(this.file)):Bo(this.file.address,this.pins))}}async inbox(e={}){return e.unread?this.box.unread(e.folder??"inbox",e.limit??20):(await this.box.list(e.folder??"inbox",e.limit??20)).messages}async read(e,r={}){let{summary:n,email:s}=await this.box.read(e);return r.markRead!==!1&&n.unread&&await this.box.update([n.id],{seen:!0}),ha(n,s)}send(e,r={}){let n=Pt(e.to);if(!n.length)throw new q(0,"bad_request","Add at least one recipient.");return this.box.send({from:{name:this.file.name,address:this.file.address},to:n,cc:Pt(e.cc),bcc:Pt(e.bcc),subject:e.subject,text:e.text,html:e.html,inReplyTo:e.inReplyTo,references:e.references,attachments:(e.attachments??[]).map(s=>({filename:s.filename,type:s.type??Nr(s.filename),content:new Uint8Array(s.content)}))},this.checkPin(!!r.trustNewKey))}async reply(e,r,n={}){let{summary:s,email:i}=await this.box.read(e),o=lo(s,i,this.file.address,{text:r.text,all:r.all,quote:r.quote});if(!o.to.length)throw new q(0,"bad_request","Could not tell who to reply to.");return this.box.send({from:{name:this.file.name,address:this.file.address},...o,bcc:[],html:r.html,attachments:(r.attachments??[]).map(u=>({filename:u.filename,type:u.type??Nr(u.filename),content:new Uint8Array(u.content)}))},this.checkPin(!!n.trustNewKey))}async ids(e){return Promise.all((Array.isArray(e)?e:[e]).map(async r=>(await this.box.find(r)).id))}async move(e,r){await this.box.update(await this.ids(e),{folder:r})}async mark(e,r){await this.box.update(await this.ids(e),{...r.read!==void 0?{seen:r.read}:{},...r.starred!==void 0?{starred:r.starred}:{}})}async*watch(e={}){let r=Math.max(5,e.interval??15)*1e3,n=new Set;if(!e.includeExisting)for(let o of(await this.box.list("inbox",100)).messages)e.includeUnread&&o.unread||n.add(o.id);let s=r,i=!0;for(;!e.signal?.aborted;){try{for(let o of await this.box.unseen(n)){if(i&&e.includeUnread&&!e.includeExisting&&!o.unread){n.add(o.id);continue}let u=await this.read(o.id,{markRead:!1});n.add(o.id),yield u}i=!1,s=r}catch(o){if(o instanceof q&&(o.status===401||o.status===403))throw o;s=Math.min(s*2,300*1e3)}await new Promise(o=>{let u=()=>{clearTimeout(a),e.signal?.removeEventListener("abort",u),o()},a=setTimeout(u,s);e.signal?.addEventListener("abort",u,{once:!0})})}}},To=class{creds;constructor(e=process.env.SHALOM_API_KEY,r={}){if(!e)throw new q(0,"no_key","Pass an account API key or set SHALOM_API_KEY.");this.creds={api:So(r.api),key:e}}listAgents(){return j(this.creds,"GET","/agents")}async createAgent(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),{secretKey:s,publicKey:i}=Yn(),o=await j(this.creds,"POST","/agents",{address:n,name:r.displayName??"",publicKey:re(i)}),u={...o.agent,api:this.creds.api,key:o.key,secretKey:re(s)};return r.save&&$r(u),{id:o.agent.id,address:o.agent.address,name:o.agent.name,token:Ao(u)}}async deleteAgent(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),s=(await this.listAgents()).agents.find(o=>o.address===n);if(!s)throw new q(404,"not_found",`${n} is not one of your agent mailboxes.`);let i=r.token?zr(r.token).key:jr(n)?.key;if(!i)throw new q(0,"no_agent",`Pass { token } for ${n}, or delete it on the AI agents page of the app.`);await j(this.creds,"POST","/agents/delete",{id:s.id,agentKey:i})}};export{To as Account,vo as Agent,q as ApiError};
63
+ `)}`,l=[e.references,e.messageId].filter(Boolean).join(" ")||void 0;return{to:i,cc:u,subject:a,text:n.text+c,inReplyTo:e.messageId,references:l}}import{chmodSync as ho,existsSync as po,mkdirSync as la,readdirSync as Qc,readFileSync as go,renameSync as fa,rmSync as da,writeFileSync as ha}from"node:fs";import{homedir as pa}from"node:os";import{join as me}from"node:path";var mo="https://shalomail.com",Te=()=>process.env.SHALOM_CONFIG_DIR||(process.platform==="win32"&&process.env.APPDATA?me(process.env.APPDATA,"shalom"):me(process.env.XDG_CONFIG_HOME||me(pa(),".config"),"shalom"));function tt(t){po(t)||la(t,{recursive:!0,mode:448});try{ho(t,448)}catch{}}function Hr(t,e){let r=`${t}.${process.pid}.tmp`;ha(r,JSON.stringify(e,null,2)+`
64
+ `,{mode:384});try{ho(r,384)}catch{}try{fa(r,t)}catch(n){throw da(r,{force:!0}),n}}var Pr=class extends Error{},$r=t=>{if(!po(t))return null;try{return JSON.parse(go(t,"utf8"))}catch(e){throw new Pr(`${t} exists but could not be read (${e.message}). Fix it or move it away; it was left as is.`)}},yo=()=>me(Te(),"config.json"),jr=()=>$r(yo())??{};function xo(t){tt(Te()),Hr(yo(),t)}var bo=()=>me(Te(),"agents"),Ao=t=>me(bo(),`${t.toLowerCase()}.json`);function Mt(t){tt(Te()),tt(bo()),Hr(Ao(t.address),t)}var zr=t=>$r(Ao(t));var Mr="shalom_agent_",wo=t=>Mr+Buffer.from(JSON.stringify({a:t.address,i:t.id,n:t.name,u:t.api,k:t.key,s:t.secretKey})).toString("base64url");function Kr(t){if(!t.startsWith(Mr))throw new Error("SHALOM_AGENT_TOKEN is not a Shalom agent token.");let e=JSON.parse(Buffer.from(t.slice(Mr.length),"base64url").toString("utf8"));return{address:e.a,id:e.i,name:e.n,api:e.u,key:e.k,secretKey:e.s,createdAt:0}}function Do(){if(process.env.SHALOM_AGENT_TOKEN)return process.env.SHALOM_AGENT_TOKEN.trim();let t=process.env.SHALOM_AGENT_TOKEN_FILE;return t?go(t,"utf8").trim():void 0}var Eo=t=>me(Te(),"pins",`${t.toLowerCase()}.json`),Bo=t=>$r(Eo(t))??{};function Gr(t,e){try{tt(Te()),tt(me(Te(),"pins")),Hr(Eo(t),e)}catch{}}var Co=(t,e)=>({address:t.address,key:t.key,secretKey:X(t.secretKey),api:e??t.api});var ga=(t,e)=>({...t,messageId:e.messageId??null,inReplyTo:e.inReplyTo??null,references:e.references??null,replyTo:ve(e.replyTo),cc:ve(e.cc),text:Ur(e),html:e.html??null,attachments:e.attachments.map(r=>({filename:r.filename??"attachment",mimeType:r.mimeType,size:r.content.byteLength,content:new Uint8Array(r.content)}))}),So=t=>(t||process.env.SHALOM_API_URL||mo).replace(/\/+$/,""),vo=class t{constructor(e,r,n){this.file=e;this.persist=r;this.pins={...r?e.pins??{}:Bo(e.address)};let s=n?So(n):e.api;this.box=new It(Co(e,s),{server:jr().serverKeys?.[s],onServer:i=>{try{let o=jr();xo({...o,serverKeys:{...o.serverKeys,[s]:i}})}catch{}},contactKey:(i,o)=>this.knownKey(i,o)})}file;persist;box;pins;static fromToken(e=Do(),r={}){if(!e)throw new q(0,"no_token","Pass an agent token or set SHALOM_AGENT_TOKEN or SHALOM_AGENT_TOKEN_FILE (run `shalom agents export <address>`).");return new t(Kr(e),!1,r.api)}static fromFile(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),s=zr(n);if(!s)throw new q(0,"no_agent",`${n} is not saved on this machine.`);return new t(s,!0,r.api)}get address(){return this.file.address}knownKey(e,r){if(!this.pins[e]){this.pins[e]=r;try{this.persist?(this.file.pins={...this.pins},Mt(this.file)):Gr(this.file.address,this.pins)}catch{}return!0}return this.pins[e]===r}checkPin(e){return(r,n)=>{if(this.pins[r]&&this.pins[r]!==n&&!e)throw new q(0,"key_changed",`The encryption key of ${r} changed since the last time. Confirm with them, then pass { trustNewKey: true }.`);this.pins[r]!==n&&(this.pins[r]=n,this.persist?(this.file.pins={...this.pins},Mt(this.file)):Gr(this.file.address,this.pins))}}async inbox(e={}){return e.unread?this.box.unread(e.folder??"inbox",e.limit??20):(await this.box.list(e.folder??"inbox",e.limit??20)).messages}async read(e,r={}){let{summary:n,email:s}=await this.box.read(e);return r.markRead!==!1&&n.unread&&await this.box.update([n.id],{seen:!0}),ga(n,s)}send(e,r={}){let n=Pt(e.to);if(!n.length)throw new q(0,"bad_request","Add at least one recipient.");return this.box.send({from:{name:this.file.name,address:this.file.address},to:n,cc:Pt(e.cc),bcc:Pt(e.bcc),subject:e.subject,text:e.text,html:e.html,inReplyTo:e.inReplyTo,references:e.references,attachments:(e.attachments??[]).map(s=>({filename:s.filename,type:s.type??Ir(s.filename),content:new Uint8Array(s.content)}))},this.checkPin(!!r.trustNewKey))}async reply(e,r,n={}){let{summary:s,email:i}=await this.box.read(e),o=fo(s,i,this.file.address,{text:r.text,all:r.all,quote:r.quote});if(!o.to.length)throw new q(0,"bad_request","Could not tell who to reply to.");return this.box.send({from:{name:this.file.name,address:this.file.address},...o,bcc:[],html:r.html,attachments:(r.attachments??[]).map(u=>({filename:u.filename,type:u.type??Ir(u.filename),content:new Uint8Array(u.content)}))},this.checkPin(!!n.trustNewKey))}async ids(e){return Promise.all((Array.isArray(e)?e:[e]).map(async r=>(await this.box.find(r)).id))}async move(e,r){await this.box.update(await this.ids(e),{folder:r})}async mark(e,r){await this.box.update(await this.ids(e),{...r.read!==void 0?{seen:r.read}:{},...r.starred!==void 0?{starred:r.starred}:{}})}async*watch(e={}){let r=Math.max(5,e.interval??15)*1e3,n=new Set;if(!e.includeExisting)for(let o of(await this.box.list("inbox",100)).messages)e.includeUnread&&o.unread||n.add(o.id);let s=r,i=!0;for(;!e.signal?.aborted;){try{for(let o of await this.box.unseen(n)){if(i&&e.includeUnread&&!e.includeExisting&&!o.unread){n.add(o.id);continue}let u=await this.read(o.id,{markRead:!1});n.add(o.id),yield u}i=!1,s=r}catch(o){if(o instanceof q&&(o.status===401||o.status===403))throw o;s=Math.min(s*2,300*1e3)}await new Promise(o=>{let u=()=>{clearTimeout(a),e.signal?.removeEventListener("abort",u),o()},a=setTimeout(u,s);e.signal?.addEventListener("abort",u,{once:!0})})}}},To=class{creds;constructor(e=process.env.SHALOM_API_KEY,r={}){if(!e)throw new q(0,"no_key","Pass an account API key or set SHALOM_API_KEY.");this.creds={api:So(r.api),key:e}}listAgents(){return j(this.creds,"GET","/agents")}async createAgent(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),{secretKey:s,publicKey:i}=Qn(),o=await j(this.creds,"POST","/agents",{address:n,name:r.displayName??"",publicKey:Y(i)}),u={...o.agent,api:this.creds.api,key:o.key,secretKey:Y(s)};return r.save&&Mt(u),{id:o.agent.id,address:o.agent.address,name:o.agent.name,token:wo(u)}}async deleteAgent(e,r={}){let n=(e.includes("@")?e:`${e}@${_e}`).toLowerCase(),s=(await this.listAgents()).agents.find(o=>o.address===n);if(!s)throw new q(404,"not_found",`${n} is not one of your agent mailboxes.`);let i=r.token?Kr(r.token).key:zr(n)?.key;if(!i)throw new q(0,"no_agent",`Pass { token } for ${n}, or delete it on the AI agents page of the app.`);await j(this.creds,"POST","/agents/delete",{id:s.id,agentKey:i})}};export{To as Account,vo as Agent,q as ApiError};