shalomail 0.2.0 → 0.2.1

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/shalom.mjs CHANGED
@@ -1,68 +1,69 @@
1
1
  #!/usr/bin/env node
2
- import{spawn as Po}from"node:child_process";import{mkdirSync as va,readFileSync as sr,writeFileSync as Sa}from"node:fs";import{hostname as Ta}from"node:os";import{basename as pn,join as ka}from"node:path";import{createInterface as Fa}from"node:readline";import{parseArgs as X}from"node:util";var gt=BigInt(4294967295),wn=BigInt(32);function Wo(t,e=!1){return e?{h:Number(t&gt),l:Number(t>>wn&gt)}:{h:Number(t>>wn&gt)|0,l:Number(t&gt)|0}}function Dn(t,e=!1){let r=t.length,n=new Uint32Array(r),s=new Uint32Array(r);for(let o=0;o<r;o++){let{h:i,l:u}=Wo(t[o],e);[n[o],s[o]]=[i,u]}return[n,s]}var Zo=t=>t/2**32|0,Yo=t=>t>>>0;function En(t,e,r,n){let s=Zo(r),o=Yo(r);t.setUint32(e,n?o:s,n),t.setUint32(e+4,n?s:o,n)}var lr=(t,e,r)=>t>>>r,fr=(t,e,r)=>t<<32-r|e>>>r,Ee=(t,e,r)=>t>>>r|e<<32-r,Be=(t,e,r)=>t<<32-r|e>>>r,Ze=(t,e,r)=>t<<64-r|e>>>r-32,Ye=(t,e,r)=>t>>>r-32|e<<64-r;function se(t,e,r,n){let s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}var Bn=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Cn=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,vn=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Sn=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,Tn=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),kn=(t,e,r,n,s,o)=>e+r+n+s+o+(t/2**32|0)|0;function yt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}var dr=t=>t?`"${t}" `:"";function Xe(t,e=""){if(typeof t!="number")throw new TypeError(dr(e)+"expected number, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError(dr(e)+"expected integer >= 0, got "+t);return t}function oe(t,e,r=""){if(yt(t)&&(e===void 0||t.length===e))return t;e!==void 0&&Xe(e,"length");let n=yt(t),s=e!==void 0?` of length ${e}`:"",o=n?`length=${t.length}`:`type=${typeof t}`,i=dr(r)+"expected Uint8Array"+s+", got "+o;throw n?new RangeError(i):new TypeError(i)}var Jo=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)},Fn=(t,e)=>{Jo(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 pr(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function Rn(t,e){oe(t,void 0,"output");let r=e.outputLen;if(!(t.length>=r))throw new RangeError('"output" expected length >= '+r)}function hr(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function xt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var Ln=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Qo=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function bt(t){if(oe(t),Ln)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=Qo[t[r]];return e}function On(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,o=0;s<r;s++,o+=2){let i=On(t.charCodeAt(o)),u=On(t.charCodeAt(o+1));if(i===void 0||u===void 0){let a=t[o]+t[o+1];throw new RangeError('hex string expected, got non-hex character "'+a+'" at index '+o)}n[s]=i*16+u}return n}function mr(...t){let e=0;for(let n=0;n<t.length;n++){let s=t[n];oe(s),e+=s.length}let r=new Uint8Array(e);for(let n=0,s=0;n<t.length;n++){let o=t[n];r.set(o,s),s+=o.length}return r}function ei(t,e,r="opts"){return Fn(t,"defaults"),e!==void 0&&Fn(e,r),Object.assign(Object.create(null),t,e)}function _n(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=ei({},e,"info");let r=(s,o)=>t(o).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 Nn(t=32){Xe(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 qn=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});var wt=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=xt(this.buffer)}update(e){pr(this),oe(e);let{view:r,buffer:n,blockLen:s}=this,o=e.length,i=!1;for(let u=0;u<o;){let a=Math.min(s-this.pos,o-u);if(a===s){let c=xt(e);for(;s<=o-u;u+=s)this.process(c,u);i=!0;continue}n.set(u===0&&a===o?e:e.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===s&&(this.process(r,0),this.pos=0,i=!0)}return this.length+=e.length,i&&this.roundClean(),this}digestInto(e){pr(this),Rn(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:s,isLE:o}=this,{pos:i}=this;r[i++]=128,r.fill(0,i),this.padOffset>s-i&&(this.process(n,0),r.fill(0)),En(n,s-8,this.length*8,o),this.process(n,0),this.roundClean();let u=e===r?n:xt(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],o)}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:o,pos:i}=this;return e.destroyed=o,e.finished=s,e.length=n,e.pos=i,i&&e.buffer.set(r),e}clone(){return this._cloneInto()}};var In=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var Un=Dn(["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))),ti=Un[0],ri=Un[1],me=new Uint32Array(80),ge=new Uint32Array(80),gr=class extends wt{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:o,Cl:i,Dh:u,Dl:a,Eh:c,El:l,Fh:f,Fl:d,Gh:p,Gl:g,Hh:m,Hl:A}=this;return[e,r,n,s,o,i,u,a,c,l,f,d,p,g,m,A]}set(e,r,n,s,o,i,u,a,c,l,f,d,p,g,m,A){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=o|0,this.Cl=i|0,this.Dh=u|0,this.Dl=a|0,this.Eh=c|0,this.El=l|0,this.Fh=f|0,this.Fl=d|0,this.Gh=p|0,this.Gl=g|0,this.Hh=m|0,this.Hl=A|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let h=0;h<16;h++,r+=4)me[h]=e.getUint32(r),ge[h]=e.getUint32(r+=4);for(let h=16;h<80;h++){let w=me[h-15]|0,E=ge[h-15]|0,k=Ee(w,E,1)^Ee(w,E,8)^lr(w,E,7),I=Be(w,E,1)^Be(w,E,8)^fr(w,E,7),v=me[h-2]|0,B=ge[h-2]|0,O=Ee(v,B,19)^Ze(v,B,61)^lr(v,B,6),P=Be(v,B,19)^Ye(v,B,61)^fr(v,B,6),_=vn(I,P,ge[h-7],ge[h-16]),U=Sn(_,k,O,me[h-7],me[h-16]);me[h]=U|0,ge[h]=_|0}let{Ah:n,Al:s,Bh:o,Bl:i,Ch:u,Cl:a,Dh:c,Dl:l,Eh:f,El:d,Fh:p,Fl:g,Gh:m,Gl:A,Hh:D,Hl:y}=this;for(let h=0;h<80;h++){let w=Ee(f,d,14)^Ee(f,d,18)^Ze(f,d,41),E=Be(f,d,14)^Be(f,d,18)^Ye(f,d,41),k=f&p^~f&m,I=d&g^~d&A,v=Tn(y,E,I,ri[h],ge[h]),B=kn(v,D,w,k,ti[h],me[h]),O=v|0,P=Ee(n,s,28)^Ze(n,s,34)^Ze(n,s,39),_=Be(n,s,28)^Ye(n,s,34)^Ye(n,s,39),U=n&o^n&u^o&u,x=s&i^s&a^i&a;D=m|0,y=A|0,m=p|0,A=g|0,p=f|0,g=d|0,{h:f,l:d}=se(c|0,l|0,B|0,O|0),c=u|0,l=a|0,u=o|0,a=i|0,o=n|0,i=s|0;let C=Bn(O,_,x);n=Cn(C,B,P,U),s=C|0}({h:n,l:s}=se(this.Ah|0,this.Al|0,n|0,s|0)),{h:o,l:i}=se(this.Bh|0,this.Bl|0,o|0,i|0),{h:u,l:a}=se(this.Ch|0,this.Cl|0,u|0,a|0),{h:c,l}=se(this.Dh|0,this.Dl|0,c|0,l|0),{h:f,l:d}=se(this.Eh|0,this.El|0,f|0,d|0),{h:p,l:g}=se(this.Fh|0,this.Fl|0,p|0,g|0),{h:m,l:A}=se(this.Gh|0,this.Gl|0,m|0,A|0),{h:D,l:y}=se(this.Hh|0,this.Hl|0,D|0,y|0),this.set(n,s,o,i,u,a,c,l,f,d,p,g,m,A,D,y)}roundClean(){hr(me,ge)}destroy(){this.destroyed=!0,hr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},yr=class extends gr{constructor(){super(64,In)}};var xr=_n(()=>new yr,qn(3));function Et(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 H=(t,e,r)=>oe(t,e,r),br=Xe;function ye(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 Ce(t,e){if(typeof t!="function")throw new TypeError(`"${e}" is invalid: expected function, got ${typeof t}`);return t}var $n=bt,Ar=(...t)=>mr(...t),Mn=t=>At(t),Je=yt,Qe=t=>Nn(t),Dt=BigInt(0),Pn=BigInt(1),ni=t=>t?`"${t}" `:"";function le(t,e=""){if(typeof t!="boolean")throw new TypeError(ni(e)+"expected boolean, got type="+typeof t);return t}function si(t){if(typeof t=="bigint"){if(!xe(t))throw new RangeError("positive bigint expected, got "+t)}else br(t);return t}function qe(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 jn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?Dt:BigInt("0x"+t)}function Bt(t){return jn(bt(t))}function fe(t){return jn(bt(be(oe(t)).reverse()))}function wr(t,e){if(Xe(e),e===0)throw new Error("zero output length is invalid");t=si(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 Ct(t,e){return wr(t,e).reverse()}function be(t){return Uint8Array.from(H(t))}function xe(t){return typeof t=="bigint"&&Dt<=t}function Dr(t,e,r){return xe(t)&&xe(e)&&xe(r)&&e<=t&&t<r}function ve(t,e,r,n){if(!Dr(e,r,n))throw new RangeError("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function Er(t){if(t<Dt)throw new Error("expected non-negative bigint, got "+t);return t===Dt?0:t.toString(2).length}var Hn=t=>(qe(t,"n"),(Pn<<BigInt(t))-Pn);function ie(t,e={},r={},n="object"){ye(t,n),ye(e,"fields"),ye(r,"optFields");function s(i,u,a){let c=n==="object"?`param "${String(i)}"`:`"${n}.${String(i)}"`,l=t[i];if(!Object.hasOwn(t,i)&&(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 o=(i,u)=>Object.entries(i).forEach(([a,c])=>s(a,c,u));o(e,!1),o(r,!0)}var K=BigInt(0),N=BigInt(1),Se=BigInt(2),Gn=BigInt(3),Br=BigInt(4),Vn=BigInt(5),oi=BigInt(7),Wn=BigInt(8),ii=BigInt(9),ui=BigInt(15),Zn=BigInt(16),ai=BigInt("0x10000000000000000");function R(t,e){if(e<=K)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=K?r:e+r}function ci(t,e,r){if(r<=N)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<K)throw new Error("invalid exponent, negatives unsupported");if(e===K)return N;if(e===N)return t;let n=t%r;if(n<K&&(n+=r),e<ai){let u=N;for(;e>K;)e&N&&(u=u*n%r),n=n*n%r,e>>=N;return u}let s=[];for(;e>K;)s.push(Number(e&ui)),e>>=Br;let o=new Array(16);o[0]=N,o[1]=n;for(let u=2;u<16;u++)o[u]=o[u-1]*n%r;let i=o[s[s.length-1]];for(let u=s.length-2;u>=0;u--){i=i*i%r,i=i*i%r,i=i*i%r,i=i*i%r;let a=s[u];a!==0&&(i=i*o[a]%r)}return i}function J(t,e,r){if(r<=N)throw new Error("pow2: expected modulus > 1, got "+r);if(e<K)throw new Error("pow2: expected non-negative exponent, got "+e);let n=t;for(;e-- >K;)n*=n,n%=r;return n}function Kn(t,e){if(t===K)throw new Error("invert: expected non-zero number");if(e<=N)throw new Error("invert: expected modulus > 1, got "+e);let r=R(t,e),n=e,s=K,o=N;for(;r!==K;){let u=n/r,a=n-r*u,c=s-o*u;n=r,r=a,s=o,o=c}if(n!==N)throw new Error("invert: does not exist");return R(s,e)}function Cr(t,e,r){let n=t;if(!n.eql(n.sqr(e),r))throw new Error("Cannot find square root")}function vr(t,e){if((t&N)===K)throw new Error(e+": expected odd modulus, got "+t)}function Yn(t,e){let r=t,n=(r.ORDER+N)/Br,s=r.pow(e,n);return Cr(r,s,e),s}function li(t,e){let r=t,n=(r.ORDER-Vn)/Wn,s=r.mul(e,Se),o=r.pow(s,n),i=r.mul(e,o),u=r.mul(r.mul(i,Se),o),a=r.mul(i,r.sub(u,r.ONE));return Cr(r,a,e),a}function fi(t){let e=Tt(t),r=Xn(t),n=r(e,e.neg(e.ONE)),s=r(e,n),o=r(e,e.neg(n)),i=(t+oi)/Zn;return((u,a)=>{let c=u,l=c.pow(a,i),f=c.mul(l,n),d=c.mul(l,s),p=c.mul(l,o),g=c.eql(c.sqr(f),a),m=c.eql(c.sqr(d),a);l=c.cmov(l,f,g),f=c.cmov(p,d,m);let A=c.eql(c.sqr(f),a),D=c.cmov(l,f,A);return Cr(c,D,a),D})}function Xn(t){if(t<Gn)throw new Error("sqrt is not defined for small field");vr(t,"tonelliShanks");let e=t-N,r=0;for(;e%Se===K;)e/=Se,r++;let n=Se,s=Tt(t);for(;et(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Yn;let o=s.pow(n,e),i=(e+N)/Se;return function(a,c){let l=a;if(l.is0(c))return c;if(et(l,c)!==1)throw new Error("Cannot find square root");let f=r,d=l.mul(l.ONE,o),p=l.pow(c,e),g=l.pow(c,i);for(;!l.eql(p,l.ONE);){if(l.is0(p))throw new Error("Cannot find square root: probably non-prime P");let m=1,A=l.sqr(p);for(;!l.eql(A,l.ONE);)if(m++,A=l.sqr(A),m===f)throw new Error("Cannot find square root");let D=N<<BigInt(f-m-1),y=l.pow(d,D);f=m,d=l.sqr(y),p=l.mul(p,d),g=l.mul(g,y)}return g}}function di(t){return vr(t,"Fp.sqrt"),t%Br===Gn?Yn:t%Wn===Vn?li:t%Zn===ii?fi(t):Xn(t)}var Jn=(t,e)=>(R(t,e)&N)===N,pi=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ie(t){if(ye(t,"field"),typeof t.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof t.ORDER);qe(t.BYTES,"BYTES"),qe(t.BITS,"BITS");for(let e of pi)Ce(t[e],"field."+e);if(t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=N)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function St(t,e,r=!1){Ie(t),Et(e,"nums"),le(r,"passZero");let n=t,s=new Array(e.length).fill(r?n.ZERO:void 0),o=e.reduce((u,a,c)=>n.is0(a)?u:(s[c]=u,n.mul(u,a)),n.ONE),i=n.inv(o);return e.reduceRight((u,a,c)=>n.is0(a)?u:(s[c]=n.mul(u,s[c]),n.mul(u,a)),i),s}function et(t,e){Ie(t);let r=t;vr(r.ORDER,"FpLegendre");let n=(r.ORDER-N)/Se,s=r.pow(e,n),o=r.eql(s,r.ONE),i=r.eql(s,r.ZERO),u=r.eql(s,r.neg(r.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function hi(t,e){if(e!==void 0&&br(e),t<=K)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=Er(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 zn=new WeakMap,vt=class{ORDER;BITS;BYTES;isLE;ZERO=K;ONE=N;_lengths;_mod;constructor(e,r={}){if(e<=N)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:o}=hi(e,n);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=s,this.BYTES=o,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 K<=e&&e<this.ORDER}is0(e){return e===K}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&N)===N}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 ci(e,r,this.ORDER)}div(e,r){return R(e*Kn(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 Kn(e,this.ORDER)}sqrt(e){let r=zn.get(this);return r||zn.set(this,r=di(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?Ct(e,this.BYTES):wr(e,this.BYTES)}fromBytes(e,r=!1){H(e);let{_lengths:n,BYTES:s,isLE:o,ORDER:i,_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,o?0:c.length-e.length),e=c}if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);let a=o?fe(e):Bt(e);if(u&&(a=R(a,i)),!r&&!this.isValid(a))throw new Error("invalid field element: outside of range 0..ORDER");return a}invertBatch(e){return St(this,e,!0)}cmov(e,r,n){return le(n,"condition"),n?r:e}};function Tt(t,e={}){return Object.freeze(vt.prototype),new vt(t,e)}var kr=BigInt(0),tt=BigInt(1),mi=BigInt(4),Sr=16,Qn=128,gi=5,es=2**31;function rt(t){let e=t;if(typeof e!="function")throw new TypeError('"Point" expected constructor, got type='+typeof t);Ce(e.fromAffine,"Point.fromAffine"),Ce(e.fromBytes,"Point.fromBytes"),Ce(e.fromHex,"Point.fromHex"),ye(e.BASE,"Point.BASE"),ye(e.ZERO,"Point.ZERO"),Ie(e.Fp),Ie(e.Fn)}function rs(t,e){rt(t),ns(e,t);let r=St(t.Fp,e.map(n=>n.Z));return e.map((n,s)=>t.fromAffine(n.toAffine(r[s])))}function yi(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 xi(t,e){let r=t*(4*e+128);if(r>es)throw new Error("invalid window size: table would need ~"+Math.ceil(r/2**20)+" MiB, max "+es/2**20+" MiB")}function bi(t,e){if(t!==void 0){Ce(t,"randomBytes");try{let r=t(e);if(!Je(r)||r.length!==e)return}catch{return}return t}}function ns(t,e){Et(t,"points"),t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function Ai(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):xe(n)&&n<r))throw new Error("invalid scalar at index "+s)})}var ss=new WeakMap;function Tr(t){return ss.get(t)||1}function wi(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 Di(t,e){let r=2**e,n=r/2,s=BigInt(r-1),o=[];for(;t>kr;){let i=0;t&tt&&(i=Number(t&s),i>=n&&(i-=r),t-=BigInt(i)),o.push(i),t>>=tt}return o}function Ei(t,e,r){let n=2**e,s=n/2,o=BigInt(n-1),i=BigInt(e),u=[];for(let a=0;a<r;a++){let c=Number(t&o);t>>=i,c>s&&(c-=n,t+=tt),u.push(c)}if(t!==kr)throw new Error("invalid wnaf");return u}function Bi(t,e,r){let n=0;for(let o of r)n=Math.max(n,o.length);let s=t;for(let o=n-1;o>=0;o--){o!==n-1&&(s=s.double());for(let i=0;i<r.length;i++){let u=r[i][o];if(u){let a=e[i][Math.abs(u)-1>>1];s=s.add(u<0?a.negate():a)}}}return s}var kt=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,r){rt(e),this.randomBytes=bi(r,Sr),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,o=2**(r-1),i=[],u=e;for(let a=0;a<s;a++){let c=u;for(let l=0;l<o;l++)i.push(c),c=c.add(u);u=i[i.length-1].double()}return{W:r,bits:n,windows:s,comp:i}}wnafCachedCT(e,r){let{W:n,windows:s,comp:o}=e,i=2**(n-1),u=Ei(r,n,s),a=this.ZERO,c=this.BASE;for(let l=0;l<s;l++){let f=u[l],d=l*i,p=Math.abs(f)-1,g=o[d];for(let A=1;A<i;A++)g=A===p?o[d+A]:g;let m=g.negate();f===0?c=c.add(o[d]):a=a.add(f<0?m:g)}return{p:a,f:c}}getWnafPrecomputes(e,r,n,s){let o=this.wnafPrecomputes.get(r),i=o?.find(u=>u.W===e&&u.bits===n);return i||(i=this.buildWnafTable(r,e,n),typeof s=="function"&&(i={...i,comp:s(i.comp)}),o||(o=[],this.wnafPrecomputes.set(r,o)),o.push(i)),i}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),!Dr(r,tt,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(e,r,n,s){let o=Tr(e);return o===1?this.fixedWindowCT(e,r,n):this.wnafCachedCT(this.getWnafPrecomputes(o,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+Qn,o=this.randomBytes(Sr);if(!Je(o)||o.length!==Sr)throw new Error("randomBytes returned invalid byte array");o[0]=o[0]&63|128;let i=r+Bt(o)*this.Point.Fn.ORDER;return this.runCT(e,i,s,n)}fixedWindowCT(e,r,n){let s=gi,o=1<<s,i=Hn(s),u=new Array(o);u[0]=this.ZERO;for(let l=1;l<o;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)&i),d=u[0];for(let p=1;p<o;p++)d=p===f?u[p]:d;c=c.add(d)}return{p:c,f:c}}shouldBlind(e,r){return this.randomBytes===void 0?!1:r===tt?!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),!xe(r))throw new Error("invalid scalar");let s=Tr(e);if(s===1||r>=this.Point.Fn.ORDER)return Ci(this.Point,[e],[r],!0);let o=this.getWnafPrecomputes(s,e,this.bits,n);return this.wnafCachedCT(o,r).p}setWindowSize(e,r){this.assertPoint(e),yi(r,this.bits);let n=Math.ceil((this.bits+Qn)/r)+1;xi(n*2**(r-1),this.Point.Fp.BYTES),ss.set(e,r),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return Tr(e)!==1}};function Ci(t,e,r,n=!1){if(rt(t),ns(e,t),le(n,"allowOversized"),Ai(r,t.Fn,n?t.Fn.ORDER**mi:void 0),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let s=e.map(i=>wi(i,4)),o=r.map(i=>Di(i,4));return Bi(t.ZERO,s,o)}function ts(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Ie(e),e}else return Tt(t,{isLE:r})}function os(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`);ie(r);for(let a of["p","n","h"]){let c=e[a];if(!(xe(c)&&c!==kr))throw new Error(`CURVE.${a} must be positive bigint`)}let s=ts(e.p,r.Fp,n),o=ts(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:o}}function Ft(t,e){return function(n){let s=t(n);return{secretKey:s,publicKey:e(s)}}}var Ot=BigInt(0),Rt=BigInt(1),Lt=BigInt(2),vi=BigInt(4),is=BigInt(8);function Si(t,e,r,n){let s=t.sqr(r),o=t.sqr(n),i=t.add(t.mul(e.a,s),o),u=t.add(t.ONE,t.mul(e.d,t.mul(s,o)));return t.eql(i,u)}function us(t,e={}){ie(e,{},{},"extraOpts");let r=e,n=os("edwards",t,r,r.FpFnLE),{Fp:s,Fn:o}=n,i=n.CURVE,{h:u}=i;if(et(s,i.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(et(s,i.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");ie(r,{},{uvRatio:"function",randomBytes:"function"});let a=r.randomBytes===void 0?Qe:r.randomBytes,c=Lt<<BigInt(s.BYTES*8)-Rt;function l(y){if(!s.isOdd)throw new Error("Field does not have .isOdd()");return s.isOdd(y)}let f=r.uvRatio===void 0?(y,h)=>{try{return{isValid:!0,value:s.sqrt(s.div(y,h))}}catch{return{isValid:!1,value:Ot}}}:r.uvRatio;if(!Si(s,i,i.Gx,i.Gy))throw new Error("bad curve params: generator point");let d=s.eql(i.a,s.neg(s.ONE))?y=>s.neg(y):s.eql(i.a,s.ONE)?y=>y:y=>s.mul(i.a,y);function p(y,h,w=!1){let E=w?Rt:Ot;return ve("coordinate "+y,h,E,c),h}function g(y){if(!(y instanceof m))throw new Error("EdwardsPoint expected")}class m{static BASE=new m(i.Gx,i.Gy,s.ONE,s.mul(i.Gx,i.Gy));static ZERO=new m(s.ZERO,s.ONE,s.ONE,s.ZERO);static Fp=s;static Fn=o;X;Y;Z;T;constructor(h,w,E,k){this.X=p("x",h),this.Y=p("y",w),this.Z=p("z",E,!0),this.T=p("t",k),Object.freeze(this)}static CURVE(){return i}static fromAffine(h){if(h instanceof m)throw new Error("extended point not allowed");let{x:w,y:E}=h||{};return p("x",w),p("y",E),new m(w,E,s.ONE,s.mul(w,E))}static fromBytes(h,w=!1){let E=s.BYTES,{a:k,d:I}=i;h=be(H(h,E,"point")),le(w,"zip215");let v=be(h),B=h[E-1];v[E-1]=B&-129;let O=fe(v),P=w?c:s.ORDER;ve("point.y",O,Ot,P);let _=s.sqr(O),U=s.sub(_,s.ONE),x=s.sub(s.mulN(I,_),k),{isValid:C,value:b}=f(U,x);if(!C)throw new Error("bad point: invalid y coordinate");let S=l(b),F=(B&128)!==0;if(!w&&s.is0(b)&&F)throw new Error("bad point: x=0 and x_0=1");return F!==S&&(b=s.neg(b)),m.fromAffine({x:b,y:O})}static fromHex(h,w=!1){return m.fromBytes(Mn(h),w)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(h=6,w=!0){return D.setWindowSize(this,h),w||this.multiply(Lt),this}assertValidity(){let h=this,{a:w,d:E}=i;if(h.is0())throw new Error("bad point: ZERO");let{X:k,Y:I,Z:v,T:B}=h,O=s.sqr(k),P=s.sqr(I),_=s.sqr(v),U=s.sqr(_),x=s.mul(O,w),C=s.mul(s.add(x,P),_),b=s.add(U,s.mul(E,s.mul(O,P)));if(!s.eql(C,b))throw new Error("bad point: equation left != right (1)");let S=s.mul(k,I),F=s.mul(v,B);if(!s.eql(S,F))throw new Error("bad point: equation left != right (2)")}equals(h){g(h);let{X:w,Y:E,Z:k}=this,{X:I,Y:v,Z:B}=h,O=s.mul(w,B),P=s.mul(I,k),_=s.mul(E,B),U=s.mul(v,k);return s.eql(O,P)&&s.eql(_,U)}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:h,Y:w,Z:E}=this,k=s.sqr(h),I=s.sqr(w),v=s.mul(s.sqr(E),Lt),B=d(k),O=s.addN(h,w),P=s.sub(s.subN(s.sqr(O),k),I),_=s.addN(B,I),U=s.subN(_,v),x=s.subN(B,I),C=s.mul(P,U),b=s.mul(_,x),S=s.mul(P,x),F=s.mul(U,_);return new m(C,b,F,S)}add(h){g(h);let{d:w}=i,{X:E,Y:k,Z:I,T:v}=this,{X:B,Y:O,Z:P,T:_}=h,U=s.mul(E,B),x=s.mul(k,O),C=s.mul(s.mulN(v,w),_),b=s.mul(I,P),S=s.sub(s.subN(s.mulN(s.addN(E,k),s.addN(B,O)),U),x),F=s.subN(b,C),M=s.addN(b,C),j=s.sub(x,d(U)),z=s.mul(S,F),G=s.mul(M,j),V=s.mul(S,j),ce=s.mul(F,M);return new m(z,G,ce,V)}subtract(h){return g(h),this.add(h.negate())}multiply(h){if(!o.isValidNot0(h))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:w,f:E}=D.mulSecret(this,h,u,A);return A([w,E])[0]}multiplyUnsafe(h){if(!o.isValid(h))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return h===Ot?m.ZERO:this.is0()||h===Rt?this:D.mulUnsafe(this,h,A)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return D.mulUnsafe(this,i.n).is0()}toAffine(h){let w=this,E=h;if(E!=null&&typeof E!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof E);let{X:k,Y:I,Z:v}=w,B=w.is0();E==null&&(E=B?s.create(is):s.inv(v));let O=s.mul(k,E),P=s.mul(I,E),_=s.mul(v,E);if(B)return{x:s.ZERO,y:s.ONE};if(!s.eql(_,s.ONE))throw new Error("invZ was invalid");return{x:O,y:P}}clearCofactor(){return u===Rt?this:u===Lt?this.double():u===vi?this.double().double():u===is?this.double().double().double():this.multiplyUnsafe(u)}toBytes(){let{x:h,y:w}=this.toAffine(),E=s.toBytes(w);return E[E.length-1]|=l(h)?128:0,E}toHex(){return $n(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let A=y=>rs(m,y),D=new kt(m,a);return D.bits>=6&&m.BASE.precompute(6),Object.freeze(m.prototype),Object.freeze(m),m}function as(t,e,r={}){if(rt(t),typeof e!="function")throw new Error('"hash" function param is required');let n=e,s=r;ie(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});let{prehash:o}=s,{BASE:i,Fp:u,Fn:a}=t,c=n.outputLen,l=2*u.BYTES;if(c!==void 0&&(qe(c,"hash.outputLen"),c!==l))throw new Error(`hash.outputLen must be ${l}, got ${c}`);let f=s.randomBytes===void 0?Qe:s.randomBytes,d=s.toMontgomery,p=s.toMontgomerySecret,g=s.adjustScalarBytes===void 0?x=>x:s.adjustScalarBytes,m=s.domain===void 0?(x,C,b)=>{if(le(b,"phflag"),C.length||b)throw new Error("Contexts/pre-hash are not supported");return x}:s.domain;function A(x){return a.create(fe(x))}function D(x){let C=B.secretKey;H(x,B.secretKey,"secretKey");let b=H(n(x),2*C,"hashedSecretKey"),S=g(b.slice(0,C)),F=b.slice(C,2*C),M=A(S);return{head:S,prefix:F,scalar:M}}function y(x){let{head:C,prefix:b,scalar:S}=D(x),F=i.multiply(S),M=F.toBytes();return{head:C,prefix:b,scalar:S,point:F,pointBytes:M}}function h(x){return y(x).pointBytes}function w(x=Uint8Array.of(),...C){let b=Ar(...C);return A(n(m(b,H(x,void 0,"context"),!!o)))}function E(x,C,b={}){ie(b,{},{},"options"),x=be(H(x,void 0,"message")),o&&(x=o(x));let{prefix:S,scalar:F,pointBytes:M}=y(C),j=w(b.context,S,x),z=i.multiply(j).toBytes(),G=w(b.context,z,M,x),V=a.create(j+G*F);if(!a.isValid(V))throw new Error("sign failed: invalid s");let ce=Ar(z,a.toBytes(V));return H(ce,B.signature,"result")}let k={zip215:s.zip215};function I(x,C,b,S=k){ie(S);let{context:F}=S,M=S.zip215===void 0?!!k.zip215:S.zip215,j=B.signature;x=H(x,j,"signature"),C=H(C,void 0,"message"),b=H(b,B.publicKey,"publicKey"),M!==void 0&&le(M,"zip215"),o&&(C=o(C));let z=j/2,G=x.subarray(0,z),V=fe(x.subarray(z,j)),ce,Ve,ht;try{ce=t.fromBytes(b,M),Ve=t.fromBytes(G,M),ht=i.multiplyUnsafe(V)}catch{return!1}if(!M&&ce.isSmallOrder())return!1;let We=w(F,G,b,C);return Ve.add(ce.multiplyUnsafe(We)).subtract(ht).clearCofactor().is0()}let v=u.BYTES,B={secretKey:v,publicKey:v,signature:2*v,seed:v};function O(x){return x=x===void 0?f(B.seed):x,H(x,B.seed,"seed")}function P(x){return Je(x)&&x.length===B.secretKey}function _(x,C){try{return!!t.fromBytes(x,C===void 0?k.zip215:C)}catch{return!1}}let U={getExtendedPublicKey:y,randomSecretKey:O,isValidSecretKey:P,isValidPublicKey:_,toMontgomery(x){if(d===void 0)throw new Error("Montgomery conversion is not supported for this curve");return d(t.fromBytes(x))},toMontgomerySecret(x){if(p===void 0)throw new Error("Montgomery conversion is not supported for this curve");return p(x)}};return Object.freeze(B),Object.freeze(U),Object.freeze({keygen:Ft(O,h),getPublicKey:h,sign:E,verify:I,utils:U,Point:t,lengths:B})}var Te=BigInt(0),Q=BigInt(1),_t=BigInt(2);function cs(t,e){return t+e-(e>>Q<<Q)}function Ti(t){let e=BigInt(6)*t;return(r,n,s)=>{let o=n+s,u=((e+s-n)*r+n)%t;return{x_2:u,x_3:o-u}}}function ki(t){return ie(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...t})}function ls(t){let e=ki(t),{P:r,type:n,adjustScalarBytes:s,powPminus2:o,randomBytes:i}=e,u=e.scalarMultBase,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let c=i===void 0?Qe:i,l=a?255:448,f=Ti(r),d=a?32:56,p=BigInt(a?9:5),g=BigInt(a?121665:39081),m=a?_t**BigInt(254):_t**BigInt(447),A=a?BigInt(8)*(_t**BigInt(251)-Q):BigInt(4)*(_t**BigInt(445)-Q),D=m+A+Q,y=b=>R(b,r),h=w(p);function w(b){return Ct(y(b),d)}function E(b){let S=be(H(b,d,"uCoordinate"));return a&&(S[31]&=127),y(fe(S))}function k(b){return fe(s(be(H(b,d,"scalar"))))}let I=new Set(a?[Te,Q,r-Q,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[Te,Q,r-Q]);function v(b,S){let F=E(S);if(I.has(F))throw new Error("invalid private or public key received");let M=_(F,k(b));if(M===Te)throw new Error("invalid private or public key received");return w(M)}function B(b){if(u===void 0)return v(b,h);let S=k(b);ve("scalar",S,m,D);let F=y(u(S));if(F===Te)throw new Error("invalid private or public key received");return w(F)}let O=B,P=v;function _(b,S){ve("u",b,Te,r),ve("scalar",S,m,D);let F=S,M=b,j=Q,z=Te,G=b,V=Q,ce=F^F>>Q;for(let We=BigInt(l-1);We>=Te;We--){let ur=cs(r,ce>>We);({x_2:j,x_3:G}=f(ur,j,G)),{x_2:z,x_3:V}=f(ur,z,V);let mt=j+z,ar=y(mt*mt),cr=j-z,mn=y(cr*cr),gn=ar-mn,Go=G+V,Vo=G-V,yn=y(Vo*mt),xn=y(Go*cr),bn=yn+xn,An=yn-xn;G=y(bn*bn),V=y(M*y(An*An)),j=y(ar*mn),z=y(gn*(ar+y(g*gn)))}let Ve=cs(r,F);({x_2:j,x_3:G}=f(Ve,j,G)),{x_2:z,x_3:V}=f(Ve,z,V);let ht=o(z);return y(j*ht)}let U={secretKey:d,publicKey:d,seed:d},x=b=>(b=b===void 0?c(d):b,H(b,U.seed,"seed"),b),C={randomSecretKey:x};return Object.freeze(U),Object.freeze(C),Object.freeze({keygen:Ft(x,O),getSharedSecret:P,getPublicKey:O,scalarMult:v,scalarMultBase:B,utils:C,GuBytes:h.slice(),lengths:U})}var fs=BigInt(0),Fr=BigInt(1),ds=BigInt(2),Fi=BigInt(3),Oi=BigInt(5),Ri=BigInt(8),Nt=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Li={p:Nt,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:Ri,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function ms(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),s=BigInt(80),o=Nt,u=t*t%o*t%o,a=J(u,ds,o)*u%o,c=J(a,Fr,o)*t%o,l=J(c,Oi,o)*c%o,f=J(l,e,o)*l%o,d=J(f,r,o)*f%o,p=J(d,n,o)*d%o,g=J(p,s,o)*p%o,m=J(g,s,o)*p%o,A=J(m,e,o)*l%o;return{pow_p_5_8:J(A,ds,o)*t%o,b2:u}}function Or(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}var ps=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function _i(t,e){let r=Nt,n=R(e*e*e,r),s=R(n*n*e,r),o=ms(t*s).pow_p_5_8,i=R(t*n*o,r),u=R(e*i*i,r),a=i,c=R(i*ps,r),l=u===t,f=u===R(-t,r),d=u===R(-t*ps,r);return l&&(i=a),(f||d)&&(i=c),Jn(i,r)&&(i=R(-i,r)),{isValid:l||f,value:i}}var nt=us(Li,{uvRatio:_i}),hs=nt.Fp;function Ni(t){let{y:e}=t;return hs.toBytes(hs.div(Fr+e,Fr-e))}function qi(t){let e=nt.Fp.BYTES;return oe(t,e),Or(xr(t.subarray(0,e))).subarray(0,e)}function Ii(t){return as(nt,xr,Object.assign({adjustScalarBytes:Or,toMontgomery:Ni,toMontgomerySecret:qi,zip215:!0},t))}var gs=Ii({});var W=(()=>{let t=Nt,e=r=>{let{pow_p_5_8:n,b2:s}=ms(r);return R(J(n,Fi,t)*s,t)};return ls({P:t,type:"x25519",powPminus2:e,adjustScalarBytes:Or,scalarMultBase:r=>{let n=R(r,nt.Fn.ORDER);if(n===fs)return fs;let s=nt.BASE.multiply(n);return R((s.Z+s.Y)*e(R(s.Z-s.Y,t)),t)}})})();var ys=1,It=new TextEncoder;function Rr(t){return ee(It.encode(`shalom/v1/${t}`))}function Ue(t){return t.buffer instanceof ArrayBuffer?t:new Uint8Array(t)}function ee(...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 xs(t,e,r,n){let s=await crypto.subtle.importKey("raw",ee(t),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:ee(e,r),info:Rr(n)},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Lr(){let{secretKey:t,publicKey:e}=W.keygen();return{secretKey:t,publicKey:e}}function bs(t){return W.getPublicKey(t)}async function As(t,e,r){let n=W.keygen(),s=W.getSharedSecret(n.secretKey,t),o=await xs(s,n.publicKey,t,r),i=crypto.getRandomValues(new Uint8Array(12)),u=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i,additionalData:Rr(r)},o,Ue(e)));return ee(new Uint8Array([ys]),n.publicKey,i,u)}async function ke(t,e,r){if(e.length<61||e[0]!==ys)throw new Error("lacre inv\xE1lido");let n=e.subarray(1,33),s=e.subarray(33,45),o=e.subarray(45),i=W.getPublicKey(t),u=W.getSharedSecret(t,n),a=await xs(u,n,i,r);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:Ue(s),additionalData:Rr(r)},a,Ue(o)))}async function ws(t,e){return JSON.parse(new TextDecoder().decode(await ke(t,e,"head")))}function te(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function Z(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 qt=2;async function Ds(t,e,r,n,s,o){let i=await crypto.subtle.importKey("raw",ee(t,e),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:ee(r,n,s),info:ee(It.encode(`shalom/v2/${o}`))},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Es(t,e,r,n){let s=W.keygen(),o=W.getPublicKey(e),i=await Ds(W.getSharedSecret(s.secretKey,t),W.getSharedSecret(e,t),s.publicKey,o,t,n),u=crypto.getRandomValues(new Uint8Array(12)),a=ee(new Uint8Array([qt]),It.encode(`shalom/v2/${n}`)),c=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:u,additionalData:a},i,Ue(r)));return ee(new Uint8Array([qt]),s.publicKey,u,c)}async function Bs(t,e,r,n){if(r.length<61||r[0]!==qt)throw new Error("lacre inv\xE1lido");let s=r.subarray(1,33),o=r.subarray(33,45),i=W.getPublicKey(t),u=await Ds(W.getSharedSecret(t,s),W.getSharedSecret(t,e),s,e,i,n),a=ee(new Uint8Array([qt]),It.encode(`shalom/v2/${n}`));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:Ue(o),additionalData:a},u,Ue(r.subarray(45))))}var ue=new TextEncoder,de=t=>t===32||t===9,Cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",st=new Uint8Array(256);for(let t=0;t<Cs.length;t++)st[Cs.charCodeAt(t)]=t;function Nr(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),o=new Uint8Array(s),i=0;for(let u=0;u<e;u+=4){let a=st[t.charCodeAt(u)],c=st[t.charCodeAt(u+1)],l=st[t.charCodeAt(u+2)],f=st[t.charCodeAt(u+3)];o[i++]=a<<2|c>>4,i<n&&(o[i++]=(c&15)<<4|l>>2),i<n&&(o[i++]=(l&3)<<6|f&63)}return s}var Ui=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"]]),Pi=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"]]),$i=/^(?:cp|windows|ms|ibm)(\d+)$/;function Mi(t){return t.replace(/^(?:x-ms-|x-|cs)/,"").replace(/[\s._-]+/g,"")}var vs=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(" ")),ji=new Set(["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr","replacement"]),Hi={encoding:"replacement",decode:t=>t&&t.byteLength?"\uFFFD":""},Ki=new Map([["utf-16","utf-16"],["utf16","utf-16"],["utf_16","utf-16"],["utf-16le","utf-16le"],["utf-16be","utf-16be"]]);function Os(t){if(t=(t||"utf8").trim().toLowerCase(),vs.has(t))return t;let e=Ki.get(t);if(e)return e;let r=Mi(t),n=r.match($i),s=n&&Pi.get(n[1])||Ui.get(r)||r;return vs.has(s)?s:null}var Ss=new Map;function Ut(t){if(ji.has(t))return Hi;let e=Ss.get(t);if(e===void 0){e=null;try{e=new TextDecoder(t)}catch{}Ss.set(t,e)}return e}var qr=new TextDecoder;function Rs(t){let e=Os(t);return e?Ut(e):null}function Ls(t){return Rs(t)||Ut("windows-1252")||qr}var zi=new Set(["utf-16le","utf-16be"]),Gi=new Set(["utf-16"]);function Vi(t){return t[0]===254&&t[1]===255?"utf-16be":t[0]===255&&t[1]===254?"utf-16le":null}function Wi(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],o=r===224?160:r===240?144:128,i=r===237?159:r===244?143:191;if(s<o||s>i)return!1;for(let u=2;u<=n;u++)if((t[e+u]&192)!==128)return!1;e+=n+1}return!0}function Pt(t,e=qr){let r=t instanceof Uint8Array?t:new Uint8Array(t);return Wi(r)?e.decode(r):Ls("windows-1252").decode(r)}function Ir(t,e){let r=t instanceof Uint8Array?t:new Uint8Array(t),n=Os(e),s=n?Ut(n):null;if(n&&Gi.has(n)){let o=Vi(r);s=o&&Ut(o)||s}return s?s.decode(r):Pt(r)}var Zi=1024,Yi=/charset\s*=\s*["']?\s*([^\s"';>]+)/;function Xi(t){let e=qr.decode(t.subarray(0,Zi)).toLowerCase(),r=0;for(;(r=e.indexOf("<meta",r))>=0;){let n=e.indexOf(">",r);n<0&&(n=e.length);let s=Yi.exec(e.slice(r,n));if(s)return s[1];r=n}return null}function _s(t,e,r){let n=new Uint8Array(t);if(e)return Ir(n,e);let s=r?Xi(n):null,o=s?Rs(s):null;return!o||zi.has(o.encoding)?Pt(n):(o.encoding==="x-user-defined"?Ls("windows-1252"):o).decode(n)}async function Pe(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 Fe(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1}function ot(t){return t.replace(/[\r\n]+/g," ")}function _r(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 o=ue.encode(r),i=[];for(let a=0,c=o.length;a<c;a++){let l=o[a];if(a<=c-2&&l===61){let f=Fe(o[a+1]),d=Fe(o[a+2]);if(f>=0&&d>=0){i.push(f<<4|d),a+=2;continue}}i.push(l)}s=new ArrayBuffer(i.length);let u=new DataView(s);for(let a=0,c=i.length;a<c;a++)u.setUint8(a,i[a])}else e==="B"?s=Nr(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=ue.encode(r);return ot(Ir(s,t))}var Ns="=\\?([^?\\s]+)\\?([QqBb])\\?([^?]*)\\?=",Ts=new RegExp(Ns,"g"),Ji=/^[ \t\r\n]+$/,Qi=new RegExp(`^(?:${Ns}\\s*)+$`);function qs(t){return Qi.test(t)}function eu(t){let e=[];Ts.lastIndex=0;let r=0,n;for(;n=Ts.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 tu(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 ks(t,e){let r="",n=null;for(let s=0;s<t.length;s++){let o=t[s];if(o.text!==void 0){let i=t[s+1];if(n&&i&&i.text===void 0&&Ji.test(o.text))continue;n&&(r+=_r(n.charset,n.encoding,n.encodedText),n=null),r+=o.text;continue}if(n&&e&&tu(n,o)){n.encodedText+=o.encodedText,n.padded=o.encodedText.endsWith("=");continue}n&&(r+=_r(n.charset,n.encoding,n.encodedText)),n={charset:o.charset,encoding:o.encoding,encodedText:o.encodedText,padded:o.encodedText.endsWith("=")}}return n&&(r+=_r(n.charset,n.encoding,n.encodedText)),r}function Ae(t){let e=eu((t||"").toString()),r=ks(e,!0);return r.indexOf("\uFFFD")<0?r:ks(e,!1)}function Fs(t,e){e=e||"utf-8";let r=[];for(let o=0;o<t.length;o++){let i=t.charAt(o),u=i==="%"?Fe(t.charCodeAt(o+1)):-1,a=u>=0?Fe(t.charCodeAt(o+2)):-1;if(a>=0)r.push(u<<4|a),o+=2;else if(i.charCodeAt(0)>126){let c=ue.encode(i);for(let l=0;l<c.length;l++)r.push(c[l])}else r.push(i.charCodeAt(0))}let n=new ArrayBuffer(r.length),s=new DataView(n);for(let o=0,i=r.length;o<i;o++)s.setUint8(o,r[o]);return Ir(n,e)}function Is(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(),o=Number(n[2])||0,i=e.get(s);i||(i={charset:null,values:[]},e.set(s,i));let u=t.params[r],a=n[0].charAt(n[0].length-1)==="*";o===0&&a&&(n=u.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",u=n[2]),i.values.push({nr:o,value:u,encoded:a}),delete t.params[r]}),e.forEach((r,n)=>{if(Object.prototype.hasOwnProperty.call(t.params,n))return;let s="",o="";for(let i of r.values.sort((u,a)=>u.nr-a.nr)){if(i.encoded){o+=i.value;continue}o&&(s+=Fs(o,r.charset),o=""),s+=i.value}o&&(s+=Fs(o,r.charset)),t.params[n]=s})}var it=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(),Pe(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Oe=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(),Pe(new Blob(this.chunks,{type:"application/octet-stream"}))}};var ut=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.output=new Oe,this.remainder=""}pushChunk(e){e.length&&this.output.append(new Uint8Array(Nr(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 o=Math.floor(this.remainder.length/4)*4;this.pushChunk(this.remainder.substring(0,o)),this.remainder=this.remainder.substring(o)}}finalize(){return this.flushRemainder(),this.output.finalize()}};var Us=61,at=class{constructor(){this.output=new Oe,this.pendingLineBreak=null}writeLineBreak(){this.pendingLineBreak&&this.output.writeBytes(this.pendingLineBreak)}update(e,r){this.writeLineBreak();let n=e.length;for(;n>0&&de(e[n-1]);)n--;let s=n>0&&e[n-1]===Us;s&&n--;let o=0;for(let i=0;i<n;i++){if(e[i]!==Us||i+2>=n)continue;let u=Fe(e[i+1]),a=Fe(e[i+2]);u<0||a<0||(this.output.writeBytes(e,o,i),this.output.writeByte(u<<4|a),i+=2,o=i+1)}this.output.writeBytes(e,o,n),this.pendingLineBreak=s?null:r}finalize(e=!1){return e||this.writeLineBreak(),this.output.finalize()}};var ru={EINVALIDOPTION:TypeError,EINVALIDINPUT:TypeError,EPARSERREUSED:Error,EMAXNESTINGDEPTH:Error,EMAXHEADERSIZE:Error,EMAXPARTCOUNT:Error,EMAXFORWARDEDADDRESSES:Error};function re(t,e){let r=new ru[t](e);return r.code=t,r}var nu=new TextDecoder("utf-8",{ignoreBOM:!0}),su=4096,ou=64,iu=t=>{let e=0,r=t.length;for(;e<r&&de(t.charCodeAt(e));)e++;for(;r>e&&de(t.charCodeAt(r-1));)r--;return t.slice(e,r)},uu=/^(?:From |[!-9;-~]*[ \t]*:)/,au=new Set(["content-type","content-transfer-encoding","content-disposition","content-id","content-description"]),$e=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 re("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 re("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 ut:e==="quoted-printable"?this.contentDecoder=new at:this.contentDecoder=new it}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,o=!1,i=-1,u=!1,a=0,c=g=>{r+=e.slice(a,g),a=g+1},l=!1,f=!1,d=g=>{l=!0,f=de(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)o=!o;else if(!o){if(m==="("&&p()){n===0&&(i=g),n++,c(g);continue}if(m===")"&&n>0){n--,c(g);continue}n===0&&(m==="="?u=!0:m===";"&&(u=!1))}n===0?d(g):c(g)}return n===0||e.indexOf(";",i)<0?r+e.slice(a):e}parseStructuredHeader(e){e=this.stripComments(e);let r={value:"",params:{}},n=!1,s="",o="value",i="",u=!1,a=!1,c=!1,l,f=()=>{s.length&&(s+=i),i=""},d=-1,p=h=>{d>=0&&(s+=e.slice(d,h),d=-1)},g=h=>{d<0&&(f(),d=h)},m=()=>{let h=s;return s="",i="",u=!1,h},A=(h,w)=>{h&&!Object.prototype.hasOwnProperty.call(r.params,h)&&(r.params[h]=w)},D=()=>{let h=m();n===!1?r.value=h:A(n,h)},y=()=>{A(m().trim().toLowerCase(),"")};for(let h=0,w=e.length;h<w;h++)switch(l=e.charAt(h),o){case"key":if(l==="="){p(h),n=m().trim().toLowerCase(),o="value";break}if(l===";"){p(h),y();break}d<0&&(d=h);break;case"value":if(u&&l!==";"){c=!1;break}if(c)g(h);else if(a&&l==="\\"){p(h),c=!0;continue}else a&&l===a?(p(h),a=!1,u=!0):!a&&l==='"'?(p(h),a=l,f()):!a&&l===";"?(p(h),D(),o="key"):!a&&(l===" "||l===" ")?(p(h),i+=l):g(h);c=!1;break}return p(e.length),o==="value"?D():y(),r.value&&(r.value=r.value.toLowerCase()),Is(r),r}decodeFlowedText(e,r){let n=[],s=[],o=!1,i=0;for(let u=0;u<=e.length;){let a=e.indexOf(`
3
- `,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,d=c.slice(f),p=d==="-- ";if(o&&l===i&&!p){if(r){let g=s[s.length-1];s[s.length-1]=g.slice(0,-1)}s.push(d)}else u&&s.push(`
4
- `),s.push(l?c:d);if(o=!p&&d.endsWith(" "),i=l,s.length>=su){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=_s(this.content,this.contentType.parsed.params.charset,this.contentType.parsed.value==="text/html").replace(/\r\n/g,`
2
+ import{spawn as Zo}from"node:child_process";import{mkdirSync as Ua,readFileSync as ar,writeFileSync as Pa}from"node:fs";import{hostname as $a}from"node:os";import{basename as bn,join as Ma}from"node:path";import{createInterface as ja}from"node:readline";import{parseArgs as X}from"node:util";var At=BigInt(4294967295),Tn=BigInt(32);function si(t,e=!1){return e?{h:Number(t&At),l:Number(t>>Tn&At)}:{h:Number(t>>Tn&At)|0,l:Number(t&At)|0}}function kn(t,e=!1){let r=t.length,n=new Uint32Array(r),s=new Uint32Array(r);for(let o=0;o<r;o++){let{h:i,l:u}=si(t[o],e);[n[o],s[o]]=[i,u]}return[n,s]}var oi=t=>t/2**32|0,ii=t=>t>>>0;function Fn(t,e,r,n){let s=oi(r),o=ii(r);t.setUint32(e,n?o:s,n),t.setUint32(e+4,n?s:o,n)}var pr=(t,e,r)=>t>>>r,hr=(t,e,r)=>t<<32-r|e>>>r,Te=(t,e,r)=>t>>>r|e<<32-r,ke=(t,e,r)=>t<<32-r|e>>>r,Je=(t,e,r)=>t<<64-r|e>>>r-32,Qe=(t,e,r)=>t>>>r-32|e<<64-r;function se(t,e,r,n){let s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}var On=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Rn=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Ln=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),_n=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,Nn=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),qn=(t,e,r,n,s,o)=>e+r+n+s+o+(t/2**32|0)|0;function wt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}var mr=t=>t?`"${t}" `:"";function et(t,e=""){if(typeof t!="number")throw new TypeError(mr(e)+"expected number, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError(mr(e)+"expected integer >= 0, got "+t);return t}function oe(t,e,r=""){if(wt(t)&&(e===void 0||t.length===e))return t;e!==void 0&&et(e,"length");let n=wt(t),s=e!==void 0?` of length ${e}`:"",o=n?`length=${t.length}`:`type=${typeof t}`,i=mr(r)+"expected Uint8Array"+s+", got "+o;throw n?new RangeError(i):new TypeError(i)}var ai=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)},In=(t,e)=>{ai(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 gr(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function Pn(t,e){oe(t,void 0,"output");let r=e.outputLen;if(!(t.length>=r))throw new RangeError('"output" expected length >= '+r)}function yr(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Dt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var $n=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ci=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Et(t){if(oe(t),$n)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=ci[t[r]];return e}function Un(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function Bt(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if($n)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,o=0;s<r;s++,o+=2){let i=Un(t.charCodeAt(o)),u=Un(t.charCodeAt(o+1));if(i===void 0||u===void 0){let a=t[o]+t[o+1];throw new RangeError('hex string expected, got non-hex character "'+a+'" at index '+o)}n[s]=i*16+u}return n}function xr(...t){let e=0;for(let n=0;n<t.length;n++){let s=t[n];oe(s),e+=s.length}let r=new Uint8Array(e);for(let n=0,s=0;n<t.length;n++){let o=t[n];r.set(o,s),s+=o.length}return r}function li(t,e,r="opts"){return In(t,"defaults"),e!==void 0&&In(e,r),Object.assign(Object.create(null),t,e)}function Mn(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=li({},e,"info");let r=(s,o)=>t(o).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 jn(t=32){et(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=Dt(this.buffer)}update(e){gr(this),oe(e);let{view:r,buffer:n,blockLen:s}=this,o=e.length,i=!1;for(let u=0;u<o;){let a=Math.min(s-this.pos,o-u);if(a===s){let l=Dt(e);for(;s<=o-u;u+=s)this.process(l,u);i=!0;continue}n.set(u===0&&a===o?e:e.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===s&&(this.process(r,0),this.pos=0,i=!0)}return this.length+=e.length,i&&this.roundClean(),this}digestInto(e){gr(this),Pn(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:s,isLE:o}=this,{pos:i}=this;r[i++]=128,r.fill(0,i),this.padOffset>s-i&&(this.process(n,0),r.fill(0)),Fn(n,s-8,this.length*8,o),this.process(n,0),this.roundClean();let u=e===r?n:Dt(e),a=this.outputLen,l=a/4,c=this.get();if(a%4||l>c.length)throw new Error("invalid outputLen");for(let f=0;f<l;f++)u.setUint32(4*f,c[f],o)}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:o,pos:i}=this;return e.destroyed=o,e.finished=s,e.length=n,e.pos=i,i&&e.buffer.set(r),e}clone(){return this._cloneInto()}};var Kn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var zn=kn(["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))),fi=zn[0],di=zn[1],ge=new Uint32Array(80),ye=new Uint32Array(80),br=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:o,Cl:i,Dh:u,Dl:a,Eh:l,El:c,Fh:f,Fl:p,Gh:h,Gl:g,Hh:m,Hl:x}=this;return[e,r,n,s,o,i,u,a,l,c,f,p,h,g,m,x]}set(e,r,n,s,o,i,u,a,l,c,f,p,h,g,m,x){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=o|0,this.Cl=i|0,this.Dh=u|0,this.Dl=a|0,this.Eh=l|0,this.El=c|0,this.Fh=f|0,this.Fl=p|0,this.Gh=h|0,this.Gl=g|0,this.Hh=m|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)ge[d]=e.getUint32(r),ye[d]=e.getUint32(r+=4);for(let d=16;d<80;d++){let y=ge[d-15]|0,w=ye[d-15]|0,k=Te(y,w,1)^Te(y,w,8)^pr(y,w,7),I=ke(y,w,1)^ke(y,w,8)^hr(y,w,7),C=ge[d-2]|0,E=ye[d-2]|0,O=Te(C,E,19)^Je(C,E,61)^pr(C,E,6),$=ke(C,E,19)^Qe(C,E,61)^hr(C,E,6),_=Ln(I,$,ye[d-7],ye[d-16]),U=_n(_,k,O,ge[d-7],ge[d-16]);ge[d]=U|0,ye[d]=_|0}let{Ah:n,Al:s,Bh:o,Bl:i,Ch:u,Cl:a,Dh:l,Dl:c,Eh:f,El:p,Fh:h,Fl:g,Gh:m,Gl:x,Hh:v,Hl:D}=this;for(let d=0;d<80;d++){let y=Te(f,p,14)^Te(f,p,18)^Je(f,p,41),w=ke(f,p,14)^ke(f,p,18)^Qe(f,p,41),k=f&h^~f&m,I=p&g^~p&x,C=Nn(D,w,I,di[d],ye[d]),E=qn(C,v,y,k,fi[d],ge[d]),O=C|0,$=Te(n,s,28)^Je(n,s,34)^Je(n,s,39),_=ke(n,s,28)^Qe(n,s,34)^Qe(n,s,39),U=n&o^n&u^o&u,b=s&i^s&a^i&a;v=m|0,D=x|0,m=h|0,x=g|0,h=f|0,g=p|0,{h:f,l:p}=se(l|0,c|0,E|0,O|0),l=u|0,c=a|0,u=o|0,a=i|0,o=n|0,i=s|0;let B=On(O,_,b);n=Rn(B,E,$,U),s=B|0}({h:n,l:s}=se(this.Ah|0,this.Al|0,n|0,s|0)),{h:o,l:i}=se(this.Bh|0,this.Bl|0,o|0,i|0),{h:u,l:a}=se(this.Ch|0,this.Cl|0,u|0,a|0),{h:l,l:c}=se(this.Dh|0,this.Dl|0,l|0,c|0),{h:f,l:p}=se(this.Eh|0,this.El|0,f|0,p|0),{h,l:g}=se(this.Fh|0,this.Fl|0,h|0,g|0),{h:m,l:x}=se(this.Gh|0,this.Gl|0,m|0,x|0),{h:v,l:D}=se(this.Hh|0,this.Hl|0,v|0,D|0),this.set(n,s,o,i,u,a,l,c,f,p,h,g,m,x,v,D)}roundClean(){yr(ge,ye)}destroy(){this.destroyed=!0,yr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Ar=class extends br{constructor(){super(64,Kn)}};var wr=Mn(()=>new Ar,Hn(3));function St(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 H=(t,e,r)=>oe(t,e,r),Dr=et;function xe(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 Fe(t,e){if(typeof t!="function")throw new TypeError(`"${e}" is invalid: expected function, got ${typeof t}`);return t}var Vn=Et,Er=(...t)=>xr(...t),Wn=t=>Bt(t),tt=wt,rt=t=>jn(t),vt=BigInt(0),Gn=BigInt(1),pi=t=>t?`"${t}" `:"";function le(t,e=""){if(typeof t!="boolean")throw new TypeError(pi(e)+"expected boolean, got type="+typeof t);return t}function hi(t){if(typeof t=="bigint"){if(!be(t))throw new RangeError("positive bigint expected, got "+t)}else Dr(t);return t}function Me(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 Zn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?vt:BigInt("0x"+t)}function Tt(t){return Zn(Et(t))}function fe(t){return Zn(Et(Ae(oe(t)).reverse()))}function Br(t,e){if(et(e),e===0)throw new Error("zero output length is invalid");t=hi(t);let r=e*2,n=t.toString(16);if(n.length>r)throw new RangeError("number is too large");return Bt(n.padStart(r,"0"))}function kt(t,e){return Br(t,e).reverse()}function Ae(t){return Uint8Array.from(H(t))}function be(t){return typeof t=="bigint"&&vt<=t}function Cr(t,e,r){return be(t)&&be(e)&&be(r)&&e<=t&&t<r}function Oe(t,e,r,n){if(!Cr(e,r,n))throw new RangeError("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function vr(t){if(t<vt)throw new Error("expected non-negative bigint, got "+t);return t===vt?0:t.toString(2).length}var Yn=t=>(Me(t,"n"),(Gn<<BigInt(t))-Gn);function ie(t,e={},r={},n="object"){xe(t,n),xe(e,"fields"),xe(r,"optFields");function s(i,u,a){let l=n==="object"?`param "${String(i)}"`:`"${n}.${String(i)}"`,c=t[i];if(!Object.hasOwn(t,i)&&(a?c!==void 0:u!=="function"))throw new TypeError(`${l} is invalid: expected own property`);if(a&&c===void 0)return;let f=typeof c;if(f!==u||c===null)throw new TypeError(`${l} is invalid: expected ${u}, got ${f}`)}let o=(i,u)=>Object.entries(i).forEach(([a,l])=>s(a,l,u));o(e,!1),o(r,!0)}var K=BigInt(0),N=BigInt(1),Re=BigInt(2),Qn=BigInt(3),Sr=BigInt(4),es=BigInt(5),mi=BigInt(7),ts=BigInt(8),gi=BigInt(9),yi=BigInt(15),rs=BigInt(16),xi=BigInt("0x10000000000000000");function R(t,e){if(e<=K)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=K?r:e+r}function bi(t,e,r){if(r<=N)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<K)throw new Error("invalid exponent, negatives unsupported");if(e===K)return N;if(e===N)return t;let n=t%r;if(n<K&&(n+=r),e<xi){let u=N;for(;e>K;)e&N&&(u=u*n%r),n=n*n%r,e>>=N;return u}let s=[];for(;e>K;)s.push(Number(e&yi)),e>>=Sr;let o=new Array(16);o[0]=N,o[1]=n;for(let u=2;u<16;u++)o[u]=o[u-1]*n%r;let i=o[s[s.length-1]];for(let u=s.length-2;u>=0;u--){i=i*i%r,i=i*i%r,i=i*i%r,i=i*i%r;let a=s[u];a!==0&&(i=i*o[a]%r)}return i}function J(t,e,r){if(r<=N)throw new Error("pow2: expected modulus > 1, got "+r);if(e<K)throw new Error("pow2: expected non-negative exponent, got "+e);let n=t;for(;e-- >K;)n*=n,n%=r;return n}function Xn(t,e){if(t===K)throw new Error("invert: expected non-zero number");if(e<=N)throw new Error("invert: expected modulus > 1, got "+e);let r=R(t,e),n=e,s=K,o=N;for(;r!==K;){let u=n/r,a=n-r*u,l=s-o*u;n=r,r=a,s=o,o=l}if(n!==N)throw new Error("invert: does not exist");return R(s,e)}function Tr(t,e,r){let n=t;if(!n.eql(n.sqr(e),r))throw new Error("Cannot find square root")}function kr(t,e){if((t&N)===K)throw new Error(e+": expected odd modulus, got "+t)}function ns(t,e){let r=t,n=(r.ORDER+N)/Sr,s=r.pow(e,n);return Tr(r,s,e),s}function Ai(t,e){let r=t,n=(r.ORDER-es)/ts,s=r.mul(e,Re),o=r.pow(s,n),i=r.mul(e,o),u=r.mul(r.mul(i,Re),o),a=r.mul(i,r.sub(u,r.ONE));return Tr(r,a,e),a}function wi(t){let e=Rt(t),r=ss(t),n=r(e,e.neg(e.ONE)),s=r(e,n),o=r(e,e.neg(n)),i=(t+mi)/rs;return((u,a)=>{let l=u,c=l.pow(a,i),f=l.mul(c,n),p=l.mul(c,s),h=l.mul(c,o),g=l.eql(l.sqr(f),a),m=l.eql(l.sqr(p),a);c=l.cmov(c,f,g),f=l.cmov(h,p,m);let x=l.eql(l.sqr(f),a),v=l.cmov(c,f,x);return Tr(l,v,a),v})}function ss(t){if(t<Qn)throw new Error("sqrt is not defined for small field");kr(t,"tonelliShanks");let e=t-N,r=0;for(;e%Re===K;)e/=Re,r++;let n=Re,s=Rt(t);for(;nt(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return ns;let o=s.pow(n,e),i=(e+N)/Re;return function(a,l){let c=a;if(c.is0(l))return l;if(nt(c,l)!==1)throw new Error("Cannot find square root");let f=r,p=c.mul(c.ONE,o),h=c.pow(l,e),g=c.pow(l,i);for(;!c.eql(h,c.ONE);){if(c.is0(h))throw new Error("Cannot find square root: probably non-prime P");let m=1,x=c.sqr(h);for(;!c.eql(x,c.ONE);)if(m++,x=c.sqr(x),m===f)throw new Error("Cannot find square root");let v=N<<BigInt(f-m-1),D=c.pow(p,v);f=m,p=c.sqr(D),h=c.mul(h,p),g=c.mul(g,D)}return g}}function Di(t){return kr(t,"Fp.sqrt"),t%Sr===Qn?ns:t%ts===es?Ai:t%rs===gi?wi(t):ss(t)}var os=(t,e)=>(R(t,e)&N)===N,Ei=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function je(t){if(xe(t,"field"),typeof t.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof t.ORDER);Me(t.BYTES,"BYTES"),Me(t.BITS,"BITS");for(let e of Ei)Fe(t[e],"field."+e);if(t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=N)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function Ot(t,e,r=!1){je(t),St(e,"nums"),le(r,"passZero");let n=t,s=new Array(e.length).fill(r?n.ZERO:void 0),o=e.reduce((u,a,l)=>n.is0(a)?u:(s[l]=u,n.mul(u,a)),n.ONE),i=n.inv(o);return e.reduceRight((u,a,l)=>n.is0(a)?u:(s[l]=n.mul(u,s[l]),n.mul(u,a)),i),s}function nt(t,e){je(t);let r=t;kr(r.ORDER,"FpLegendre");let n=(r.ORDER-N)/Re,s=r.pow(e,n),o=r.eql(s,r.ONE),i=r.eql(s,r.ZERO),u=r.eql(s,r.neg(r.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function Bi(t,e){if(e!==void 0&&Dr(e),t<=K)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=vr(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 Jn=new WeakMap,Ft=class{ORDER;BITS;BYTES;isLE;ZERO=K;ONE=N;_lengths;_mod;constructor(e,r={}){if(e<=N)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:o}=Bi(e,n);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=s,this.BYTES=o,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 K<=e&&e<this.ORDER}is0(e){return e===K}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&N)===N}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 bi(e,r,this.ORDER)}div(e,r){return R(e*Xn(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 Xn(e,this.ORDER)}sqrt(e){let r=Jn.get(this);return r||Jn.set(this,r=Di(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?kt(e,this.BYTES):Br(e,this.BYTES)}fromBytes(e,r=!1){H(e);let{_lengths:n,BYTES:s,isLE:o,ORDER:i,_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 l=new Uint8Array(s);l.set(e,o?0:l.length-e.length),e=l}if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);let a=o?fe(e):Tt(e);if(u&&(a=R(a,i)),!r&&!this.isValid(a))throw new Error("invalid field element: outside of range 0..ORDER");return a}invertBatch(e){return Ot(this,e,!0)}cmov(e,r,n){return le(n,"condition"),n?r:e}};function Rt(t,e={}){return Object.freeze(Ft.prototype),new Ft(t,e)}var Rr=BigInt(0),st=BigInt(1),Ci=BigInt(4),Fr=16,is=128,vi=5,us=2**31;function ot(t){let e=t;if(typeof e!="function")throw new TypeError('"Point" expected constructor, got type='+typeof t);Fe(e.fromAffine,"Point.fromAffine"),Fe(e.fromBytes,"Point.fromBytes"),Fe(e.fromHex,"Point.fromHex"),xe(e.BASE,"Point.BASE"),xe(e.ZERO,"Point.ZERO"),je(e.Fp),je(e.Fn)}function cs(t,e){ot(t),ls(e,t);let r=Ot(t.Fp,e.map(n=>n.Z));return e.map((n,s)=>t.fromAffine(n.toAffine(r[s])))}function Si(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>us)throw new Error("invalid window size: table would need ~"+Math.ceil(r/2**20)+" MiB, max "+us/2**20+" MiB")}function ki(t,e){if(t!==void 0){Fe(t,"randomBytes");try{let r=t(e);if(!tt(r)||r.length!==e)return}catch{return}return t}}function ls(t,e){St(t,"points"),t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function Fi(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):be(n)&&n<r))throw new Error("invalid scalar at index "+s)})}var fs=new WeakMap;function Or(t){return fs.get(t)||1}function Oi(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 Ri(t,e){let r=2**e,n=r/2,s=BigInt(r-1),o=[];for(;t>Rr;){let i=0;t&st&&(i=Number(t&s),i>=n&&(i-=r),t-=BigInt(i)),o.push(i),t>>=st}return o}function Li(t,e,r){let n=2**e,s=n/2,o=BigInt(n-1),i=BigInt(e),u=[];for(let a=0;a<r;a++){let l=Number(t&o);t>>=i,l>s&&(l-=n,t+=st),u.push(l)}if(t!==Rr)throw new Error("invalid wnaf");return u}function _i(t,e,r){let n=0;for(let o of r)n=Math.max(n,o.length);let s=t;for(let o=n-1;o>=0;o--){o!==n-1&&(s=s.double());for(let i=0;i<r.length;i++){let u=r[i][o];if(u){let a=e[i][Math.abs(u)-1>>1];s=s.add(u<0?a.negate():a)}}}return s}var Lt=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,r){ot(e),this.randomBytes=ki(r,Fr),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,o=2**(r-1),i=[],u=e;for(let a=0;a<s;a++){let l=u;for(let c=0;c<o;c++)i.push(l),l=l.add(u);u=i[i.length-1].double()}return{W:r,bits:n,windows:s,comp:i}}wnafCachedCT(e,r){let{W:n,windows:s,comp:o}=e,i=2**(n-1),u=Li(r,n,s),a=this.ZERO,l=this.BASE;for(let c=0;c<s;c++){let f=u[c],p=c*i,h=Math.abs(f)-1,g=o[p];for(let x=1;x<i;x++)g=x===h?o[p+x]:g;let m=g.negate();f===0?l=l.add(o[p]):a=a.add(f<0?m:g)}return{p:a,f:l}}getWnafPrecomputes(e,r,n,s){let o=this.wnafPrecomputes.get(r),i=o?.find(u=>u.W===e&&u.bits===n);return i||(i=this.buildWnafTable(r,e,n),typeof s=="function"&&(i={...i,comp:s(i.comp)}),o||(o=[],this.wnafPrecomputes.set(r,o)),o.push(i)),i}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),!Cr(r,st,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(e,r,n,s){let o=Or(e);return o===1?this.fixedWindowCT(e,r,n):this.wnafCachedCT(this.getWnafPrecomputes(o,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+is,o=this.randomBytes(Fr);if(!tt(o)||o.length!==Fr)throw new Error("randomBytes returned invalid byte array");o[0]=o[0]&63|128;let i=r+Tt(o)*this.Point.Fn.ORDER;return this.runCT(e,i,s,n)}fixedWindowCT(e,r,n){let s=vi,o=1<<s,i=Yn(s),u=new Array(o);u[0]=this.ZERO;for(let c=1;c<o;c++)u[c]=u[c-1].add(e);let a=Math.ceil(n/s),l=this.ZERO;for(let c=a-1;c>=0;c--){if(c!==a-1)for(let h=0;h<s;h++)l=l.double();let f=Number(r>>BigInt(c*s)&i),p=u[0];for(let h=1;h<o;h++)p=h===f?u[h]:p;l=l.add(p)}return{p:l,f:l}}shouldBlind(e,r){return this.randomBytes===void 0?!1:r===st?!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),!be(r))throw new Error("invalid scalar");let s=Or(e);if(s===1||r>=this.Point.Fn.ORDER)return Ni(this.Point,[e],[r],!0);let o=this.getWnafPrecomputes(s,e,this.bits,n);return this.wnafCachedCT(o,r).p}setWindowSize(e,r){this.assertPoint(e),Si(r,this.bits);let n=Math.ceil((this.bits+is)/r)+1;Ti(n*2**(r-1),this.Point.Fp.BYTES),fs.set(e,r),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return Or(e)!==1}};function Ni(t,e,r,n=!1){if(ot(t),ls(e,t),le(n,"allowOversized"),Fi(r,t.Fn,n?t.Fn.ORDER**Ci:void 0),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let s=e.map(i=>Oi(i,4)),o=r.map(i=>Ri(i,4));return _i(t.ZERO,s,o)}function as(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return je(e),e}else return Rt(t,{isLE:r})}function ds(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`);ie(r);for(let a of["p","n","h"]){let l=e[a];if(!(be(l)&&l!==Rr))throw new Error(`CURVE.${a} must be positive bigint`)}let s=as(e.p,r.Fp,n),o=as(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:o}}function _t(t,e){return function(n){let s=t(n);return{secretKey:s,publicKey:e(s)}}}var Nt=BigInt(0),qt=BigInt(1),It=BigInt(2),qi=BigInt(4),ps=BigInt(8);function Ii(t,e,r,n){let s=t.sqr(r),o=t.sqr(n),i=t.add(t.mul(e.a,s),o),u=t.add(t.ONE,t.mul(e.d,t.mul(s,o)));return t.eql(i,u)}function hs(t,e={}){ie(e,{},{},"extraOpts");let r=e,n=ds("edwards",t,r,r.FpFnLE),{Fp:s,Fn:o}=n,i=n.CURVE,{h:u}=i;if(nt(s,i.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(nt(s,i.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");ie(r,{},{uvRatio:"function",randomBytes:"function"});let a=r.randomBytes===void 0?rt:r.randomBytes,l=It<<BigInt(s.BYTES*8)-qt;function c(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:Nt}}}:r.uvRatio;if(!Ii(s,i,i.Gx,i.Gy))throw new Error("bad curve params: generator point");let p=s.eql(i.a,s.neg(s.ONE))?D=>s.neg(D):s.eql(i.a,s.ONE)?D=>D:D=>s.mul(i.a,D);function h(D,d,y=!1){let w=y?qt:Nt;return Oe("coordinate "+D,d,w,l),d}function g(D){if(!(D instanceof m))throw new Error("EdwardsPoint expected")}class m{static BASE=new m(i.Gx,i.Gy,s.ONE,s.mul(i.Gx,i.Gy));static ZERO=new m(s.ZERO,s.ONE,s.ONE,s.ZERO);static Fp=s;static Fn=o;X;Y;Z;T;constructor(d,y,w,k){this.X=h("x",d),this.Y=h("y",y),this.Z=h("z",w,!0),this.T=h("t",k),Object.freeze(this)}static CURVE(){return i}static fromAffine(d){if(d instanceof m)throw new Error("extended point not allowed");let{x:y,y:w}=d||{};return h("x",y),h("y",w),new m(y,w,s.ONE,s.mul(y,w))}static fromBytes(d,y=!1){let w=s.BYTES,{a:k,d:I}=i;d=Ae(H(d,w,"point")),le(y,"zip215");let C=Ae(d),E=d[w-1];C[w-1]=E&-129;let O=fe(C),$=y?l:s.ORDER;Oe("point.y",O,Nt,$);let _=s.sqr(O),U=s.sub(_,s.ONE),b=s.sub(s.mulN(I,_),k),{isValid:B,value:A}=f(U,b);if(!B)throw new Error("bad point: invalid y coordinate");let S=c(A),F=(E&128)!==0;if(!y&&s.is0(A)&&F)throw new Error("bad point: x=0 and x_0=1");return F!==S&&(A=s.neg(A)),m.fromAffine({x:A,y:O})}static fromHex(d,y=!1){return m.fromBytes(Wn(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(It),this}assertValidity(){let d=this,{a:y,d:w}=i;if(d.is0())throw new Error("bad point: ZERO");let{X:k,Y:I,Z:C,T:E}=d,O=s.sqr(k),$=s.sqr(I),_=s.sqr(C),U=s.sqr(_),b=s.mul(O,y),B=s.mul(s.add(b,$),_),A=s.add(U,s.mul(w,s.mul(O,$)));if(!s.eql(B,A))throw new Error("bad point: equation left != right (1)");let S=s.mul(k,I),F=s.mul(C,E);if(!s.eql(S,F))throw new Error("bad point: equation left != right (2)")}equals(d){g(d);let{X:y,Y:w,Z:k}=this,{X:I,Y:C,Z:E}=d,O=s.mul(y,E),$=s.mul(I,k),_=s.mul(w,E),U=s.mul(C,k);return s.eql(O,$)&&s.eql(_,U)}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:y,Z:w}=this,k=s.sqr(d),I=s.sqr(y),C=s.mul(s.sqr(w),It),E=p(k),O=s.addN(d,y),$=s.sub(s.subN(s.sqr(O),k),I),_=s.addN(E,I),U=s.subN(_,C),b=s.subN(E,I),B=s.mul($,U),A=s.mul(_,b),S=s.mul($,b),F=s.mul(U,_);return new m(B,A,F,S)}add(d){g(d);let{d:y}=i,{X:w,Y:k,Z:I,T:C}=this,{X:E,Y:O,Z:$,T:_}=d,U=s.mul(w,E),b=s.mul(k,O),B=s.mul(s.mulN(C,y),_),A=s.mul(I,$),S=s.sub(s.subN(s.mulN(s.addN(w,k),s.addN(E,O)),U),b),F=s.subN(A,B),M=s.addN(A,B),j=s.sub(b,p(U)),G=s.mul(S,F),W=s.mul(M,j),Z=s.mul(S,j),ce=s.mul(F,M);return new m(G,W,ce,Z)}subtract(d){return g(d),this.add(d.negate())}multiply(d){if(!o.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(!o.isValid(d))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return d===Nt?m.ZERO:this.is0()||d===qt?this:v.mulUnsafe(this,d,x)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return v.mulUnsafe(this,i.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:k,Y:I,Z:C}=y,E=y.is0();w==null&&(w=E?s.create(ps):s.inv(C));let O=s.mul(k,w),$=s.mul(I,w),_=s.mul(C,w);if(E)return{x:s.ZERO,y:s.ONE};if(!s.eql(_,s.ONE))throw new Error("invZ was invalid");return{x:O,y:$}}clearCofactor(){return u===qt?this:u===It?this.double():u===qi?this.double().double():u===ps?this.double().double().double():this.multiplyUnsafe(u)}toBytes(){let{x:d,y}=this.toAffine(),w=s.toBytes(y);return w[w.length-1]|=c(d)?128:0,w}toHex(){return Vn(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let x=D=>cs(m,D),v=new Lt(m,a);return v.bits>=6&&m.BASE.precompute(6),Object.freeze(m.prototype),Object.freeze(m),m}function ms(t,e,r={}){if(ot(t),typeof e!="function")throw new Error('"hash" function param is required');let n=e,s=r;ie(s,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});let{prehash:o}=s,{BASE:i,Fp:u,Fn:a}=t,l=n.outputLen,c=2*u.BYTES;if(l!==void 0&&(Me(l,"hash.outputLen"),l!==c))throw new Error(`hash.outputLen must be ${c}, got ${l}`);let f=s.randomBytes===void 0?rt:s.randomBytes,p=s.toMontgomery,h=s.toMontgomerySecret,g=s.adjustScalarBytes===void 0?b=>b:s.adjustScalarBytes,m=s.domain===void 0?(b,B,A)=>{if(le(A,"phflag"),B.length||A)throw new Error("Contexts/pre-hash are not supported");return b}:s.domain;function x(b){return a.create(fe(b))}function v(b){let B=E.secretKey;H(b,E.secretKey,"secretKey");let A=H(n(b),2*B,"hashedSecretKey"),S=g(A.slice(0,B)),F=A.slice(B,2*B),M=x(S);return{head:S,prefix:F,scalar:M}}function D(b){let{head:B,prefix:A,scalar:S}=v(b),F=i.multiply(S),M=F.toBytes();return{head:B,prefix:A,scalar:S,point:F,pointBytes:M}}function d(b){return D(b).pointBytes}function y(b=Uint8Array.of(),...B){let A=Er(...B);return x(n(m(A,H(b,void 0,"context"),!!o)))}function w(b,B,A={}){ie(A,{},{},"options"),b=Ae(H(b,void 0,"message")),o&&(b=o(b));let{prefix:S,scalar:F,pointBytes:M}=D(B),j=y(A.context,S,b),G=i.multiply(j).toBytes(),W=y(A.context,G,M,b),Z=a.create(j+W*F);if(!a.isValid(Z))throw new Error("sign failed: invalid s");let ce=Er(G,a.toBytes(Z));return H(ce,E.signature,"result")}let k={zip215:s.zip215};function I(b,B,A,S=k){ie(S);let{context:F}=S,M=S.zip215===void 0?!!k.zip215:S.zip215,j=E.signature;b=H(b,j,"signature"),B=H(B,void 0,"message"),A=H(A,E.publicKey,"publicKey"),M!==void 0&&le(M,"zip215"),o&&(B=o(B));let G=j/2,W=b.subarray(0,G),Z=fe(b.subarray(G,j)),ce,Ye,xt;try{ce=t.fromBytes(A,M),Ye=t.fromBytes(W,M),xt=i.multiplyUnsafe(Z)}catch{return!1}if(!M&&ce.isSmallOrder())return!1;let Xe=y(F,W,A,B);return Ye.add(ce.multiplyUnsafe(Xe)).subtract(xt).clearCofactor().is0()}let C=u.BYTES,E={secretKey:C,publicKey:C,signature:2*C,seed:C};function O(b){return b=b===void 0?f(E.seed):b,H(b,E.seed,"seed")}function $(b){return tt(b)&&b.length===E.secretKey}function _(b,B){try{return!!t.fromBytes(b,B===void 0?k.zip215:B)}catch{return!1}}let U={getExtendedPublicKey:D,randomSecretKey:O,isValidSecretKey:$,isValidPublicKey:_,toMontgomery(b){if(p===void 0)throw new Error("Montgomery conversion is not supported for this curve");return p(t.fromBytes(b))},toMontgomerySecret(b){if(h===void 0)throw new Error("Montgomery conversion is not supported for this curve");return h(b)}};return Object.freeze(E),Object.freeze(U),Object.freeze({keygen:_t(O,d),getPublicKey:d,sign:w,verify:I,utils:U,Point:t,lengths:E})}var Le=BigInt(0),Q=BigInt(1),Ut=BigInt(2);function gs(t,e){return t+e-(e>>Q<<Q)}function Ui(t){let e=BigInt(6)*t;return(r,n,s)=>{let o=n+s,u=((e+s-n)*r+n)%t;return{x_2:u,x_3:o-u}}}function Pi(t){return ie(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function",scalarMultBase:"function"}),Object.freeze({...t})}function ys(t){let e=Pi(t),{P:r,type:n,adjustScalarBytes:s,powPminus2:o,randomBytes:i}=e,u=e.scalarMultBase,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let l=i===void 0?rt:i,c=a?255:448,f=Ui(r),p=a?32:56,h=BigInt(a?9:5),g=BigInt(a?121665:39081),m=a?Ut**BigInt(254):Ut**BigInt(447),x=a?BigInt(8)*(Ut**BigInt(251)-Q):BigInt(4)*(Ut**BigInt(445)-Q),v=m+x+Q,D=A=>R(A,r),d=y(h);function y(A){return kt(D(A),p)}function w(A){let S=Ae(H(A,p,"uCoordinate"));return a&&(S[31]&=127),D(fe(S))}function k(A){return fe(s(Ae(H(A,p,"scalar"))))}let I=new Set(a?[Le,Q,r-Q,BigInt("325606250916557431795983626356110631294008115727848805560023387167927233504"),BigInt("39382357235489614581723060781553021112529911719440698176882885853963445705823")]:[Le,Q,r-Q]);function C(A,S){let F=w(S);if(I.has(F))throw new Error("invalid private or public key received");let M=_(F,k(A));if(M===Le)throw new Error("invalid private or public key received");return y(M)}function E(A){if(u===void 0)return C(A,d);let S=k(A);Oe("scalar",S,m,v);let F=D(u(S));if(F===Le)throw new Error("invalid private or public key received");return y(F)}let O=E,$=C;function _(A,S){Oe("u",A,Le,r),Oe("scalar",S,m,v);let F=S,M=A,j=Q,G=Le,W=A,Z=Q,ce=F^F>>Q;for(let Xe=BigInt(c-1);Xe>=Le;Xe--){let lr=gs(r,ce>>Xe);({x_2:j,x_3:W}=f(lr,j,W)),{x_2:G,x_3:Z}=f(lr,G,Z);let bt=j+G,fr=D(bt*bt),dr=j-G,Dn=D(dr*dr),En=fr-Dn,ri=W+Z,ni=W-Z,Bn=D(ni*bt),Cn=D(ri*dr),vn=Bn+Cn,Sn=Bn-Cn;W=D(vn*vn),Z=D(M*D(Sn*Sn)),j=D(fr*Dn),G=D(En*(fr+D(g*En)))}let Ye=gs(r,F);({x_2:j,x_3:W}=f(Ye,j,W)),{x_2:G,x_3:Z}=f(Ye,G,Z);let xt=o(G);return D(j*xt)}let U={secretKey:p,publicKey:p,seed:p},b=A=>(A=A===void 0?l(p):A,H(A,U.seed,"seed"),A),B={randomSecretKey:b};return Object.freeze(U),Object.freeze(B),Object.freeze({keygen:_t(b,O),getSharedSecret:$,getPublicKey:O,scalarMult:C,scalarMultBase:E,utils:B,GuBytes:d.slice(),lengths:U})}var xs=BigInt(0),Lr=BigInt(1),bs=BigInt(2),$i=BigInt(3),Mi=BigInt(5),ji=BigInt(8),Pt=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Hi={p:Pt,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:ji,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Ds(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),s=BigInt(80),o=Pt,u=t*t%o*t%o,a=J(u,bs,o)*u%o,l=J(a,Lr,o)*t%o,c=J(l,Mi,o)*l%o,f=J(c,e,o)*c%o,p=J(f,r,o)*f%o,h=J(p,n,o)*p%o,g=J(h,s,o)*h%o,m=J(g,s,o)*h%o,x=J(m,e,o)*c%o;return{pow_p_5_8:J(x,bs,o)*t%o,b2:u}}function _r(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}var As=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Ki(t,e){let r=Pt,n=R(e*e*e,r),s=R(n*n*e,r),o=Ds(t*s).pow_p_5_8,i=R(t*n*o,r),u=R(e*i*i,r),a=i,l=R(i*As,r),c=u===t,f=u===R(-t,r),p=u===R(-t*As,r);return c&&(i=a),(f||p)&&(i=l),os(i,r)&&(i=R(-i,r)),{isValid:c||f,value:i}}var it=hs(Hi,{uvRatio:Ki}),ws=it.Fp;function zi(t){let{y:e}=t;return ws.toBytes(ws.div(Lr+e,Lr-e))}function Gi(t){let e=it.Fp.BYTES;return oe(t,e),_r(wr(t.subarray(0,e))).subarray(0,e)}function Vi(t){return ms(it,wr,Object.assign({adjustScalarBytes:_r,toMontgomery:zi,toMontgomerySecret:Gi,zip215:!0},t))}var Es=Vi({});var Y=(()=>{let t=Pt,e=r=>{let{pow_p_5_8:n,b2:s}=Ds(r);return R(J(n,$i,t)*s,t)};return ys({P:t,type:"x25519",powPminus2:e,adjustScalarBytes:_r,scalarMultBase:r=>{let n=R(r,it.Fn.ORDER);if(n===xs)return xs;let s=it.BASE.multiply(n);return R((s.Z+s.Y)*e(R(s.Z-s.Y,t)),t)}})})();var Bs=1,Mt=new TextEncoder;function Nr(t){return ee(Mt.encode(`shalom/v1/${t}`))}function He(t){return t.buffer instanceof ArrayBuffer?t:new Uint8Array(t)}function ee(...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 Cs(t,e,r,n){let s=await crypto.subtle.importKey("raw",ee(t),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:ee(e,r),info:Nr(n)},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function qr(){let{secretKey:t,publicKey:e}=Y.keygen();return{secretKey:t,publicKey:e}}function vs(t){return Y.getPublicKey(t)}async function Ss(t,e,r){let n=Y.keygen(),s=Y.getSharedSecret(n.secretKey,t),o=await Cs(s,n.publicKey,t,r),i=crypto.getRandomValues(new Uint8Array(12)),u=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i,additionalData:Nr(r)},o,He(e)));return ee(new Uint8Array([Bs]),n.publicKey,i,u)}async function we(t,e,r){if(e.length<61||e[0]!==Bs)throw new Error("lacre inv\xE1lido");let n=e.subarray(1,33),s=e.subarray(33,45),o=e.subarray(45),i=Y.getPublicKey(t),u=Y.getSharedSecret(t,n),a=await Cs(u,n,i,r);return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:He(s),additionalData:Nr(r)},a,He(o)))}async function Ts(t,e){return JSON.parse(new TextDecoder().decode(await we(t,e,"head")))}function te(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function V(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 $t=2;async function ks(t,e,r,n,s,o){let i=await crypto.subtle.importKey("raw",ee(t,e),"HKDF",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:ee(r,n,s),info:ee(Mt.encode(`shalom/v2/${o}`))},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Fs(t,e,r,n){let s=Y.keygen(),o=Y.getPublicKey(e),i=await ks(Y.getSharedSecret(s.secretKey,t),Y.getSharedSecret(e,t),s.publicKey,o,t,n),u=crypto.getRandomValues(new Uint8Array(12)),a=ee(new Uint8Array([$t]),Mt.encode(`shalom/v2/${n}`)),l=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:u,additionalData:a},i,He(r)));return ee(new Uint8Array([$t]),s.publicKey,u,l)}async function Os(t,e,r,n){if(r.length<61||r[0]!==$t)throw new Error("lacre inv\xE1lido");let s=r.subarray(1,33),o=r.subarray(33,45),i=Y.getPublicKey(t),u=await ks(Y.getSharedSecret(t,s),Y.getSharedSecret(t,e),s,e,i,n),a=ee(new Uint8Array([$t]),Mt.encode(`shalom/v2/${n}`));return new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:He(o),additionalData:a},u,He(r.subarray(45))))}var ue=new TextEncoder,de=t=>t===32||t===9,Rs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut=new Uint8Array(256);for(let t=0;t<Rs.length;t++)ut[Rs.charCodeAt(t)]=t;function Ur(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),o=new Uint8Array(s),i=0;for(let u=0;u<e;u+=4){let a=ut[t.charCodeAt(u)],l=ut[t.charCodeAt(u+1)],c=ut[t.charCodeAt(u+2)],f=ut[t.charCodeAt(u+3)];o[i++]=a<<2|l>>4,i<n&&(o[i++]=(l&15)<<4|c>>2),i<n&&(o[i++]=(c&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"]]),Zi=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"]]),Yi=/^(?:cp|windows|ms|ibm)(\d+)$/;function Xi(t){return t.replace(/^(?:x-ms-|x-|cs)/,"").replace(/[\s._-]+/g,"")}var Ls=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(" ")),Ji=new Set(["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr","replacement"]),Qi={encoding:"replacement",decode:t=>t&&t.byteLength?"\uFFFD":""},eu=new Map([["utf-16","utf-16"],["utf16","utf-16"],["utf_16","utf-16"],["utf-16le","utf-16le"],["utf-16be","utf-16be"]]);function Us(t){if(t=(t||"utf8").trim().toLowerCase(),Ls.has(t))return t;let e=eu.get(t);if(e)return e;let r=Xi(t),n=r.match(Yi),s=n&&Zi.get(n[1])||Wi.get(r)||r;return Ls.has(s)?s:null}var _s=new Map;function jt(t){if(Ji.has(t))return Qi;let e=_s.get(t);if(e===void 0){e=null;try{e=new TextDecoder(t)}catch{}_s.set(t,e)}return e}var Pr=new TextDecoder;function Ps(t){let e=Us(t);return e?jt(e):null}function $s(t){return Ps(t)||jt("windows-1252")||Pr}var tu=new Set(["utf-16le","utf-16be"]),ru=new Set(["utf-16"]);function nu(t){return t[0]===254&&t[1]===255?"utf-16be":t[0]===255&&t[1]===254?"utf-16le":null}function su(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],o=r===224?160:r===240?144:128,i=r===237?159:r===244?143:191;if(s<o||s>i)return!1;for(let u=2;u<=n;u++)if((t[e+u]&192)!==128)return!1;e+=n+1}return!0}function Ht(t,e=Pr){let r=t instanceof Uint8Array?t:new Uint8Array(t);return su(r)?e.decode(r):$s("windows-1252").decode(r)}function $r(t,e){let r=t instanceof Uint8Array?t:new Uint8Array(t),n=Us(e),s=n?jt(n):null;if(n&&ru.has(n)){let o=nu(r);s=o&&jt(o)||s}return s?s.decode(r):Ht(r)}var ou=1024,iu=/charset\s*=\s*["']?\s*([^\s"';>]+)/;function uu(t){let e=Pr.decode(t.subarray(0,ou)).toLowerCase(),r=0;for(;(r=e.indexOf("<meta",r))>=0;){let n=e.indexOf(">",r);n<0&&(n=e.length);let s=iu.exec(e.slice(r,n));if(s)return s[1];r=n}return null}function Ms(t,e,r){let n=new Uint8Array(t);if(e)return $r(n,e);let s=r?uu(n):null,o=s?Ps(s):null;return!o||tu.has(o.encoding)?Ht(n):(o.encoding==="x-user-defined"?$s("windows-1252"):o).decode(n)}async function Ke(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 _e(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1}function at(t){return t.replace(/[\r\n]+/g," ")}function Ir(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 o=ue.encode(r),i=[];for(let a=0,l=o.length;a<l;a++){let c=o[a];if(a<=l-2&&c===61){let f=_e(o[a+1]),p=_e(o[a+2]);if(f>=0&&p>=0){i.push(f<<4|p),a+=2;continue}}i.push(c)}s=new ArrayBuffer(i.length);let u=new DataView(s);for(let a=0,l=i.length;a<l;a++)u.setUint8(a,i[a])}else e==="B"?s=Ur(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=ue.encode(r);return at($r(s,t))}var js="=\\?([^?\\s]+)\\?([QqBb])\\?([^?]*)\\?=",Ns=new RegExp(js,"g"),au=/^[ \t\r\n]+$/,cu=new RegExp(`^(?:${js}\\s*)+$`);function Hs(t){return cu.test(t)}function lu(t){let e=[];Ns.lastIndex=0;let r=0,n;for(;n=Ns.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 fu(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 qs(t,e){let r="",n=null;for(let s=0;s<t.length;s++){let o=t[s];if(o.text!==void 0){let i=t[s+1];if(n&&i&&i.text===void 0&&au.test(o.text))continue;n&&(r+=Ir(n.charset,n.encoding,n.encodedText),n=null),r+=o.text;continue}if(n&&e&&fu(n,o)){n.encodedText+=o.encodedText,n.padded=o.encodedText.endsWith("=");continue}n&&(r+=Ir(n.charset,n.encoding,n.encodedText)),n={charset:o.charset,encoding:o.encoding,encodedText:o.encodedText,padded:o.encodedText.endsWith("=")}}return n&&(r+=Ir(n.charset,n.encoding,n.encodedText)),r}function De(t){let e=lu((t||"").toString()),r=qs(e,!0);return r.indexOf("\uFFFD")<0?r:qs(e,!1)}function Is(t,e){e=e||"utf-8";let r=[];for(let o=0;o<t.length;o++){let i=t.charAt(o),u=i==="%"?_e(t.charCodeAt(o+1)):-1,a=u>=0?_e(t.charCodeAt(o+2)):-1;if(a>=0)r.push(u<<4|a),o+=2;else if(i.charCodeAt(0)>126){let l=ue.encode(i);for(let c=0;c<l.length;c++)r.push(l[c])}else r.push(i.charCodeAt(0))}let n=new ArrayBuffer(r.length),s=new DataView(n);for(let o=0,i=r.length;o<i;o++)s.setUint8(o,r[o]);return $r(n,e)}function Ks(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(),o=Number(n[2])||0,i=e.get(s);i||(i={charset:null,values:[]},e.set(s,i));let u=t.params[r],a=n[0].charAt(n[0].length-1)==="*";o===0&&a&&(n=u.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",u=n[2]),i.values.push({nr:o,value:u,encoded:a}),delete t.params[r]}),e.forEach((r,n)=>{if(Object.prototype.hasOwnProperty.call(t.params,n))return;let s="",o="";for(let i of r.values.sort((u,a)=>u.nr-a.nr)){if(i.encoded){o+=i.value;continue}o&&(s+=Is(o,r.charset),o=""),s+=i.value}o&&(s+=Is(o,r.charset)),t.params[n]=s})}var ct=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(),Ke(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Ne=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(),Ke(new Blob(this.chunks,{type:"application/octet-stream"}))}};var lt=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.output=new Ne,this.remainder=""}pushChunk(e){e.length&&this.output.append(new Uint8Array(Ur(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 o=Math.floor(this.remainder.length/4)*4;this.pushChunk(this.remainder.substring(0,o)),this.remainder=this.remainder.substring(o)}}finalize(){return this.flushRemainder(),this.output.finalize()}};var zs=61,ft=class{constructor(){this.output=new Ne,this.pendingLineBreak=null}writeLineBreak(){this.pendingLineBreak&&this.output.writeBytes(this.pendingLineBreak)}update(e,r){this.writeLineBreak();let n=e.length;for(;n>0&&de(e[n-1]);)n--;let s=n>0&&e[n-1]===zs;s&&n--;let o=0;for(let i=0;i<n;i++){if(e[i]!==zs||i+2>=n)continue;let u=_e(e[i+1]),a=_e(e[i+2]);u<0||a<0||(this.output.writeBytes(e,o,i),this.output.writeByte(u<<4|a),i+=2,o=i+1)}this.output.writeBytes(e,o,n),this.pendingLineBreak=s?null:r}finalize(e=!1){return e||this.writeLineBreak(),this.output.finalize()}};var du={EINVALIDOPTION:TypeError,EINVALIDINPUT:TypeError,EPARSERREUSED:Error,EMAXNESTINGDEPTH:Error,EMAXHEADERSIZE:Error,EMAXPARTCOUNT:Error,EMAXFORWARDEDADDRESSES:Error};function re(t,e){let r=new du[t](e);return r.code=t,r}var pu=new TextDecoder("utf-8",{ignoreBOM:!0}),hu=4096,mu=64,gu=t=>{let e=0,r=t.length;for(;e<r&&de(t.charCodeAt(e));)e++;for(;r>e&&de(t.charCodeAt(r-1));)r--;return t.slice(e,r)},yu=/^(?:From |[!-9;-~]*[ \t]*:)/,xu=new Set(["content-type","content-transfer-encoding","content-disposition","content-id","content-description"]),ze=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 re("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 re("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 lt:e==="quoted-printable"?this.contentDecoder=new ft:this.contentDecoder=new ct}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,o=!1,i=-1,u=!1,a=0,l=g=>{r+=e.slice(a,g),a=g+1},c=!1,f=!1,p=g=>{c=!0,f=de(e.charCodeAt(g))},h=()=>!u||!c||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)o=!o;else if(!o){if(m==="("&&h()){n===0&&(i=g),n++,l(g);continue}if(m===")"&&n>0){n--,l(g);continue}n===0&&(m==="="?u=!0:m===";"&&(u=!1))}n===0?p(g):l(g)}return n===0||e.indexOf(";",i)<0?r+e.slice(a):e}parseStructuredHeader(e){e=this.stripComments(e);let r={value:"",params:{}},n=!1,s="",o="value",i="",u=!1,a=!1,l=!1,c,f=()=>{s.length&&(s+=i),i=""},p=-1,h=d=>{p>=0&&(s+=e.slice(p,d),p=-1)},g=d=>{p<0&&(f(),p=d)},m=()=>{let d=s;return s="",i="",u=!1,d},x=(d,y)=>{d&&!Object.prototype.hasOwnProperty.call(r.params,d)&&(r.params[d]=y)},v=()=>{let d=m();n===!1?r.value=d:x(n,d)},D=()=>{x(m().trim().toLowerCase(),"")};for(let d=0,y=e.length;d<y;d++)switch(c=e.charAt(d),o){case"key":if(c==="="){h(d),n=m().trim().toLowerCase(),o="value";break}if(c===";"){h(d),D();break}p<0&&(p=d);break;case"value":if(u&&c!==";"){l=!1;break}if(l)g(d);else if(a&&c==="\\"){h(d),l=!0;continue}else a&&c===a?(h(d),a=!1,u=!0):!a&&c==='"'?(h(d),a=c,f()):!a&&c===";"?(h(d),v(),o="key"):!a&&(c===" "||c===" ")?(h(d),i+=c):g(d);l=!1;break}return h(e.length),o==="value"?v():D(),r.value&&(r.value=r.value.toLowerCase()),Ks(r),r}decodeFlowedText(e,r){let n=[],s=[],o=!1,i=0;for(let u=0;u<=e.length;){let a=e.indexOf(`
3
+ `,u);a<0&&(a=e.length);let l=e.slice(u,a),c=0;for(;l.charCodeAt(c)===62;)c++;let f=l.charCodeAt(c)===32?c+1:c,p=l.slice(f),h=p==="-- ";if(o&&c===i&&!h){if(r){let g=s[s.length-1];s[s.length-1]=g.slice(0,-1)}s.push(p)}else u&&s.push(`
4
+ `),s.push(c?l:p);if(o=!h&&p.endsWith(" "),i=c,s.length>=hu){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=Ms(this.content,this.contentType.parsed.params.charset,this.contentType.parsed.value==="text/html").replace(/\r\n/g,`
5
5
  `);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 i of this.headerLines)e.length&&/^[ \t]/.test(i)?e[e.length-1].push(i):e.push([i]);let r=new Set;for(let i of e){let u=i.join(`
6
- `),a=u.indexOf(":"),c=a<0?u:u.slice(0,a);this.rawHeaderLines.push({key:c.toLowerCase(),line:u});let l=i.join("");a=l.indexOf(":");let f=a<0?l:l.slice(0,a),d=a<0?"":iu(ot(l.slice(a+1)));this.headers.push({key:f.toLowerCase(),originalKey:f,value:d});let p=f.toLowerCase();if(au.has(p)&&!r.has(p))switch(r.add(p),p){case"content-type":this.contentType.value=d;break;case"content-transfer-encoding":this.contentTransferEncoding.value=d;break;case"content-disposition":this.contentDisposition.value=d;break;case"content-id":this.contentId=d;break;case"content-description":this.contentDescription=d;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:ue.encode(n),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value);let s=this.contentDisposition.parsed.value,o=s.search(/[ \t]/);o>=0&&(this.contentDisposition.parsed.value=s.slice(0,o)),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,ou);let n=this.postalMime.limits.maxHeadersSize;if(this.postalMime.counters.headerSize>n)throw re("EMAXHEADERSIZE",`Maximum header size of ${n} bytes exceeded`);let s=Pt(e,nu);if(!de(e[0])&&!uu.test(s))return this.endHeaders(),!0;this.headerLines.push(s);break}case"body":this.contentDecoder&&this.contentDecoder.update(e,r);break}return!1}};var Ur={"&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;":`
7
- `,"&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 cu=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 lu(t){return t.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof Ur[e]=="string")return Ur[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=cu.get(n)??n,n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}var Hs=t=>t.toString(16).toUpperCase().padStart(2,"0");function Re(t){return t.trim().replace(/[<>"'?&]/g,e=>"&#x"+Hs(e.charCodeAt(0))+";")}var fu=/[^A-Za-z0-9\-._~!$'()*+,;:@]+/g,du=Array.from({length:256},(t,e)=>"%"+Hs(e));function pu(t){return t.replace(fu,e=>Array.from(ue.encode(e),r=>du[r]).join(""))}function Ks(t){return"<div>"+Re(t).replace(/\n/g,"<br />")+"</div>"}function Ps(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 zs(t,e){let r=t.lastIndexOf(">")+1;return e(t.slice(0,r))+t.slice(r)}function ct(t,e,r){return zs(t,n=>n.replace(e,r))}function $s(t,e,r,n){let s=[],o=0,i=0;for(;;){e.lastIndex=i;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){i=c+1;continue}s.push(t.slice(o,a),n(...l)),o=i=a+l[0].length}return s.push(t.slice(o)),s.join("")}function Pr(t,e,r,n,s,o){let i=Ps(t,/>/g),u=Ps(t,n),a=[],c=0,l=0;for(;;){e.lastIndex=l;let f=e.exec(t);if(!f)break;let d=f.index;l=d+1;let p=d+f[0].length;if(r){let A=i(p);if(!A)break;p=A.index+1}let g=u(p);if(!g)break;let m=g.index+g[0].length;if(s){let A=i(m);if(!A)break;m=A.index+1}a.push(t.slice(c,d),o),c=l=m}return a.push(t.slice(c)),a.join("")}function $r(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 Ms(t,e){e.lastIndex=0;let r=e.exec(t);return r&&r.index<t.lastIndexOf(">")?t.slice(0,r.index):t}function Gs(t){return t=t.replace(/\r\n|[\n\r\u2028\u2029]/g,""),t=Pr(t,/<!--/g,!1,/-->/g,!1," "),t=ct(t,/<br\b[^>]*>/gi,`
8
- `),t=ct(t,/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
6
+ `),a=u.indexOf(":"),l=a<0?u:u.slice(0,a);this.rawHeaderLines.push({key:l.toLowerCase(),line:u});let c=i.join("");a=c.indexOf(":");let f=a<0?c:c.slice(0,a),p=a<0?"":gu(at(c.slice(a+1)));this.headers.push({key:f.toLowerCase(),originalKey:f,value:p});let h=f.toLowerCase();if(xu.has(h)&&!r.has(h))switch(r.add(h),h){case"content-type":this.contentType.value=p;break;case"content-transfer-encoding":this.contentTransferEncoding.value=p;break;case"content-disposition":this.contentDisposition.value=p;break;case"content-id":this.contentId=p;break;case"content-description":this.contentDescription=p;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:ue.encode(n),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value);let s=this.contentDisposition.parsed.value,o=s.search(/[ \t]/);o>=0&&(this.contentDisposition.parsed.value=s.slice(0,o)),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,mu);let n=this.postalMime.limits.maxHeadersSize;if(this.postalMime.counters.headerSize>n)throw re("EMAXHEADERSIZE",`Maximum header size of ${n} bytes exceeded`);let s=Ht(e,pu);if(!de(e[0])&&!yu.test(s))return this.endHeaders(),!0;this.headerLines.push(s);break}case"body":this.contentDecoder&&this.contentDecoder.update(e,r);break}return!1}};var Mr={"&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;":`
7
+ `,"&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 bu=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 Au(t){return t.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof Mr[e]=="string")return Mr[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=bu.get(n)??n,n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}var Ys=t=>t.toString(16).toUpperCase().padStart(2,"0");function qe(t){return t.trim().replace(/[<>"'?&]/g,e=>"&#x"+Ys(e.charCodeAt(0))+";")}var wu=/[^A-Za-z0-9\-._~!$'()*+,;:@]+/g,Du=Array.from({length:256},(t,e)=>"%"+Ys(e));function Eu(t){return t.replace(wu,e=>Array.from(ue.encode(e),r=>Du[r]).join(""))}function Xs(t){return"<div>"+qe(t).replace(/\n/g,"<br />")+"</div>"}function Gs(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 Js(t,e){let r=t.lastIndexOf(">")+1;return e(t.slice(0,r))+t.slice(r)}function dt(t,e,r){return Js(t,n=>n.replace(e,r))}function Vs(t,e,r,n){let s=[],o=0,i=0;for(;;){e.lastIndex=i;let u=e.exec(t);if(!u)break;let a=u.index,l=t.indexOf(">",a);if(l<0)break;r.lastIndex=a;let c=r.exec(t);if(!c){i=l+1;continue}s.push(t.slice(o,a),n(...c)),o=i=a+c[0].length}return s.push(t.slice(o)),s.join("")}function jr(t,e,r,n,s,o){let i=Gs(t,/>/g),u=Gs(t,n),a=[],l=0,c=0;for(;;){e.lastIndex=c;let f=e.exec(t);if(!f)break;let p=f.index;c=p+1;let h=p+f[0].length;if(r){let x=i(h);if(!x)break;h=x.index+1}let g=u(h);if(!g)break;let m=g.index+g[0].length;if(s){let x=i(m);if(!x)break;m=x.index+1}a.push(t.slice(l,p),o),l=c=m}return a.push(t.slice(l)),a.join("")}function Hr(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 Ws(t,e){e.lastIndex=0;let r=e.exec(t);return r&&r.index<t.lastIndexOf(">")?t.slice(0,r.index):t}function Qs(t){return t=t.replace(/\r\n|[\n\r\u2028\u2029]/g,""),t=jr(t,/<!--/g,!1,/-->/g,!1," "),t=dt(t,/<br\b[^>]*>/gi,`
8
+ `),t=dt(t,/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
9
9
 
10
- `),t=Pr(t,/<script\b/gi,!0,/<\/script\b/gi,!0," "),t=Pr(t,/<style\b/gi,!0,/<\/style\b/gi,!0," "),t=$r(t,/<body\b/gi),t=$r(t,/<\/head\b/gi),t=$r(t,/<!doctype\b/gi),t=Ms(t,/<\/body\b/gi),t=Ms(t,/<\/html\b/gi),t=zs(t,e=>$s(e,/<a\b/gi,/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/iy,(r,n)=>` (${n}) `)),t=ct(t,/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,""),t=$s(t,/<li\b/gi,/<li\b[^>]*>[\n\u0001\s]*/iy,()=>"* "),t=ct(t,/<hr\b[^>]*>/g,`
10
+ `),t=jr(t,/<script\b/gi,!0,/<\/script\b/gi,!0," "),t=jr(t,/<style\b/gi,!0,/<\/style\b/gi,!0," "),t=Hr(t,/<body\b/gi),t=Hr(t,/<\/head\b/gi),t=Hr(t,/<!doctype\b/gi),t=Ws(t,/<\/body\b/gi),t=Ws(t,/<\/html\b/gi),t=Js(t,e=>Vs(e,/<a\b/gi,/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/iy,(r,n)=>` (${n}) `)),t=dt(t,/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,""),t=Vs(t,/<li\b/gi,/<li\b[^>]*>[\n\u0001\s]*/iy,()=>"* "),t=dt(t,/<hr\b[^>]*>/g,`
11
11
  -------------
12
- `),t=ct(t,/<[^>]*>/g," "),t=t.replace(/\u0001/g,`
12
+ `),t=dt(t,/<[^>]*>/g," "),t=t.replace(/\u0001/g,`
13
13
  `).replace(/[ \t]+/g," ").replace(/^\s+$/gm,"").replace(/\n\n+/g,`
14
14
 
15
15
  `).replace(/^\n+/,`
16
16
  `).replace(/\n+$/,`
17
- `),t=lu(t),t}var js=null;function Vs(t){if(typeof Intl>"u")return t;let e=new Date(t);return isNaN(e.getTime())?t:(js??=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),js.format(e))}function hu(t){return(t.name?[t.name,`<${t.address}>`]:[t.address]).join(" ")}function $t(t){let e=[],r=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(r),e.push(i)}else e.push(hu(n))};return t.forEach(r),e.join("")}function mu(t){return`<a href="mailto:${Re(pu(t.address))}" class="postal-email-address">${Re(t.name||`<${t.address}>`)}</a>`}function Mt(t){let e=[],r=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${Re(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(r),e.push(i)}else e.push(mu(n))};return t.forEach(r),e.join(" ")}function gu(t,e,r){t=(t||"").toString(),e=e||76;let n=0,s=t.length,o="",i,u;for(;n<s;){if(i=t.slice(n,n+e),i.length<e){o+=i;break}if(u=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=u[0],o+=i,n+=i.length;continue}else(u=i.match(/(\s+)[^\s]*$/))&&u[0].length-(r?(u[1]||"").length:0)<i.length?i=i.slice(0,i.length-(u[0].length-(r?(u[1]||"").length:0))):(u=t.slice(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+u[0].slice(0,u[0].length-(r?0:(u[1]||"").length)));o+=i,n+=i.length,n<s&&(o+=`\r
18
- `)}return o}function Ws(t){let e=[];t.from&&e.push({key:"From",val:$t([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:$t(t.to)}),t.cc&&t.cc.length&&e.push({key:"Cc",val:$t(t.cc)}),t.bcc&&t.bcc.length&&e.push({key:"Bcc",val:$t(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 gu(u.val,80,!0).split(/\r?\n/).map(d=>d.trim()).map((d,p)=>`${p?l:c}${d}`)}),s=n.map(u=>u.length).reduce((u,a)=>a>u?a:u,0),o="-".repeat(s);return`
17
+ `),t=Au(t),t}var Zs=null;function eo(t){if(typeof Intl>"u")return t;let e=new Date(t);return isNaN(e.getTime())?t:(Zs??=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),Zs.format(e))}function Bu(t){return(t.name?[t.name,`<${t.address}>`]:[t.address]).join(" ")}function Kt(t){let e=[],r=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(r),e.push(i)}else e.push(Bu(n))};return t.forEach(r),e.join("")}function Cu(t){return`<a href="mailto:${qe(Eu(t.address))}" class="postal-email-address">${qe(t.name||`<${t.address}>`)}</a>`}function zt(t){let e=[],r=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${qe(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(r),e.push(i)}else e.push(Cu(n))};return t.forEach(r),e.join(" ")}function vu(t,e,r){t=(t||"").toString(),e=e||76;let n=0,s=t.length,o="",i,u;for(;n<s;){if(i=t.slice(n,n+e),i.length<e){o+=i;break}if(u=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=u[0],o+=i,n+=i.length;continue}else(u=i.match(/(\s+)[^\s]*$/))&&u[0].length-(r?(u[1]||"").length:0)<i.length?i=i.slice(0,i.length-(u[0].length-(r?(u[1]||"").length:0))):(u=t.slice(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+u[0].slice(0,u[0].length-(r?0:(u[1]||"").length)));o+=i,n+=i.length,n<s&&(o+=`\r
18
+ `)}return o}function to(t){let e=[];t.from&&e.push({key:"From",val:Kt([t.from])}),t.subject&&e.push({key:"Subject",val:t.subject}),t.date&&e.push({key:"Date",val:eo(t.date)}),t.to&&t.to.length&&e.push({key:"To",val:Kt(t.to)}),t.cc&&t.cc.length&&e.push({key:"Cc",val:Kt(t.cc)}),t.bcc&&t.bcc.length&&e.push({key:"Bcc",val:Kt(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,l=`${u.key}: ${" ".repeat(a)}`,c=`${" ".repeat(u.key.length+1)} ${" ".repeat(a)}`;return vu(u.val,80,!0).split(/\r?\n/).map(p=>p.trim()).map((p,h)=>`${h?c:l}${p}`)}),s=n.map(u=>u.length).reduce((u,a)=>a>u?a:u,0),o="-".repeat(s);return`
19
19
  ${o}
20
20
  ${n.join(`
21
21
  `)}
22
22
  ${o}
23
- `}function Zs(t){let e=[];return t.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${Mt([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">${Re(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="${Re(t.date)}">${Re(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">${Mt(t.to)}</div>`),t.cc&&t.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Mt(t.cc)}</div>`),t.bcc&&t.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Mt(t.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
24
- <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}var Me=1,so=2,jt=4,Ys=8,Xs=16,Mr=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 o=new Int32Array(this.slots.length*2);o.set(this.slots),this.slots=o}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]&Me?this.str.charAt(this.slots[r+1]):""}isOperator(e){return(this.slots[e*3]&Me)!==0}noBreak(e){return(this.slots[e*3]&so)!==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])}},yu=/\s/,xu=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,bu=/^[^@\s]+@[^@\s]+$/,Au=/^[^@\s]+@\[[^[\]\\\s]*\]$/,wu=/^@(?:[^@\s"]+|\[[^[\]\\\s]*\])$/;function oo(t){return bu.test(t)||Au.test(t)}var Du=/^[^@\s]+@\S+$/,Js=/\s*\b[^@\s]+@[^\s]+\b\s*/y,Eu=/@(\[[^[\]\\]*\])$/;function io(t){let e=t.charAt(t.length-1)==="]"?Eu.exec(t):null;return e?t.length-e[1].length-1:t.lastIndexOf("@")}function Qs(t){let e=io(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 ne(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 eo(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95}function to(t,e){return eo(t.charCodeAt(e-1))!==eo(t.charCodeAt(e))}function ro(t,e,r){for(let n=e;n<r;n++)if(t.charCodeAt(n)===64)return n;return-1}var Bu=/^"(?:[^"\\]|\\[\s\S])*"/;function jr(t,e){if(e<0)return t;let r=e;for(;r>0&&ne(t.charCodeAt(r-1));)r--;let n=e+1;for(;n<t.length&&ne(t.charCodeAt(n));)n++;return r===e&&n===e+1?t:t.slice(0,r)+"@"+t.slice(n)}function uo(t){let e=Bu.exec(t);if(e){let n=e[0].length;for(;n<t.length&&ne(t.charCodeAt(n));)n++;if(t.charAt(n)==="@"&&t.indexOf("@",n+1)<0)return jr(t,n)}let r=t.indexOf("@");return r<0||t.indexOf("@",r+1)>=0||t.lastIndexOf('"')>r?t:jr(t,r)}function Cu(t){let e=t.length,r=0;for(;r<e;){for(;r<e&&ne(t.charCodeAt(r));)r++;if(r>=e)break;let n=r,s=r;for(;s<e&&!ne(t.charCodeAt(s));)s++;let o=ro(t,n,s);if(o>=0){let i=-1;for(let a=s;a>n;a--)if(to(t,a)){i=a;break}let u=n;for(;i>=0&&o>=0;){if(o>u&&s>o+1&&i>o+1){for(let a=u;a<o;a++)if(to(t,a)){if(a>n)return a;let c=n;for(;c>0&&ne(t.charCodeAt(c-1));)c--;return c}}u=o+1,o=ro(t,u,s)}}r=s}return-1}function vu(t,e){if(t=uo(t),!yu.test(t))return{address:t,text:e};let r,n=t.match(xu);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+/),o=s.findIndex(oo);if(o<0&&(o=s.findIndex(i=>Du.test(i))),o<0)return{address:t,text:e};t=s.splice(o,1)[0],r=s}return{address:t,text:[e,...r].filter(s=>s).join(" ")}}function Su(t){let e=[],r="",n="",s=0,o="",i="",u=!1,a="",c=!1,l=-1;for(let f=0,d=t.length;f<d;f++){let p=t.charAt(f);if(s){p==="\\"&&f<d-1?n+=t.charAt(++f):p==="("?(s++,n+=p):p===")"&&!--s?(e.push(n.trim()),n="",u=i!=="@"):n+=p;continue}if(u&&p!=="("&&(u=!1,p!=="@"&&p!=="<"&&!ne(t.charCodeAt(f))&&(r+=" ",i=" ")),o){if(p==="\\"&&o==='"'&&f<d-1){r+=p+t.charAt(++f),i=t.charAt(f);continue}p===o&&(o="")}else if(p==='"')o='"',c=!0;else if(p===":"&&l<0&&a==="@"&&!c)l=r.length+1;else if(p==="[")o="]";else if(p==="("){s=1;continue}else if(p==="<"){r="",i="",e.length=0,a="",c=!1,l=-1;continue}r+=p,i=p,!a&&!ne(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 ao(t,e,r){let n="text",s={address:[],comment:[],text:[],textWasQuoted:[],quotedLocalAt:[]},o=!1,i,u=!1,a={address:"",comment:"",text:""};for(i=e;i<r;i++){let l=t.value(i),f=i>e?t.operatorAt(i-1):"",d=i>e&&t.noBreak(i-1);if(t.isOperator(i))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==='"'&&d&&i>e+1&&t.operatorAt(i-2)==='"';if(d&&s[n].length&&(f!==")"||a[n]==="@"||l.charAt(0)==="@")){let m=s[n].length-1;n==="text"&&!u&&(o&&l.charAt(0)==="@"&&(s.quotedLocalAt[m]=s.text[m].length),o=!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),o=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 Tu(t,e,r){return Ae(ao(t,e,r).data.text.join(" "))}function ku(t,e,r){let n=ao(t,e,r),s=n.data,o=n.textFromComment,i,u=[],a=[];for(let g of s.address){let m=Su(g);for(let A of m.comments)u.push(A);m.address&&a.push(m.address)}if(s.address=a,!s.address.length&&s.text.length&&!o){let g=s.text.map(m=>uo(m));for(i=0;i<s.text.length;i++){let m=s.quotedLocalAt[i],A=s.textWasQuoted[i]&&m>=0&&wu.test(s.text[i].slice(m))?Qs(s.text[i]):"";if(A||!s.textWasQuoted[i]&&oo(g[i])){s.address=[A||g[i]],s.text.splice(i,1),s.textWasQuoted.splice(i,1),s.quotedLocalAt.splice(i,1);break}}if(!s.address.length){for(i=0;i<s.text.length;i++)if(!s.textWasQuoted[i]){let m=g[i],A=Cu(m);if(A>=0){Js.lastIndex=A;let D=Js.exec(m);if(D){s.address=[D[0].trim()],s.text[i]=(m.slice(0,A)+" "+m.slice(A+D[0].length)).trim();break}}s.text[i]=s.text[i].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&&qs(l.trim()))return{address:"",name:Ae(l)};c&&l.indexOf("@")>=0&&(f=Qs(jr(l,io(l))),l=""),{address:f,text:l}=vu(f,l),!l&&u.length&&(l=u.join(" "),o=!0);let d=l||f||"",p={address:f||(o?"":l)||"",name:Ae(d)};return(p.address===d||p.address===p.name)&&(p.address.match(/@/)?p.name="":p.address=""),p}var Hr=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 Mr(this.str),this.operators={'"':'"',"(":")","<":">",",":"",":":"",";":""}}tokenize(){let e=this.str,r=e.length;for(let i=0;i<r;i++)this.checkChar(e.charAt(i),i);this.closeText(r);let n=this.list,s=n.slots,o=0;for(let i=0,u=n.length;i<u;i++){let a=s[i*3],c=s[i*3+1],l=s[i*3+2];if(a&jt){let f=this.cleanValue(c,l,a).trim();if(!f)continue;n.cleaned.set(o,f)}else if(!(a&Me)){for(;c<l&&ne(e.charCodeAt(c));)c++;for(;l>c&&ne(e.charCodeAt(l-1));)l--;if(c===l)continue}s[o*3]=a,s[o*3+1]=c,s[o*3+2]=l,o++}return n.length=o,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,o=(n&Ys)!==0,i=(n&Xs)!==0,u="";for(let a=e;a<r;a++){let c=s.charAt(a);if(o&&!i&&c==="\\"){i=!0;continue}i=!1,c===`
25
- `?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",`
26
- `,",",";"].includes(s)?Me|so:Me,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(Me,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]|=jt);return}}this.node<0&&(this.node=this.list.push((this.operatorExpecting==='"'||this.operatorExpecting===")"?Ys:0)|(this.escaped?Xs:0),r,r)),e===`
27
- `&&(e=" ",this.list.slots[this.node*3]|=jt),e.charCodeAt(0)>=33||e===" "||e===" "?!this.operatorExpecting&&e!==" "&&e!==" "&&(this.afterAt=e==="@"):this.list.slots[this.node*3]|=jt,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):(ne(e.charCodeAt(0))||(this.afterAt=e==="@"),!1)}resetInner(){this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1}};function no(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 Fu(t){let e=new Hr(t).tokenize(),r=[],n=null,s=[],o=0;for(let i=0,u=e.length;i<=u;i++){let a=i<u?e.operatorAt(i):"";if(!(i<u&&a!==","&&a!==";"&&a!==":")){if(a===":"){n||(n={name:Tu(e,o,i),group:[]},s=[]),o=i+1;continue}i>o&&(n?s:r).push(ku(e,o,i)),o=i+1,n&&(a===";"||i===u)&&(n.group=no(s),r.push(n),n=null)}}return no(r)}function Ou(t,e){let r=Fu(t);if(e&&e.flatten){let n=[],s=o=>{o.forEach(i=>{if(i.group)return s(i.group);n.push(i)})};return s(r),n}return r}var Ht=Ou;function co(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(t),s=n.byteLength,o=s%3,i=s-o,u,a,c,l,f;for(let d=0;d<i;d=d+3)f=n[d]<<16|n[d+1]<<8|n[d+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 o===1?(f=n[i],u=(f&252)>>2,a=(f&3)<<4,e+=r[u]+r[a]+"=="):o===2&&(f=n[i]<<8|n[i+1],u=(f&64512)>>10,a=(f&1008)>>4,c=(f&15)<<2,e+=r[u]+r[a]+r[c]+"="),e}var Ru=/-?(?:\d{1,12}\.\d{1,3}|\d{1,15})/y,Lu=/"((?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\["\\])*)"/y,_u=/[A-Za-z*][!#$%&'*+\-.^_`|~0-9A-Za-z:/]*/y,Nu=/:[A-Za-z0-9+/=]*:/y,qu=/\?[01]/y,Iu=/@-?\d{1,15}/y,Uu=/%"((?:[\x20\x21\x23\x24\x26-\x7e]|%[0-9a-f]{2})*)"/y,Pu=/[a-z*][a-z0-9_\-.*]*/y,Kr=/ */y;function ae(t,e){e.lastIndex=t.pos;let r=e.exec(t.input);return r&&(t.pos=e.lastIndex),r}function lo(t){let e=ae(t,Lu);return e&&e[1].replace(/\\(["\\])/g,"$1")}function $u(t){let e=ae(t,Uu);if(!e)return!1;try{return decodeURIComponent(e[1]),!0}catch{return!1}}function Mu(t){let e=t.input.charAt(t.pos);switch(e){case'"':return lo(t)??!1;case":":return!!ae(t,Nu);case"?":return!!ae(t,qu);case"@":return!!ae(t,Iu);case"%":return $u(t)}return!!ae(t,e==="-"||e>="0"&&e<="9"?Ru:_u)}function ju(t){let e={input:t,pos:0};ae(e,Kr);let r=lo(e);if(r===null)return null;let n=new Map;for(;e.input[e.pos]===";";){e.pos++,ae(e,Kr);let s=ae(e,Pu);if(!s)return null;let o=!0;if(e.input[e.pos]==="="&&(e.pos++,o=Mu(e),o===!1))return null;n.set(s[0],o)}return ae(e,Kr),e.pos===e.input.length?{value:r,params:n}:null}function Hu(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 fo(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=ju(e.value),n=r?.params.get("origin");if(!(!r?.value||typeof n!="string"||!Hu(n)))return{code:r.value,origin:n}}function Ku(t){return!!t&&typeof t.getReader=="function"}function zu(t){return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}function Gu(t){let e=Object.prototype.toString.call(t);return e==="[object ArrayBuffer]"||e==="[object SharedArrayBuffer]"}var Vu=new Set(["arraybuffer","base64","utf8"]);function Wu(t){let e=String(t||"").replace(/[-_\s]/g,"").toLowerCase()||"arraybuffer";if(!Vu.has(e))throw re("EINVALIDOPTION",`Unknown attachment encoding ${e}`);return e}function Zu(t,e,r){return t.type==="subMessage"?e==="html"?Zs(t.value):Ws(t.value):r?e==="html"?Ks(t.value):Gs(t.value):t.value}var Yu=new Uint8Array([10]),Xu=256,Ju=2*1024*1024,Qu=1e4,ea=10,ta=1e4;function Kt(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 lt(t,e,r,n=0){if(t==null)return e;if(typeof t!="number"||!Number.isInteger(t)||t<n)throw re("EINVALIDOPTION",`${r} must be a ${n?"positive":"non-negative"} integer`);return t}function ra(t){return{maxNestingDepth:lt(t.maxNestingDepth,Xu,"maxNestingDepth"),maxHeadersSize:lt(t.maxHeadersSize,Ju,"maxHeadersSize"),maxPartCount:lt(t.maxPartCount,Qu,"maxPartCount",1),maxRfc822NestingDepth:lt(t.maxRfc822NestingDepth,ea,"maxRfc822NestingDepth"),maxForwardedAddresses:lt(t.maxForwardedAddresses,ta,"maxForwardedAddresses")}}var je=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:ra(this.options),this.counters=r?r.counters:{headerSize:0,partCount:0,forwardedAddresses:0},this.root=this.currentNode=new $e({postalMime:this}),this.boundaries=[],this.textContent={},this.textMap=new Map,this.textTypes=new Set,this.attachments=[],this.forceRfc822Attachments=!1,this.attachmentEncoding=Wu(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 o=0;o<s.length;o++){let i=s[o];if(e.length<i.value.length+2)continue;let u=!0;for(let f=0;f<i.value.length;f++)if(e[f+2]!==i.value[f]){u=!1;break}if(!u)continue;let a=i.value.length+2,c=!1;e.length>=i.value.length+4&&e[i.value.length+2]===45&&e[i.value.length+3]===45&&(c=!0,a=i.value.length+4);let l=!0;for(let f=a;f<e.length;f++)if(!de(e[f])){l=!1;break}if(l)return c?(await i.node.finalize(!0),this.currentNode=i.node.parentNode||this.root):(await i.node.finalizeChildNodes(!0),this.currentNode=new $e({postalMime:this,parentNode:i.node,parentMultipartType:i.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:Yu,done:this.readPos>=this.av.length}}addTextEntry(e,r,n){let s=this.textMap.get(e);s||(s={},this.textMap.set(e,s));let o=s[r]||[];s[r]=o,o.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),o=s&&this.rfc822NestingDepth>=this.limits.maxRfc822NestingDepth;if(s&&!o)await this.collectSubMessage(e);else if(this.isInlineTextNode(e)){let i=e.contentType.parsed.value==="text/html"?"html":"plain";this.addTextEntry(r||e,i,{type:"text",value:e.getTextContent()})}else e.content&&this.collectAttachment(e,e.content,n,o)}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+=Kt(n.from)+Kt(n.to)+Kt(n.cc)+Kt(n.bcc),this.counters.forwardedAddresses>this.limits.maxForwardedAddresses)throw re("EMAXFORWARDEDADDRESSES",`Maximum forwarded address count of ${this.limits.maxForwardedAddresses} addresses exceeded`);let s=r.textTypes.has("plain"),o=r.textTypes.has("html");(s||!o)&&this.addTextEntry(e,"plain",{type:"subMessage",value:n}),o&&this.addTextEntry(e,"html",{type:"subMessage",value:n}),r.textMap.forEach((i,u)=>{this.textMap.set(u,i)});for(let i of n.attachments)this.attachments.push(i)}collectAttachment(e,r,n,s){let o=e.contentDisposition.parsed.params.filename||e.contentType.parsed.params.name||null,i={filename:o?Ae(ot(o)):null,mimeType:e.contentType.parsed.value,disposition:e.contentDisposition.parsed.value||null};switch(n&&e.contentId&&!s&&(i.related=!0),s&&(i.rfc822DepthExceeded=!0),e.contentDescription&&(i.description=Ae(e.contentDescription)),e.contentId&&(i.contentId=e.contentId),e.contentType.parsed.value){case"text/calendar":case"application/ics":{e.contentType.parsed.params.method&&(i.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--;i.content=ue.encode(u.slice(0,a)+`
28
- `);break}default:i.content=r}this.attachments.push(i)}renderTextContent(){let e={};this.textMap.forEach(r=>{this.textTypes.forEach(n=>{let s=e[n]||[];e[n]=s;let o=r[n],i=o||r[n==="html"?"plain":"html"]||[];for(let u of i)s.push(Zu(u,n,!o))})}),Object.keys(e).forEach(r=>{this.textContent[r]=e[r].join(`
29
- `)})}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=re("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 o=new Uint8Array(r),i=0;for(let u of n)o.set(u,i),i+=u.length;return o}async resolveInput(e){let r=e;if(Ku(r)&&(r=await this.resolveStream(r)),r=r||new ArrayBuffer(0),typeof r=="string"&&(r=ue.encode(r)),zu(r)&&(r=await Pe(r)),ArrayBuffer.isView(r))return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(!Gu(r))throw re("EINVALIDINPUT","Unsupported email input type");return r}buildMessage(){let e=this.root.headers,r={headers:e.map(o=>({key:o.key,originalKey:o.originalKey,value:o.value}))};for(let o of["from","sender"]){let i=e.find(u=>u.key===o);if(i&&i.value){let u=Ht(i.value);u&&u.length&&(r[o]=u[0])}}for(let[o,i]of[["delivered-to","deliveredTo"],["return-path","returnPath"]]){let u=e.find(a=>a.key===o);if(u&&u.value){let a=Ht(u.value);a&&a.length&&a[0].address&&(r[i]=a[0].address)}}for(let[o,i]of[["to","to"],["cc","cc"],["bcc","bcc"],["reply-to","replyTo"]]){let u=[];for(let a of e)if(a.key===o&&a.value)for(let c of Ht(a.value))u.push(c);u.length&&(r[i]=u)}for(let[o,i]of[["subject","subject"],["message-id","messageId"],["in-reply-to","inReplyTo"],["references","references"]]){let u=e.find(a=>a.key===o);u&&u.value&&(r[i]=Ae(u.value))}let n=e.find(o=>o.key==="date");if(n){let o=new Date(n.value);r.date=o.toString()==="Invalid Date"?n.value:o.toISOString()}let s=fo(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=co(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 re("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 na=t=>{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4));return Uint8Array.from(e,r=>r.charCodeAt(0))},sa=t=>{let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},zr=t=>t.reduce((e,r)=>e<<8n|BigInt(r),0n);function oa(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 Gr=(t,e)=>sa(oa(t,e)),zt=t=>zr(na(t)),Gt=t=>Math.ceil(t.toString(16).length/2);function po(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 ho(t,e){let[r,n]=[t%e,e],[s,o]=[1n,0n];for(;n!==0n;){let i=r/n;[r,n]=[n,r-i*n],[s,o]=[o,s-i*o]}if(r!==1n)throw new Error("sem inverso");return(s%e+e)%e}async function mo(t,e){let r=Gt(e)+32,n=[];for(let i=0,u=0;u<r;i++){let a=new Uint8Array(t.length+4);a.set(t),new DataView(a.buffer).setUint32(t.length,i);let c=new Uint8Array(await crypto.subtle.digest("SHA-256",a));n.push(c),u+=c.length}let s=new Uint8Array(n.reduce((i,u)=>i+u.length,0)),o=0;for(let i of n)s.set(i,o),o+=i.length;return zr(s)%e}var ia=(t=Date.now())=>Math.floor(t/(168*3600*1e3));function go(t=ia()){let e=new Uint8Array(36);return new DataView(e.buffer).setUint32(0,t),e.set(crypto.getRandomValues(new Uint8Array(32)),4),e}async function yo(t,e){let r=Gt(t.n);for(;;){let n=zr(crypto.getRandomValues(new Uint8Array(r)))%t.n;if(!(n<2n)){try{ho(n,t.n)}catch{continue}return{blinded:await mo(e,t.n)*po(n,t.e,t.n)%t.n,r:n}}}}function xo(t,e,r){return e*ho(r,t.n)%t.n}async function bo(t,e,r){return r>0n&&r<t.n&&po(r,t.e,t.n)===await mo(e,t.n)}var Ao=t=>({n:zt(t.n),e:zt(t.e)});function wo(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 ua(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 aa(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 ca(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 Vr=t=>(t||"").match(/<[^<>\s]+>/)?.[0]??(t||"").trim().split(/\s+/)[0]??"";function la(t){let e=Vr(t.references)||Vr(t.inReplyTo)||Vr(t.messageId);return e?ca(e.toLowerCase()):""}function Do(t,e,r){let n=t.date&&!Number.isNaN(Date.parse(t.date))?new Date(t.date):r;return{from:wo(t.from)[0]??null,to:wo(t.to).slice(0,5),subject:(t.subject||"").trim().slice(0,200),date:n.toISOString(),snippet:ua(t.text,t.html),attachments:t.attachments.filter(s=>s.disposition!=="inline"||!s.contentId).length,t:la(t)||void 0,auth:e?"pass":aa(t.headers),e2e:e}}async function Eo(t,e){let r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}async function Bo(t){let e=await Eo(t,new CompressionStream("gzip"));return e.length<t.length?e:t}var fa=t=>t.length>2&&t[0]===31&&t[1]===139;async function Co(t){return fa(t)?Eo(t,new DecompressionStream("gzip")):t}var Wr=3,da=new TextEncoder,vo=new TextDecoder;function pa(t,e){let r=Z(t.c);if(!gs.verify(Z(t.s),r,e))throw new Error("certificado do remetente com assinatura inv\xE1lida");let n=JSON.parse(vo.decode(r));if(typeof n.a!="string"||typeof n.k!="string"||typeof n.e!="number")throw new Error("certificado do remetente malformado");return n}async function Zr(t,e,r,n,s){let o=await As(t,da.encode(JSON.stringify(r)),"cert"),i=await Es(t,e,n,s);return ee(new Uint8Array([Wr,o.length>>8,o.length&255]),o,i)}var Yr=t=>t[0]===Wr;async function Xr(t,e,r,n,s){if(e.length<4||e[0]!==Wr)throw new Error("n\xE3o \xE9 uma mensagem com remetente lacrado");let o=e[1]<<8|e[2],i=e.subarray(3,3+o),u=e.subarray(3+o),a=JSON.parse(vo.decode(await ke(t,i,"cert"))),c=pa(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 Bs(t,Z(c.k),u,r),sender:{address:c.a.toLowerCase(),publicKey:c.k}}}var Zt=new TextEncoder,Fo=t=>/^[\x20-\x7e]*$/.test(t);function Jr(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function Qr(t){if(Fo(t))return t;let e=[],r="";for(let n of t)Zt.encode(r+n).length>45&&(e.push(r),r=""),r+=n;return r&&e.push(r),e.map(n=>`=?UTF-8?B?${Jr(Zt.encode(n))}?=`).join(`\r
30
- `)}function Vt(t){return t.name?`${Fo(t.name)?`"${t.name.replace(/["\\]/g,"\\$&")}"`:Qr(t.name)} <${t.address}>`:t.address}var Wt=t=>t.replace(/[\r\n]+/g," ");function So(t,e){let r=Jr(Zt.encode(e)).replace(/.{1,76}/g,`$&\r
23
+ `}function ro(t){let e=[];return t.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${zt([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">${qe(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="${qe(t.date)}">${qe(eo(t.date))}</div>`),t.to&&t.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${zt(t.to)}</div>`),t.cc&&t.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${zt(t.cc)}</div>`),t.bcc&&t.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${zt(t.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
24
+ <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}var Ge=1,fo=2,Gt=4,no=8,so=16,Kr=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 o=new Int32Array(this.slots.length*2);o.set(this.slots),this.slots=o}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]&Ge?this.str.charAt(this.slots[r+1]):""}isOperator(e){return(this.slots[e*3]&Ge)!==0}noBreak(e){return(this.slots[e*3]&fo)!==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])}},Su=/\s/,Tu=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,ku=/^[^@\s]+@[^@\s]+$/,Fu=/^[^@\s]+@\[[^[\]\\\s]*\]$/,Ou=/^@(?:[^@\s"]+|\[[^[\]\\\s]*\])$/;function po(t){return ku.test(t)||Fu.test(t)}var Ru=/^[^@\s]+@\S+$/,oo=/\s*\b[^@\s]+@[^\s]+\b\s*/y,Lu=/@(\[[^[\]\\]*\])$/;function ho(t){let e=t.charAt(t.length-1)==="]"?Lu.exec(t):null;return e?t.length-e[1].length-1:t.lastIndexOf("@")}function io(t){let e=ho(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 ne(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 uo(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95}function ao(t,e){return uo(t.charCodeAt(e-1))!==uo(t.charCodeAt(e))}function co(t,e,r){for(let n=e;n<r;n++)if(t.charCodeAt(n)===64)return n;return-1}var _u=/^"(?:[^"\\]|\\[\s\S])*"/;function zr(t,e){if(e<0)return t;let r=e;for(;r>0&&ne(t.charCodeAt(r-1));)r--;let n=e+1;for(;n<t.length&&ne(t.charCodeAt(n));)n++;return r===e&&n===e+1?t:t.slice(0,r)+"@"+t.slice(n)}function mo(t){let e=_u.exec(t);if(e){let n=e[0].length;for(;n<t.length&&ne(t.charCodeAt(n));)n++;if(t.charAt(n)==="@"&&t.indexOf("@",n+1)<0)return zr(t,n)}let r=t.indexOf("@");return r<0||t.indexOf("@",r+1)>=0||t.lastIndexOf('"')>r?t:zr(t,r)}function Nu(t){let e=t.length,r=0;for(;r<e;){for(;r<e&&ne(t.charCodeAt(r));)r++;if(r>=e)break;let n=r,s=r;for(;s<e&&!ne(t.charCodeAt(s));)s++;let o=co(t,n,s);if(o>=0){let i=-1;for(let a=s;a>n;a--)if(ao(t,a)){i=a;break}let u=n;for(;i>=0&&o>=0;){if(o>u&&s>o+1&&i>o+1){for(let a=u;a<o;a++)if(ao(t,a)){if(a>n)return a;let l=n;for(;l>0&&ne(t.charCodeAt(l-1));)l--;return l}}u=o+1,o=co(t,u,s)}}r=s}return-1}function qu(t,e){if(t=mo(t),!Su.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+/),o=s.findIndex(po);if(o<0&&(o=s.findIndex(i=>Ru.test(i))),o<0)return{address:t,text:e};t=s.splice(o,1)[0],r=s}return{address:t,text:[e,...r].filter(s=>s).join(" ")}}function Iu(t){let e=[],r="",n="",s=0,o="",i="",u=!1,a="",l=!1,c=-1;for(let f=0,p=t.length;f<p;f++){let h=t.charAt(f);if(s){h==="\\"&&f<p-1?n+=t.charAt(++f):h==="("?(s++,n+=h):h===")"&&!--s?(e.push(n.trim()),n="",u=i!=="@"):n+=h;continue}if(u&&h!=="("&&(u=!1,h!=="@"&&h!=="<"&&!ne(t.charCodeAt(f))&&(r+=" ",i=" ")),o){if(h==="\\"&&o==='"'&&f<p-1){r+=h+t.charAt(++f),i=t.charAt(f);continue}h===o&&(o="")}else if(h==='"')o='"',l=!0;else if(h===":"&&c<0&&a==="@"&&!l)c=r.length+1;else if(h==="[")o="]";else if(h==="("){s=1;continue}else if(h==="<"){r="",i="",e.length=0,a="",l=!1,c=-1;continue}r+=h,i=h,!a&&!ne(t.charCodeAt(f))&&(a=h)}return c>=0&&r.indexOf("@",c)>=0&&(r=r.slice(c)),s&&e.push(n.trim()),{address:r.trim(),comments:e.filter(f=>f)}}function go(t,e,r){let n="text",s={address:[],comment:[],text:[],textWasQuoted:[],quotedLocalAt:[]},o=!1,i,u=!1,a={address:"",comment:"",text:""};for(i=e;i<r;i++){let c=t.value(i),f=i>e?t.operatorAt(i-1):"",p=i>e&&t.noBreak(i-1);if(t.isOperator(i))switch(c){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 h=f==='"'&&p&&i>e+1&&t.operatorAt(i-2)==='"';if(p&&s[n].length&&(f!==")"||a[n]==="@"||c.charAt(0)==="@")){let m=s[n].length-1;n==="text"&&!u&&(o&&c.charAt(0)==="@"&&(s.quotedLocalAt[m]=s.text[m].length),o=!1),s[n][m]+=c,n==="text"&&u&&(s.textWasQuoted[m]=!0)}else s[n].push(c),n==="text"&&(s.textWasQuoted.push(u||h),s.quotedLocalAt.push(h&&c.charAt(0)==="@"?0:-1),o=u);a[n]=c.charAt(c.length-1)}}let l=!1;return!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[],l=!0),{data:s,textFromComment:l}}function Uu(t,e,r){return De(go(t,e,r).data.text.join(" "))}function Pu(t,e,r){let n=go(t,e,r),s=n.data,o=n.textFromComment,i,u=[],a=[];for(let g of s.address){let m=Iu(g);for(let x of m.comments)u.push(x);m.address&&a.push(m.address)}if(s.address=a,!s.address.length&&s.text.length&&!o){let g=s.text.map(m=>mo(m));for(i=0;i<s.text.length;i++){let m=s.quotedLocalAt[i],x=s.textWasQuoted[i]&&m>=0&&Ou.test(s.text[i].slice(m))?io(s.text[i]):"";if(x||!s.textWasQuoted[i]&&po(g[i])){s.address=[x||g[i]],s.text.splice(i,1),s.textWasQuoted.splice(i,1),s.quotedLocalAt.splice(i,1);break}}if(!s.address.length){for(i=0;i<s.text.length;i++)if(!s.textWasQuoted[i]){let m=g[i],x=Nu(m);if(x>=0){oo.lastIndex=x;let v=oo.exec(m);if(v){s.address=[v[0].trim()],s.text[i]=(m.slice(0,x)+" "+m.slice(x+v[0].length)).trim();break}}s.text[i]=s.text[i].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 l=!s.address.length&&s.textWasQuoted.some(g=>g),c=s.text.join(" "),f=s.address.join(" ");if(!f&&Hs(c.trim()))return{address:"",name:De(c)};l&&c.indexOf("@")>=0&&(f=io(zr(c,ho(c))),c=""),{address:f,text:c}=qu(f,c),!c&&u.length&&(c=u.join(" "),o=!0);let p=c||f||"",h={address:f||(o?"":c)||"",name:De(p)};return(h.address===p||h.address===h.name)&&(h.address.match(/@/)?h.name="":h.address=""),h}var Gr=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 Kr(this.str),this.operators={'"':'"',"(":")","<":">",",":"",":":"",";":""}}tokenize(){let e=this.str,r=e.length;for(let i=0;i<r;i++)this.checkChar(e.charAt(i),i);this.closeText(r);let n=this.list,s=n.slots,o=0;for(let i=0,u=n.length;i<u;i++){let a=s[i*3],l=s[i*3+1],c=s[i*3+2];if(a&Gt){let f=this.cleanValue(l,c,a).trim();if(!f)continue;n.cleaned.set(o,f)}else if(!(a&Ge)){for(;l<c&&ne(e.charCodeAt(l));)l++;for(;c>l&&ne(e.charCodeAt(c-1));)c--;if(l===c)continue}s[o*3]=a,s[o*3+1]=l,s[o*3+2]=c,o++}return n.length=o,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,o=(n&no)!==0,i=(n&so)!==0,u="";for(let a=e;a<r;a++){let l=s.charAt(a);if(o&&!i&&l==="\\"){i=!0;continue}i=!1,l===`
25
+ `?u+=" ":(l.charCodeAt(0)>=33||l===" "||l===" ")&&(u+=l)}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",`
26
+ `,",",";"].includes(s)?Ge|fo:Ge,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(Ge,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]|=Gt);return}}this.node<0&&(this.node=this.list.push((this.operatorExpecting==='"'||this.operatorExpecting===")"?no:0)|(this.escaped?so:0),r,r)),e===`
27
+ `&&(e=" ",this.list.slots[this.node*3]|=Gt),e.charCodeAt(0)>=33||e===" "||e===" "?!this.operatorExpecting&&e!==" "&&e!==" "&&(this.afterAt=e==="@"):this.list.slots[this.node*3]|=Gt,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):(ne(e.charCodeAt(0))||(this.afterAt=e==="@"),!1)}resetInner(){this.innerQuoted=!1,this.innerComment=0,this.innerLiteral=!1,this.innerEscaped=!1}};function lo(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 $u(t){let e=new Gr(t).tokenize(),r=[],n=null,s=[],o=0;for(let i=0,u=e.length;i<=u;i++){let a=i<u?e.operatorAt(i):"";if(!(i<u&&a!==","&&a!==";"&&a!==":")){if(a===":"){n||(n={name:Uu(e,o,i),group:[]},s=[]),o=i+1;continue}i>o&&(n?s:r).push(Pu(e,o,i)),o=i+1,n&&(a===";"||i===u)&&(n.group=lo(s),r.push(n),n=null)}}return lo(r)}function Mu(t,e){let r=$u(t);if(e&&e.flatten){let n=[],s=o=>{o.forEach(i=>{if(i.group)return s(i.group);n.push(i)})};return s(r),n}return r}var Vt=Mu;function yo(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(t),s=n.byteLength,o=s%3,i=s-o,u,a,l,c,f;for(let p=0;p<i;p=p+3)f=n[p]<<16|n[p+1]<<8|n[p+2],u=(f&16515072)>>18,a=(f&258048)>>12,l=(f&4032)>>6,c=f&63,e+=r[u]+r[a]+r[l]+r[c];return o===1?(f=n[i],u=(f&252)>>2,a=(f&3)<<4,e+=r[u]+r[a]+"=="):o===2&&(f=n[i]<<8|n[i+1],u=(f&64512)>>10,a=(f&1008)>>4,l=(f&15)<<2,e+=r[u]+r[a]+r[l]+"="),e}var ju=/-?(?:\d{1,12}\.\d{1,3}|\d{1,15})/y,Hu=/"((?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\["\\])*)"/y,Ku=/[A-Za-z*][!#$%&'*+\-.^_`|~0-9A-Za-z:/]*/y,zu=/:[A-Za-z0-9+/=]*:/y,Gu=/\?[01]/y,Vu=/@-?\d{1,15}/y,Wu=/%"((?:[\x20\x21\x23\x24\x26-\x7e]|%[0-9a-f]{2})*)"/y,Zu=/[a-z*][a-z0-9_\-.*]*/y,Vr=/ */y;function ae(t,e){e.lastIndex=t.pos;let r=e.exec(t.input);return r&&(t.pos=e.lastIndex),r}function xo(t){let e=ae(t,Hu);return e&&e[1].replace(/\\(["\\])/g,"$1")}function Yu(t){let e=ae(t,Wu);if(!e)return!1;try{return decodeURIComponent(e[1]),!0}catch{return!1}}function Xu(t){let e=t.input.charAt(t.pos);switch(e){case'"':return xo(t)??!1;case":":return!!ae(t,zu);case"?":return!!ae(t,Gu);case"@":return!!ae(t,Vu);case"%":return Yu(t)}return!!ae(t,e==="-"||e>="0"&&e<="9"?ju:Ku)}function Ju(t){let e={input:t,pos:0};ae(e,Vr);let r=xo(e);if(r===null)return null;let n=new Map;for(;e.input[e.pos]===";";){e.pos++,ae(e,Vr);let s=ae(e,Zu);if(!s)return null;let o=!0;if(e.input[e.pos]==="="&&(e.pos++,o=Xu(e),o===!1))return null;n.set(s[0],o)}return ae(e,Vr),e.pos===e.input.length?{value:r,params:n}:null}function Qu(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 bo(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=Ju(e.value),n=r?.params.get("origin");if(!(!r?.value||typeof n!="string"||!Qu(n)))return{code:r.value,origin:n}}function ea(t){return!!t&&typeof t.getReader=="function"}function ta(t){return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}function ra(t){let e=Object.prototype.toString.call(t);return e==="[object ArrayBuffer]"||e==="[object SharedArrayBuffer]"}var na=new Set(["arraybuffer","base64","utf8"]);function sa(t){let e=String(t||"").replace(/[-_\s]/g,"").toLowerCase()||"arraybuffer";if(!na.has(e))throw re("EINVALIDOPTION",`Unknown attachment encoding ${e}`);return e}function oa(t,e,r){return t.type==="subMessage"?e==="html"?ro(t.value):to(t.value):r?e==="html"?Xs(t.value):Qs(t.value):t.value}var ia=new Uint8Array([10]),ua=256,aa=2*1024*1024,ca=1e4,la=10,fa=1e4;function Wt(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 pt(t,e,r,n=0){if(t==null)return e;if(typeof t!="number"||!Number.isInteger(t)||t<n)throw re("EINVALIDOPTION",`${r} must be a ${n?"positive":"non-negative"} integer`);return t}function da(t){return{maxNestingDepth:pt(t.maxNestingDepth,ua,"maxNestingDepth"),maxHeadersSize:pt(t.maxHeadersSize,aa,"maxHeadersSize"),maxPartCount:pt(t.maxPartCount,ca,"maxPartCount",1),maxRfc822NestingDepth:pt(t.maxRfc822NestingDepth,la,"maxRfc822NestingDepth"),maxForwardedAddresses:pt(t.maxForwardedAddresses,fa,"maxForwardedAddresses")}}var Ve=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:da(this.options),this.counters=r?r.counters:{headerSize:0,partCount:0,forwardedAddresses:0},this.root=this.currentNode=new ze({postalMime:this}),this.boundaries=[],this.textContent={},this.textMap=new Map,this.textTypes=new Set,this.attachments=[],this.forceRfc822Attachments=!1,this.attachmentEncoding=sa(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 o=0;o<s.length;o++){let i=s[o];if(e.length<i.value.length+2)continue;let u=!0;for(let f=0;f<i.value.length;f++)if(e[f+2]!==i.value[f]){u=!1;break}if(!u)continue;let a=i.value.length+2,l=!1;e.length>=i.value.length+4&&e[i.value.length+2]===45&&e[i.value.length+3]===45&&(l=!0,a=i.value.length+4);let c=!0;for(let f=a;f<e.length;f++)if(!de(e[f])){c=!1;break}if(c)return l?(await i.node.finalize(!0),this.currentNode=i.node.parentNode||this.root):(await i.node.finalizeChildNodes(!0),this.currentNode=new ze({postalMime:this,parentNode:i.node,parentMultipartType:i.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:ia,done:this.readPos>=this.av.length}}addTextEntry(e,r,n){let s=this.textMap.get(e);s||(s={},this.textMap.set(e,s));let o=s[r]||[];s[r]=o,o.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),o=s&&this.rfc822NestingDepth>=this.limits.maxRfc822NestingDepth;if(s&&!o)await this.collectSubMessage(e);else if(this.isInlineTextNode(e)){let i=e.contentType.parsed.value==="text/html"?"html":"plain";this.addTextEntry(r||e,i,{type:"text",value:e.getTextContent()})}else e.content&&this.collectAttachment(e,e.content,n,o)}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+=Wt(n.from)+Wt(n.to)+Wt(n.cc)+Wt(n.bcc),this.counters.forwardedAddresses>this.limits.maxForwardedAddresses)throw re("EMAXFORWARDEDADDRESSES",`Maximum forwarded address count of ${this.limits.maxForwardedAddresses} addresses exceeded`);let s=r.textTypes.has("plain"),o=r.textTypes.has("html");(s||!o)&&this.addTextEntry(e,"plain",{type:"subMessage",value:n}),o&&this.addTextEntry(e,"html",{type:"subMessage",value:n}),r.textMap.forEach((i,u)=>{this.textMap.set(u,i)});for(let i of n.attachments)this.attachments.push(i)}collectAttachment(e,r,n,s){let o=e.contentDisposition.parsed.params.filename||e.contentType.parsed.params.name||null,i={filename:o?De(at(o)):null,mimeType:e.contentType.parsed.value,disposition:e.contentDisposition.parsed.value||null};switch(n&&e.contentId&&!s&&(i.related=!0),s&&(i.rfc822DepthExceeded=!0),e.contentDescription&&(i.description=De(e.contentDescription)),e.contentId&&(i.contentId=e.contentId),e.contentType.parsed.value){case"text/calendar":case"application/ics":{e.contentType.parsed.params.method&&(i.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--;i.content=ue.encode(u.slice(0,a)+`
28
+ `);break}default:i.content=r}this.attachments.push(i)}renderTextContent(){let e={};this.textMap.forEach(r=>{this.textTypes.forEach(n=>{let s=e[n]||[];e[n]=s;let o=r[n],i=o||r[n==="html"?"plain":"html"]||[];for(let u of i)s.push(oa(u,n,!o))})}),Object.keys(e).forEach(r=>{this.textContent[r]=e[r].join(`
29
+ `)})}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 l=re("EINVALIDINPUT","Stream chunks must be Uint8Array values");throw s.cancel(l).catch(()=>{}),l}n.push(new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),r+=a.byteLength}let o=new Uint8Array(r),i=0;for(let u of n)o.set(u,i),i+=u.length;return o}async resolveInput(e){let r=e;if(ea(r)&&(r=await this.resolveStream(r)),r=r||new ArrayBuffer(0),typeof r=="string"&&(r=ue.encode(r)),ta(r)&&(r=await Ke(r)),ArrayBuffer.isView(r))return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(!ra(r))throw re("EINVALIDINPUT","Unsupported email input type");return r}buildMessage(){let e=this.root.headers,r={headers:e.map(o=>({key:o.key,originalKey:o.originalKey,value:o.value}))};for(let o of["from","sender"]){let i=e.find(u=>u.key===o);if(i&&i.value){let u=Vt(i.value);u&&u.length&&(r[o]=u[0])}}for(let[o,i]of[["delivered-to","deliveredTo"],["return-path","returnPath"]]){let u=e.find(a=>a.key===o);if(u&&u.value){let a=Vt(u.value);a&&a.length&&a[0].address&&(r[i]=a[0].address)}}for(let[o,i]of[["to","to"],["cc","cc"],["bcc","bcc"],["reply-to","replyTo"]]){let u=[];for(let a of e)if(a.key===o&&a.value)for(let l of Vt(a.value))u.push(l);u.length&&(r[i]=u)}for(let[o,i]of[["subject","subject"],["message-id","messageId"],["in-reply-to","inReplyTo"],["references","references"]]){let u=e.find(a=>a.key===o);u&&u.value&&(r[i]=De(u.value))}let n=e.find(o=>o.key==="date");if(n){let o=new Date(n.value);r.date=o.toString()==="Invalid Date"?n.value:o.toISOString()}let s=bo(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=yo(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 re("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 pa=t=>{let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4));return Uint8Array.from(e,r=>r.charCodeAt(0))},ha=t=>{let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},Wr=t=>t.reduce((e,r)=>e<<8n|BigInt(r),0n);function ma(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 Zr=(t,e)=>ha(ma(t,e)),Zt=t=>Wr(pa(t)),Yt=t=>Math.ceil(t.toString(16).length/2);function Ao(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 wo(t,e){let[r,n]=[t%e,e],[s,o]=[1n,0n];for(;n!==0n;){let i=r/n;[r,n]=[n,r-i*n],[s,o]=[o,s-i*o]}if(r!==1n)throw new Error("sem inverso");return(s%e+e)%e}async function Do(t,e){let r=Yt(e)+32,n=[];for(let i=0,u=0;u<r;i++){let a=new Uint8Array(t.length+4);a.set(t),new DataView(a.buffer).setUint32(t.length,i);let l=new Uint8Array(await crypto.subtle.digest("SHA-256",a));n.push(l),u+=l.length}let s=new Uint8Array(n.reduce((i,u)=>i+u.length,0)),o=0;for(let i of n)s.set(i,o),o+=i.length;return Wr(s)%e}var ga=(t=Date.now())=>Math.floor(t/(168*3600*1e3));function Eo(t=ga()){let e=new Uint8Array(36);return new DataView(e.buffer).setUint32(0,t),e.set(crypto.getRandomValues(new Uint8Array(32)),4),e}async function Bo(t,e){let r=Yt(t.n);for(;;){let n=Wr(crypto.getRandomValues(new Uint8Array(r)))%t.n;if(!(n<2n)){try{wo(n,t.n)}catch{continue}return{blinded:await Do(e,t.n)*Ao(n,t.e,t.n)%t.n,r:n}}}}function Co(t,e,r){return e*wo(r,t.n)%t.n}async function vo(t,e,r){return r>0n&&r<t.n&&Ao(r,t.e,t.n)===await Do(e,t.n)}var So=t=>({n:Zt(t.n),e:Zt(t.e)});function To(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 ya(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 xa(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 ba(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 Yr=t=>(t||"").match(/<[^<>\s]+>/)?.[0]??(t||"").trim().split(/\s+/)[0]??"";function Aa(t){let e=Yr(t.references)||Yr(t.inReplyTo)||Yr(t.messageId);return e?ba(e.toLowerCase()):""}function ko(t,e,r){let n=t.date&&!Number.isNaN(Date.parse(t.date))?new Date(t.date):r;return{from:To(t.from)[0]??null,to:To(t.to).slice(0,5),subject:(t.subject||"").trim().slice(0,200),date:n.toISOString(),snippet:ya(t.text,t.html),attachments:t.attachments.filter(s=>s.disposition!=="inline"||!s.contentId).length,t:Aa(t)||void 0,auth:e?"pass":xa(t.headers),e2e:e}}async function Xr(t,e){let r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}var Ee=[0,83,72,1],Fo=t=>Math.max(256,2**(Math.ceil(Math.log2(t))-4));async function Oo(t){let e=await Xr(t,new CompressionStream("gzip")),r=Ee.length+4+e.length,n=new Uint8Array(Math.ceil(r/Fo(r))*Fo(r));return n.set(Ee),new DataView(n.buffer).setUint32(Ee.length,e.length),n.set(e,Ee.length+4),n}var wa=t=>t.length>2&&t[0]===31&&t[1]===139,Da=t=>t.length>=8&&Ee.every((e,r)=>t[r]===e);async function Ro(t){if(Da(t)){let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(Ee.length);return Xr(t.subarray(Ee.length+4,Ee.length+4+e),new DecompressionStream("gzip"))}return wa(t)?Xr(t,new DecompressionStream("gzip")):t}async function Jr(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 Qr=3,Ea=new TextEncoder,Lo=new TextDecoder;function Ba(t,e){let r=V(t.c);if(!Es.verify(V(t.s),r,e))throw new Error("certificado do remetente com assinatura inv\xE1lida");let n=JSON.parse(Lo.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 en(t,e,r,n,s){let o=await Ss(t,Ea.encode(JSON.stringify(r)),"cert"),i=await Fs(t,e,n,s);return ee(new Uint8Array([Qr,o.length>>8,o.length&255]),o,i)}var tn=t=>t[0]===Qr;async function rn(t,e,r,n,s){if(e.length<4||e[0]!==Qr)throw new Error("n\xE3o \xE9 uma mensagem com remetente lacrado");let o=e[1]<<8|e[2],i=e.subarray(3,3+o),u=e.subarray(3+o),a=JSON.parse(Lo.decode(await we(t,i,"cert"))),l=Ba(a,n);if(s>l.e+300*1e3||s<l.i-300*1e3)throw new Error("certificado do remetente fora da validade");return{payload:await Os(t,V(l.k),u,r),sender:{address:l.a.toLowerCase(),publicKey:l.k}}}var Qt=new TextEncoder,Io=t=>/^[\x20-\x7e]*$/.test(t);function nn(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}function sn(t){if(Io(t))return t;let e=[],r="";for(let n of t)Qt.encode(r+n).length>45&&(e.push(r),r=""),r+=n;return r&&e.push(r),e.map(n=>`=?UTF-8?B?${nn(Qt.encode(n))}?=`).join(`\r
30
+ `)}function Xt(t){return t.name?`${Io(t.name)?`"${t.name.replace(/["\\]/g,"\\$&")}"`:sn(t.name)} <${t.address}>`:t.address}var Jt=t=>t.replace(/[\r\n]+/g," ");function _o(t,e){let r=nn(Qt.encode(e)).replace(/.{1,76}/g,`$&\r
31
31
  `);return`Content-Type: ${t}; charset=utf-8\r
32
32
  Content-Transfer-Encoding: base64\r
33
33
  \r
34
- ${r}`}function To(t){let e=Qr(Wt(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
+ ${r}`}function No(t){let e=sn(Jt(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
35
35
  `)}\r
36
36
  \r
37
- ${Jr(t.content).replace(/.{1,76}/g,`$&\r
38
- `)}`}function ha(t){let e=`alt-${crypto.randomUUID()}`,r={type:`multipart/alternative; boundary="${e}"`,content:`--${e}\r
39
- ${So("text/plain",t.text)}--${e}\r
40
- ${So("text/html",t.html)}--${e}--\r
37
+ ${nn(t.content).replace(/.{1,76}/g,`$&\r
38
+ `)}`}function Ca(t){let e=`alt-${crypto.randomUUID()}`,r={type:`multipart/alternative; boundary="${e}"`,content:`--${e}\r
39
+ ${_o("text/plain",t.text)}--${e}\r
40
+ ${_o("text/html",t.html)}--${e}--\r
41
41
  `},n=(t.attachments??[]).filter(o=>o.cid),s=(t.attachments??[]).filter(o=>!o.cid);if(n.length){let o=`rel-${crypto.randomUUID()}`;r={type:`multipart/related; boundary="${o}"`,content:`--${o}\r
42
42
  Content-Type: ${r.type}\r
43
43
  \r
44
44
  ${r.content}${n.map(i=>`--${o}\r
45
- ${To(i)}`).join("")}--${o}--\r
45
+ ${No(i)}`).join("")}--${o}--\r
46
46
  `}}if(s.length){let o=`mix-${crypto.randomUUID()}`;r={type:`multipart/mixed; boundary="${o}"`,content:`--${o}\r
47
47
  Content-Type: ${r.type}\r
48
48
  \r
49
49
  ${r.content}${s.map(i=>`--${o}\r
50
- ${To(i)}`).join("")}--${o}--\r
51
- `}}return r}function en(t,e){let r=[`From: ${Vt(t.from)}`,t.to.length?`To: ${t.to.map(Vt).join(", ")}`:"",t.cc.length?`Cc: ${t.cc.map(Vt).join(", ")}`:"",e&&t.bcc.length?`Bcc: ${t.bcc.map(Vt).join(", ")}`:"",`Subject: ${Qr(Wt(t.subject))}`,`Date: ${t.date.toUTCString().replace("GMT","+0000")}`,`Message-ID: ${t.messageId}`,t.inReplyTo?`In-Reply-To: ${Wt(t.inReplyTo)}`:"",t.references?`References: ${Wt(t.references)}`:"","MIME-Version: 1.0"].filter(Boolean),n=ha(t);return Zt.encode(`${r.join(`\r
50
+ ${No(i)}`).join("")}--${o}--\r
51
+ `}}return r}function on(t,e){let r=[`From: ${Xt(t.from)}`,t.to.length?`To: ${t.to.map(Xt).join(", ")}`:"",t.cc.length?`Cc: ${t.cc.map(Xt).join(", ")}`:"",e&&t.bcc.length?`Bcc: ${t.bcc.map(Xt).join(", ")}`:"",`Subject: ${sn(Jt(t.subject))}`,`Date: ${t.date.toUTCString().replace("GMT","+0000")}`,`Message-ID: ${t.messageId}`,t.inReplyTo?`In-Reply-To: ${Jt(t.inReplyTo)}`:"",t.references?`References: ${Jt(t.references)}`:"","MIME-Version: 1.0"].filter(Boolean),n=Ca(t);return Qt.encode(`${r.join(`\r
52
52
  `)}\r
53
53
  Content-Type: ${n.type}\r
54
54
  \r
55
- ${n.content}`)}function Oo(t){return`<${crypto.randomUUID()}@${t}>`}var ko=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Ro(t,e){let r=ko(t).replace(/https?:\/\/[^\s<]+/g,s=>`<a href="${s}">${s}</a>`).replace(/\n/g,"<br>"),n=e?`<br><div>${ko(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 we="shalomail.com",Y=class extends Error{constructor(r,n,s){super(s);this.status=r;this.code=n}status;code},ma={bad_key:"Invalid or revoked API key. Run `shalom login` to connect this terminal again.",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 $(t,e,r,n,s={}){let o={"x-shalom":"1","user-agent":"shalom-cli"};s.anonymous||(o.authorization=`Bearer ${t.key}`),n!==void 0&&(o["content-type"]="application/json");let i;try{i=await fetch(`${t.api}/api${r}`,{method:e,headers:o,body:n===void 0?void 0:JSON.stringify(n)})}catch(a){throw new Y(0,"offline",`Could not reach ${t.api} (${a.message}).`)}if(s.raw&&i.ok)return new Uint8Array(await i.arrayBuffer());let u=await i.json().catch(()=>({}));if(!i.ok){let a=u.error??`http_${i.status}`;throw new Y(i.status,a,ma[a]??u.message??`Request failed (${i.status}).`)}return u}async function ga(t,e){let r=await $({api:t,key:""},"GET","/auth/config",void 0,{anonymous:!0}),n=JSON.stringify({certKey:r.certKey,tokenKey:r.tokenKey});if(e&&e!==n)throw new Y(0,"server_keys","The server's signing keys changed since the first use. Stopping for safety.");return{cert:Z(r.certKey),token:Ao(r.tokenKey),wire:n}}var Yt=class{constructor(e,r){this.agent=e;this.pins=r}agent;pins;keys=null;cert=null;get creds(){return{api:this.agent.api,key:this.agent.key}}server(){return this.keys??=ga(this.agent.api,this.pins.server).then(e=>(this.pins.server||this.pins.onServer(e.wire),e)),this.keys}async summarize(e){let r=Z(e.head),n,s=!1;try{if(Yr(r)){let{payload:o,sender:i}=await Xr(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:i.address}},s=!0}else n=await ws(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:o,more:i}=await $(this.creds,"GET",`/messages?${s}`);return{messages:await Promise.all(o.map(u=>this.summarize(u))),more:i}}async find(e){for(let r of["inbox","archive","sent","spam","trash"]){let n;for(let s=0;s<5;s++){let o=new URLSearchParams({folder:r,limit:"100"});n&&o.set("before",String(n));let{messages:i,more:u}=await $(this.creds,"GET",`/messages?${o}`),a=i.find(c=>c.id===e||e.length>=6&&c.id.startsWith(e));if(a)return a;if(!u||!i.length)break;n=i[i.length-1].received_at}}throw new Y(404,"not_found",`Message ${e} not found.`)}async read(e){let r=await this.find(e),n=await this.summarize(r),s=await $(this.creds,"GET",`/messages/${r.id}/raw`,void 0,{raw:!0}),o;if(Yr(s)){let u=await Xr(this.agent.secretKey,s,"raw",(await this.server()).cert,r.received_at);if(n.verifiedSender&&u.sender.address!==n.from?.address)throw new Y(0,"tampered","The message body does not match its sender.");o=u.payload}else{if(n.verifiedSender)throw new Y(0,"tampered","The message body is not sealed by its sender.");o=await ke(this.agent.secretKey,s,"raw")}let i=await je.parse(await Co(o),{attachmentEncoding:"arraybuffer"});return{summary:n,email:i}}update(e,r){return $(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 $(this.creds,"POST","/cert",{});return this.cert={signed:e,until:JSON.parse(new TextDecoder().decode(Z(e.c))).e},e}async token(){let e=(await this.server()).token,r=go(),{blinded:n,r:s}=await yo(e,r),o=Gt(e.n),{signed:i}=await $(this.creds,"POST","/tokens",{blinded:[Gr(n,o)]}),u=xo(e,zt(i[0]),s);if(!await bo(e,r,u))throw new Y(0,"bad_tokens","The server returned an invalid delivery ticket.");return{token:r,sig:Gr(u,o)}}async sealed(e,r,n){let s=Do(await je.parse(r),!0,new Date);return{head:te(await Zr(e,this.agent.secretKey,n,new TextEncoder().encode(JSON.stringify(s)),"head")),raw:te(await Zr(e,this.agent.secretKey,n,await Bo(r),"raw"))}}async publicKeyOf(e){return(await $(this.creds,"POST","/keys",{address:e},{anonymous:!0})).publicKey}async send(e,r){let n=e.cc??[],s=e.bcc??[],o=[...e.to,...n,...s],i=D=>D.toLowerCase().endsWith(`@${we}`),u=e.html??Ro(e.text),a={from:e.from,to:e.to,cc:n,bcc:s,subject:e.subject,text:e.text,html:u,messageId:Oo(we),inReplyTo:e.inReplyTo,references:e.references,date:new Date,attachments:e.attachments},c=en(a,!1),l=en(a,!0),f=await this.myCert(),d=[...new Set(o.map(D=>D.address.toLowerCase()).filter(i))],p=[];for(let D of d){let y=await this.publicKeyOf(D);if(!y)throw new Y(404,"no_such_user",`${D} does not exist.`);r(D,y),p.push({address:D,...await this.sealed(Z(y),c,f)})}let g=D=>D.filter(y=>!i(y.address)),m=o.filter(D=>!i(D.address)).length,A=await $(this.creds,"POST","/send",{...m?{to:g(e.to),cc:g(n),bcc:g(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:te(D.content),cid:D.cid}))}:{},sentCopy:await this.sealed(bs(this.agent.secretKey),l,f)});for(let D of p){let y=await this.token();await $(this.creds,"POST","/deliver",{to:D.address,head:D.head,raw:D.raw,token:te(y.token),sig:y.sig},{anonymous:!0})}return{id:A.id,external:m,internal:p.length}}};var he=t=>t?t.name?`${t.name} <${t.address}>`:t.address:"(unknown)",He=t=>new Date(t).toISOString().replace("T"," ").slice(0,16);function ya(t){return t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
55
+ ${n.content}`)}function Uo(t){return`<${crypto.randomUUID()}@${t}>`}var qo=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Po(t,e){let r=qo(t).replace(/https?:\/\/[^\s<]+/g,s=>`<a href="${s}">${s}</a>`).replace(/\n/g,"<br>"),n=e?`<br><div>${qo(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 Be="shalomail.com",z=class extends Error{constructor(r,n,s){super(s);this.status=r;this.code=n}status;code},va={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 P(t,e,r,n,s={}){let o={"x-shalom":"1","user-agent":"shalom-cli"};s.anonymous||(o.authorization=`Bearer ${t.key}`),n!==void 0&&(o["content-type"]="application/json");let i;try{i=await fetch(`${t.api}/api${r}`,{method:e,headers:o,body:n===void 0?void 0:JSON.stringify(n)})}catch(a){throw new z(0,"offline",`Could not reach ${t.api} (${a.message}).`)}if(s.raw&&i.ok)return new Uint8Array(await i.arrayBuffer());let u=await i.json().catch(()=>({}));if(!i.ok){let a=u.error??`http_${i.status}`;throw new z(i.status,a,va[a]??u.message??`Request failed (${i.status}).`)}return u}var Sa={"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 ka(t,e){let r=await P({api:t,key:""},"GET","/auth/config",void 0,{anonymous:!0}),n=JSON.stringify({certKey:r.certKey,tokenKey:r.tokenKey}),s=Sa[t.replace(/\/+$/,"")];if(s&&s!==await Ta(n)||e&&e!==n)throw new z(0,"server_keys","The server's signing keys are not the ones this package trusts. Stopping for safety.");return{cert:V(r.certKey),token:So(r.tokenKey),wire:n}}var er=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??=ka(this.agent.api,this.pins.server).then(e=>(this.pins.server||this.pins.onServer(e.wire),e)),this.keys}async summarize(e){let r=V(e.head),n,s=!1;try{if(tn(r)){let{payload:o,sender:i}=await rn(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:i.address}},s=!0,n.b&&this.bodyHashes.set(e.id,n.b)}else n=await Ts(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:o,more:i}=await P(this.creds,"GET",`/messages?${s}`);return{messages:await Promise.all(o.map(u=>this.summarize(u))),more:i}}async find(e){if(/^[0-9a-f-]{36}$/i.test(e))try{return(await P(this.creds,"GET",`/messages/${e}`)).message}catch(r){throw r instanceof z&&r.status===404?new z(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 o=new URLSearchParams({folder:r,limit:"100"});n&&o.set("before",String(n));let{messages:i,more:u}=await P(this.creds,"GET",`/messages?${o}`),a=i.find(l=>l.id===e||e.length>=6&&l.id.startsWith(e));if(a)return a;if(!u||!i.length)break;n=i[i.length-1].received_at}}throw new z(404,"not_found",`Message ${e} not found.`)}async read(e){let r=await this.find(e),n=await this.summarize(r),s=await P(this.creds,"GET",`/messages/${r.id}/raw`,void 0,{raw:!0}),o;if(tn(s)){let u=await rn(this.agent.secretKey,s,"raw",(await this.server()).cert,r.received_at);if(n.verifiedSender&&u.sender.address!==n.from?.address)throw new z(0,"tampered","The message body does not match its sender.");let a=this.bodyHashes.get(r.id);if(a&&await Jr(u.payload)!==a)throw new z(0,"tampered","The message body does not belong to this message.");o=u.payload}else{if(n.verifiedSender)throw new z(0,"tampered","The message body is not sealed by its sender.");o=await we(this.agent.secretKey,s,"raw")}let i=await Ve.parse(await Ro(o),{attachmentEncoding:"arraybuffer"});return{summary:n,email:i}}update(e,r){return P(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 P(this.creds,"POST","/cert",{});return this.cert={signed:e,until:JSON.parse(new TextDecoder().decode(V(e.c))).e},e}async tokens(e){let r=[],n=(await this.server()).token,s=Yt(n.n);for(;r.length<e;){let o=await Promise.all(Array.from({length:Math.min(20,e-r.length)},async()=>{let u=Eo();return{token:u,...await Bo(n,u)}})),{signed:i}=await P(this.creds,"POST","/tokens",{blinded:o.map(u=>Zr(u.blinded,s))});for(let u=0;u<o.length;u++){let a=Co(n,Zt(i[u]),o[u].r);if(!await vo(n,o[u].token,a))throw new z(0,"bad_tokens","The server returned an invalid delivery ticket.");r.push({token:o[u].token,sig:Zr(a,s)})}}return r}async unread(e="inbox",r=20,n=10){let s=[],o;for(let i=0;i<n&&s.length<r;i++){let{messages:u,more:a}=await this.list(e,100,o);if(s.push(...u.filter(l=>l.unread)),!a||!u.length)break;o=u[u.length-1].receivedAt}return s.slice(0,r)}async unseen(e,r=10){let n=[],s;for(let o=0;o<r;o++){let{messages:i,more:u}=await this.list("inbox",100,s),a=i.filter(l=>!e.has(l.id));if(n.push(...a),a.length<i.length||!u||!i.length)break;s=i[i.length-1].receivedAt}return n.sort((o,i)=>o.receivedAt-i.receivedAt)}async sealed(e,r,n){let s=await Oo(r),o={...ko(await Ve.parse(r),!0,new Date),b:await Jr(s)};return{head:te(await en(e,this.agent.secretKey,n,new TextEncoder().encode(JSON.stringify(o)),"head")),raw:te(await en(e,this.agent.secretKey,n,s,"raw"))}}async publicKeyOf(e){return(await P(this.creds,"POST","/keys",{address:e},{anonymous:!0})).publicKey}async send(e,r){let n=e.cc??[],s=e.bcc??[],o=[...e.to,...n,...s],i=d=>d.toLowerCase().endsWith(`@${Be}`),u=e.html??Po(e.text),a={from:e.from,to:e.to,cc:n,bcc:s,subject:e.subject,text:e.text,html:u,messageId:Uo(Be),inReplyTo:e.inReplyTo,references:e.references,date:new Date,attachments:e.attachments},l=on(a,!1),c=on(a,!0),f=await this.myCert(),p=[...new Set(o.map(d=>d.address.toLowerCase()).filter(i))],h=[];for(let d of p){let y=await this.publicKeyOf(d);if(!y)throw new z(404,"no_such_user",`${d} does not exist.`);r(d,y),h.push({address:d,...await this.sealed(V(y),l,f)})}let g=Math.ceil((5*1024*1024+2048)/3)*4;if(h.some(d=>d.raw.length>g))throw new z(413,"too_big","Too large for Shalom addresses: up to 5 MB per message.");let m=await this.tokens(h.length),x=d=>d.filter(y=>!i(y.address)),v=o.filter(d=>!i(d.address)).length,D=await P(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:te(d.content),cid:d.cid}))}:{},sentCopy:await this.sealed(vs(this.agent.secretKey),c,f)});for(let[d,y]of h.entries()){let w=m[d];await P(this.creds,"POST","/deliver",{to:y.address,head:y.head,raw:y.raw,token:te(w.token),sig:w.sig},{anonymous:!0})}return{id:D.id,external:v,internal:h.length}}};var he=t=>t?t.name?`${t.name} <${t.address}>`:t.address:"(unknown)",We=t=>new Date(t).toISOString().replace("T"," ").slice(0,16);function un(t){return t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
56
56
  `).replace(/<\/(p|div|li|h\d|tr)>/gi,`
57
57
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&").replace(/\n{3,}/g,`
58
58
 
59
- `).trim()}var Xt=t=>t.text?.trim()?t.text.trim():t.html?ya(t.html):"",pe=t=>(t??[]).filter(e=>e.address).map(e=>({name:e.name??"",address:e.address}));function tn(t,e){return{...t,messageId:e.messageId??null,inReplyTo:e.inReplyTo??null,references:e.references??null,replyTo:pe(e.replyTo),cc:pe(e.cc),text:Xt(e),html:e.html??null,attachments:e.attachments.map(r=>({filename:r.filename??"attachment",mimeType:r.mimeType,size:r.content.byteLength}))}}var xa={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"},rn=t=>xa[t.split(".").pop()?.toLowerCase()??""]??"application/octet-stream",Le=t=>(Array.isArray(t)?t:t?[t]:[]).flatMap(e=>e.split(",")).map(e=>e.trim()).filter(Boolean).map(e=>{let r=/^(.*?)\s*<([^>]+)>$/.exec(e);return r?{name:r[1].replace(/^"|"$/g,""),address:r[2].toLowerCase()}:{name:"",address:e.toLowerCase()}});function Lo(t,e,r,n){let s=pe(e.replyTo).length?pe(e.replyTo):t.from?[t.from]:[],o=n.to?.length?n.to:s,i=n.all?[...pe(e.to),...pe(e.cc)].filter(l=>l.address.toLowerCase()!==r.toLowerCase()&&!o.some(f=>f.address===l.address)):n.cc??[],u=/^\s*re\s*:/i.test(t.subject)?t.subject:`Re: ${t.subject}`,a=n.quote===!1?"":`
59
+ `).trim()}var tr=t=>t.text?.trim()?t.text.trim():t.html?un(t.html):"",pe=t=>(t??[]).filter(e=>e.address).map(e=>({name:e.name??"",address:e.address}));function an(t,e){return{...t,messageId:e.messageId??null,inReplyTo:e.inReplyTo??null,references:e.references??null,replyTo:pe(e.replyTo),cc:pe(e.cc),text:tr(e),html:e.html??null,attachments:e.attachments.map(r=>({filename:r.filename??"attachment",mimeType:r.mimeType,size:r.content.byteLength}))}}var Fa={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"},cn=t=>Fa[t.split(".").pop()?.toLowerCase()??""]??"application/octet-stream";function Oa(t){let e=[],r="",n=!1,s=!1;for(let o of t)o==='"'&&!s?n=!n:o==="<"&&!n?s=!0:o===">"&&!n&&(s=!1),o===","&&!n&&!s?(e.push(r),r=""):r+=o;return[...e,r]}var Ie=t=>(Array.isArray(t)?t:t?[t]:[]).flatMap(Oa).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 $o(t,e,r,n){let s=pe(e.replyTo).length?pe(e.replyTo):t.from?[t.from]:[],o=n.to?.length?n.to:s,i=new Set([r,...o.map(f=>f.address)].map(f=>f.toLowerCase())),u=n.all?[...pe(e.to),...pe(e.cc),...n.cc??[]].filter(f=>{let p=f.address.toLowerCase();return i.has(p)?!1:(i.add(p),!0)}):n.cc??[],a=/^\s*re\s*:/i.test(t.subject)?t.subject:`Re: ${t.subject}`,l=n.quote===!1?"":`
60
60
 
61
- On ${e.date??He(t.receivedAt)}, ${he(t.from)} wrote:
62
- ${Xt(e).split(`
63
- `).map(l=>`> ${l}`).join(`
64
- `)}`,c=[e.references,e.messageId].filter(Boolean).join(" ")||void 0;return{to:o,cc:i,subject:u,text:n.text+a,inReplyTo:e.messageId,references:c}}import{chmodSync as _o,existsSync as No,mkdirSync as ba,readdirSync as Aa,readFileSync as wa,rmSync as Da,writeFileSync as Ea}from"node:fs";import{homedir as Ba}from"node:os";import{join as _e}from"node:path";var Ca="https://shalomail.com",Jt=()=>process.env.SHALOM_CONFIG_DIR||(process.platform==="win32"&&process.env.APPDATA?_e(process.env.APPDATA,"shalom"):_e(process.env.XDG_CONFIG_HOME||_e(Ba(),".config"),"shalom"));function nn(t){No(t)||ba(t,{recursive:!0,mode:448});try{_o(t,448)}catch{}}function qo(t,e){Ea(t,JSON.stringify(e,null,2)+`
65
- `,{mode:384});try{_o(t,384)}catch{}}var on=t=>{try{return JSON.parse(wa(t,"utf8"))}catch{return null}},Qt=()=>_e(Jt(),"config.json"),De=()=>on(Qt())??{};function er(t){nn(Jt()),qo(Qt(),t)}var Ke=t=>(t||process.env.SHALOM_API_URL||De().api||Ca).replace(/\/+$/,""),ft=()=>_e(Jt(),"agents"),tr=t=>_e(ft(),`${t.toLowerCase()}.json`);function dt(t){nn(Jt()),nn(ft()),qo(tr(t.address),t)}var ze=t=>on(tr(t)),Io=t=>Da(tr(t),{force:!0});function un(){return No(ft())?Aa(ft()).filter(t=>t.endsWith(".json")).map(t=>on(_e(ft(),t))).filter(t=>!!t):[]}var pt=tr,sn="shalom_agent_",an=t=>sn+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 cn(t){if(!t.startsWith(sn))throw new Error("SHALOM_AGENT_TOKEN is not a Shalom agent token.");let e=JSON.parse(Buffer.from(t.slice(sn.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}}var Uo=(t,e)=>({address:t.address,key:t.key,secretKey:Z(t.secretKey),api:e??t.api});var hn="0.2.0",Oa=`shalom ${hn}: end-to-end encrypted mailboxes for AI agents (https://${we})
61
+ On ${e.date??We(t.receivedAt)}, ${he(t.from)} wrote:
62
+ ${tr(e).split(`
63
+ `).map(f=>`> ${f}`).join(`
64
+ `)}`,c=[e.references,e.messageId].filter(Boolean).join(" ")||void 0;return{to:o,cc:u,subject:a,text:n.text+l,inReplyTo:e.messageId,references:c}}import{chmodSync as Mo,existsSync as fn,mkdirSync as Ra,readdirSync as La,readFileSync as jo,renameSync as _a,rmSync as Ho,writeFileSync as Na}from"node:fs";import{homedir as qa}from"node:os";import{join as me}from"node:path";var Ia="https://shalomail.com",Ue=()=>process.env.SHALOM_CONFIG_DIR||(process.platform==="win32"&&process.env.APPDATA?me(process.env.APPDATA,"shalom"):me(process.env.XDG_CONFIG_HOME||me(qa(),".config"),"shalom"));function mt(t){fn(t)||Ra(t,{recursive:!0,mode:448});try{Mo(t,448)}catch{}}function dn(t,e){let r=`${t}.${process.pid}.tmp`;Na(r,JSON.stringify(e,null,2)+`
65
+ `,{mode:384});try{Mo(r,384)}catch{}try{_a(r,t)}catch(n){throw Ho(r,{force:!0}),n}}var gt=class extends Error{},rr=t=>{if(!fn(t))return null;try{return JSON.parse(jo(t,"utf8"))}catch(e){throw new gt(`${t} exists but could not be read (${e.message}). Fix it or move it away; it was left as is.`)}},nr=()=>me(Ue(),"config.json"),Ce=()=>rr(nr())??{};function sr(t){mt(Ue()),dn(nr(),t)}var ve=t=>(t||process.env.SHALOM_API_URL||Ce().api||Ia).replace(/\/+$/,""),ht=()=>me(Ue(),"agents"),or=t=>me(ht(),`${t.toLowerCase()}.json`);function yt(t){mt(Ue()),mt(ht()),dn(or(t.address),t)}var Se=t=>rr(or(t)),Ko=t=>Ho(or(t),{force:!0});function pn(){return fn(ht())?La(ht()).filter(t=>t.endsWith(".json")).flatMap(t=>{try{return rr(me(ht(),t))??[]}catch(e){return process.stderr.write(`shalom: ${e.message}
66
+ `),[]}}):[]}var Pe=or,ln="shalom_agent_",hn=t=>ln+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 mn(t){if(!t.startsWith(ln))throw new Error("SHALOM_AGENT_TOKEN is not a Shalom agent token.");let e=JSON.parse(Buffer.from(t.slice(ln.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 gn(){if(process.env.SHALOM_AGENT_TOKEN)return process.env.SHALOM_AGENT_TOKEN.trim();let t=process.env.SHALOM_AGENT_TOKEN_FILE;return t?jo(t,"utf8").trim():void 0}var zo=t=>me(Ue(),"pins",`${t.toLowerCase()}.json`),Go=t=>rr(zo(t))??{};function Vo(t,e){try{mt(Ue()),mt(me(Ue(),"pins")),dn(zo(t),e)}catch{}}var Wo=(t,e)=>({address:t.address,key:t.key,secretKey:V(t.secretKey),api:e??t.api});var An="0.2.1",Ha=`shalom ${An}: end-to-end encrypted mailboxes for AI agents (https://${Be})
66
67
 
67
68
  Account
68
69
  shalom login Connect this terminal to your account in the browser
@@ -71,14 +72,14 @@ Account
71
72
  shalom whoami Show the account and the agents saved here
72
73
  shalom agents list List your agent mailboxes
73
74
  shalom agents create <name> [--name "Display name"]
74
- Create <name>@${we}; its private key stays on this machine
75
+ Create <name>@${Be}; its private key stays on this machine
75
76
  shalom agents delete <address> [--yes] Delete a mailbox and everything in it
76
77
  shalom agents rotate <address> Issue a new API key for a mailbox
77
78
  shalom agents export <address> Print SHALOM_AGENT_TOKEN to run the agent on a server
78
- shalom agents import <token> Save an exported agent on this machine
79
+ shalom agents import <token> [--yes] Save an exported agent on this machine
79
80
  shalom plan Show your plan and how many mailboxes you use
80
- shalom upgrade <5|12|unlimited> Up to 5 mailboxes for US$ 4.99/mo, 12 for US$ 9.99/mo, or
81
- unlimited for US$ 49.90/mo (up to 250 new a day)
81
+ shalom upgrade Open the plans page: up to 5 mailboxes for US$ 4.99/mo, 12 for
82
+ US$ 9.99/mo, or unlimited for US$ 49.90/mo (up to 250 new a day)
82
83
 
83
84
  Mailbox (pick the agent with --as <address>, or set SHALOM_AGENT_TOKEN)
84
85
  shalom inbox [--folder inbox] [--limit 20] [--unread]
@@ -93,31 +94,31 @@ Mailbox (pick the agent with --as <address>, or set SHALOM_AGENT_TOKEN)
93
94
  the message as JSON on stdin
94
95
 
95
96
  Every command accepts --json for machine-readable output and --api <url> to use another server.
96
- Ids can be shortened to their first 8 characters.`,or=class extends Error{},T=t=>{throw new or(t)},q=!1,L=(t,e)=>{q?e!==void 0&&process.stdout.write(JSON.stringify(e,null,2)+`
97
+ Ids can be shortened to their first 8 characters.`,cr=class extends Error{},T=t=>{throw new cr(t)},q=!1,L=(t,e)=>{q?e!==void 0&&process.stdout.write(JSON.stringify(e,null,2)+`
97
98
  `):process.stdout.write(t+`
98
- `)},rr=t=>(t.includes("@")?t:`${t}@${we}`).toLowerCase();async function Ra(t,e=!1){process.stdin.isTTY||T("Missing input. Pass it as a flag (this terminal cannot prompt).");let r=Fa({input:process.stdin,output:process.stdout,terminal:!0});return e&&(r._writeToOutput=n=>{n.startsWith(t)&&process.stdout.write(t)}),new Promise(n=>r.question(t,s=>{r.close(),e&&process.stdout.write(`
99
- `),n(s.trim())}))}async function La(){if(process.stdin.isTTY)return"";let t=[];for await(let e of process.stdin)t.push(e);return Buffer.concat(t).toString("utf8")}function ir(t){let e=De(),r=process.env.SHALOM_API_KEY||e.accountKey;return r||T("Not logged in. Run `shalom login` to connect this terminal."),{api:Ke(t),key:r}}var fn={free:"Free",agents5:"Agents 5",agents12:"Agents 12",unlimited:"Unlimited"},$o=t=>new Promise(e=>setTimeout(e,t)),_a={darwin:"macOS",win32:"Windows",linux:"Linux"};async function Na(t,e){let{secretKey:r,publicKey:n}=Lr(),s=`${Ta().replace(/\.local$/,"")} (${_a[process.platform]??process.platform}), shalom ${hn}`,o=await $({api:t,key:""},"POST","/cli/start",{device:s,publicKey:te(n)},{anonymous:!0}),i=c=>process.stderr.write(c+`
99
+ `)},ir=t=>(t.includes("@")?t:`${t}@${Be}`).toLowerCase();async function Ka(t,e=!1){process.stdin.isTTY||T("Missing input. Pass it as a flag (this terminal cannot prompt).");let r=ja({input:process.stdin,output:process.stdout,terminal:!0});return e&&(r._writeToOutput=n=>{n.startsWith(t)&&process.stdout.write(t)}),new Promise(n=>r.question(t,s=>{r.close(),e&&process.stdout.write(`
100
+ `),n(s.trim())}))}async function za(){if(process.stdin.isTTY)return"";let t=[];for await(let e of process.stdin)t.push(e);return Buffer.concat(t).toString("utf8")}function wn(t){let e=Ce(),r=process.env.SHALOM_API_KEY||e.accountKey;return r||T("Not logged in. Run `shalom login` to connect this terminal."),{api:ve(t),key:r}}var Ga={free:"Free",agents5:"Agents 5",agents12:"Agents 12",unlimited:"Unlimited"},Yo=t=>new Promise(e=>setTimeout(e,t)),Va={darwin:"macOS",win32:"Windows",linux:"Linux"};async function Wa(t,e){let{secretKey:r,publicKey:n}=qr(),s=`${$a().replace(/\.local$/,"")} (${Va[process.platform]??process.platform}), shalom ${An}`,o=await P({api:t,key:""},"POST","/cli/start",{device:s,publicKey:te(n)},{anonymous:!0}),i=l=>process.stderr.write(l+`
100
101
  `);i(`
101
102
  To connect this terminal, confirm the code ${o.code} at:
102
103
  ${o.url}
103
- `),e&&process.stdout.isTTY?(Mo(o.url),i("Opened your browser. Waiting for you to confirm...")):i("Waiting for you to confirm...");let u=Date.now()+o.expiresIn*1e3,a=Math.max(1,o.interval)*1e3;for(;Date.now()<u;){await $o(a);let c;try{c=await $({api:t,key:""},"POST","/cli/poll",{poll:o.poll},{anonymous:!0}),a=Math.max(1,o.interval)*1e3}catch{a=Math.min(a*2,15e3);continue}if(c.status==="approved"&&c.sealedKey)return new TextDecoder().decode(await ke(r,Z(c.sealedKey),"raw"));if(c.status==="denied"&&T("The connection was cancelled in the browser."),c.status==="expired")break}return T("The code expired. Run `shalom login` again.")}async function qa(t){let{values:e}=X({args:t,options:{key:{type:"string"},api:{type:"string"},json:{type:"boolean"},"no-browser":{type:"boolean"}}});q=!!e.json;let r=Ke(e.api),n=(e.key||process.env.SHALOM_API_KEY||await Na(r,!e["no-browser"])).trim();n.startsWith("shalom_sk_")||T("That is not an account API key. It starts with shalom_sk_.");let s=await $({api:r,key:n},"GET","/auth/me");er({...De(),api:r,accountKey:n,account:s.user.address}),L(`Logged in as ${s.user.address}. Key saved in ${Qt()}.`,{account:s.user.address,api:r})}function Ia(t){let{values:e}=X({args:t,options:{json:{type:"boolean"}}});q=!!e.json;let{accountKey:r,account:n,...s}=De();er(s),L("Logged out. Agent mailboxes saved on this machine were kept.",{ok:!0})}async function Ua(t){let{values:e}=X({args:t,options:{json:{type:"boolean"},api:{type:"string"}}});q=!!e.json;let r=De(),n=un().map(o=>o.address),s=r.account??null;(r.accountKey||process.env.SHALOM_API_KEY)&&(s=(await $(ir(e.api),"GET","/auth/me")).user.address),L([s?`Account: ${s}`:"Account: not logged in (run `shalom login`)",`Server: ${Ke(e.api)}`,`Agents on this machine: ${n.length?n.join(", "):"none"}`].join(`
104
- `),{account:s,api:Ke(e.api),agents:n})}function dn(t){if(t.limit===null)return`${t.used} agent mailboxes in use (Unlimited, up to 250 new a day).`;let e=t.plan==="free"?" Need more? `shalom upgrade 5` (US$ 4.99/mo), `shalom upgrade 12` (US$ 9.99/mo) or `shalom upgrade unlimited` (US$ 49.90/mo).":t.plan==="agents5"?" Need more? `shalom upgrade 12` (US$ 9.99/mo) or `shalom upgrade unlimited` (US$ 49.90/mo).":" Need more? `shalom upgrade unlimited` (US$ 49.90/mo).";return`${t.used} of ${t.limit} agent mailboxes used (${fn[t.plan]??t.plan}).${t.used>=t.limit?e:""}`}async function Pa(t){let[e,...r]=t,{values:n,positionals:s}=X({args:r,allowPositionals:!0,options:{json:{type:"boolean"},api:{type:"string"},name:{type:"string"},yes:{type:"boolean",short:"y"}}});if(q=!!n.json,e==="import"){let c=s[0]||process.env.SHALOM_AGENT_TOKEN||T("Usage: shalom agents import <token>"),l=cn(c);return l.createdAt=Date.now(),dt(l),L(`Saved ${l.address} in ${pt(l.address)}.`,{address:l.address,file:pt(l.address)})}if(e==="export"){let c=rr(s[0]||T("Usage: shalom agents export <address>")),l=ze(c)??T(`${c} is not saved on this machine.`);return q||process.stderr.write(`This token contains the private key of the mailbox. Store it as a secret.
105
- `),L(an(l),{address:c,token:an(l)})}let o=ir(n.api),i=()=>$(o,"GET","/agents");if(!e||e==="list"||e==="ls"){let{agents:c,plan:l}=await i();if(q)return L("",{agents:c.map(d=>({...d,onThisMachine:!!ze(d.address)})),plan:l});if(!c.length)return L(`No agent mailboxes yet. Create one: shalom agents create support
106
- ${dn(l)}`);let f=c.map(d=>[d.address,d.name,new Date(d.createdAt).toISOString().slice(0,10),d.paused?"paused":"active",ze(d.address)?"here":""]);return L(jo(["ADDRESS","NAME","CREATED","STATUS","KEY"],f)+`
104
+ `),e&&process.stdout.isTTY?(Xo(o.url),i("Opened your browser. Waiting for you to confirm...")):i("Waiting for you to confirm...");let u=Date.now()+o.expiresIn*1e3,a=Math.max(1,o.interval)*1e3;for(;Date.now()<u;){await Yo(a);let l;try{l=await P({api:t,key:""},"POST","/cli/poll",{poll:o.poll},{anonymous:!0}),a=Math.max(1,o.interval)*1e3}catch{a=Math.min(a*2,15e3);continue}if(l.status==="approved"&&l.sealedKey)return new TextDecoder().decode(await we(r,V(l.sealedKey),"raw"));if(l.status==="denied"&&T("The connection was cancelled in the browser."),l.status==="expired")break}return T("The code expired. Run `shalom login` again.")}async function Za(t){let{values:e}=X({args:t,options:{key:{type:"string"},api:{type:"string"},json:{type:"boolean"},"no-browser":{type:"boolean"}}});q=!!e.json;let r=ve(e.api),n=(e.key||process.env.SHALOM_API_KEY||await Wa(r,!e["no-browser"])).trim();n.startsWith("shalom_sk_")||T("That is not an account API key. It starts with shalom_sk_.");let s=await P({api:r,key:n},"GET","/auth/me");sr({...Ce(),api:r,accountKey:n,account:s.user.address}),L(`Logged in as ${s.user.address}. Key saved in ${nr()}.`,{account:s.user.address,api:r})}async function Ya(t){let{values:e}=X({args:t,options:{json:{type:"boolean"},api:{type:"string"}}});q=!!e.json;let{accountKey:r,account:n,...s}=Ce(),o=!r;r&&(o=await P({api:ve(e.api),key:r},"POST","/agents/logout",{}).then(()=>!0,i=>i instanceof z&&i.status===401)),sr(s),L(o?"Logged out. Agent mailboxes saved on this machine were kept.":"Logged out here, but the server could not be reached to revoke the key. Revoke it on the AI agents page.",{ok:!0,revoked:o})}async function Xa(t){let{values:e}=X({args:t,options:{json:{type:"boolean"},api:{type:"string"}}});q=!!e.json;let r=Ce(),n=pn().map(o=>o.address),s=r.account??null;(r.accountKey||process.env.SHALOM_API_KEY)&&(s=(await P(wn(e.api),"GET","/auth/me")).user.address),L([s?`Account: ${s}`:"Account: not logged in (run `shalom login`)",`Server: ${ve(e.api)}`,`Agents on this machine: ${n.length?n.join(", "):"none"}`].join(`
105
+ `),{account:s,api:ve(e.api),agents:n})}function xn(t){if(t.limit===null)return`${t.used} agent mailboxes in use (Unlimited, up to 250 new a day).`;let e=t.plan==="free"?" Need more? `shalom upgrade 5` (US$ 4.99/mo), `shalom upgrade 12` (US$ 9.99/mo) or `shalom upgrade unlimited` (US$ 49.90/mo).":t.plan==="agents5"?" Need more? `shalom upgrade 12` (US$ 9.99/mo) or `shalom upgrade unlimited` (US$ 49.90/mo).":" Need more? `shalom upgrade unlimited` (US$ 49.90/mo).";return`${t.used} of ${t.limit} agent mailboxes used (${Ga[t.plan]??t.plan}).${t.used>=t.limit?e:""}`}async function Ja(t){let[e,...r]=t,{values:n,positionals:s}=X({args:r,allowPositionals:!0,options:{json:{type:"boolean"},api:{type:"string"},name:{type:"string"},yes:{type:"boolean",short:"y"}}});if(q=!!n.json,e==="import"){let l=s[0]||process.env.SHALOM_AGENT_TOKEN||T("Usage: shalom agents import <token>"),c=mn(l),f=Se(c.address);if(f&&!n.yes){if(f.key===c.key&&f.secretKey===c.secretKey)return L(`${c.address} is already saved in ${Pe(c.address)}.`,{address:c.address,file:Pe(c.address)});T(`${c.address} is already saved on this machine with other keys. Pass --yes to replace it.`)}return c.createdAt=f?.createdAt??Date.now(),f?.pins&&(c.pins=f.pins),yt(c),L(`Saved ${c.address} in ${Pe(c.address)}.`,{address:c.address,file:Pe(c.address)})}if(e==="export"){let l=ir(s[0]||T("Usage: shalom agents export <address>")),c=Se(l)??T(`${l} is not saved on this machine.`);return q||process.stderr.write(`This token contains the private key of the mailbox. Store it as a secret.
106
+ `),L(hn(c),{address:l,token:hn(c)})}let o=wn(n.api),i=()=>P(o,"GET","/agents");if(!e||e==="list"||e==="ls"){let{agents:l,plan:c}=await i();if(q)return L("",{agents:l.map(p=>({...p,onThisMachine:!!Se(p.address)})),plan:c});if(!l.length)return L(`No agent mailboxes yet. Create one: shalom agents create yourname-bot
107
+ ${xn(c)}`);let f=l.map(p=>[p.address,p.name,new Date(p.createdAt).toISOString().slice(0,10),p.paused?"paused":"active",Se(p.address)?"here":""]);return L(Jo(["ADDRESS","NAME","CREATED","STATUS","KEY"],f)+`
107
108
 
108
- `+dn(l))}if(e==="create"||e==="new"){let c=s[0]||T('Usage: shalom agents create <name> [--name "Display name"]'),l=rr(c);l.endsWith(`@${we}`)||T(`Agent mailboxes are always @${we}.`);let{secretKey:f,publicKey:d}=Lr(),p=await $(o,"POST","/agents",{address:l,name:n.name??"",publicKey:te(d)}),g={...p.agent,api:o.api,key:p.key,secretKey:te(f)};return dt(g),L([`Created ${p.agent.address}.`,`Its private key and API key are in ${pt(p.agent.address)} (only on this machine).`,"",`Read mail: shalom inbox --as ${p.agent.address}`,`Send mail: shalom send --as ${p.agent.address} --to someone@example.com --subject "Hi" --text "Hello"`,`On a server: shalom agents export ${p.agent.address} (then set SHALOM_AGENT_TOKEN)`].join(`
109
- `),{...p.agent,file:pt(p.agent.address)})}let u=rr(s[0]||T(`Usage: shalom agents ${e} <address>`)),a=(await i()).agents.find(c=>c.address===u)??T(`${u} is not one of your agent mailboxes.`);if(e==="delete"||e==="rm")return n.yes||(await Ra(`This deletes ${u} and all its mail for good. Type the address to confirm: `)).toLowerCase()!==u&&T("Not deleted."),await $(o,"POST","/agents/delete",{id:a.id}),Io(u),L(`Deleted ${u}.`,{deleted:u});if(e==="rotate"){let c=ze(u)??T(`${u} is not saved on this machine, so its private key is not here. Rotate from the machine that has it.`),{key:l}=await $(o,"POST","/agents/rotate",{id:a.id});return dt({...c,key:l}),L(`New API key saved for ${u}. The old one stopped working.`,{address:u})}T(`Unknown command: shalom agents ${e}. Run shalom --help.`)}async function $a(t){let{values:e}=X({args:t,options:{json:{type:"boolean"},api:{type:"string"}}});q=!!e.json;let r=await $(ir(e.api),"GET","/billing");L(dn(r)+(r.periodEnd&&r.plan!=="free"?`
110
- Renews on ${new Date(r.periodEnd).toISOString().slice(0,10)}.`:""),r)}async function Ma(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{json:{type:"boolean"},api:{type:"string"},"no-open":{type:"boolean"}}});q=!!e.json;let n={5:"agents5",12:"agents12",unlimited:"unlimited"}[(r[0]??"").toLowerCase()]??T("Usage: shalom upgrade <5|12|unlimited>"),s=await $(ir(e.api),"POST","/billing/checkout",{plan:n});if(s.url)return!e["no-open"]&&!q&&process.stdout.isTTY&&Mo(s.url),L(`Finish in your browser:
111
- ${s.url}`,{url:s.url});L(s.changed?`Plan changed to ${fn[s.plan]}.`:`You are already on ${fn[s.plan]}.`,s)}function Mo(t){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",r=process.platform==="win32"?["/c","start","",t]:[t];try{Po(e,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Ne(t,e){let r,n=!0;if(!t&&process.env.SHALOM_AGENT_TOKEN)r=cn(process.env.SHALOM_AGENT_TOKEN),n=!1;else if(t||process.env.SHALOM_AGENT){let a=rr(t||process.env.SHALOM_AGENT);r=ze(a)??T(`${a} is not saved on this machine. Create it with \`shalom agents create\` or import its token.`)}else{let a=un();a.length===1?r=a[0]:T(a.length?`Pick an agent with --as <address>: ${a.map(c=>c.address).join(", ")}`:"No agent mailbox on this machine. Create one: shalom agents create support")}let s=De(),o=e?Ke(e):r.api;return{box:new Yt(Uo(r,o),{server:s.serverKeys?.[o],onServer:a=>{let c=De();er({...c,serverKeys:{...c.serverKeys,[o]:a}})}}),file:r,checkPin:(a,c,l=!1)=>{let f=r.pins??{};f[a]&&f[a]!==c&&!l&&T(`The encryption key of ${a} changed since the last time. Confirm with them, then resend with --trust-new-key.`),f[a]!==c&&(r.pins={...f,[a]:c},n&&dt(r))}}}var Ge={json:{type:"boolean"},api:{type:"string"},as:{type:"string"}},nr=t=>t.slice(0,8);function jo(t,e){let r=t.map((s,o)=>Math.min(48,Math.max(s.length,...e.map(i=>(i[o]??"").length)))),n=(s,o)=>s.length>r[o]?s.slice(0,r[o]-1)+"\u2026":s.padEnd(r[o]);return[t,...e].map(s=>s.map(n).join(" ").trimEnd()).join(`
112
- `)}async function ja(t){let{values:e}=X({args:t,options:{...Ge,folder:{type:"string",default:"inbox"},limit:{type:"string",default:"20"},unread:{type:"boolean"}}});q=!!e.json;let{box:r}=Ne(e.as,e.api),{messages:n}=await r.list(e.folder,Number(e.limit)||20);if(e.unread&&(n=n.filter(o=>o.unread)),q)return L("",n);if(!n.length)return L(`Nothing in ${e.folder}.`);let s=n.map(o=>[o.unread?"\u2022":" ",nr(o.id),he(e.folder==="sent"?o.to[0]??null:o.from),o.subject||"(no subject)",He(o.receivedAt)]);L(jo(["","ID",e.folder==="sent"?"TO":"FROM","SUBJECT","DATE"],s))}async function Ha(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ge,"save-attachments":{type:"string"},"keep-unread":{type:"boolean"}}});q=!!e.json;let{box:n}=Ne(e.as,e.api),{summary:s,email:o}=await n.read(r[0]||T("Usage: shalom read <id>"));!e["keep-unread"]&&s.unread&&await n.update([s.id],{seen:!0});let i=[];if(e["save-attachments"]){va(e["save-attachments"],{recursive:!0});for(let a of o.attachments){let c=ka(e["save-attachments"],pn(a.filename||"attachment").replace(/^\.+/,"_"));Sa(c,new Uint8Array(a.content)),i.push(c)}}if(q)return L("",{...tn(s,o),saved:i});let u=[`From: ${he(s.from)}${s.verifiedSender?" (Shalom, end-to-end, sender verified)":s.auth==="fail"?" (WARNING: sender not authenticated)":""}`,`To: ${pe(o.to).map(he).join(", ")}`,...o.cc?.length?[`Cc: ${pe(o.cc).map(he).join(", ")}`]:[],`Date: ${o.date??He(s.receivedAt)}`,`Subject: ${s.subject||"(no subject)"}`,`Id: ${s.id}`,"",Xt(o)||"(empty)"];o.attachments.length&&(u.push("","Attachments:",...o.attachments.map(a=>` ${a.filename??"attachment"} (${a.mimeType}, ${Math.ceil(a.content.byteLength/1024)} KB)`)),i.length&&u.push(`Saved to ${e["save-attachments"]}.`)),L(u.join(`
113
- `))}async function Ho(t){return t.text!==void 0?t.text:t["text-file"]?sr(t["text-file"],"utf8"):La()}var Ko={...Ge,to:{type:"string",multiple:!0},cc:{type:"string",multiple:!0},bcc:{type:"string",multiple:!0},subject:{type:"string"},text:{type:"string"},"text-file":{type:"string"},"html-file":{type:"string"},attach:{type:"string",multiple:!0},"trust-new-key":{type:"boolean"}};async function Ka(t){let{values:e}=X({args:t,options:Ko});q=!!e.json;let r=Le(e.to);r.length||T("Add at least one recipient with --to.");let n=await Ho(e);!n.trim()&&!e["html-file"]&&T("Write the message with --text, --text-file or stdin.");let{box:s,file:o,checkPin:i}=Ne(e.as,e.api),u=(e.attach??[]).map(c=>({filename:pn(c),type:rn(c),content:new Uint8Array(sr(c))})),a=await s.send({from:{name:o.name,address:o.address},to:r,cc:Le(e.cc),bcc:Le(e.bcc),subject:e.subject??"",text:n,html:e["html-file"]?sr(e["html-file"],"utf8"):void 0,attachments:u},(c,l)=>i(c,l,e["trust-new-key"]));L(`Sent from ${o.address} (${[a.internal&&`${a.internal} Shalom, end-to-end`,a.external&&`${a.external} outside`].filter(Boolean).join(", ")}).`,{ok:!0,...a})}async function za(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ko,all:{type:"boolean"},"no-quote":{type:"boolean"}}});q=!!e.json;let{box:n,file:s,checkPin:o}=Ne(e.as,e.api),{summary:i,email:u}=await n.read(r[0]||T('Usage: shalom reply <id> --text "..."')),a=await Ho(e);a.trim()||T("Write the reply with --text, --text-file or stdin.");let c=Lo(i,u,s.address,{text:a,all:e.all,quote:!e["no-quote"],to:Le(e.to),cc:Le(e.cc)});c.to.length||T("Could not tell who to reply to. Pass --to.");let l=await n.send({from:{name:s.name,address:s.address},...c,bcc:Le(e.bcc),attachments:(e.attach??[]).map(f=>({filename:pn(f),type:rn(f),content:new Uint8Array(sr(f))}))},(f,d)=>o(f,d,e["trust-new-key"]));L(`Replied to ${c.to.map(he).join(", ")}.`,{ok:!0,...l})}async function zo(t,e){return e.length||T("Pass at least one message id."),Promise.all(e.map(async r=>r.length===36?r:(await t.find(r)).id))}async function ln(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ge,to:{type:"string"}}});q=!!e.json;let n=e.to;["inbox","archive","spam","trash"].includes(n)||T("Use --to inbox, archive, spam or trash.");let{box:s}=Ne(e.as,e.api),o=await zo(s,r);await s.update(o,{folder:n}),L(`Moved ${o.length} to ${n}.`,{ok:!0,ids:o,folder:n})}async function Ga(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ge,read:{type:"boolean"},unread:{type:"boolean"},star:{type:"boolean"},unstar:{type:"boolean"}}});q=!!e.json;let n={};(e.read||e.unread)&&(n.seen=!!e.read),(e.star||e.unstar)&&(n.starred=!!e.star),Object.keys(n).length||T("Use --read, --unread, --star or --unstar.");let{box:s}=Ne(e.as,e.api),o=await zo(s,r);await s.update(o,n),L(`Updated ${o.length}.`,{ok:!0,ids:o,...n})}function Va(t,e,r){return new Promise(n=>{let s=Po(t,{shell:!0,stdio:["pipe","inherit","inherit"],env:{...process.env,...r}});s.on("error",()=>n(127)),s.on("close",o=>n(o??1)),s.stdin.end(JSON.stringify(e)+`
114
- `)})}async function Wa(t){let{values:e}=X({args:t,options:{...Ge,interval:{type:"string",default:"15"},exec:{type:"string"},"mark-read":{type:"boolean"},all:{type:"boolean"}}});q=!!e.json;let{box:r,file:n}=Ne(e.as,e.api),s=Math.max(5,Number(e.interval)||15)*1e3,o=new Set;if(!e.all)for(let a of(await r.list("inbox",100)).messages)o.add(a.id);q||process.stderr.write(`Watching ${n.address} every ${s/1e3}s. Ctrl+C to stop.
115
- `);let i=!1;process.on("SIGINT",()=>{i=!0,process.stderr.write(`
116
- `),process.exit(0)});let u=s;for(;!i;){try{let{messages:a}=await r.list("inbox",50),c=a.filter(l=>!o.has(l.id)).sort((l,f)=>l.receivedAt-f.receivedAt);for(let l of c)if(o.add(l.id),e.exec||q){let{summary:f,email:d}=await r.read(l.id),p=tn(f,d);if(q?process.stdout.write(JSON.stringify(p)+`
117
- `):process.stdout.write(`${He(l.receivedAt)} ${nr(l.id)} ${he(l.from)} ${l.subject}
118
- `),e.exec){let g=await Va(e.exec,p,{SHALOM_MESSAGE_ID:l.id,SHALOM_FROM:l.from?.address??"",SHALOM_SUBJECT:l.subject,SHALOM_AGENT:n.address});g!==0?process.stderr.write(`exec exited with ${g} for ${nr(l.id)}
119
- `):e["mark-read"]&&await r.update([l.id],{seen:!0})}else e["mark-read"]&&await r.update([l.id],{seen:!0})}else process.stdout.write(`${He(l.receivedAt)} ${nr(l.id)} ${he(l.from)} ${l.subject}
120
- `),e["mark-read"]&&await r.update([l.id],{seen:!0});u=s}catch(a){process.stderr.write(`watch: ${a.message}
121
- `),u=Math.min(u*2,300*1e3)}await $o(u)}}async function Za(t){let[e,...r]=t;switch(e){case void 0:case"help":case"--help":case"-h":return L(Oa);case"version":case"--version":case"-v":return L(hn);case"login":return qa(r);case"logout":return Ia(r);case"whoami":return Ua(r);case"agents":case"agent":return Pa(r);case"plan":return $a(r);case"upgrade":return Ma(r);case"inbox":case"list":case"ls":return ja(r);case"read":case"show":return Ha(r);case"send":return Ka(r);case"reply":return za(r);case"move":case"mv":return ln(r);case"mark":return Ga(r);case"trash":return ln([...r,"--to","trash"]);case"archive":return ln([...r,"--to","archive"]);case"watch":return Wa(r);default:T(`Unknown command: ${e}. Run shalom --help.`)}}Za(process.argv.slice(2)).catch(t=>{let e=t instanceof or||t instanceof Y||t?.code?.startsWith("ERR_PARSE_ARGS")?t.message:`Unexpected error: ${t?.stack??t}`;q?process.stdout.write(JSON.stringify({error:t instanceof Y?t.code:"error",message:e})+`
109
+ `+xn(c))}if(e==="create"||e==="new"){let l=s[0]||T('Usage: shalom agents create <name> [--name "Display name"]'),c=ir(l);c.endsWith(`@${Be}`)||T(`Agent mailboxes are always @${Be}.`);let{secretKey:f,publicKey:p}=qr(),h=await P(o,"POST","/agents",{address:c,name:n.name??"",publicKey:te(p)}),g={...h.agent,api:o.api,key:h.key,secretKey:te(f)};return yt(g),L([`Created ${h.agent.address}.`,`Its private key and API key are in ${Pe(h.agent.address)} (only on this machine).`,"",`Read mail: shalom inbox --as ${h.agent.address}`,`Send mail: shalom send --as ${h.agent.address} --to someone@example.com --subject "Hi" --text "Hello"`,`On a server: shalom agents export ${h.agent.address} (then set SHALOM_AGENT_TOKEN)`].join(`
110
+ `),{...h.agent,file:Pe(h.agent.address)})}let u=ir(s[0]||T(`Usage: shalom agents ${e} <address>`)),a=(await i()).agents.find(l=>l.address===u)??T(`${u} is not one of your agent mailboxes.`);if(e==="delete"||e==="rm"){n.yes||(await Ka(`This deletes ${u} and all its mail for good. Type the address to confirm: `)).toLowerCase()!==u&&T("Not deleted.");let l=Se(u)??T(`${u} is not saved on this machine, and deleting from the terminal needs its own key. Delete it on the AI agents page of the app.`);return await P(o,"POST","/agents/delete",{id:a.id,agentKey:l.key}),Ko(u),L(`Deleted ${u}.`,{deleted:u})}if(e==="rotate"){let l=Se(u)??T(`${u} is not saved on this machine, so its private key is not here. Rotate from the machine that has it.`),{sealedKey:c}=await P(o,"POST","/agents/rotate",{id:a.id}),f=new TextDecoder().decode(await we(V(l.secretKey),V(c),"raw"));return yt({...l,key:f}),L(`New API key saved for ${u}. The old one stopped working.`,{address:u})}T(`Unknown command: shalom agents ${e}. Run shalom --help.`)}async function Qa(t){let{values:e}=X({args:t,options:{json:{type:"boolean"},api:{type:"string"}}});q=!!e.json;let r=await P(wn(e.api),"GET","/billing");L(xn(r)+(r.periodEnd&&r.plan!=="free"?`
111
+ Renews on ${new Date(r.periodEnd).toISOString().slice(0,10)}.`:""),r)}async function ec(t){let{values:e}=X({args:t,allowPositionals:!0,options:{json:{type:"boolean"},api:{type:"string"},"no-open":{type:"boolean"}}});q=!!e.json;let r=`${ve(e.api)}/agentes-ia#ag-plans`;!e["no-open"]&&!q&&process.stdout.isTTY&&Xo(r),L(`Choose your plan in the browser, on the AI agents page:
112
+ ${r}`,{url:r})}function Xo(t){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",r=process.platform==="win32"?["/c","start","",t]:[t];try{Zo(e,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function $e(t,e){let r,n=!0;if(!t&&gn())r=mn(gn()),r.pins=Go(r.address),n=!1;else if(t||process.env.SHALOM_AGENT){let a=ir(t||process.env.SHALOM_AGENT);r=Se(a)??T(`${a} is not saved on this machine. Create it with \`shalom agents create\` or import its token.`)}else{let a=pn();a.length===1?r=a[0]:T(a.length?`Pick an agent with --as <address>: ${a.map(l=>l.address).join(", ")}`:"No agent mailbox on this machine. Create one: shalom agents create yourname-bot")}let s=Ce(),o=e?ve(e):r.api;return{box:new er(Wo(r,o),{server:s.serverKeys?.[o],onServer:a=>{let l=Ce();sr({...l,serverKeys:{...l.serverKeys,[o]:a}})}}),file:r,checkPin:(a,l,c=!1)=>{let f=r.pins??{};f[a]&&f[a]!==l&&!c&&T(`The encryption key of ${a} changed since the last time. Confirm with them, then resend with --trust-new-key.`),f[a]!==l&&(r.pins={...f,[a]:l},n?yt(r):Vo(r.address,r.pins))}}}var Ze={json:{type:"boolean"},api:{type:"string"},as:{type:"string"}},ur=t=>t.slice(0,8);function Jo(t,e){let r=t.map((s,o)=>Math.min(48,Math.max(s.length,...e.map(i=>(i[o]??"").length)))),n=(s,o)=>s.length>r[o]?s.slice(0,r[o]-1)+"\u2026":s.padEnd(r[o]);return[t,...e].map(s=>s.map(n).join(" ").trimEnd()).join(`
113
+ `)}async function tc(t){let{values:e}=X({args:t,options:{...Ze,folder:{type:"string",default:"inbox"},limit:{type:"string",default:"20"},unread:{type:"boolean"}}});q=!!e.json;let{box:r}=$e(e.as,e.api),n=Number(e.limit)||20,s=e.unread?await r.unread(e.folder,n):(await r.list(e.folder,n)).messages;if(q)return L("",s);if(!s.length)return L(`Nothing in ${e.folder}.`);let o=s.map(i=>[i.unread?"\u2022":" ",ur(i.id),he(e.folder==="sent"?i.to[0]??null:i.from),i.subject||"(no subject)",We(i.receivedAt)]);L(Jo(["","ID",e.folder==="sent"?"TO":"FROM","SUBJECT","DATE"],o))}async function rc(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ze,"save-attachments":{type:"string"},"keep-unread":{type:"boolean"}}});q=!!e.json;let{box:n}=$e(e.as,e.api),{summary:s,email:o}=await n.read(r[0]||T("Usage: shalom read <id>"));!e["keep-unread"]&&s.unread&&await n.update([s.id],{seen:!0});let i=[];if(e["save-attachments"]){Ua(e["save-attachments"],{recursive:!0});let a=new Set;for(let l of o.attachments){let c=bn(l.filename||"attachment").replace(/^\.+/,"_"),f=c.lastIndexOf("."),[p,h]=f>0?[c.slice(0,f),c.slice(f)]:[c,""],g=c;for(let x=2;a.has(g.toLowerCase());x++)g=`${p} (${x})${h}`;a.add(g.toLowerCase());let m=Ma(e["save-attachments"],g);Pa(m,new Uint8Array(l.content)),i.push(m)}}if(q)return L("",{...an(s,o),saved:i});let u=[`From: ${he(s.from)}${s.verifiedSender?" (Shalom, end-to-end, sender verified)":s.auth==="fail"?" (WARNING: sender not authenticated)":""}`,`To: ${pe(o.to).map(he).join(", ")}`,...o.cc?.length?[`Cc: ${pe(o.cc).map(he).join(", ")}`]:[],`Date: ${o.date??We(s.receivedAt)}`,`Subject: ${s.subject||"(no subject)"}`,`Id: ${s.id}`,"",tr(o)||"(empty)"];o.attachments.length&&(u.push("","Attachments:",...o.attachments.map(a=>` ${a.filename??"attachment"} (${a.mimeType}, ${Math.ceil(a.content.byteLength/1024)} KB)`)),i.length&&u.push(`Saved to ${e["save-attachments"]}.`)),L(u.join(`
114
+ `))}async function Qo(t){return t.text!==void 0?t.text:t["text-file"]?ar(t["text-file"],"utf8"):za()}var ei={...Ze,to:{type:"string",multiple:!0},cc:{type:"string",multiple:!0},bcc:{type:"string",multiple:!0},subject:{type:"string"},text:{type:"string"},"text-file":{type:"string"},"html-file":{type:"string"},attach:{type:"string",multiple:!0},"trust-new-key":{type:"boolean"}};async function nc(t){let{values:e}=X({args:t,options:ei});q=!!e.json;let r=Ie(e.to);r.length||T("Add at least one recipient with --to.");let n=e["html-file"]?ar(e["html-file"],"utf8"):void 0,s=n!==void 0&&e.text===void 0&&!e["text-file"]?un(n):await Qo(e);!s.trim()&&!n&&T("Write the message with --text, --text-file or stdin.");let{box:o,file:i,checkPin:u}=$e(e.as,e.api),a=(e.attach??[]).map(c=>({filename:bn(c),type:cn(c),content:new Uint8Array(ar(c))})),l=await o.send({from:{name:i.name,address:i.address},to:r,cc:Ie(e.cc),bcc:Ie(e.bcc),subject:e.subject??"",text:s,html:n,attachments:a},(c,f)=>u(c,f,e["trust-new-key"]));L(`Sent from ${i.address} (${[l.internal&&`${l.internal} Shalom, end-to-end`,l.external&&`${l.external} outside`].filter(Boolean).join(", ")}).`,{ok:!0,...l})}async function sc(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...ei,all:{type:"boolean"},"no-quote":{type:"boolean"}}});q=!!e.json;let{box:n,file:s,checkPin:o}=$e(e.as,e.api),{summary:i,email:u}=await n.read(r[0]||T('Usage: shalom reply <id> --text "..."')),a=await Qo(e);a.trim()||T("Write the reply with --text, --text-file or stdin.");let l=$o(i,u,s.address,{text:a,all:e.all,quote:!e["no-quote"],to:Ie(e.to),cc:Ie(e.cc)});l.to.length||T("Could not tell who to reply to. Pass --to.");let c=await n.send({from:{name:s.name,address:s.address},...l,bcc:Ie(e.bcc),attachments:(e.attach??[]).map(f=>({filename:bn(f),type:cn(f),content:new Uint8Array(ar(f))}))},(f,p)=>o(f,p,e["trust-new-key"]));L(`Replied to ${l.to.map(he).join(", ")}.`,{ok:!0,...c})}async function ti(t,e){return e.length||T("Pass at least one message id."),Promise.all(e.map(async r=>(await t.find(r)).id))}async function yn(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ze,to:{type:"string"}}});q=!!e.json;let n=e.to;["inbox","archive","spam","trash"].includes(n)||T("Use --to inbox, archive, spam or trash.");let{box:s}=$e(e.as,e.api),o=await ti(s,r);await s.update(o,{folder:n}),L(`Moved ${o.length} to ${n}.`,{ok:!0,ids:o,folder:n})}async function oc(t){let{values:e,positionals:r}=X({args:t,allowPositionals:!0,options:{...Ze,read:{type:"boolean"},unread:{type:"boolean"},star:{type:"boolean"},unstar:{type:"boolean"}}});q=!!e.json;let n={};(e.read||e.unread)&&(n.seen=!!e.read),(e.star||e.unstar)&&(n.starred=!!e.star),Object.keys(n).length||T("Use --read, --unread, --star or --unstar.");let{box:s}=$e(e.as,e.api),o=await ti(s,r);await s.update(o,n),L(`Updated ${o.length}.`,{ok:!0,ids:o,...n})}function ic(t,e,r){return new Promise(n=>{let{SHALOM_AGENT_TOKEN:s,SHALOM_API_KEY:o,...i}=process.env,u=Zo(t,{shell:!0,stdio:["pipe","inherit","inherit"],env:{...i,...r}});u.on("error",()=>n(127)),u.on("close",a=>n(a??1)),u.stdin.on("error",()=>{}),u.stdin.end(JSON.stringify(e)+`
115
+ `)})}async function uc(t){let{values:e}=X({args:t,options:{...Ze,interval:{type:"string",default:"15"},exec:{type:"string"},"mark-read":{type:"boolean"},all:{type:"boolean"}}});q=!!e.json;let{box:r,file:n}=$e(e.as,e.api),s=Math.max(5,Number(e.interval)||15)*1e3,o=!!e["mark-read"]&&!e.all,i=new Set;if(!e.all)for(let c of(await r.list("inbox",100)).messages)o&&c.unread||i.add(c.id);q||process.stderr.write(`Watching ${n.address} every ${s/1e3}s. Ctrl+C to stop.
116
+ `);let u=!1;process.on("SIGINT",()=>{u=!0,process.stderr.write(`
117
+ `),process.exit(0)});let a=s,l=!0;for(;!u;){try{for(let c of await r.unseen(i)){if(l&&o&&!c.unread){i.add(c.id);continue}if(e.exec||q){let{summary:f,email:p}=await r.read(c.id),h=an(f,p);if(q?process.stdout.write(JSON.stringify(h)+`
118
+ `):process.stdout.write(`${We(c.receivedAt)} ${ur(c.id)} ${he(c.from)} ${c.subject}
119
+ `),e.exec){let g=await ic(e.exec,h,{SHALOM_MESSAGE_ID:c.id,SHALOM_FROM:c.from?.address??"",SHALOM_SUBJECT:c.subject,SHALOM_AGENT:n.address});i.add(c.id),g!==0?process.stderr.write(`exec exited with ${g} for ${ur(c.id)}
120
+ `):e["mark-read"]&&await r.update([c.id],{seen:!0})}else i.add(c.id),e["mark-read"]&&await r.update([c.id],{seen:!0})}else process.stdout.write(`${We(c.receivedAt)} ${ur(c.id)} ${he(c.from)} ${c.subject}
121
+ `),i.add(c.id),e["mark-read"]&&await r.update([c.id],{seen:!0})}l=!1,a=s}catch(c){process.stderr.write(`watch: ${c.message}
122
+ `),a=Math.min(a*2,300*1e3)}await Yo(a)}}async function ac(t){let[e,...r]=t;switch(e){case void 0:case"help":case"--help":case"-h":return L(Ha);case"version":case"--version":case"-v":return L(An);case"login":return Za(r);case"logout":return Ya(r);case"whoami":return Xa(r);case"agents":case"agent":return Ja(r);case"plan":return Qa(r);case"upgrade":return ec(r);case"inbox":case"list":case"ls":return tc(r);case"read":case"show":return rc(r);case"send":return nc(r);case"reply":return sc(r);case"move":case"mv":return yn(r);case"mark":return oc(r);case"trash":return yn([...r,"--to","trash"]);case"archive":return yn([...r,"--to","archive"]);case"watch":return uc(r);default:T(`Unknown command: ${e}. Run shalom --help.`)}}ac(process.argv.slice(2)).catch(t=>{process.argv.slice(2).includes("--json")&&(q=!0);let e=t instanceof cr||t instanceof z||t instanceof gt||t?.code?.startsWith("ERR_PARSE_ARGS")?t.message:`Unexpected error: ${t?.stack??t}`;q?process.stdout.write(JSON.stringify({error:t instanceof z?t.code:"error",message:e})+`
122
123
  `):process.stderr.write(`shalom: ${e}
123
124
  `),process.exit(1)});